Documentation

ExistentialRules.ChaseSequence.Nontermination.BirthFacts

BirthFacts #

The birth facts of a trigger are very similar to the backtracking done for the MFA-like conditions only that we do not consider body atoms here. Therefore, we also do not need to introduce fresh constants. Overall this is all much simpler.

def PreGroundTerm.birthTrigger {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] [Inhabited sig.C] (term : PreGroundTerm sig) (term_is_func : ∃ (func : SkolemFS sig), ∃ (ts : List (CustomBasicDatastructures.FiniteTree (SkolemFS sig) sig.C)), term = CustomBasicDatastructures.FiniteTree.inner func ts) (term_arity_ok : arity_ok term = true) :

For a functional PreGroundTerm, we can find a PreTrigger that introduces it (ignoring how pure body variables are mapped).

Equations
Instances For
    def PreGroundTerm.birthFacts {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] [Inhabited sig.C] (term : PreGroundTerm sig) (term_arity_ok : arity_ok term = true) :
    List (Fact sig)

    For a PreGroundTerm, we can find the facts necessarily present when the term is "born". These are all facts in the head of the birthTrigger for the term as well as all birthFacts for the subterms (i.e. the children) or the term.

    Equations
    Instances For
      def PreGroundTerm.birthFacts_list {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] [Inhabited sig.C] (terms : List (PreGroundTerm sig)) (terms_arity_ok : ∀ (t : PreGroundTerm sig), t ∈ terms → arity_ok t = true) :
      List (Fact sig)

      This is just an elaborate way of flatMapping over the terms calling birthFacts for each. This way we do not have to show termination explicitely.

      Equations
      Instances For

        We lift the PreGroundTerm definitions to GroundTerms.

        def GroundTerm.birthTrigger {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] [Inhabited sig.C] (term : GroundTerm sig) (term_is_func : ∃ (func : SkolemFS sig), ∃ (ts : List (GroundTerm sig)), ∃ (arity_ok : ts.length = func.arity), term = GroundTerm.func func ts arity_ok) :
        Equations
        Instances For
          def GroundTerm.birthFacts {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] [Inhabited sig.C] (term : GroundTerm sig) :
          List (Fact sig)
          Equations
          Instances For
            def PreTrigger.birthFacts {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] [Inhabited sig.C] (trg : PreTrigger sig) :
            List (Fact sig)

            The PreTrigger.birthFacts are simply the birth facts of all frontier terms.

            Equations
            Instances For