metaprob icon indicating copy to clipboard operation
metaprob copied to clipboard

Immutable traces as subtrace keys

Open jar398 opened this issue 6 years ago • 1 comments

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.

jar398 avatar Oct 16 '18 16:10 jar398

As of #106 traces are now regular Clojure maps. Need to think through how this issue is affected by that change.

zane avatar Jan 25 '19 23:01 zane