Documentation

Pdl.LocalTableau

Local Tableaux (Section 3) #

One-sided local rules #

Local rules replace a given set of formulas by other sets, one for each branch. The list of resulting branches can be empty, representing that the given set is closed. In the Haskell prover this is done in "ruleFor" in the Logic.PDL.Prove.Tree module.

Instances For
    Equations
    Instances For

      Loaded Rules #

      The loaded diamond rule, given by unfoldDiamondLoaded. In MB page 19 these were multiple rules ¬u, ¬; ¬* and ¬?. It replaces the loaded formula by up to one loaded formula and a list of normal formulas. It's a bit annoying to need the rule twice here due to the definition of LoadFormula and the extra definition of unfoldDiamondLoaded'.

      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          Given a LoadRule application, define the equivalent unloaded rule application. This allows re-using oneSidedLocalRuleTruth to prove loadRuleTruth.

          Equations
          Instances For

            The loaded unfold rule is sound and invertible. In the notes this is part of localRuleTruth.

            Local Rules #

            inductive LocalRule :

            A local rule is a OneSidedLocalRule, a left-right contradiction, or a LoadRule. Note that formulas can be in four places: left, right, loaded left, loaded right.

            We do not have neg/contradiction rules between loaded and unloaded formulas (i.e. between ({unload χ}, ∅, some (Sum.inl ~χ)) and (∅, {unload χ}, some (Sum.inr ~χ))) because in any such case we could also close the tableau before or without loading.

            The YS_def arguments in non-terminal rules enables deriving DecidableEq for LocalRule.

            Instances For
              instance instReprLocalRule {a✝ : Sequent} {a✝¹ : List Sequent} :
              Repr (LocalRule a✝ a✝¹)
              Equations
              def instReprLocalRule.repr {a✝ : Sequent} {a✝¹ : List Sequent} :
              LocalRule a✝ a✝¹Std.Format
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                def instDecidableEqLocalRule.decEq {a✝ : Sequent} {a✝¹ : List Sequent} (x✝ x✝¹ : LocalRule a✝ a✝¹) :
                Decidable (x✝ = x✝¹)
                Equations
                Instances For
                  def applyLocalRule {Lcond Rcond : List Formula} {Ocond : Olf} {ress : List Sequent} :
                  LocalRule (Lcond, Rcond, Ocond) ressSequentList Sequent
                  Equations
                  Instances For
                    theorem oneSidedL_preserves_right {LRO : Sequent} {Lcond : List Formula} (Lpreproof : Lcond LRO.L) {Lres : List (List Formula)} (orule : OneSidedLocalRule Lcond Lres) {YS : List Sequent} (YS_def : YS = List.map (fun (res : List Formula) => (res, , none)) Lres) (c : Sequent) :
                    c applyLocalRule (LocalRule.oneSidedL orule YS_def) LROc.right = LRO.right
                    theorem oneSidedR_preserves_left {LRO : Sequent} {Rcond : List Formula} (Rpreproof : Rcond LRO.R) {Rres : List (List Formula)} (orule : OneSidedLocalRule Rcond Rres) {YS : List Sequent} (YS_def : YS = List.map (fun (res : List Formula) => (, res, none)) Rres) (c : Sequent) :
                    c applyLocalRule (LocalRule.oneSidedR orule YS_def) LROc.left = LRO.left
                    theorem oneSidedL_sat_down (LRO : Sequent) {Lcond : List Formula} (Lpreproof : Lcond LRO.L) {Lres : List (List Formula)} (orule : OneSidedLocalRule Lcond Lres) {YS : List Sequent} (YS_def : YS = List.map (fun (res : List Formula) => (res, , none)) Lres) {X : List Formula} (LX_sat : HasSat.satisfiable (LRO.left X)) :
                    capplyLocalRule (LocalRule.oneSidedL orule YS_def) LRO, HasSat.satisfiable (c.left X)
                    theorem oneSidedR_sat_down (LRO : Sequent) {Rcond : List Formula} (Rpreproof : Rcond LRO.R) {Rres : List (List Formula)} (orule : OneSidedLocalRule Rcond Rres) {YS : List Sequent} (YS_def : YS = List.map (fun (res : List Formula) => (, res, none)) Rres) {X : List Formula} (RX_sat : HasSat.satisfiable (LRO.right X)) :
                    capplyLocalRule (LocalRule.oneSidedR orule YS_def) LRO, HasSat.satisfiable (c.right X)
                    theorem loadedL_preserves_right {LRO : Sequent} (χ : LoadFormula) (Opreproof : LRO.O = some (Sum.inl (~'χ))) {ress : List (List Formula × Option NegLoadFormula)} (lrule : LoadRule (~'χ) ress) {YS : List Sequent} (YS_def : YS = List.map (fun (x : List Formula × Option NegLoadFormula) => match x with | (X, o) => (X, , Option.map Sum.inl o)) ress) (c : Sequent) :
                    c applyLocalRule (LocalRule.loadedL χ lrule YS_def) LROc.right = LRO.right

                    Applying a LoadRule on the left will leave the right unchanged.

                    theorem loadedR_preserves_left {LRO : Sequent} (χ : LoadFormula) (Opreproof : LRO.O = some (Sum.inr (~'χ))) {ress : List (List Formula × Option NegLoadFormula)} (lrule : LoadRule (~'χ) ress) {YS : List Sequent} (YS_def : YS = List.map (fun (x : List Formula × Option NegLoadFormula) => match x with | (X, o) => (, X, Option.map Sum.inr o)) ress) (c : Sequent) :
                    c applyLocalRule (LocalRule.loadedR χ lrule YS_def) LROc.left = LRO.left

                    Applying a LoadRule on the right will leave the left unchanged.

                    theorem loadedL_sat_down (LRO : Sequent) (χ : LoadFormula) (Opreproof : LRO.O = some (Sum.inl (~'χ))) {ress : List (List Formula × Option NegLoadFormula)} (lrule : LoadRule (~'χ) ress) {YS : List Sequent} (YS_def : YS = List.map (fun (x : List Formula × Option NegLoadFormula) => match x with | (X, o) => (X, , Option.map Sum.inl o)) ress) {X : List Formula} (LX_sat : HasSat.satisfiable (LRO.left X)) :
                    capplyLocalRule (LocalRule.loadedL χ lrule YS_def) LRO, HasSat.satisfiable (c.left X)

                    Applying a LoadRule on the left preserves satisfiability of the left, even together with any other list of formulas as context.

                    theorem loadedR_sat_down (LRO : Sequent) (χ : LoadFormula) (Opreproof : LRO.O = some (Sum.inr (~'χ))) {ress : List (List Formula × Option NegLoadFormula)} (lrule : LoadRule (~'χ) ress) {YS : List Sequent} (YS_def : YS = List.map (fun (x : List Formula × Option NegLoadFormula) => match x with | (X, o) => (, X, Option.map Sum.inr o)) ress) {X : List Formula} (RX_sat : HasSat.satisfiable (LRO.right X)) :
                    capplyLocalRule (LocalRule.loadedR χ lrule YS_def) LRO, HasSat.satisfiable (c.right X)

                    Applying a LoadRule on the right preserves satisfiability of the right, even together with any other list of formulas as context.

                    inductive LocalRuleApp :

                    A local rule application going from ⟨L,R,O⟩ to C consists of a local rule lr replacing ⟨Lcond, Rcond, Ocond⟩ by ress and proofs that ⟨Lcond, Rcond, Ocond⟩ is a subsequent of ⟨L,R,O⟩ and that C are the results of applying lr to ⟨L,R,O⟩.

                    Instances For
                      def instDecidableEqLocalRuleApp.decEq {a✝ : Sequent} {a✝¹ : List Sequent} (x✝ x✝¹ : LocalRuleApp a✝ a✝¹) :
                      Decidable (x✝ = x✝¹)
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        theorem localRuleTruth {X : Sequent} {C : List Sequent} (lrA : LocalRuleApp X C) {W : Type} (M : KripkeModel W) (w : W) :
                        (M, w)X CiC, (M, w)Ci
                        Equations
                        • One or more equations did not get rendered due to their size.
                        inductive LocalTableau (X : Sequent) :

                        Local tableau for X, maximal by definition.

                        Instances For
                          instance LocalTableau.instDecidableEq {X : Sequent} {lt1 lt2 : LocalTableau X} :
                          Decidable (lt1 = lt2)
                          Equations
                          • One or more equations did not get rendered due to their size.

                          If we can apply a local rule to a sequent then it cannot be basic.

                          Termination of LocalTableau #

                          @[irreducible]

                          The local measure we use together with D-M to show that LocalTableau are finite.

                          Equations
                          Instances For
                            Equations
                            Instances For
                              theorem node_to_multiset_eq {L R : List Formula} {O : Olf} :
                              node_to_multiset (L, R, O) = L + R + O.toForm
                              theorem node_to_multiset_eq_of_three_eq {L L' R R' : List Formula} {O O' : Olf} (hL : L = L') (hR : R = R') (hO : O = O') :

                              If each three parts are the same then node_to_multiset is the same.

                              theorem List.Subperm.append {α : Type u_1} {l₁ l₂ r₁ r₂ : List α} :
                              l₁.Subperm l₂r₁.Subperm r₂(l₁ ++ r₁).Subperm (l₂ ++ r₂)
                              theorem preconP_to_submultiset {Lcond L Rcond R : List Formula} {Ocond O : Olf} (preconditionProof : Lcond.Subperm L Rcond.Subperm R Ocond O) :
                              theorem Multiset.sub_of_le {α : Type u_1} [DecidableEq α] {M N X Y : Multiset α} (h : N M) :
                              M - N + Y = X M + Y = X + N
                              theorem Multiset_diff_append_of_le {α : Type u_1} [DecidableEq α] {R Rcond Rnew : List α} :
                              ↑(R.diff Rcond ++ Rnew) = R - Rcond + Rnew
                              theorem List.Perm_diff_append_of_Subperm {α : Type u_1} [DecidableEq α] {L M : List α} (h : M.Subperm L) :
                              L.Perm (L.diff M ++ M)
                              theorem List.count_eq_diff_of_subperm {α : Type u_1} [DecidableEq α] {L M : List α} (h : M.Subperm L) (φ : α) :
                              count φ L = count φ (L.diff M) + count φ M
                              theorem node_to_multiset_of_precon {L R Lcond Rcond Lnew Rnew : List Formula} {O Ocond Onew : Olf} (precon : Lcond.Subperm L Rcond.Subperm R Ocond O) (O_extracon : O noneOcond = noneOnew = none) :
                              node_to_multiset (L, R, O) - node_to_multiset (Lcond, Rcond, Ocond) + node_to_multiset (Lnew, Rnew, Onew) = node_to_multiset (L.diff Lcond ++ Lnew, R.diff Rcond ++ Rnew, O.change Ocond Onew)

                              Applying node_to_multiset before or after applyLocalRule gives the same.

                              theorem LocalRule.cond_non_empty {Lcond Rcond : List Formula} {Ocond : Olf} {X : List Sequent} (rule : LocalRule (Lcond, Rcond, Ocond) X) :
                              node_to_multiset (Lcond, Rcond, Ocond)
                              theorem Multiset.sub_add_of_subset_eq {α : Type u_1} {X : Multiset α} [DecidableEq α] {M : Multiset α} (h : X M) :
                              M = M - X + X
                              theorem unfoldBox.decreases_lmOf_nonAtomic {ψ : Formula} {α : Program} {φ : Formula} {X : List Formula} (α_non_atomic : ¬α.isAtomic) (X_in : X unfoldBox α φ) (ψ_in_X : ψ X) :
                              theorem H_goes_down (α : Program) (φ : Formula) {Fs : List Formula} {δ : List Program} (in_H : (Fs, δ) H α) {ψ : Formula} (in_Fs : ψ Fs) :
                              theorem unfoldDiamond.decreases_lmOf_nonAtomic {ψ : Formula} {α : Program} {φ : Formula} {X : List Formula} (α_non_atomic : ¬α.isAtomic) (X_in : X unfoldDiamond α φ) (ψ_in_X : ψ X) :
                              theorem LocalRuleDecreases {X : Sequent} {ress : List Sequent} (rule : LocalRule X ress) (Y : Sequent) :
                              Y ressynode_to_multiset Y, xnode_to_multiset X, y < x
                              def MultisetLT' {α : Type u_1} [Preorder α] (M N : Multiset α) :
                              Equations
                              Instances For
                                theorem localRuleApp.decreases_DM {X : Sequent} {B : List Sequent} (lrA : LocalRuleApp X B) (Y : Sequent) :
                                Y Blt_Sequent Y X
                                @[irreducible]
                                Equations
                                Instances For

                                  Helper functions, relating end nodes and children #

                                  noncomputable def endNode_to_endNodeOfChildNonComp {X : Sequent} {a✝ : List Sequent} {subTabs : (Y : Sequent) → Y a✝LocalTableau Y} {E : Sequent} (lrA : LocalRuleApp X a✝) (E_in : E endNodesOf (LocalTableau.byLocalRule lrA subTabs)) :
                                  { x : Sequent // ∃ (h : x a✝), E endNodesOf (subTabs x h) }
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    theorem endNodeIsEndNodeOfChild {X : Sequent} {a✝ : List Sequent} {subTabs : (Y : Sequent) → Y a✝LocalTableau Y} {E : Sequent} (lrA : LocalRuleApp X a✝) (E_in : E endNodesOf (LocalTableau.byLocalRule lrA subTabs)) :
                                    ∃ (Y : Sequent) (h : Y a✝), E endNodesOf (subTabs Y h)
                                    theorem endNodeOfChild_to_endNode {X Y : Sequent} {ltX : LocalTableau X} {C : List Sequent} (lrA : LocalRuleApp X C) (subTabs : (Y : Sequent) → Y CLocalTableau Y) (h : ltX = LocalTableau.byLocalRule lrA subTabs) (Y_in : Y C) {Z : Sequent} (Z_in : Z endNodesOf (subTabs Y Y_in)) :

                                    Overall Soundness and Invertibility of LocalTableau #

                                    theorem localTableauTruth {X : Sequent} (lt : LocalTableau X) {W : Type} (M : KripkeModel W) (w : W) :
                                    (M, w)X YendNodesOf lt, (M, w)Y

                                    Local Tableaux make progress #

                                    These lemmas are used to show soundness, in particular loadedDiamondPaths.

                                    theorem endNodesOf_basic {X Z : Sequent} {ltZ : LocalTableau Z} :
                                    X endNodesOf ltZX.basic

                                    End nodes of any local tableau are basic.

                                    theorem endNodesOf_nonbasic_lt_Sequent {X Y : Sequent} (lt : LocalTableau X) (X_nonbas : ¬X.basic) :

                                    If X is not basic, then all end nodes Y of a local tableau lt for X are strictly lower than X according to the DM-ordering of their multisets.

                                    theorem non_eq_of_ltSequent {X Y : Sequent} :
                                    lt_Sequent X YX Y

                                    If a sequent is lower according the DM-ordering, then it is different.

                                    theorem endNodesOf_nonbasic_non_eq {X Y : Sequent} (lt : LocalTableau X) (X_nonbas : ¬X.basic) :
                                    Y endNodesOf ltY X

                                    If X is not basic, then for all end nodes Y of a local tableau lt for X we have that Y ≠ X.

                                    If a sequent is lower according to the DM-ordering, then they are multiset-different. (The analogue with finset instead of multiset does not hold.)