Liking cljdoc? Tell your friends :D

anglican.trap

CPS transformation of Anglican program

CPS transformation of Anglican program
raw docstring

*checkpoint-gensym*clj/s

gensym used to generate checkpoint identifiers, see comment about stable gensym in emit.clj; initially redirects to gensym

gensym used to generate checkpoint identifiers,
see comment about stable gensym in emit.clj; 
initially redirects to *gensym*
sourceraw docstring

*gensym*clj/s

customized gensym for code generation, bound to `symbol' in tests

customized gensym for code generation,
bound to `symbol' in tests
sourceraw docstring

*primitive-namespaces*clj/s

functions in these namespaces are primitive

functions in these namespaces are primitive
sourceraw docstring

*primitive-procedures*clj/s

primitive procedures, do not exist in CPS form

primitive procedures, do not exist in CPS form
sourceraw docstring

->observeclj/s≠

(->observe id dist value cont state)
clj

Positional factory function for class anglican.trap.observe.

Positional factory function for class anglican.trap.observe.
cljs

Positional factory function for anglican.trap/observe.

Positional factory function for anglican.trap/observe.
sourceraw docstring

->resultclj/s≠

(->result state)
clj

Positional factory function for class anglican.trap.result.

Positional factory function for class anglican.trap.result.
cljs

Positional factory function for anglican.trap/result.

Positional factory function for anglican.trap/result.
sourceraw docstring

->sampleclj/s≠

(->sample id dist cont state)
clj

Positional factory function for class anglican.trap.sample.

Positional factory function for class anglican.trap.sample.
cljs

Positional factory function for anglican.trap/sample.

Positional factory function for anglican.trap/sample.
sourceraw docstring

adding-primitive-namespacesclj/smacro

(adding-primitive-namespaces names & body)

includes namespaces into the set of primitive namespaces

includes namespaces into the set of primitive namespaces
sourceraw docstring

adding-primitive-proceduresclj/smacro

(adding-primitive-procedures names & body)

includes names into the set of primitive procedures

includes names into the set of primitive procedures
sourceraw docstring

continueclj/s

(continue cont value state)

returns a trampolined call to continuation

returns a trampolined call to continuation
sourceraw docstring

cps-of-andclj/s

(cps-of-and args cont)

transforms and to CPS

transforms and to CPS
sourceraw docstring

cps-of-applicationclj/s

(cps-of-application exprs cont)

transforms application to CPS

transforms application to CPS
sourceraw docstring

cps-of-applyclj/s

(cps-of-apply args cont)

transforms apply to CPS

transforms apply to CPS
sourceraw docstring

cps-of-caseclj/s

(cps-of-case args cont)

transforms case to CPS

transforms case to CPS
sourceraw docstring

cps-of-catchclj/s

(cps-of-catch args cont)

transforms catch to CPS, delimits code in which values can be thrown using throw with a matching tag

transforms catch to CPS,
delimits code in which values can be thrown using `throw` with a matching 
tag
sourceraw docstring

cps-of-condclj/s

(cps-of-cond clauses cont)

transforms cond to CPS

transforms cond to CPS
sourceraw docstring

cps-of-doclj/s

(cps-of-do exprs cont)

transforms do to CPS

transforms do to CPS
sourceraw docstring

cps-of-expressionclj/s

(cps-of-expression expr cont)

dispatches CPS transformation by expression type

dispatches CPS transformation by expression type
sourceraw docstring

cps-of-hash-mapclj/s

(cps-of-hash-map expr cont)

transforms literal map to CPS

transforms literal map to CPS
sourceraw docstring

cps-of-ifclj/s

(cps-of-if args cont)

transforms if to CPS

transforms if to CPS
sourceraw docstring

cps-of-letclj/s

(cps-of-let args cont)

transforms let to CPS

transforms let to CPS
sourceraw docstring

cps-of-loopclj/s

(cps-of-loop [bindings & body] cont)

transforms loop

transforms loop
sourceraw docstring

cps-of-observeclj/s

(cps-of-observe args cont)

transforms observe to CPS, observe updates the weight by adding the result of observe (log-probability) to the log-weight

transforms observe to CPS,
observe updates the weight by adding
the result of observe (log-probability)
to the log-weight
sourceraw docstring

cps-of-opaqueclj/s

(cps-of-opaque expr cont)

transforms opaque expression to CPS

transforms opaque expression to CPS
sourceraw docstring

cps-of-orclj/s

(cps-of-or args cont)

transforms or to CPS

transforms or to CPS
sourceraw docstring

cps-of-predictclj/s

(cps-of-predict args cont)

transforms predict to CPS, predict appends predicted expression and its value to (:predicts $state)

transforms predict to CPS,
predict appends predicted expression
and its value to (:predicts $state)
sourceraw docstring

cps-of-recurclj/s

(cps-of-recur args cont)

transforms recur

transforms recur
sourceraw docstring

cps-of-retrieveclj/s

(cps-of-retrieve args cont)

transforms retrieve to CPS

transforms retrieve to CPS
sourceraw docstring

cps-of-sampleclj/s

(cps-of-sample args cont)

transforms sample to CPS; on sample the program is interrupted and the control is transferred to the inference algorithm

