def mine_on.col

minebender-game@1.0.0.0 · proof_laws.bend:570

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

570def mine_on.col(+w: Nat, +h: Nat, +layout: T.Grid(Bool), +x: Nat, +y: Nat,
571  +sh: {B.shaped(Bool, w, h, layout) == True{} : Bool}, yh: {Nat.is_lt(y, h) == True{} : Bool},
572  m: {Maybe.default(&2, Bool, List.get(&2, Bool, PL.row_of(Bool, layout, y), x), False{}) == True{} : Bool},
573  +b: Bool, be: {Nat.is_lt(x, w) == b : Bool}) -> {B.on_board(w, h, T.Pos{x, y}) == True{} : Bool}:
574  match b:
575    case True{}:
576      %Equal.sym(Bool, Nat.is_lt(x, w), True{}, be) : {Bool.and(_, Nat.is_lt(y, h)) == True{} : Bool}
577      yh
578    case False{}:
579      +row = PL.row_of(Bool, layout, y)
580      Empty.absurd({B.on_board(w, h, T.Pos{x, y}) == True{} : Bool},
581        P.false_ne_true(%P.get_out(Bool, row, x,
582          %Equal.sym(Nat, List.length(&2, Bool, row), w, PL.row_in_len(Bool, w, h, layout, y, sh, yh)) :
583            {Nat.is_lt(x, _) == False{} : Bool}; be) :
584          {Maybe.default(&2, Bool, _, False{}) == True{} : Bool}; m))

Uses (17)

Used by (1)