Documentation

ExistentialRules.ChaseSequence.Nontermination.HeadChoice

HeadChoice #

Here we define HeadChoices, which are merely functions from triggers to head indices. We also define machinery to get a branch from a tree that corresponds to a given HeadChoice.

@[reducible, inline]
abbrev HeadChoice (sig : Signature) [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] :
Type (max (max u_3 u_2) u_1)

A HeadChoice is a function that maps each trigger to one of its head indices.

Equations
Instances For

    Often we want to assume that a HeadChoice for equivalent triggers returns the same index.

    Equations
    Instances For

      Sometimes we even require that the head choice only depends on the rule; that is, each trigger with the same rules uses the same head.

      Equations
      Instances For
        def PreTrigger.output_for_headChoice {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] (trg : PreTrigger sig) (hc : HeadChoice sig) :
        List (Fact sig)

        A shortcut for the trigger output dictaded by a head choice.

        Equations
        Instances For
          theorem PreTrigger.output_for_headChoice_eq_of_equiv {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {trg trg2 : PreTrigger sig} {hc : HeadChoice sig} (hc_consistent : hc.consistent_for_equivalent_triggers) (equiv : trg.equiv trg2) :

          The head choice output for equivalent triggers is the same given that the head choice is consistent_for_equivalent_triggers.

          def ChaseNodeOrigin.adheres_to_headChoice {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {obs : ObsolescenceCondition sig} {rules : RuleSet sig} (orig : ChaseNodeOrigin obs rules) (hc : HeadChoice sig) :

          A ChaseNodeOrigin adheres to a HeadChoice if it uses the index that is the head choice of its trigger.

          Equations
          Instances For
            theorem ChaseNodeOrigin.result_eq_of_adheres_to_headChoice {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {obs : ObsolescenceCondition sig} {rules : RuleSet sig} {orig : ChaseNodeOrigin obs rules} {hc : HeadChoice sig} (adheres : orig.adheres_to_headChoice hc) :
            def ChaseNode.adheres_to_headChoice {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {obs : ObsolescenceCondition sig} {rules : RuleSet sig} {N : Type u} [CN : ChaseNode N obs rules] (node : N) (hc : HeadChoice sig) :

            A ChaseNode adheres to a HeadChoice if its origin uses the index that is the head choice of its trigger.

            Equations
            Instances For
              theorem ChaseNode.origin_result_eq_of_adheres_to_headChoice {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {obs : ObsolescenceCondition sig} {rules : RuleSet sig} {N : Type u} [CN : ChaseNode N obs rules] {node : N} (isSome : (origin node).isSome = true) {hc : HeadChoice sig} (adheres : adheres_to_headChoice node hc) :
              origin_result node isSome = ((origin node).get isSome).fst.val.output_for_headChoice hc
              def ChaseDerivationSkeleton.adheres_to_headChoice {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {obs : ObsolescenceCondition sig} {rules : RuleSet sig} {N : Type u} [CN : ChaseNode N obs rules] (cd : ChaseDerivationSkeleton N obs rules) (hc : HeadChoice sig) :

              A ChaseDerivationSkeleton adheres to a HeadChoice if every node adheres to the HeadChoice.

              Equations
              Instances For
                def FiniteTriggerList.adheres_to_headChoice {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {obs : ObsolescenceCondition sig} {rules : RuleSet sig} (l : FiniteTriggerList obs rules) (hc : HeadChoice sig) :

                A FiniteTriggerList adheres to a HeadChoice if every element adheres to the HeadChoice.

                Equations
                Instances For

                  A InfiniteTriggerList adheres to a HeadChoice if every element adheres to the HeadChoice.

                  Equations
                  Instances For
                    def TreeDerivation.generator_for_headChoice {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {obs : ObsolescenceCondition sig} {rules : RuleSet sig} {N : Type u} [CN : ChaseNode N obs rules] (td : TreeDerivation N obs rules) (hc : HeadChoice sig) (n : td.NodeWithAddress) :

                    The generator function used to generate the tree branch corresponding to the given HeadChoice.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      theorem TreeDerivation.generator_for_headChoice_mem_childNodes {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {obs : ObsolescenceCondition sig} {rules : RuleSet sig} {N : Type u} [CN : ChaseNode N obs rules] {td : TreeDerivation N obs rules} {hc : HeadChoice sig} (n next : td.NodeWithAddress) :
                      next ∈ td.generator_for_headChoice hc n → next ∈ n.childNodes

                      The generator function produces a child node if it produces a value at all.

                      The generator function does not yield a new value if and only if the childNodes are empty.

                      theorem TreeDerivation.generator_for_headChoice_adheres_to_headChoice {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {obs : ObsolescenceCondition sig} {rules : RuleSet sig} {N : Type u} [CN : ChaseNode N obs rules] {td : TreeDerivation N obs rules} {hc : HeadChoice sig} (n next : td.NodeWithAddress) :

                      The node produced by generator_for_headChoice adheres to the head choice.

                      def TreeDerivation.subderivation_for_headChoice {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {obs : ObsolescenceCondition sig} {rules : RuleSet sig} {N : Type u} [CN : ChaseNode N obs rules] (td : TreeDerivation N obs rules) (hc : HeadChoice sig) :
                      ChaseDerivation N obs rules

                      This function generates the tree branch that corresponds to the given HeadChoice.

                      Equations
                      Instances For
                        theorem TreeDerivation.subderivation_for_headChoice_mem_branches {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {obs : ObsolescenceCondition sig} {rules : RuleSet sig} {N : Type u} [CN : ChaseNode N obs rules] {td : TreeDerivation N obs rules} {hc : HeadChoice sig} :

                        The subderivation_for_headChoice is a branch, which follows since we use TreeDerivation.generate_subderivation to build it.

                        theorem TreeDerivation.head_subderivation_for_headChoice {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {obs : ObsolescenceCondition sig} {rules : RuleSet sig} {N : Type u} [CN : ChaseNode N obs rules] {td : TreeDerivation N obs rules} {hc : HeadChoice sig} :

                        The head of subderivation_for_headChoice is the root of the tree derivation.

                        theorem TreeDerivation.next_subderivation_for_headChoice_mem_childNodes {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {obs : ObsolescenceCondition sig} {rules : RuleSet sig} {N : Type u} [CN : ChaseNode N obs rules] {td : TreeDerivation N obs rules} {hc : HeadChoice sig} (next : N) :

                        The head of subderivation_for_headChoice is the root of the tree derivation.

                        The subderivation for a head choice adheres to that head choice.

                        def ChaseTree.subderivation_for_headChoice {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {obs : ObsolescenceCondition sig} {kb : KnowledgeBase sig} {N : Type u} [CN : ChaseNode N obs kb.rules] (ct : ChaseTree N obs kb) (hc : HeadChoice sig) :
                        ChaseBranch N obs kb

                        This function generates the tree branch that corresponds to the given HeadChoice.

                        Equations
                        Instances For

                          The subderivation for a head choice adheres to that head choice.