Documentation

Pdl.BuildTree

From winning strategies to model graphs (Section 6.3) #

BuildTree #

theorem LoadFormula.split_splitLast_to_loadBoxes {δs : List Program} {φ : Formula} {δs_ : List Program} {δ : Program} {ξ : AnyFormula} (ξsp_def : ξ.split = (δs, φ)) (sp_def : splitLast δs = some (δs_, δ)) :
def PdlRule.all (X : Sequent) :
List ((Y : Sequent) × PdlRule X Y)

List of all PdlRules applicable to X. Code is based on part of theMoves This is also similar to the definitions in LocalAll.lean.

Equations
  • One or more equations did not get rendered due to their size.
  • PdlRule.all X = []
Instances For
    theorem PdlRule.all_spec {X Y : Sequent} (bas : X.basic) (r : PdlRule X Y) :
    Y, r all X

    Specification that PdlRule.all is complete, almost: we demand X.basic here which is not part of the PdlRule type, but demanded by Tableau.pdl.

    inductive BuildTree :

    Tree data type to keep track of choices made by Builder. Might still need to be tweaked.

    • Choices should be labelled with the choices made by prover? TODO: Do we need to keep track of which rule is used?
    Instances For
      def theRep {H : History} {X : Sequent} (rp : rep H X) :
      Equations
      Instances For
        @[irreducible]
        noncomputable def buildTree (s : Strategy tableauGame Builder) {H : History} {X : Sequent} {p : ProverPos H X BuilderPos H X} (h : winning s H, X, p) :

        The tree generated from a winning Builder strategy

        Equations
        Instances For

          Matches #

          WORRY: Where in the below is it okay/safe to work with the BuildTree type and where should we insist on the (more specific) buildTree result value?

          inductive Match {pos : GamePos} :
          BuildTree posType

          Path inside a BuildTree. Analogous to PathIn for Tableau.

          Instances For
            def Match.btAt {pos : GamePos} {bt : BuildTree pos} :
            Match bt(newPos : GamePos) × BuildTree newPos
            Equations
            Instances For
              def Match.append {a✝ : GamePos} {bt : BuildTree a✝} (m1 : Match bt) (m2 : Match m1.btAt.snd) :
              Equations
              Instances For
                structure Match.edge {x✝ : GamePos} {bt : BuildTree x✝} (m n : Match bt) :

                The parent-child relation ⋖_𝕋 in a Builder strategy tree. Similar to edge but data.

                Instances For
                  theorem Match.leaf_no_edge {pos : GamePos} {bt : BuildTree pos} (m : Match bt) (rp : rep m.btAt.fst.fst m.btAt.fst.snd.fst) (h : m.btAt.snd = BuildTree.Leaf rp) (n : Match bt) :

                  If m ends at a leaf, then it cannot have an edge to any n.

                  def Match.rewind {a✝ : GamePos} {bt : BuildTree a✝} :
                  Match bt(k : ) → Match bt

                  Go back up inside bt by k steps. FIXME: instead of Nat, use Fin like we do in PathIn.rewind.

                  Equations
                  Instances For
                    def Match.companionOf {pos mPos : GamePos} {bt : BuildTree pos} (m : Match bt) (rp : rep mPos.fst mPos.snd.fst) :
                    m.btAt = mPos, BuildTree.Leaf rpMatch bt
                    Equations
                    Instances For
                      def Match.companion {a✝ : GamePos} {bt : BuildTree a✝} (m n : Match bt) :
                      Equations
                      Instances For

                        Pre-states (Def 6.13) #

                        As possible worlds for the model graph we want to define maximal paths inside the build tree that do not contain (M) steps.

                        In the paper pre-states are allowed to be of the form π;π' when π ends at a repeat and π' is a maximal prefix of the path from the companion to that repeat. Here we only store the π part of such pre-states, because the π' is then uniquely determined by π.

                        def Match.edge.isModal {pos : GamePos} {bt : BuildTree pos} {m n : Match bt} :
                        m.edge nProp

                        This edge between matches is a modal step. To even say this we adjusted BuildTree to contain data which rule was used.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          def Match.isLeaf {pos : GamePos} {bt : BuildTree pos} {m : Match bt} :
                          Equations
                          Instances For
                            inductive PreStateP {pos : GamePos} (bt : BuildTree pos) (m : Match bt) :

                            A pre-state-part starting at m is any path in bt : BuildTree consisting of non-(M) edges and stopping at a leaf or at an (M) application. (No Match.companion steps here, see note above.)

                            PROBLEM / QUESTION: do we also need leafs given by empty prMoves???

                            Instances For
                              def BuildTree.allPreStatePs {pos : GamePos} (bt : BuildTree pos) (m : Match bt) :

                              Collect all PreStatePs from a given m onwards.

                              Equations
                              Instances For
                                theorem BuildTree.allPreStatePs_spec {pos : GamePos} {bt : BuildTree pos} {m : Match bt} (π : PreStateP bt m) :
                                inductive PreState {pos : GamePos} (bt : BuildTree pos) :

                                A pre-state is a maximal pre-state-part, i.e. starting at the root or just after (M).

                                WORRY: should fromRoot also have a condition about pos being the start of the game?

                                Instances For

                                  Collect all PreStates for a given BuildTree.

                                  Equations
                                  Instances For
                                    theorem BuildTree.allPreStates_spec {pos : GamePos} {bt : BuildTree pos} (π : PreState bt) :
                                    def PreState.forms {a✝ : GamePos} {bt : BuildTree a✝} :

                                    Collect formulas in a pre-state. The non-loaded part of Λ(π) in paper.

                                    TODO: If the pre-state ends in a repeat, also include formulas in the path from companion to (M).

                                    QUESTION: Can we collect loaded formulas here by unloading them? Or would that make the loaded case of PreState.pdlFormCase unsayable?

                                    Equations
                                    Instances For
                                      def PreState.lforms {a✝ : GamePos} {bt : BuildTree a✝} :

                                      Collect formulas in a pre-state. The loaded part of Λ(π) in paper.

                                      Equations
                                      Instances For
                                        def PreState.last {a✝ : GamePos} {bt : BuildTree a✝} :
                                        Equations
                                        Instances For
                                          theorem PreState.formsCases {a✝ : GamePos} {bt : BuildTree a✝} {φ : Formula} {π : PreState bt} :
                                          φ π.formsφ.basic = true φ π.last sorry

                                          TODO Lemma 6.14

                                          theorem PreState.pdlFormCase {a✝ : GamePos} {bt : BuildTree a✝} {α : Program} {φ : Formula} {δ : List Program} {π : PreState bt} :
                                          ¬α.isAtomic(~αφ) π.formsH α, .1 [~⌈⌈δ⌉⌉φ] π.forms

                                          WIP Lemma 6.15 (unloaded case only)

                                          WIP Lemma 6.16: pre-states are saturated and locally consistent, their last node is basic.

                                          def BuildTree.toModel {Pos : GamePos} (bt : BuildTree Pos) :

                                          Definition 6.17 to get model graph from strategy tree.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            theorem PreState.diamondExistence {a✝ : GamePos} {bt : BuildTree a✝} {α : Program} {φ : AnyFormula} {π : PreState bt} :
                                            (~'αφ) π.lforms∃ (t : Match bt), AnyNegFormula.mem_Sequent t.btAt.fst.snd.fst (~''φ) ∃ (ρ : PreState bt) (u : Match bt), Modelgraphs.Q sorry α π.forms.toFinset, ρ.forms.toFinset,

                                            WIP Lemma 6.18

                                            QUESTION: which R can we use here in order to use Modelgraphs.Q?

                                            Model graph of pre-states #

                                            theorem strmg (X : Sequent) (s : Strategy tableauGame Builder) (h : winning s (startPos X)) :
                                            ∃ (WS : Finset (Finset Formula)) (mg : ModelGraph WS), ZWS, X.toFinset Z

                                            Theorem 6.21: If Builder has a winning strategy then there is a model graph.