metaprob
metaprob copied to clipboard
Immutable traces as subtrace keys
In python-metaprob, a subtrace key could be any value, including a trace. I never understood how this worked, since traces were python 'objects' and were mutable.
For clojure-metaprob I restricted keys to a small number of scalar types (string, integer, a few others) thinking that compound values were not needed, and also noting that traces were still problematic since at that time all traces were mutable.
Then we made the switch to immutable traces. And now there is an application for compound values as keys, namely mem
.
I propose that immutable traces be allowed as keys. Immutable traces should be sufficient for purposes of mem
.
Perhaps if a mutable trace is encontered, its trace-state
could be used as the key.
As of #106 traces are now regular Clojure maps. Need to think through how this issue is affected by that change.