Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does a Dictionary<List<_>> qualify as semipersistent?

Tags:

c#

f#

prolog

In Extended Abstract: A Functional Derivation of the Warren Abstract Machine, Maciej Pir´og and Jeremy Gibbons describe a data structure as semi-persistent [7] " if we can backtrack to its previous versions, but we never simultaneously keep two different modifications (siblings) of the same ancestor." Assume some object dict : System.Collections.Dictionary<A, FSharp.Collections.List<B>>. Let the values in the dictionary represent the states relevant to certain keys. Would dict be an effectively semi-persistent state-tracking mechanism, assuming only one such Dictionary is used? Is that guaranteed by the mutability of the Dictionary type coupled with the sequences of previous states?

like image 513
jcc333 Avatar asked Nov 08 '22 01:11

jcc333


1 Answers

That's a tough one (to parse, no less answer) - please NOTE: this is per my understanding of the abstract given... The answer would be Yes AND No. The key here lies in the usage, not necessarily the structure. Dictionary itself is persistent. Like the authors you could use it in a semi-persistent manner. Having the state values in a list, however, can be a bit troubling, as you may be tempted to retain siblings (again, in the usage).

For a better understanding - go to the source:
https://www.lri.fr/~conchon/publis/spds-esop08.pdf

like image 121
John Avatar answered Nov 14 '22 22:11

John