Recipe: constructive "traces" for provenance tracking to explain/justify results to users #82
Replies: 1 comment
-
|
One paper you should consider reading is this one: "Provenance Semirings." http://repository.upenn.edu/bitstreams/b598c0a7-0d24-4162-8279-5f51a17d29c2/download It presents a method (using semirings) to keep algebraic provenance of facts as they flow through the fixed point. As you say, lattices can also track provenance as well--many semirings can be given lattice structure, etc. We have thought about implementing semirings on top of Ascent for a while--this is used pervasively in probabilistic Datalog implementations, and other systems that reason about provenance. The database research community has thought about this using semirings specifically and their algebraic properties for various reasons (e.g., they work nicely with diffing / semi-naive evaluation) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
You might want to know how a certain fact was derived:
The easiest way to implement this is to use a collection that implements
Ordas a lattice.Ordon random stuff to quickly define a lattice.ord_lattice_impl!macro #80 on that topic.)choice-domain, but it wasn't a problem for me.Here's an example of tracking the (shortest) dependency chain for some nodes via a
Tracetype:Instead of just nodes in a graph, you can imagine pushing elements of some type
enum Reasonto track which specific rules were executed, such as for a typechecker or interpreter.For reference, here was my hand-written, persistent (concurrent) singly-linked list implementation of
Trace.Persistent singly-linked list implementation
This wraps elements of type
Node(not shown) which isOrd.You could also use
Vec(if you're okay with copying the entire collection for each modification) or use a persistent container library, such asrpds::List.Note that this is directly described in the Ascent paper, but it might not be obvious that "shortest path" can be used for constructive proofs generally:
(or you might not have read the paper)
Beta Was this translation helpful? Give feedback.
All reactions