probcomp / GenExperimental.jl

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

Replace fail() #9

Closed marcoct closed 7 years ago

marcoct commented 7 years ago

The purpose of fail() is to provide a means to communicate that something in the model failed (e.g. the path planner failed to find a path), and the log likelihood of any constraints should be zero. Come up with a more principled replacement for fail(), which just sets the log-weight to -inf.

marcoct commented 7 years ago

The sort of failures like no-path-found interact with the checks that all constraints and interventions were actually visited. Since checking that constraints, interventions, and proposals are actually visited is essential for usability (because naming typos are common) it is required that even if the program fails and cannot produce data (e.g. no path found), it must call a nil() module that generates a singleton Nil with probability one, for all random choices that may be constrained or proposed.