Documentation

ExistentialRules.ChaseSequence.CriticalInstance

Critical Instance #

The critical instance is a special database that connects all constants from a rule set plus additional constants in all possible ways with the predicates from the rule set. Traditionally, the list of additional constants only consists of a single one, often called "*". However, we allow arbitrary lists. No trigger can ever be active on this Database, which might come in handy in proofs where such a Database needs to be found. In a way, the critical instance also generalized all databases. With this idea in mind, it also forms the basis for MFA-like termination checks.

def RuleSet.generalizedCriticalInstance {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] (rs : RuleSet sig) (finite : CustomBasicDatastructures.Set.finite rs) (additional_consts : List sig.C) :

The generalizedCriticalInstance consists of all facts that can be build from predicates in the rule set and constants from the ruleset plus the all the constants that we pass to this function.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem RuleSet.generalizedCriticalInstance_constants {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {rs : RuleSet sig} {finite : CustomBasicDatastructures.Set.finite rs} {additional_consts : List sig.C} :

    Constants in the generalizedCriticalInstance are either in the additional constants or they come from the rule set. One should think that this is not only a subset relation but an equality. However this only holds if there is at least one predicate in the rule set that has arity at least one. Intuitively this should be true for any interesting rule set but technically we do not demand this anywhere.

    As mentioned above, we show equality of the set of constants by demanding that a predicate of arity ≠ 0 exists in the rule set.

    If the constants of a FunctionFreeFact all occur in the critical instance, then so does the FunctionFreeFact.

    Every trigger using only constants from the critical instance is loaded.

    theorem RuleSet.generalizedCriticalInstance_no_trigger_with_datalog_head_active {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {obs : ObsolescenceCondition sig} {rs : RuleSet sig} {finite : CustomBasicDatastructures.Set.finite rs} {additional_consts : List sig.C} (trg : RTrigger { cond := obs.cond, monotone := ⋯ } rs) :

    No trigger is active on the critical instance if it features at least one head disjunct without existentials. As soon as one is loaded, it is also obsolete.

    theorem RuleSet.generalizedCriticalInstance_no_trigger_active_for_restrictedObsolescence {sig : Signature} [DecidableEq sig.P] [DecidableEq sig.C] [DecidableEq sig.V] {rs : RuleSet sig} {finite : CustomBasicDatastructures.Set.finite rs} {additional_consts : List sig.C} :
    (∃ (c : sig.C), c ∈ CustomBasicDatastructures.List.toSet additional_consts ∪ rs.constants) → ∀ (trg : RTrigger { cond := (RestrictedObsolescence sig).cond, monotone := ⋯ } rs), trg.val.rule.head ≠ [] → ¬trg.val.active (rs.generalizedCriticalInstance finite additional_consts).toFactSet.val

    For RestrictedObsolescence, no trigger with non-empty head can ever be active if at least one constant is in the critical instance.