probcomp / Venturecxx

Primary implementation of the Venture probabilistic programming system
http://probcomp.csail.mit.edu/venture/
GNU General Public License v3.0
28 stars 6 forks source link

Is there a way to list all the random choices for each scope:block? #674

Open fsaad opened 7 years ago

fsaad commented 7 years ago
venture[script] > assume sim = (rowid) ~> {normal(0,1) #dummy:rowid};
[]
venture[script] > predict sim(10)
-0.627003587782
venture[script] > list_directives
35: sim: assume sim = make_csp(quote(rowid()), quote(tag(quote(dummy), rowid, normal(0.0, 1.0)))):      <procedure>
37: predict sim(10.0):   -0.627003587782

After the predict line, the tag ('dummy, 10) lives somewhere in the trace. It would be useful to be able to retrieve a table the scope:block names that are currently active (especially for blocks whose names are created dynamically), the random choices which are in the expression of the enclosing tag, and the values of those random choices.

axch commented 7 years ago

Short answer is no, but there should be. I could point you into the places in the code that would want to be modified, and we could probably pair it after the workshop. Or is it more pressing than that?

fsaad commented 7 years ago

@axch Sounds good RE pairing -- I managed to debug my program enough for the issue not to be a blocker, but we should definitely revisit in the future.