In non-ground facts may be specified analogously to Coral [RSS92]. Facts are edge-addition rules without preconditions. Non-ground facts are facts that contain variables. Non-ground facts serve to initialize a graph with certain values before other rules manipulate the graph. This can be used especially for data flow analysis: the initialization statements there are non-ground facts. Non-ground facts in a rule group are always evaluated before other rules of the it are evaluated.
As example consider the specification of available expression dataflow analysis, the first two rules are non-ground facts:
// Find available expressions
EARS AvailableExpressions ()
{
RANGE b <= AVIN; e <= AVIN.TARGET;
// non-ground facts: initiallization to FULL set.
AVIN(b,e);
AVOUT(b,e);
// EARS rules.
AVIN(b,e) :- FORALL p: BlockGraph(b,p), AVOUT(p,e);
AVOUT(b,e) :- COMPOUT(b,e);
AVOUT(b,e) :- TRANSP(b,e), AVIN(b,e);
}
Also self-edge facts may be specified which draw self edges on nodes:
EARS ComputeDominators(b: BasicBlock)
{
Dominators(b,b); // self-edge fact: each block is dominated by itself
}
Non-ground facts also may be negated. Then generates loops over the graph nodes that delete existing edges.
There are all in all several possibilities, how to initialize a graph:
Before and after facts target predicates can be written. If a target predicate is written before the fact, it is copied directly before the edge addition. If it is written after the fact, it is copied direcly after the edge addition.
For further examples on facts consider example file facts.ox.