Documentation

Pdl.BuildTree

From winning strategies to model graphs (Section 6.3) #

Lessons learned while working on this file:

BuildTree #

inductive BuildTree :

Winning Strategy Tree for Builder. At a BuStep it is the turn of Builder and we have a single child for the Move they make. At a PrStep it is the turn of Prover, and we have children for all possible Move.

In the paper "a leaf is either labeled with a sequent to which no rule is applicable, or it is a (free) repeat". Here we make leafs with PrStep because at such a position it is the turn of Prover but there are no moves so Prover loses.

GOAL: The BuildTree type should carry all information we need, so later we should not care about how a specific strategy tree for builder gets made/computer, but just that there is one.

Instances For
    def BuildTree.isLeaf {pos : GamePos} :
    BuildTree posProp
    Equations
    Instances For
      Equations
      Instances For
        @[irreducible]

        Given a winning Builder strategy, compute its BuildTree.

        Equations
        Instances For

          Matches #

          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.BuEdge {x✝ : GamePos} {bt : BuildTree x✝} (m n : Match bt) :
                Instances For
                  structure Match.PrEdge {x✝ : GamePos} {bt : BuildTree x✝} (m n : Match bt) :
                  Instances For
                    def Match.Edge {a✝ : GamePos} {bt : BuildTree a✝} (m n : Match bt) :

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

                    Equations
                    Instances For
                      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 BuildTree must contain Move and thus rule data.

                      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
                          theorem Match.isLeaf_no_edge {pos : GamePos} {bt : BuildTree pos} (m : Match bt) (h : isLeaf) (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. TODO: to correctly do this, replace Nat with a Fin like we do in PathIn.rewind. For that we need Match.length and maybe Match.toHistory first.

                          Equations
                          Instances For
                            def Match.companionOf {pos : GamePos} {bt : BuildTree pos} (m : Match bt) (h : m.btAt.snd.isFreeRepLeaf) :
                            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 π.

                                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.