Skip to content

Add Lean 4 model spec + TUI for dog FSM#1

Open
steele232 wants to merge 2 commits intomainfrom
claude/lean-tui-model-UwBzM
Open

Add Lean 4 model spec + TUI for dog FSM#1
steele232 wants to merge 2 commits intomainfrom
claude/lean-tui-model-UwBzM

Conversation

@steele232
Copy link
Copy Markdown
Owner

  • DogFsm/Model.lean: pure FSM types, transition function, and proved
    lemmas (allowed_always_succeeds, disallowed_always_fails, deterministic)
  • DogFsm/Properties.lean: 9 Plausible PBT properties covering allowed/
    disallowed actions, determinism, successor validity, cycle length, etc.
  • DogFsm/Tui.lean: interactive ANSI TUI loop driven by the model spec;
    allowedEvents is derived from transition so they can never disagree
  • Main.lean + lakefile.lean: lake build / exe entry points

https://claude.ai/code/session_01QEjq9cD1BmnwUrp6Fuq94W

claude added 2 commits April 7, 2026 02:27
- DogFsm/Model.lean: pure FSM types, transition function, and proved
  lemmas (allowed_always_succeeds, disallowed_always_fails, deterministic)
- DogFsm/Properties.lean: 9 Plausible PBT properties covering allowed/
  disallowed actions, determinism, successor validity, cycle length, etc.
- DogFsm/Tui.lean: interactive ANSI TUI loop driven by the model spec;
  allowedEvents is derived from transition so they can never disagree
- Main.lean + lakefile.lean: lake build / exe entry points

https://claude.ai/code/session_01QEjq9cD1BmnwUrp6Fuq94W
- dog_fsm_model.e: stateless transition model using Design by Contract;
  require/ensure clauses enforce allowed/disallowed actions at runtime,
  making the contracts the model spec (no separate PBT framework needed)
- dog_fsm_tui.e: ANSI TUI loop driven entirely by the model; allowed/
  blocked events always queried from model, never hard-coded in the TUI
- compile.sh: builds with `se c`; -debug flag enables full contract
  checking at runtime (the mode to use when validating against Erlang impl)

https://claude.ai/code/session_01QEjq9cD1BmnwUrp6Fuq94W
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants