From winning strategies to model graphs (Section 6.3) #
Lessons learned while working on this file:
- Not all leafs in the BuildTree are backpointers. We want open leafs (where builder wins the game) to actually build worlds :-) Moreover, free repeats also let builder win.
BuildTree #
A free repeat is a non-loaded sequent that occured before.
Equations
- FreeRepeat Hist X = { k : Fin (List.length Hist) // (List.get Hist k).multisetEqTo X ∧ ¬X.isLoaded = true }
Instances For
Winning Strategy Tree for Builder. At each step, we consider
- ALL rules R that prover may choose, followed immediately by
- ONE of the children then chosen by Builder
The type is actually similar to Tableau, as it also uses a history, but it does allow open leaves.
For choosing a local tableau end node the mutual RuleChoice is needed to avoid the error
"nested inductive datatypes parameters cannot contain local variables".
Instead of the .lpr constructor here we have .fpr because we only make a RuleTree when Builder
wins and thus we can never reach an lpr where Prover would win, but do allow free repeats.
As in Tableau note that the history is stored in reverse.
- loc
{H : History}
{X : Sequent}
(nbas : ¬X.basic)
(next : (lt : LocalTableau X) → BuildChoice H X (endNodesOf lt))
: BuildTree H X
Prover chooses local tab, we pick one end node.
- pdl
{H : List Sequent}
{X : Sequent}
(bas : X.basic)
(next : (Y : Sequent) → PdlRule X Y → BuildTree (X :: H) Y)
: BuildTree H X
Prover chooses PDL rule, never branches, so continue with unique child.
- freeRepeat
{H : History}
{X : Sequent}
: FreeRepeat H X → BuildTree H X
Free repeat means builder wins.
- openLeaf
{H : History}
{X : Sequent}
: BuildTree H X
Leaf that is (might be?!) not a repeat, but no rules can be applied.
Instances For
Given a winning Builder strategy, compute its RuleTree.
NEW: note the Sum.inl p here. This ensure we start tree building from a Prover position, i.e.
- not allowing BuilderPos.lpr here (easy, was forbidden already anyway as prover wins there.)
- not allowing BuilderPos.ltab because we cannot use BuildTree.loc for a single fixed local tab.
Equations
- One or more equations did not get rendered due to their size.
- buildTree s h_2 = BuildTree.openLeaf
Instances For
Matches #
A match is a path inside a BuildTree. Analogous to PathIn for Tableau. In Game Theory
this could be called a "rollout", but note that it stays within the given Builder strategy tree
and it is not tracking all intermediate game positions.
- nil {H : History} {X : Sequent} {bt : BuildTree H X} : Match bt
- loc {H : History} {X : Sequent} {nbas : ¬X.basic} {next : (lt : LocalTableau X) → BuildChoice H X (endNodesOf lt)} {lt : LocalTableau X} : Match (next lt).6 → Match (BuildTree.loc nbas next)
- pdl {H : List Sequent} {X : Sequent} {bas : X.basic} {next : (Y : Sequent) → PdlRule X Y → BuildTree (X :: H) Y} {Y : Sequent} {r : PdlRule X Y} : Match (next Y r) → Match (BuildTree.pdl bas next)
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Match.all (BuildTree.loc nbas next) = do let ltX ← LocalTableau.all X let __do_lift ← Match.all (next ltX).6 pure __do_lift.loc
- Match.all (BuildTree.freeRepeat fr) = [Match.nil]
- Match.all BuildTree.openLeaf = [Match.nil]
Instances For
- H : History
- mY : Sequent
- next (lt : LocalTableau self.mY) : BuildChoice self.H self.mY (endNodesOf lt)
- lt : LocalTableau self.mY
Instances For
Instances For
This edge between matches is a modal step.
To even say this BuildTree must contain the rule data.
Equations
- Match.Edge.isModal (Sum.inl val) = False
- Match.Edge.isModal (Sum.inr { H := H_1, mX := mX, nY := nY, bas := bas, next := next, r := r, btAt_m_def := btAt_m_def, btAt_n_def := btAt_n_def }) = r.isModal
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Roll back to the companion. Only possibe if we started with H=[] so we know the root.
Equations
- m.companionOf h = match BuildTree.getFreeRepeat ⋯ with | ⟨⟨k, k_lt⟩, same_and_free⟩ => m.rewind ⟨k, ⋯⟩
Instances For
The repeat ♥ companion relation on Match.
Equations
- m.companion n = ∃ (h : m.isFreeRepeat), n = m.companionOf h
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 in PreState and PreStateP
we only store the π part of such pre-states, because the π' is then uniquely determined by π.
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.)
- edge {H : History} {X : Sequent} {bt : BuildTree H X} {m n : Match bt} (e : m.Edge n) : ¬e.isModal → PreStatePart bt n → PreStatePart bt m
- stopAtM {H : History} {X : Sequent} {bt : BuildTree H X} {m n : Match bt} (e : m.Edge n) : e.isModal → PreStatePart bt m
- stopAtOpenLeaf {H : History} {X : Sequent} {bt : BuildTree H X} {m : Match bt} : Match.isOpenLeaf → PreStatePart bt m
- stopAtFreeRepeat {H : History} {X : Sequent} {bt : BuildTree H X} {m : Match bt} : m.isFreeRepeat → PreStatePart bt m
Instances For
Collect all PreStatePs from a given m onwards.
Equations
- One or more equations did not get rendered due to their size.
Instances For
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 H being empty, i.e. the start of the game?
- fromRoot {H : History} {X : Sequent} {bt : BuildTree H X} : PreStatePart bt Match.nil → PreState bt
- fromMod {H : History} {X : Sequent} {bt : BuildTree H X} {o m : Match bt} (e : o.Edge m) : e.isModal → PreStatePart bt m → PreState bt
Instances For
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
- PreState.forms = sorry
Instances For
Collect formulas in a pre-state. The loaded part of Λ(π) in paper.
Equations
- PreState.lforms = sorry
Instances For
Equations
- PreState.last = sorry
Instances For
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
WIP Lemma 6.18
QUESTION: which R can we use here in order to use Modelgraphs.Q?
Model graph of pre-states #
Theorem 6.21: If Builder has a winning strategy then there is a model graph.
Uses BuildTree.toModel.