probcomp / metaprob

An embedded language for probabilistic programming and meta-programming.
GNU General Public License v3.0
168 stars 17 forks source link

The trace for an application should be determined by the callee, not the caller #84

Open jar398 opened 5 years ago

jar398 commented 5 years ago

Currently the meta-circular interpreter's code for an application creates a trace whose subtraces are the traces for all arguments, the procedure evaluation, and the call to the procedure. This practice interferes with at least three extensions that I would like to see:

This change would be subtle and fussy. Also it might require passing additional parameters to an inf and adjusting all of our current inf definitions. But is not particularly complicated conceptually. The trace-building code for applications would just get moved out of infer and into infer-apply (the procedure entry and exit logic).