BirthFacts #
The birth facts of a trigger are very similar to the backtracking done for the MFA-like conditions only that we do not consider body atoms here. Therefore, we also do not need to introduce fresh constants. Overall this is all much simpler.
For a functional PreGroundTerm, we can find a PreTrigger that introduces it (ignoring how pure body variables are mapped).
Equations
- One or more equations did not get rendered due to their size.
- PreGroundTerm.birthTrigger (CustomBasicDatastructures.FiniteTree.leaf c) term_is_func_2 term_arity_ok_2 = ⋯.elim
Instances For
For a PreGroundTerm, we can find the facts necessarily present when the term is "born". These are all facts in the head of the birthTrigger for the term as well as all birthFacts for the subterms (i.e. the children) or the term.
Equations
- One or more equations did not get rendered due to their size.
- PreGroundTerm.birthFacts (CustomBasicDatastructures.FiniteTree.leaf c) term_arity_ok_2 = []
Instances For
This is just an elaborate way of flatMapping over the terms calling birthFacts for each. This way we do not have to show termination explicitely.
Equations
- PreGroundTerm.birthFacts_list [] terms_arity_ok_2 = []
- PreGroundTerm.birthFacts_list (hd :: tl) terms_arity_ok_2 = hd.birthFacts ⋯ ++ PreGroundTerm.birthFacts_list tl ⋯
Instances For
We lift the PreGroundTerm definitions to GroundTerms.
Equations
- term.birthTrigger term_is_func = term.val.birthTrigger ⋯ ⋯
Instances For
Equations
- term.birthFacts = term.val.birthFacts ⋯
Instances For
Equations
- GroundTerm.birthFacts_list terms = List.flatMap GroundTerm.birthFacts terms
Instances For
The PreTrigger.birthFacts are simply the birth facts of all frontier terms.