Chase Tree Result is Universal Model Set #
This whole file is dedicated to showing that the result of a ChaseTree
is a universal model set [BMMP16].
More precisely, we want to show the universality part as we have already shown in ChaseTree.result_models_kb that each
element of the result is a model.
So what exactly remains to be shown?
We aim to show that for a given ChaseTree for a KnowledgeBase and any model $M$ of the KnowledgeBase,
we can pick a fact set $F$ from the result of the chase tree such that there is a homomorphism from $F$ to $M$.
This result is shown in RegularChaseTree.universal_result.
The proof works by step-wise construction of both a branch in the chase tree as well as a suitable homomorphism.
The constructions builds both at the same time.
One step of the construction is done by the hom_step function below, which calls hom_step_of_trg_ex for the heavy lifting.
The base of the construction is simply an empty branch and the id mapping.
In each step of the construction, we consider an InductiveHomomorphismResult, which we define to be a pair of a node in the chase tree and a GroundTermMapping such that the mapping is a homomorphism from the node into the model $M$.
In the proof of RegularChaseTree.universal_result,
we leverage the TreeDerivation.generate_subderivation function with hom_step as the generator function.
Besides that, all the homomorphisms from the individual steps need to be combined into a single function. The definition is not too hard and all relevant properties are also not too hard to show once we can establish that the homomorphisms for each step always extend the previous one.
The InductiveHomomorphismResult is used for the step-wise construction is forms the element that is the input and output of the generator function used in TreeDerivation.generate_subderivation later. It consists of a node in the chase tree and a GroundTermMapping that is a homomorphism from the node to the target model. The generated branch is the chain of all the generated nodes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Consider any node in the chase tree together with a homomorphism from this node to the target model. Given that the list of child nodes is not empty, we return one of child node together with an extended homomorphism. How do we know that such a node and homomorphism exist? If the list of children is not empty, there needs to exists a trigger that has been used to derive them. The existing trigger is loaded for the target model but since it is a model, we can also show that it also needs to be satisfied for the model. The way in which the trigger is satisfied in the model dictates which child node we pick and how we define the homomorphisms for the fresh terms introduced by the trigger. This is already all that happens here but it is not quite trivial to show that the constructed GroundTermMapping is indeed a homomorphism.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The node that we pick in hom_step_of_trg_ex is in the childNodes of the previous node. This is trivial.
The homomorphisms that we construct in hom_step_of_trg_ex agrees with the previous one on all terms in the previous node. This is also trivial.
When extending the InductiveHomomorphismResult from one step to the next, we do not necessarily know that a trigger is active for the current node. Indeed the chase might just have already finished. So we do a simple case distinction here and return an Option either with the result from hom_step_of_trg_ex or simply none.
Equations
- One or more equations did not get rendered due to their size.
Instances For
If there is a new node returned by hom_step, then it is in the childNodes of the current node.
If hom_step returns none, then the current node does not have any children.
The homomorphism returns in hom_step agrees with the current one on all terms from the current node.
We define the first InductiveHomomorphismResult to be used in the following infinite construction.
Equations
Instances For
We use the inductive constructor to generate an infinite list of derivations together with their respective homomorphisms.
Equations
- One or more equations did not get rendered due to their size.
Instances For
In every step of the infinite list, the associated mapping is indeed a homomorphism from the step's derivation to the target model.
The infinite list always has a first element that we unwrap here.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The first derivation in the generated list is a branch in the chase tree.
The first derivation in the generated list is equal to taking the heads of each derivation.
As outlined at the very top of this file, we now use TreeDerivation.generate_subderivation with the hom_step generator to obtain the branch in the tree that yields the result FactSet for which the combined GroundTermMappings form a homomorphism into the target model.