Module Tests


module Tests: sig .. end
Tests of the probabilistic language.

val print_dist : ('a -> string) -> ('a * float) list -> unit
Prints a distribution.
val run_example : Prob_lang.term -> unit
Computes the distribution for one term, and prints it.
val _let : Prob_lang.varname -> Prob_lang.term -> Prob_lang.term -> Prob_lang.term
"let x = a in b" is handled as sugar.
val coin : float -> Prob_lang.term
A coin flip.
val x : string Pervasives.ref
val id : Prob_lang.term
example of a function which uses its arg.
val k5 : Prob_lang.term
example of a function which doesn't use its arg.
val t : string Pervasives.ref
val f : string Pervasives.ref
val tt : Prob_lang.term
Church boolean "true" ...
val ff : Prob_lang.term
... and "false".
val church1 : Prob_lang.term
val church2 : Prob_lang.term
val _not : Prob_lang.term
"not", treating 0 and 1 as Booleans.
val case0 : Prob_lang.term
val case1 : Prob_lang.term
val case2 : Prob_lang.term
val _if : Prob_lang.term -> Prob_lang.term -> Prob_lang.term -> Prob_lang.term
An "if statement".
val if0 : Prob_lang.term
val if1 : Prob_lang.term
val foo : Prob_lang.term
Test of combination of _let and _if.
val _e : string Pervasives.ref
val _b : string Pervasives.ref
val _a : string Pervasives.ref
val earthquake : Prob_lang.term
val burglar : Prob_lang.term
val alarm : Prob_lang.term
The alarm example.
val test1 : Prob_lang.term
A query using the alarm network.
val main : unit
Runs all the tests.