- Type Parameters:
L- the languageD- the fact
An e-class analysis: a fact of type
D for every e-class, kept true as the graph
changes (egg's Analysis trait, the paper's section 4).
make(EGraph, L) computes the fact for one e-node from the facts of its children's classes;
join(D, D) combines the facts of two classes that become one, and must be a semilattice
join - commutative, associative and idempotent - or rebuilding may not terminate;
modify(EGraph, int) may add nodes or merge classes once a class's fact is known, as constant
folding does, and must be idempotent for the same reason. The invariant the graph keeps is that
every class's fact equals the join of make over its nodes.
-
Method Summary
Modifier and TypeMethodDescriptionThe fact for a class made of two classes with these facts.The fact fornode, whose children's facts are readable throughgraph.default voidA hook after a class's fact changes: add nodes to it or merge, or do nothing.none()The analysis that knows nothing: every fact isnulland nothing is modified.
-
Method Details
-
make
The fact fornode, whose children's facts are readable throughgraph.- Parameters:
graph- the graph the node is being added tonode- the e-node, whose children are ids of classes ofgraph- Returns:
- the node's fact;
nullonly if the analysis allows it, asnone()does
-
join
-
modify
-
none
-