LAWS.consistent: def of minebender-game@1.0.0.0 Import: import minebender-game@1.0.0.0/LAWS.bend as LAWS Lines 166-174 of minebender-game@1.0.0.0/LAWS.bend: https://jend.leeeet.dev/read.txt?path=minebender-game@1.0.0.0/LAWS.bend&start_line=166&end_line=174 import Base import minebender-game@1.0.0.0/types.bend as T # The layout could be the real one, given everything the player sees: it has # the board's shape, exactly the announced number of mines, a mine under # every Boom, none under a number, and every number counts its neighbours. def consistent(v: T.Knowledge, +layout: T.Grid(Bool)) -> Bool: match v: case T.Knowledge{+w, +h, n, +rows}: shaped(Bool, w, h, layout) && shaped(T.Seen, w, h, rows) && Nat.is_eq(total_mines(layout), n) && agrees_all(w, h, rows, layout, cells(w, h)) Uses (10): 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=Nat.is_eq https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/LAWS.bend&name=agrees_all https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/LAWS.bend&name=cells https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/LAWS.bend&name=shaped https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/LAWS.bend&name=total_mines 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=Knowledge https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/types.bend&name=Seen