Download spec/invariants.md from Snapkitty/unlambda-idris-spark: direct link, hf CLI and curl.
- Browser
- Download file 1.64 kB
-
https://huggingface.co/Snapkitty/unlambda-idris-spark/resolve/main/spec/invariants.md
- Command line
-
hf download hf://Snapkitty/unlambda-idris-spark/spec/invariants.md
-
curl -L -o invariants.md https://huggingface.co/Snapkitty/unlambda-idris-spark/resolve/main/spec/invariants.md
Unlambda / Idris 2 / SPARK verification contract
Scope of this executable slice
This starter project verifies a bounded heap model and a small abstract-machine control model. It is not yet a complete Unlambda implementation. Before adding the remaining language primitives, freeze the chosen Unlambda dialect and its operational semantics.
Shared invariants
- H1: heap capacity is fixed and every valid index is in
0 .. Capacity - 1. - H2:
Used <= Capacity. - H3: allocation succeeds only when capacity remains; failure does not change
Used. - H4: a successful allocation increases
Usedby exactly one. - M1: machine fuel never increases during a transition.
- M2: an exhausted machine reports
OutOfFuel, neverHalted. - M3: the Idris model's state constructors make the terminal status explicit.
Proof boundary
Idris 2 checks the model and its proof terms. SPARK/GNATprove checks Ada contracts and runtime-safety/functional verification conditions. Neither tool proves the other language's implementation. Agreement is established through the shared invariants, tests, and (later) a translation/correspondence proof.
Escape-hatch policy
Reject believe_me, assert_total, assert_smaller, sorry, admit, pragma Assume, and unchecked imported proof claims in proof-bearing files unless a specific reviewed exception is documented. The scanner is a guardrail, not a sound proof of absence of unsoundness.