Alternative Matches and the Chase #
In this file, we relate alternative matches to ChaseDerivation and ChaseBranch.
All of this considers the deterministic setting, i.e. only rule sets where each rule has exactly one head disjunct.
One of the main result is result_isStrongCore_of_noAltMatch, which states
that the result of a ChaseBranch without alternative matches is always a strong core.
A GroundTermMapping is an alternative for a ChaseDerivation and a FactSet if it is an alternative match into the fact set for the trigger is used to derive ChaseDerivation.next.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A ChaseDerivation has an alternative match into a FactSet simply if there is a GroundTermMapping that is such an alternative match for ChaseDerivation.next.
Equations
- cd.has_alt_match_for_next_and_fs fs = ∃ (h : GroundTermMapping sig), h.is_alt_match_for_chase_derivation_and_fs cd fs
Instances For
More generally, a ChaseDerivation has an alternative match into a FactSet if one of its subderivations has an alternative match for ChaseDerivation.next (according to the above definition) into the fact set.
Equations
- cd.has_alt_match_for_fs fs = ∃ (cd2 : ChaseDerivation obs rules), cd2 <:+ cd ∧ cd2.has_alt_match_for_next_and_fs fs
Instances For
Finally, a ChaseDerivation has an alternative match, if it has an alternative match into its own result.
Equations
- cd.has_alt_match = cd.has_alt_match_for_fs cd.result
Instances For
If a ChaseBranch has no alternative match (into its own result), then the result is a weak core.
If a ChaseBranch has an alternative match (into its own result), then there is an non-trivial endomorphism on the result, i.e. an endomorphism that is not the identity.
This is more of a lemma quite technical unfortunately. Take a ChaseBranch, a FactSet and a homomorphism $h$ from the chase result into the fact set that is at the same time an endomorphism on the fact set. If there is a term $t$ in the chase result such that no non-zero repetition of $h$ maps $t$ to itself, then the chase branch must have an alternative match for the fact set. Intuitively this is because $t$ is apparently a redundant term.
For a ChaseBranch without alternative match, every endomorphism on the result is surjective. This is shown by contradiction using altMatch_of_some_not_reaches_self.
From result_isWeakCore_of_noAltMatch and every_endo_surjective_of_noAltMatch, we get that the result of a ChaseBranch without alternative matches is a strong core.
The following is a quite technical result, which is designed to act as a lemma for further theorems that we did not formalize yet. To give a teaser, there are related to interleaving the restricted and core chase, basically using the restricted chase as long as alternative matches can be avoided and only in the end falling back to computing the rest with the core chase.
Take a ChaseBranch and a FactSet $F$ that is a superset of the chase result. Furthermore assume that the chase branch has no alternative match in $F$.
For every homomorphic subset of $F$, we know that it must still be a superset of the chase result.
On a higher level, imagine that $F$ is some fact set that might be computed using a core chase that started on the previous chase result.
Then by this result we know that the core computation of the core chase will never remove a term that was introduced by our initial restricted chase branch.
Part of the proof again uses altMatch_of_some_not_reaches_self.
Personal note: When I was thinking about this theorem on paper, I ended up confusing myself again and again doubting if this even holds. Finally, I had enough of it and invested (a lot of) time to formalize this in Lean and get some peace of mind. Of course it still remains to show the theorems where this would actually be used.