def open_safe.k

minebender-game@1.0.0.0 · proof_laws.bend:906

import minebender-game@1.0.0.0/proof_laws.bend as ProofLaws
import Base
import minebender-game@1.0.0.0/types.bend as T
import minebender-game@1.0.0.0/board.bend as B
import minebender-game@1.0.0.0/game.bend as G
import minebender-game@1.0.0.0/LAWS.bend as L
import minebender-game@1.0.0.0/proof_copy.bend as PC

906def open_safe.k(+w: Nat, +h: Nat, +layout: T.Grid(Bool), +g: G.Game,
907  +playing: {G.status(g) == T.Playing{} : T.Status}, +p: T.Pos, safe: {L.mine(layout, p) == False{} : Bool},
908  c: Canon(w, h, layout, g)) ->
909  {L.is_lost(G.status(G.open(g, p))) == False{} : Bool}:
910  match c:
911    case (eg, facts):
912      +s = shown_of(g)
913      +f = flags_of(g)
914      %Equal.sym(G.Game, g, G.Game{w, h, layout, s, f, G.status(g)}, eg) :
915        {L.is_lost(G.status(G.open(_, p))) == False{} : Bool}
916      %Equal.sym(T.Status, G.status(g), T.Playing{}, playing) :
917        {L.is_lost(G.status(G.open(G.Game{w, h, layout, s, f, _}, p))) == False{} : Bool}
918      open_safe_c(w, h, layout, s, f, p,
919        %Equal.sym(Bool, B.mine(layout, p), L.mine(layout, p), PC.mine_eq(layout, p)) :
920          {_ == False{} : Bool}; safe)

Uses (18)

Used by (1)