dwrensha / lean4-maze Goto Github PK
View Code? Open in Web Editor NEWmaze game encoded in Lean 4 syntax
License: Apache License 2.0
maze game encoded in Lean 4 syntax
License: Apache License 2.0
Hello! I was playing around a bit after today's talk and tried to bored-ly solve the long maze just to pass some time.
I'm not sure if there's anything to fix really, but just to note, if you do:
example : can_escape maze3 :=
by west
west
west
south
south
south
south
east
east
north
north
east
east
south
south
south
south
south
south
south
south
west
west
west
west
west
west
west
west
west
west
west
west
west
west
west
west
west
west
west
west
west
west
west
north
north
north
north
north
north
north
north
east
east
south
south
south
south
south
south
east
east
east
east
north
north
north
north
east
east
east
north
north
east
east
east
east
east
east
the last east
says cannot move east
, even though clearly you can from the picture.
The issue seems to be simp
failing -- if I apply step_east
and then simp
, the infoview says:
▶ 473:5-473:9: error:
tactic 'simp' failed, nested error:
(deterministic) timeout at 'simp', maximum number of heartbeats (200000) has been reached (use 'set_option maxHeartbeats <num>' to set the limit)
and indeed set_option maxHeartbeats 999999999
fixes the issue (lets me east
).
Not sure as I say that there's anything that needs tweaking, I take it changing the default globally is silly, but yeah just sharing :)
Thanks for the fun.
This works in nightly 2021-11-24:
def maze1 := ┌───┐
│▓▓▓│
│░@▓│
│▓▓▓│
└───┘
example : can_escape maze1 := by
apply step_west
simp
out
but in 2021-11-25, the simp
step errors out with:
application type mismatch
Eq.ndrec
(Eq.refl
(update_state_with_row_aux 0 (0 + 1) [CellContents.wall, CellContents.wall]
(game_state_from_cells_aux { x := 3, y := 3 } (0 + 1)
[[CellContents.empty, CellContents.player, CellContents.wall],
[CellContents.wall, CellContents.wall, CellContents.wall]])).position)
argument has type
(update_state_with_row_aux 0 (0 + 1) [CellContents.wall, CellContents.wall]
(game_state_from_cells_aux { x := 3, y := 3 } (0 + 1)
[[CellContents.empty, CellContents.player, CellContents.wall],
[CellContents.wall, CellContents.wall, CellContents.wall]])).position =
(update_state_with_row_aux 0 (0 + 1) [CellContents.wall, CellContents.wall]
(game_state_from_cells_aux { x := 3, y := 3 } (0 + 1)
[[CellContents.empty, CellContents.player, CellContents.wall],
[CellContents.wall, CellContents.wall, CellContents.wall]])).position
but function has type
(fun s =>
(update_state_with_row_aux 0 (0 + 1) [CellContents.wall, CellContents.wall]
(game_state_from_cells_aux { x := 3, y := 3 } (0 + 1)
[[CellContents.empty, CellContents.player, CellContents.wall],
[CellContents.wall, CellContents.wall, CellContents.wall]])).position.2 =
s.2)
(update_state_with_row_aux 0 (0 + 1) [CellContents.wall, CellContents.wall]
(game_state_from_cells_aux { x := 3, y := 3 } (0 + 1)
[[CellContents.empty, CellContents.player, CellContents.wall],
[CellContents.wall, CellContents.wall, CellContents.wall]])).position →
∀ {b : Coords},
(update_state_with_row_aux 0 (0 + 1) [CellContents.wall, CellContents.wall]
(game_state_from_cells_aux { x := 3, y := 3 } (0 + 1)
[[CellContents.empty, CellContents.player, CellContents.wall],
[CellContents.wall, CellContents.wall, CellContents.wall]])).position =
b →
(fun s =>
(update_state_with_row_aux 0 (0 + 1) [CellContents.wall, CellContents.wall]
(game_state_from_cells_aux { x := 3, y := 3 } (0 + 1)
[[CellContents.empty, CellContents.player, CellContents.wall],
[CellContents.wall, CellContents.wall, CellContents.wall]])).position.2 =
s.2)
One of these commits must be to blame:
leanprover/lean4@9a939f9
leanprover/lean4@f7decd2
leanprover/lean4@17f99e3
leanprover/lean4@292d321
leanprover/lean4@a8f4146
On a cursory glance, the last one seems most suspicious to me.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.