Constant Mappings #
A ConstantMapping is a TermMapping from constants to GroundTerms.
This is very similar to a GroundSubstitution only that it maps constants instead of variables
Equations
- ConstantMapping sig = TermMapping sig.C (GroundTerm sig)
Instances For
The id ConstantMapping is the GroundTerm.const constructor.
Equations
Instances For
We apply a ConstantMapping to a PreGroundTerm by applying it to all leaves.
Equations
- g.apply_pre_ground_term = FiniteTree.mapLeaves fun (c : sig.C) => (g c).val
Instances For
Applying the ConstantMapping.id on a PreGroundTerm yields the same term.
Applying a ConstantMapping to a PreGroundTerm retains the PreGroundTerm.arity_ok property.
Mapping the same term using two ConstantMappings yields the same term if the mappings agree on all leaves of the term.
If the ConstantMapping is the id on the leaves of a term, applying the mapping to the term is also the id.
We lift ConstantMappings to GroundTerms in the obvious way.
Equations
- g.apply_ground_term t = ⟨g.apply_pre_ground_term t.val, ⋯⟩
Instances For
Applying a ConstantMapping to a GroundTerm.const is the same as directly applying the mapping to the underlying constant.
Applyign a ConstantMapping to a GroundTerm.func is the same as applying the mapping to all child terms.
For a non-constant SkolemTerm, if we apply a ConstantMapping after a GroundSubstitution, we can instead apply the substitution that is the composition of the ConstantMapping after the GroundSubstitution. Note that this does not work for constants since the ConstantMapping might map it some something else, whereas the composed substitution maps each constant to itself.
Mapping the same term using two ConstantMappings yields the same term if the mappings agree on all constants of the term.
If the ConstantMapping is the id on the constants of a term, applying the mapping to the term is also the id.
We lift ConstantMappings to Facts in the obvious way.
Equations
Instances For
Applying a ConstantMapping to a fact can be seens as applying a GroundTermMapping to the fact.
Consider a ConstantMapping, a PreTrigger, and a FunctionFreeAtom. If the constant mapping if the id on all constants in the atom, then applying the mapping after the trigger is the same a applying a trigger where the constant mapping is composed with the original substitution.
Mapping the same fact using two ConstantMappings yields the same fact if the mappings agree on all constants of the fact.
If the ConstantMapping is the id on the constants of a fact, applying the mapping to the fact is also the id.
We lift ConstantMapping s to FactSet`s in the obvious way.