MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::plug::autodiff::phase Namespace Reference

Classes

class  Eval
 This phase is the heart of AD. More...

Functions

static const Def * compose_cn (const Def *f, const Def *g)
 The high level view is:

Function Documentation

◆ compose_cn()

const Def * mim::plug::autodiff::phase::compose_cn ( const Def * f,
const Def * g )
static

The high level view is:

f: B -> C
g: A -> B
f o g := λ x. f(g(x)) : A -> C

In CPS the types look like:

f: Cn[B, Cn C]
g: Cn[A, Cn B]
h = f o g
h: Cn[A, cn C]
h = λ (a ret_h) = g (a, h')
h': Cn B
h'= λ b = f (b, ret_h)

Definition at line 29 of file eval.cpp.

References compose_cn(), mim::Pi::dom(), mim::Pi::isa_returning(), and mim::Pi::ret_dom().

Referenced by mim::plug::autodiff::phase::Eval::augment_app(), and compose_cn().