ProofFlood.flood_path.take: def of minebender-game@1.0.0.0 Import: import minebender-game@1.0.0.0/proof_flood.bend as ProofFlood Lines 582-602 of minebender-game@1.0.0.0/proof_flood.bend: https://jend.leeeet.dev/read.txt?path=minebender-game@1.0.0.0/proof_flood.bend&start_line=582&end_line=602 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/LAWS.bend as L import minebender-game@1.0.0.0/proof_base.bend as P import minebender-game@1.0.0.0/proof_grid.bend as PG import minebender-game@1.0.0.0/proof_lists.bend as PL def flood_path.take(+c: T.Pos, +back: List<&2, T.Pos>, +rest: List<&2, G.Work>, +w: Nat, +h: Nat, +layout: T.Grid(Bool), +shown: T.Grid(Bool), +p0: T.Pos, +q: T.Pos, +ok: {Bool.and(L.zero_walk(List.reverse(&2, T.Pos, back), w, h, layout, p0, c), works_ok(rest, w, h, layout, p0)) == True{} : Bool}, before: {B.at(Bool, False{}, shown, q) == False{} : Bool}, +b: Bool, be: {B.same(c, q) == b : Bool}, ih: {works_ok(G.push(B.zero(w, h, layout, c), B.neighbours(w, h, c), back, rest), w, h, layout, p0) == True{} : Bool} -> {B.at(Bool, False{}, B.set_at(Bool, shown, c, True{}), q) == False{} : Bool} -> Walk(w, h, layout, p0, q)) -> Walk(w, h, layout, p0, q): match b: case True{}: +hd = L.zero_walk(List.reverse(&2, T.Pos, back), w, h, layout, p0, c) +okc = P.and_true_l(hd, works_ok(rest, w, h, layout, p0), ok) (List.reverse(&2, T.Pos, back), %PG.same_sound(c, q, be) : {L.zero_walk(List.reverse(&2, T.Pos, back), w, h, layout, p0, _) == True{} : Bool}; okc) case False{}: +hd = L.zero_walk(List.reverse(&2, T.Pos, back), w, h, layout, p0, c) +okc = P.and_true_l(hd, works_ok(rest, w, h, layout, p0), ok) ih(works_ok_push(B.zero(w, h, layout, c), c, back, rest, w, h, layout, p0, {==}, okc, P.and_true_r(hd, works_ok(rest, w, h, layout, p0), ok)), %Equal.sym(Bool, B.at(Bool, False{}, B.set_at(Bool, shown, c, True{}), q), B.at(Bool, False{}, shown, q), PL.at_set_ne(Bool, shown, c, q, True{}, False{}, be)) : {_ == False{} : Bool}; before) Uses (24): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.reverse https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/LAWS.bend&name=zero_walk https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/board.bend&name=at https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/board.bend&name=neighbours https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/board.bend&name=same https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/board.bend&name=set_at https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/board.bend&name=zero https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/game.bend&name=Work https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/game.bend&name=push https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/proof_base.bend&name=and_true_l https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/proof_base.bend&name=and_true_r https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/proof_flood.bend&name=Walk https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/proof_flood.bend&name=works_ok https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/proof_flood.bend&name=works_ok_push https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/proof_grid.bend&name=same_sound https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/proof_lists.bend&name=at_set_ne https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/types.bend&name=Grid https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/types.bend&name=Pos