def closed_flood.cells

minebender-game@1.0.0.0 · proof_inv.bend:132

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/game.bend as G
import minebender-game@1.0.0.0/proof_cells.bend as PS

132def closed_flood.cells(+n: Nat, +work: List<&2, G.Work>, +hd: Bool, +w: Nat, +h: Nat, +layout: T.Grid(Bool),
133  +shown: T.Grid(Bool), +sh: {B.shaped(Bool, w, h, shown) == True{} : Bool},
134  +cl: {closed(w, h, layout, shown) == True{} : Bool}, +cnt: {n == B.count_false(shown) : Nat},
135  +he: {G.head_hidden(w, h, shown, work) == hd : Bool}, ps: List<&2, T.Pos>,
136  +ons: {PS.allp(~PS.WH, ~PS.onb, PS.WH{w, h}, ps) == True{} : Bool}) ->
137  {PS.allp(~CL, ~cl_f, CL{w, h, layout, G.flood(n, work, hd, w, h, layout, shown)}, ps) == True{} : Bool}:
138  match ps:
139    case Nil{}:
140      {==}
141    case +q <> +t:
142      +F = G.flood(n, work, hd, w, h, layout, shown)
143      %Equal.sym(Bool, cl_f(CL{w, h, layout, F}, q), True{},
144        closed_flood.cell(n, work, hd, w, h, layout, shown, sh, cl, cnt, he, q,
145          PS.allp_head(~PS.WH, ~PS.onb, PS.WH{w, h}, q, t, ons),
146          Bool.and(B.at(Bool, False{}, F, q), B.zero(w, h, layout, q)), {==})) :
147        {Bool.and(_, PS.allp(~CL, ~cl_f, CL{w, h, layout, F}, t)) == True{} : Bool}
148      closed_flood.cells(n, work, hd, w, h, layout, shown, sh, cl, cnt, he, t,
149        PS.allp_tail(~PS.WH, ~PS.onb, PS.WH{w, h}, q, t, ons))

Uses (23)

Used by (1)