def mine_on.row

minebender-game@1.0.0.0 · proof_laws.bend:586

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

586def mine_on.row(+w: Nat, +h: Nat, +layout: T.Grid(Bool), +x: Nat, +y: Nat,
587  +sh: {B.shaped(Bool, w, h, layout) == True{} : Bool},
588  m: {B.mine(layout, T.Pos{x, y}) == True{} : Bool}, +b: Bool, +be: {Nat.is_lt(y, h) == b : Bool}) ->
589  {B.on_board(w, h, T.Pos{x, y}) == True{} : Bool}:
590  match b:
591    case True{}:
592      mine_on.col(w, h, layout, x, y, sh, be,
593        %Equal.sym(Maybe<&2, List<&2, Bool>>, List.get(&2, List<&2, Bool>, layout, y), Some{PL.row_of(Bool, layout, y)},
594          PL.row_in_get(Bool, w, h, layout, y, sh, be)) :
595          {Maybe.default(&2, Bool, List.get(&2, Bool, Maybe.default(&2, List<&2, Bool>, _, Nil{}), x), False{}) == True{} : Bool};
596        m, Nat.is_lt(x, w), {==})
597    case False{}:
598      Empty.absurd({B.on_board(w, h, T.Pos{x, y}) == True{} : Bool},
599        P.false_ne_true(%P.get_out(List<&2, Bool>, layout, y,
600          %Equal.sym(Nat, List.length(&2, List<&2, Bool>, layout), h, PL.shaped_len(Bool, w, h, layout, sh)) :
601            {Nat.is_lt(y, _) == False{} : Bool}; be) :
602          {Maybe.default(&2, Bool, List.get(&2, Bool, Maybe.default(&2, List<&2, Bool>, _, Nil{}), x), False{})
603            == True{} : Bool}; m))

Uses (21)

Used by (1)