Documentation

LeanPool.PDL.Tableau

PDL-Tableaux (Section 4) #

Projections #

Extract the continuation of an atomic box with the specified program index.

Equations
Instances For

    Collect the continuations of matching atomic boxes in a formula list.

    Equations
    Instances For
      @[simp]
      theorem PDL.proj {A : ℕ} {X : List Formula} {g : Formula} :

      Collect the continuations of matching atomic boxes in a formula finset.

      Equations
      Instances For

        Membership in the projection of a Finset of formulas. This is the Finset analogue of proj.

        Histories and Repeats #

        @[reducible, inline]

        A history is a list of Sequents. In the Tableau type this only tracks "big" steps, not steps happening within a LocalTableau. The list is in reverse order, i.e. the head is the newest Sequent.

        Equations
        Instances For
          def PDL.rep (Hist : History) (X : Sequent) :

          We have a repeat iff the history contains a node that is setEqTo the current node. Note that this is a Prop, it does not carry a specific number of steps to go back.

          Equations
          Instances For
            @[instance_reducible]
            instance PDL.instDecidableRep {H : History} {X : Sequent} :
            Equations
            @[simp]
            def PDL.rep.toNat {H : History} {X : Sequent} (rp : rep H X) :

            Given rep H X, get the index of the companion in H using List.findIdx?.

            Equations
            Instances For
              def PDL.rep.toFin {H : History} {X : Sequent} (rp : rep H X) :

              Given rep H X, get the index of the companion in H using List.findIdx?.

              Equations
              Instances For
                theorem PDL.rep.toFin_agrees {H : History} {X : Sequent} (rp : rep H X) :
                H[rp.toFin] = X

                Loaded Path Repeats #

                A lpr means we can go k steps back in the history to reach an equal node, and all nodes on the way are loaded. Note: k=0 means the first element of Hist is the companion.

                Equations
                Instances For
                  theorem PDL.LoadedPathRepeat.ext {Hist : History} {X : Sequent} (lprA lprB : LoadedPathRepeat Hist X) :
                  ↑lprA = ↑lprB → lprA = lprB

                  If there is any loaded path repeat, then we can compute one. FIXME There is probably a more elegant way, avoiding Nonempty and Fin.find?. Something like: def getLPR (H : History) (X : Sequent) : Option ... := ... that might also give us uniqueness of LPRs?

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    theorem PDL.LoadedPathRepeat_comp_isLoaded {Hist : History} {X : Sequent} (lpr : LoadedPathRepeat Hist X) :
                    (List.get Hist ↑lpr).isLoaded
                    @[instance_reducible]
                    Equations
                    @[instance_reducible]
                    Equations

                    Free, forbidden and allowed repeats #

                    In Tableau we only want to allow the application of a rule when there is no loaded-path repeat and there is no free repeat. For this we introduce FreeRepeat and the flprep abbreviation.

                    def PDL.FreeRepeat (Hist : History) (X : Sequent) :

                    A free repeat is a non-loaded sequent that occured before. Values of this type are pairs: the number of steps to go back in the history and a proof that we then find the same set.

                    Equations
                    Instances For
                      def PDL.flprep (H : History) (X : Sequent) :

                      Either a free repeat or a loaded-path repeat. Note that the negation of this is not the same as ¬ rep because it will still allow loaded repeats that are not loaded-path repeats, at which Tableau may continue. See also posOf that is used to define tableauGame later.

                      Equations
                      Instances For
                        @[simp]

                        The PDL rules #

                        inductive PDL.PdlRule (X Y : Sequent) :

                        A rule to go from X to Y. Note the four variants of the modal rule.

                        Instances For
                          def PDL.instDecidableEqPdlRule.decEq {X✝ Y✝ : Sequent} (x✝ x✝¹ : PdlRule X✝ Y✝) :
                          Decidable (x✝ = x✝¹)
                          Instances For

                            Whether a PDL rule is one of the two modal rules.

                            Equations
                            Instances For
                              @[instance_reducible]
                              Equations
                              • One or more equations did not get rendered due to their size.
                              inductive PDL.Tableau :

                              The Tableau [parent, grandparent, ...] child type.

                              This represents a closed tableau for X, constructed by either of:

                              • a local tableau for X followed by Tableau for all end nodes,
                              • a PDL rule application followed by Tableau for all results, or
                              • a loaded-path repeat (also called successful, see [MB1988] condition 6 in Def 14 on page 25).
                              Instances For
                                def PDL.Tableau.size {Hist : History} {X : Sequent} :
                                Tableau Hist X → ℕ

                                The number of nodes in a tableau, including every local-rule continuation.

                                Equations
                                Instances For
                                  theorem PDL.Tableau.size_next_lt_of_loc {Hist : History} {X : Sequent} {tab : Tableau Hist X} {nrep : ¬flprep Hist X} {nbas : ¬X.basic} {lt : LocalTableau X} {next : (Y : Sequent) → Y ∈ endNodesOf lt → Tableau (X :: Hist) Y} (tab_def : tab = loc nrep nbas lt next) (Y : Sequent) (Y_in : Y ∈ endNodesOf lt) :
                                  (next Y Y_in).size < tab.size
                                  theorem PDL.Tableau.size_next_lt_of_pdl {Hist : History} {X Y : Sequent} {tab : Tableau Hist X} {nrep : ¬flprep Hist X} {bas : X.basic} {r : PdlRule X Y} {next : Tableau (X :: Hist) Y} (tab_def : tab = pdl nrep bas r next) :
                                  next.size < tab.size
                                  def PDL.decidableExistsEndNodeOf {X : Sequent} {lt : LocalTableau X} {f : (Y : Sequent) → Y ∈ endNodesOf lt → Prop} {dec : (Y : Sequent) → (Y_in : Y ∈ endNodesOf lt) → Decidable (f Y Y_in)} :
                                  Decidable (∃ (Y : Sequent) (Y_in : Y ∈ endNodesOf lt), f Y Y_in)

                                  Decide an existential predicate over the end nodes of a local tableau.

                                  Equations
                                  Instances For
                                    @[instance_reducible]
                                    instance PDL.Tableau.instDecidableEq {Hist : History} {X : Sequent} {tab1 tab2 : Tableau Hist X} :
                                    Decidable (tab1 = tab2)
                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    def PDL.Tableau.isLrep {Hist : History} {X : Sequent} :
                                    Tableau Hist X → Prop

                                    Whether a tableau is a loaded-path-repeat leaf.

                                    Equations
                                    Instances For
                                      inductive PDL.provable :

                                      Provability witnessed by a tableau closing the negation on either side.

                                      Instances For

                                        A Sequent is inconsistent if there exists a closed tableau for it.

                                        Equations
                                        Instances For

                                          A Sequent is consistent iff it is not inconsistent.

                                          Equations
                                          Instances For