transforms sample to CPS;
on sample the program is interrupted
and the control is transferred to the inference algorithm
sourceraw docstring

cps-of-setclj/s

(cps-of-set expr cont)

transforms literal set to CPS

transforms literal set to CPS
sourceraw docstring

cps-of-storeclj/s

(cps-of-store args cont)

transforms store to CPS; the continuation receives the stored value

transforms store to CPS;
the continuation receives the stored value
sourceraw docstring

cps-of-throwclj/s

(cps-of-throw args _)

transforms throw to CPS, returns to the nearest surrounding catch form with a matching tag

transforms throw to CPS,
returns to the nearest surrounding `catch` form with a matching tag
sourceraw docstring

cps-of-vectorclj/s

(cps-of-vector expr cont)

transforms literal vector to CPS

transforms literal vector to CPS
sourceraw docstring

cps-of-whenclj/s

(cps-of-when args cont)

transforms when to CPS

transforms when to CPS
sourceraw docstring

declaration?clj/s

(declaration? form)

true if the form is a declaration

true if the form is a declaration
sourceraw docstring

defn-with-named-contclj/smacro

(defn-with-named-cont cps-of & args)

binds the continuation to a name

binds the continuation to a name
sourceraw docstring

fn-cpsclj/s

(fn-cps args)

transforms function definition to CPS form

transforms function definition to CPS form
sourceraw docstring

fn-form?clj/s

(fn-form? expr)

true when the argument is a fn form

true when the argument is a fn form
sourceraw docstring

make-of-argsclj/s

(make-of-args args make)
(make-of-args args first-is-rator make)

builds lexical bindings for all compound args and then calls `make' to build expression out of the args; used by predict, observe, sample, application

builds lexical bindings for all compound args
and then calls `make' to build expression
out of the args; used by predict, observe, sample, application
sourceraw docstring

map->observeclj/s≠

clj
(map->observe m__7585__auto__)

Factory function for class anglican.trap.observe, taking a map of keywords to field values.

Factory function for class anglican.trap.observe, taking a map of keywords to field values.
cljs
(map->observe G__23176)

Factory function for anglican.trap/observe, taking a map of keywords to field values.

Factory function for anglican.trap/observe, taking a map of keywords to field values.
sourceraw docstring

map->resultclj/s≠

clj
(map->result m__7585__auto__)

Factory function for class anglican.trap.result, taking a map of keywords to field values.

Factory function for class anglican.trap.result, taking a map of keywords to field values.
cljs
(map->result G__23204)

Factory function for anglican.trap/result, taking a map of keywords to field values.

Factory function for anglican.trap/result, taking a map of keywords to field values.
sourceraw docstring

map->sampleclj/s≠

clj
(map->sample m__7585__auto__)

Factory function for class anglican.trap.sample, taking a map of keywords to field values.

Factory function for class anglican.trap.sample, taking a map of keywords to field values.
cljs
(map->sample G__23190)

Factory function for anglican.trap/sample, taking a map of keywords to field values.

Factory function for anglican.trap/sample, taking a map of keywords to field values.
sourceraw docstring

mem-cpsclj/s

(mem-cps [arg & _ :as args])

transforms mem to CPS

transforms mem to CPS
sourceraw docstring

mem-form?clj/s

(mem-form? expr)

true when the argument is a mem form

true when the argument is a mem form
sourceraw docstring

observecljs

source

opaque-cpsclj/s

(opaque-cps expr)

return CPS form of an opaque expression

return CPS form of an opaque expression
sourceraw docstring

opaque?clj/s

(opaque? expr)

true when the argument is an expression which is passed to continuation (rather than accepts continuation) in its CPS form

true when the argument is an expression
which is passed to continuation (rather
than accepts continuation) in its CPS form
sourceraw docstring

primitive-operator?clj/s

(primitive-operator? procedure)

true if the experssion is converted by clojure to a primitive procedure in operator position

true if the experssion is converted by clojure 
to a primitive procedure in operator position
sourceraw docstring

primitive-procedure-cpsclj/s

(primitive-procedure-cps expr)

wraps primitive procedure as a CPS form

wraps primitive procedure as a CPS form
sourceraw docstring

primitive-procedure?clj/s

(primitive-procedure? expr)

true if the expression is primitive, that is, a procedure that does not have a CPS form

true if the expression is primitive,
that is, a procedure that does not have a CPS form
sourceraw docstring

query-cpsclj/s

(query-cps args)

transforms nested query into CPS

transforms nested query into CPS
sourceraw docstring

query-form?clj/s

(query-form? expr)

true when the argument is a mem form

true when the argument is a mem form
sourceraw docstring

resultcljs

source

result-contclj/s

(result-cont v s)
source

samplecljs

source

shading-primitive-proceduresclj/smacro

(shading-primitive-procedures names & body)

excludes names from the set of primitive procedures

excludes names from the set of primitive procedures
sourceraw docstring

simple?clj/s

(simple? expr)

true if expr has no continuation

true if expr has no continuation
sourceraw docstring

state-contclj/s

(state-cont _ s)

returns state

returns state
sourceraw docstring

value-contclj/s

(value-cont v _)

returns value

returns value
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close