def cell_none

minebender-game@1.0.0.0 · proof_speed.bend:149

import minebender-game@1.0.0.0/proof_speed.bend as ProofSpeed
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/solver.bend as S
import minebender-game@1.0.0.0/proof_base.bend as P
import minebender-game@1.0.0.0/proof_lists.bend as PL

149# The row of an unassigned cell, and the cell in it.
150def cell_none(+w: Nat, +h: Nat, +part: T.Grid(Maybe<&2, Bool>), +x: Nat, +y: Nat,
151  +sh: {B.shaped(Maybe<&2, Bool>, w, h, part) == True{} : Bool}, +on: {B.on_board(w, h, T.Pos{x, y}) == True{} : Bool},
152  fr: {S.look(part, T.Pos{x, y}) == None{} : Maybe<&2, Bool>}) ->
153  {List.get(&2, Maybe<&2, Bool>, PL.row_of(Maybe<&2, Bool>, part, y), x) == Some{None{}} : Maybe<&2, Maybe<&2, Bool>>}:
154  +xw = P.and_true_l(Nat.is_lt(x, w), Nat.is_lt(y, h), on)
155  +yh = P.and_true_r(Nat.is_lt(x, w), Nat.is_lt(y, h), on)
156  +row = PL.row_of(Maybe<&2, Bool>, part, y)
157  +xl = {%Equal.sym(Nat, List.length(&2, Maybe<&2, Bool>, row), w, PL.row_in_len(Maybe<&2, Bool>, w, h, part, y, sh, yh)) :
158    {Nat.is_lt(x, _) == True{} : Bool};
159    xw : {Nat.is_lt(x, List.length(&2, Maybe<&2, Bool>, row)) == True{} : Bool}}
160  %fr : {List.get(&2, Maybe<&2, Bool>, row, x) == Some{_} : Maybe<&2, Maybe<&2, Bool>>}
161  PL.get_in(Maybe<&2, Bool>, row, x, None{}, xl)

Uses (17)

Used by (3)