probcomp / GenExperimental.jl

Featherweight embedded probabilistic programming language and compositional inference programming library
MIT License
17 stars 2 forks source link

Check that, after a program has executed, all constrained choices were visited #5

Open marcoct opened 7 years ago

marcoct commented 7 years ago

It is illegal to constrain the value of a random choice without also guaranteeing that that random choice exists. This requirement allows us to check that a set of constraints was valid, by checking that every constraint was visited during the execution. This is a critical error-reporting check, because otherwise common naming issues will go un-noticed.

marcoct commented 7 years ago

For example, in the initial tutorial notebook, the names "foo-$n" and "foo_$n" were mixed up.

marcoct commented 7 years ago

Done.

marcoct commented 7 years ago

I am removing this feature temporarily, because it was confusing during my re-write of the probabilistic program tracing with subtraces (https://github.com/probcomp/Gen.jl/issues/58). There is some interaction with the design of subtraces. For example: