From winning strategies to model graphs (Section 6.3) #
Lessons learned while working on this file:
- Are actually all leafs in the BuildTree backpointers? No, we also want all other leafs where builder wins the game to actually build some model :-)
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.
- BuStep {pos : Game.Pos} {newPos : GamePos} (hturn : Game.turn pos = Builder) (m : Move pos newPos) (next : BuildTree newPos) : BuildTree pos
- PrStep {pos : Game.Pos} (hturn : Game.turn pos = Prover) (next : (newPos : GamePos) → Move pos newPos → BuildTree newPos) : BuildTree pos
Instances For
Equations
- (BuildTree.BuStep hturn m next).isFreeRepLeaf = (false = true)
- (BuildTree.PrStep hturn_4 next_4).isFreeRepLeaf = True
- (BuildTree.PrStep hturn_4 next_4).isFreeRepLeaf = False
- (BuildTree.PrStep hturn_4 next_4).isFreeRepLeaf = False
- (BuildTree.PrStep hturn_3 next_3).isFreeRepLeaf = ⋯.elim
Instances For
Given a winning Builder strategy, compute its BuildTree.
Equations
- One or more equations did not get rendered due to their size.
- buildTree s h_2 = BuildTree.PrStep ⋯ fun (newPos : GamePos) (mov : Move ⟨H, ⟨X, Sum.inl (ProverPos.bas nrep bas)⟩⟩ newPos) => buildTree s ⋯
- buildTree s h_2 = BuildTree.PrStep ⋯ fun (newPos : GamePos) (mov : Move ⟨H, ⟨X, Sum.inl (ProverPos.nbas nrep nbas)⟩⟩ newPos) => buildTree s ⋯
- buildTree s h_2 = ⋯.elim
Instances For
Matches #
Path inside a BuildTree. Analogous to PathIn for Tableau.
- nil {pos : GamePos} {bt : BuildTree pos} : Match bt
- bu {pos : Game.Pos} {x✝ : GamePos} {next : BuildTree x✝} {hturn : Game.turn pos = Builder} {m : Move pos x✝} : Match next → Match (BuildTree.BuStep hturn m next)
- pr {pos : GamePos} {next : (newPos : GamePos) → Move pos newPos → BuildTree newPos} {hturn : Game.turn pos = Prover} (newPos : GamePos) (mov : Move pos newPos) : Match (next newPos mov) → Match (BuildTree.PrStep hturn next)
Instances For
Inspired by PathIn.length.
Note that this counts all steps, even the prLocTab ones where pos.1 does not get longer.
Equations
Instances For
- mPos : GamePos
Instances For
Rewind a Match, i.e. go back up inside bt by k steps.
This used to use Nat but now we take a Fin like in PathIn.rewind, and
for that we needed to define Match.length first.
IDEA: also use Match.toHistory here?
Equations
Instances For
Given a rep H X, determine the index of the companion in H using List.findIdx?.
Note that we do not care about loading here.
Equations
Instances For
This is NOT TRUE, because history only records different steps and will
not count Move.prLocTab steps, though these are steps in the Match.
WAIT, but Match.toHistory DOES count all steps, so the length statement here should be true. ??
?? are we sure about this one ??
Note that the history from pos needs to be added on the right side.
?? Or better restrict pos to be a starting position of the game!?!?
(Analogous to how many things in TableauPath are only the Hist = [] case.)
Equations
- m.companionOf h = sorry
Instances For
The repeat ♥ companion relation on Match.
Equations
- m.companion n = ∃ (h : m.btAt.snd.isFreeRepLeaf), 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 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.)
PROBLEM / QUESTION: do we also need leafs given by empty prMoves???
- edge {pos : GamePos} {bt : BuildTree pos} {m n : Match bt} (e : m.Edge n) : ¬e.isModal → PreStateP bt n → PreStateP bt m
- stopLeaf {pos : GamePos} {bt : BuildTree pos} {m : Match bt} : Match.isLeaf → PreStateP bt m
- stopAtM {pos : GamePos} {bt : BuildTree pos} {m n : Match bt} (e : m.Edge n) : e.isModal → PreStateP bt m
Instances For
Collect all PreStatePs from a given m onwards.
Equations
- (BuildTree.PrStep hturn next).allPreStatePs m = sorry
- (BuildTree.BuStep hturn mov next).allPreStatePs x_2 = sorry
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 pos being the start of the game?
- fromRoot {pos : GamePos} {bt : BuildTree pos} : PreStateP bt Match.nil → PreState bt
- fromMod {pos : GamePos} {bt : BuildTree pos} {o m : Match bt} (e : o.Edge m) : e.isModal → PreStateP 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?