CPS transformation of Anglican program
CPS transformation of Anglican program
customized gensym for code generation, bound to `symbol' in tests
customized gensym for code generation, bound to `symbol' in tests
functions in these namespaces are primitive
functions in these namespaces are primitive
primitive procedures, do not exist in CPS form
primitive procedures, do not exist in CPS form
(->observe id dist value cont state)
Positional factory function for class anglican.trap.observe.
Positional factory function for class anglican.trap.observe.
(->result state)
Positional factory function for class anglican.trap.result.
Positional factory function for class anglican.trap.result.
(->sample id dist cont state)
Positional factory function for class anglican.trap.sample.
Positional factory function for class anglican.trap.sample.
(adding-primitive-namespaces names & body)
includes namespaces into the set of primitive namespaces
includes namespaces into the set of primitive namespaces
(adding-primitive-procedures names & body)
includes names into the set of primitive procedures
includes names into the set of primitive procedures
(continue cont value state)
returns a trampolined call to continuation
returns a trampolined call to continuation
(cps-of-application exprs cont)
transforms application to CPS
transforms application to CPS
(cps-of-apply args cont)
transforms apply to CPS
transforms apply to CPS
(cps-of-case args cont)
transforms case to CPS
transforms case to CPS
(cps-of-cond clauses cont)
transforms cond to CPS
transforms cond to CPS
(cps-of-expression expr cont)
dispatches CPS transformation by expression type
dispatches CPS transformation by expression type
(cps-of-hash-map expr cont)
transforms literal map to CPS
transforms literal map to CPS
(cps-of-loop [bindings & body] cont)
transforms loop
transforms loop
(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
(cps-of-opaque expr cont)
transforms opaque expression to CPS
transforms opaque expression to CPS
(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)
(cps-of-retrieve args cont)
transforms retrieve to CPS
transforms retrieve to CPS
(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
(cps-of-set expr cont)
transforms literal set to CPS
transforms literal set to CPS
(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
(cps-of-vector expr cont)
transforms literal vector to CPS
transforms literal vector to CPS
(cps-of-when args cont)
transforms when to CPS
transforms when to CPS
(declaration? form)
true if the form is a declaration
true if the form is a declaration
(defn-with-named-cont cps-of & args)
binds the continuation to a name
binds the continuation to a name
(fn-cps args)
transforms function definition to CPS form
transforms function definition to CPS form
(fn-form? expr)
true when the argument is a fn form
true when the argument is a fn form
(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
(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.
(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.
(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.
(mem-cps [arg & _ :as args])
transforms mem to CPS
transforms mem to CPS
(mem-form? expr)
true when the argument is a mem form
true when the argument is a mem form
(opaque-cps expr)
return CPS form of an opaque expression
return CPS form of an opaque expression
(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
(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
(primitive-procedure-cps expr)
wraps primitive procedure as a CPS form
wraps primitive procedure as a CPS form
(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
(query-cps args)
transforms nested query into CPS
transforms nested query into CPS
(query-form? expr)
true when the argument is a mem form
true when the argument is a mem form
(shading-primitive-procedures names & body)
excludes names from the set of primitive procedures
excludes names from the set of primitive procedures
(simple? expr)
true if expr has no continuation
true if expr has no continuation
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close