Fixpoint3.Predicate
This file provides an interface for interacting with Fixpoint.Ast.Ram.Predicates.
Core features include providing a list of all RelSym in Predicates,
provide the PredType of a RelSym and transforming RelSym of one
PredType into a RelSym of another PredType.
The three PredTypes originate from semi-naive evaluation and are Full, Delta and New
(delta').
Instead of adding an enum type (Full/Delta/New) to the predicate, we embed the type into the identifier, which we can do since we have an upper bound on the integers used.
For a Datalog AST consisting of predicates PredSym("Road", 0) and PredSym("Path", 1)
the RAM has 6 predicates, 3 for each predicate in the Datalog AST. Every predicate
has a Full version, a Delta version and a New version.
For PredSym("Road", 0) the predicates in RAM are PredSym("Road", 0), PredSym("Road", 2),
and PredSym("Road", 4). PredSym("Road", 0) is the full predicate, PredSym("Road", 2)
is the delta predicate and PredSym("Road", 4) is the delta' predicate.
For PredSym("Path", 1) the predicates in RAM are be PredSym("Path", 1), PredSym("Path", 3),
and PredSym("Path", 5).
In the above way PredType is encoded in the identifier of a PredSym.
Definitions
Returns a list of all full RelSym in predInfo.
def bodyAtomToRelSym(body: BodyPredicate, wantedType: PredType, predInfo: Predicates): RelSym§ SourceReturns the full RelSym associated with the PredSym in body according to predInfo.
Returns a RelSym of type wantedType given the RelSym relSym, which must be
a full RelSym.
Returns a list of all RelSym known in program.
Returns 1 plus the maximum full predicate in predicates.
Returns the RelSym of type wantedType from relSym according to predInfo.
def headAtomToRelSym(head: HeadPredicate, wantedType: PredType, predInfo: Predicates): RelSym§ SourceReturns the full RelSym associated with the PredSym in head according to predInfo.
def initialize(program: Datalog, db: Map[RelSym, BPlusTree[Vector[Boxed], Boxed, Static]]): Predicates§ SourceCollect all preciate information given a Datalog program program and database db.
Returns true if id is the id of a full PredSym according to predInfo.
Returns a RelSym of type wantedType from relSym according to predInfo.
Returns the type of the PredSym in relSym according to predInfo.