Next: Adorn Linear Cliques
Up: Adorn the Relevant PCG
Previous: Adorn PcgOrNode & PcgAndNode
Upon completion of the adornment of a clique, all clique predicates
with CO_NO_BINDING should disappear.
Some new clique predicates may be generated.
As we all know, cliques are shared when it is first extracted (i.e.
based on their predicate name and arity) Here, we do something even
more intelligent such that we share cliques for those clients (i.e.
pcg-or-nodes) that have the same binding pattern.
However, since we may generate new adorned rules, we could potentially
create rules that are not recursive any more and in fact, more than
one clique may be splitted from this clique, thus, upon completion of
the whole adornment of the extracted pcg, the set of adorned cliques
(represented here as local-clique-list) have to be REORGANIZED.
- Adorner::adornClique(pcg_or_node)
If this pcg_or_node is in a XY clique, then call adornXYClique(pcg_or_node,
clique). Otherwise, we will decide whether it's linear recursive or
not by calling
CoClique::determineRecursiveType(void), and then call adorn
function respectively. (adornLinearClique() or
adornNonLinearClique())
- CoClique::determineRecursiveType(void)
If any clique_predicate in the clique has a non-linear recursive rule, then
this clique is non-linear. A non-linear recursive rule is a rule
which has more than one literal (OR node) whose base clique is the
same as the current clique.
- Adorner::generateCliquePredicate(predicate_name, arity,
binding, clique)
If this predicate_name (with the binding) is already in the clique, we've reached
closure in adorning and we return NULL.
Otherwise, we create a new_clique_predicate and add it into the clique. We copy the
contents (exit rules and recursive rules) from any clique_predicate (of the same
predicate_name, but regardless of the binding) into the new_clique_predicate.
Next: Adorn Linear Cliques
Up: Adorn the Relevant PCG
Previous: Adorn PcgOrNode & PcgAndNode
Haixun Wang
7/19/1998