def closed_explode.cell

minebender-game@1.0.0.0 · proof_inv.bend:218

import minebender-game@1.0.0.0/proof_inv.bend as ProofInv
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/proof_base.bend as P
import minebender-game@1.0.0.0/proof_cells.bend as PS

218def closed_explode.cell(+w: Nat, +h: Nat, +layout: T.Grid(Bool), +shown: T.Grid(Bool), +p: T.Pos,
219  +mp: {B.mine(layout, p) == True{} : Bool}, +cl: {closed(w, h, layout, shown) == True{} : Bool},
220  +q: T.Pos, +on: {B.on_board(w, h, q) == True{} : Bool}, +b: Bool,
221  +be: {Bool.and(B.at(Bool, False{}, B.set_at(Bool, shown, p, True{}), q), B.zero(w, h, layout, q)) == b : Bool}) ->
222  {cl_f(CL{w, h, layout, B.set_at(Bool, shown, p, True{})}, q) == True{} : Bool}:
223  match b:
224    case False{}:
225      +s2 = B.set_at(Bool, shown, p, True{})
226      %Equal.sym(Bool, Bool.and(B.at(Bool, False{}, s2, q), B.zero(w, h, layout, q)), False{}, be) :
227        {Bool.or(Bool.not(_), PS.allp(~T.Grid(Bool), ~shown_in, s2, B.neighbours(w, h, q))) == True{} : Bool}
228      {==}
229    case True{}:
230      +s2 = B.set_at(Bool, shown, p, True{})
231      %Equal.sym(Bool, Bool.and(B.at(Bool, False{}, s2, q), B.zero(w, h, layout, q)), True{}, be) :
232        {Bool.or(Bool.not(_), PS.allp(~T.Grid(Bool), ~shown_in, s2, B.neighbours(w, h, q))) == True{} : Bool}
233      closed_explode.nbrs(w, h, layout, shown, p, mp, cl, q, on,
234        P.and_true_l(B.at(Bool, False{}, s2, q), B.zero(w, h, layout, q), be),
235        P.and_true_r(B.at(Bool, False{}, s2, q), B.zero(w, h, layout, q), be),
236        B.neighbours(w, h, q), PS.neighbours_all(w, h, q))

Uses (23)

Used by (1)