Documentation

ExistentialRules.ChaseSequence.Termination.ConstantMappings.Basic

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

@[reducible, inline]
abbrev ConstantMapping (sig : Signature) [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] :
Type (max u_3 u_3 u_2)
Equations
Instances For
    @[reducible, inline]

    We apply a ConstantMapping to a PreGroundTerm by applying it to all leaves.

    Equations
    Instances For

      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
      Instances For

        Applying a ConstantMapping to a GroundTerm.const is the same as directly applying the mapping to the underlying constant.

        theorem ConstantMapping.apply_ground_term_func {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] (g : ConstantMapping sig) (func : SkolemFS sig) (ts : List (GroundTerm sig)) (arity_ok : ts.length = func.arity) :

        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.

        theorem ConstantMapping.apply_ground_term_congr_left {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] (g g2 : ConstantMapping sig) (t : GroundTerm sig) :
        (∀ (c : sig.C), c t.constantsg c = g2 c)g.apply_ground_term t = g2.apply_ground_term t

        Mapping the same term using two ConstantMappings yields the same term if the mappings agree on all constants of the term.

        theorem ConstantMapping.apply_ground_term_eq_self_of_id_on_constants {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] (g : ConstantMapping sig) (t : GroundTerm sig) (id_on_constants : ∀ (c : sig.C), c t.constantsg c = GroundTerm.const c) :

        If the ConstantMapping is the id on the constants of a term, applying the mapping to the term is also the id.

        @[reducible, inline]
        abbrev ConstantMapping.apply_fact {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] (g : ConstantMapping sig) :
        Fact sigFact sig

        We lift ConstantMappings to Facts in the obvious way.

        Equations
        Instances For

          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.

          theorem ConstantMapping.apply_fact_congr_left {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] (g g2 : ConstantMapping sig) (f : Fact sig) :
          (∀ (c : sig.C), c f.constantsg c = g2 c)g.apply_fact f = g2.apply_fact f

          Mapping the same fact using two ConstantMappings yields the same fact if the mappings agree on all constants of the fact.

          theorem ConstantMapping.apply_fact_eq_self_of_id_on_constants {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] (g : ConstantMapping sig) (f : Fact sig) (id_on_constants : ∀ (c : sig.C), c f.constantsg c = GroundTerm.const c) :

          If the ConstantMapping is the id on the constants of a fact, applying the mapping to the fact is also the id.

          @[reducible, inline]

          We lift ConstantMapping s to FactSet`s in the obvious way.

          Equations
          Instances For