Documentation

Pdl.LocalRules

Local rules and local rule applications #

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
              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
                instance instReprLocalRule {a✝ : Sequent} {a✝¹ : List Sequent} :
                Repr (LocalRule a✝ a✝¹)
                Equations
                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

                    Helper originally written for Lemma 6.14 but currently unused.

                    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.

                      Local Rule Applications #

                      structure 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 (x✝ x✝¹ : LocalRuleApp) :
                        Decidable (x✝ = x✝¹)
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          @[reducible, inline]
                          Equations
                          Instances For
                            theorem localRuleTruth (lra : LocalRuleApp) {W : Type} (M : KripkeModel W) (w : W) :
                            (M, w) lra.X Cilra.C, (M, w) Ci

                            Any local rule application is sound and invertible.

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

                            def localRuleApp_of_nonbasic_in_L (L R : List Formula) (O : Olf) (f : Formula) (f_in : f L) (f_nonBas : f.basic = false) :
                            { lra : LocalRuleApp // lra.X = (L, R, O) }

                            For a given non-basic formula in the left list L, construct a LocalRuleApp using an appropriate OneSidedLocalRule.

                            Equations
                            Instances For
                              def localRuleApp_of_nonbasic_in_R (L R : List Formula) (O : Olf) (f : Formula) (f_in : f R) (f_nonBas : f.basic = false) :
                              { lra : LocalRuleApp // lra.X = (L, R, O) }

                              For a given non-basic formula in the right list R, construct a LocalRuleApp using an appropriate OneSidedLocalRule.

                              Equations
                              Instances For
                                theorem basic_iff_noLocalRuleApp {Y : Sequent} :
                                Y.basic ¬∃ (lra : LocalRuleApp), lra.X = Y

                                A sequent is basic iff no local rule can be applied. Note that in the paper (L+) and (L-) are also local rules and had to be excluded here, but here in the Lean formalization they are PdlRules anyway.

                                Local rule applications preserve atomic formulas #

                                theorem LocalRuleApp.preserve_atom_down (lra : LocalRuleApp) (Y : Sequent) :
                                Y lra.C∀ (p : ), ·p lra.X.bothSides·p Y.bothSides
                                theorem LocalRuleApp.preserve_neg_atom_down (lra : LocalRuleApp) (Y : Sequent) :
                                Y lra.C∀ (p : ), ~·p lra.X.bothSides~·p Y.bothSides
                                theorem LocalRuleApp.preserve_local_atom_down (lra : LocalRuleApp) (Y : Sequent) :
                                Y lra.C∀ (f : Formula), (f = ∃ (p : ), f = ·p f = ~·p) → f lra.X.bothSidesf Y.bothSides
                                theorem loaded_unfold_child_closes_left {α : Program} {χ : LoadFormula} {w : List Formula} {o : Option NegLoadFormula} (h : (w, o) unfoldDiamondLoaded α χ) :
                                Dset α, fYset χ.unload, f w f Olf.L (Option.map Sum.inl o)
                                theorem loaded_unfold'_child_closes_left {α : Program} {φ : Formula} {w : List Formula} {o : Option NegLoadFormula} (h : (w, o) unfoldDiamondLoaded' α φ) :
                                Dset α, fYset φ, f w f Olf.L (Option.map Sum.inl o)
                                theorem loaded_unfold_child_closes_right {α : Program} {χ : LoadFormula} {w : List Formula} {o : Option NegLoadFormula} (h : (w, o) unfoldDiamondLoaded α χ) :
                                Dset α, fYset χ.unload, f w f Olf.R (Option.map Sum.inr o)
                                theorem loaded_unfold'_child_closes_right {α : Program} {φ : Formula} {w : List Formula} {o : Option NegLoadFormula} (h : (w, o) unfoldDiamondLoaded' α φ) :
                                Dset α, fYset φ, f w f Olf.R (Option.map Sum.inr o)
                                theorem LocalRuleApp.formula_preserved_or_expanded (lra : LocalRuleApp) {Y : Sequent} (hY : Y lra.C) (f : Formula) :
                                f lra.X.bothSidesf Y.bothSides ∀ (φ ψ : Formula) (α : Program), (f = ~~φφ Y.bothSides) (f = φ ψφ Y.bothSides ψ Y.bothSides) (f = ~(φ ψ) → ~φ Y.bothSides ~ψ Y.bothSides) ((f = αφ) → ∃ (l : TP α), ((Bset α l φ).all fun (x : Formula) => decide (x Y.bothSides)) = true) ((f = ~αφ) → Dset α, ((Yset φ).all fun (x : Formula) => decide (x Y.bothSides)) = true)

                                Every formula at the source of a local rule is either retained by a chosen child or is the principal formula and has the closure data required for saturatedness in that child.

                                Saturated and Locally Consistent Sets of Formulas #

                                A set of formulas is saturated if it is closed under: removing double negations, splitting (negated) conjunctions, unfolding boxes using any test profile, and unfolding diamonds using H. Part of Def 6.2

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

                                  Any basic sequent is also saturated.

                                  A set of formulas is lcoally consistent iff it does not contain and for all atoms p ∈ X we do not have ~p ∈ X. Part of Def 6.2

                                  Equations
                                  Instances For

                                    LocalRuleApp preserves saturatedness backwards.

                                    A free diamond at the source of a local rule application is either kept in the chosen child, or it is the principal formula, and then the child contains one of its unfoldings. Analogous to LocalRuleApp.formula_preserved_or_expanded, but for Sequent.wForms, i.e. here we also know that the formulas in the child occur unloaded. (This is why we cannot obtain this lemma from LocalRuleApp.formula_preserved_or_expanded: the latter uses Sequent.bothSides, where a formula may also come from unloading the loaded formula of a sequent.)

                                    A loaded diamond at the source of a local rule application is either kept in the chosen child, or it is the principal formula, and then the child contains one of the results of the LoadRule that was applied to it. This is the loaded analogue of LocalRuleApp.wForms_negBox_preserved_or_unfolded.

                                    The only LoadRule applicable to ~'⌊α⌋χ for a loaded χ is LoadRule.dia.

                                    The only LoadRule applicable to ~'⌊α⌋φ for a normal φ is LoadRule.dia'.

                                    theorem LocalRuleApp.preserve_basic_down (lra : LocalRuleApp) (Y : Sequent) :
                                    Y lra.C∀ (f : Formula), f.basic = truef lra.X.bothSidesf Y.bothSides

                                    Local rule applications preserve basic formulas: no local rule with children can have a basic formula as its principal formula. Note that is not basic, for that case see LocalRuleApp.preserve_bottom_down.

                                    theorem LocalRuleApp.preserve_free (lra : LocalRuleApp) (hfree : lra.O = none) (Y : Sequent) :
                                    Y lra.CY.O = none

                                    Local rules never load a formula: if the sequent we apply a local rule to is free, then so are all children. (The rules loadedL and loadedR are not applicable to a free sequent, and all other local rules leave the Olf component unchanged.)