Open azreika opened 4 years ago
We might want to have a MultiClause as well so that clauses
A(x), B(x) :- C(x).
are properly reflected in the AST.
Class RuleBody converts multi-heads, disjunction, and general negations to our current version of AST. This does not fit well into our current pipeline infrastructure. The class RuleBody should be replaced by proper AST classes for disjunctions, negations, and multi-head rules and lowered to our current AST.
It would be nice to have a representation of disjunctions within the AST.
Currently, they are handled entirely in the parser as syntactic sugar, where they are expanded into conjunctions, and so never actually appear at any stage afterwards. Having a representation of disjunctions will make certain transformers, especially inlining, substantially more natural and simple. It also means disjunctions do not have to be specially handled, but are actually described in the AST, and can be introduced or manipulated as needed.
The support could be done partially, in a similar way to how
true
andfalse
are currently handled, whereby disjunctions can be removed by a specific transformer in the pipeline that can be called at any time. This would mean that existing transformers do not need to be changed to support disjunctions, as long as the disjunction-removing transformer is called beforehand. This would reduce the engineering effort needed.