Repository navigation
Strata v0.4.0
Install: curl -fsSL https://strata-lang.dev/install.sh | sh (macOS arm64).
Written proofs
lemma,assert … by,calc(#540): a lemma is a function that exists only for verification;verifyproves it once, in its own small query, and a call gives itsensuresas one fact. A recursive lemma is a proof by induction.assert e by lemma(…)/assert e by { steps }provesefrom the steps alone, then adds it as one fact;calcchains prove one step per query.std.lemmasstarts with six proven frame lemmas over dicts.- Proofs hidden by default (#540):
strata viewand the editors hide loop invariants,decreases,assert … by,calcand lemmas behind a marker (// ⋯ 2 invariants);--proofsshows them.strata editfrom the default view puts hidden proofs back in their place (and says when a place is gone);strata diffreports proof changes apart from code changes. - Spec functions (#551): functions used only in contracts and proofs are one symbol in a function's own query (equal arguments give equal results) and are seen through inside lemma and
assert … byproofs, so queries stay small. - examples/tasks (#551):
enqueueis proven (157 checks) with a loop invariant, a frame and 25 proven lemmas, and all three laws are proven,no_double_claimincluded.claim,record,release,expireandrun_workerare still partly fuzzed: their remaining checks need written proofs likeenqueue's. The whole package verifies in about 50 s cold.
Verification speed and soundness
contracts.*verifies in 9 s instead of over 300 s (#538): a function's own call inside a lambda goes by its contract instead of being unfolded at every element.- #551 prover fixes: congruence for contract-only calls,
set(xs.map(f))exact, the same map/push/list literal is one value, batch answers the solver gave up on asked again alone, proof queries hold only their path's conditions.
Memory and speed of compiled programs
- Static uniqueness (#521):
compiler/uniqueproves which in-place updates find their value held once, and the compiled code leaves those run-time tests out (234 of 347 such sites in the compiler proven; -15% instructions on update-heavy code). - Small values in registers (#522): a function returning a tuple, record or sum of up to 4 words returns it in registers, and callers keep it on the stack — no heap object. 30M calls returning a tuple: 30M allocations → 1, 10.7G → 6.5G instructions.
strata checkof the compiler: 10.5% fewer heap objects, 5% fewer cycles. - Memory fixes found by per-site counters (#523): strings grow in place in small blocks, constant list literals are one shared block,
forover a non-mutlist borrows it,xs = xs[..n]drops the tail in place, temporary iterators move into the loop, accumulated sets passed asmut.strata checkof the compiler: -8% instructions. - Smaller executables (#537, #539): executables are linked with
-dead_strip: hello world 1.64 MB → 55 KB; the compiler, which hosts the JIT, keeps its runtime symbols. - A stage-2 miscompilation from small values (a stack-kept call result's fields freed twice) is fixed (#542).
- Scoped allocation from roots: design and measurement (#545):
compiler/rootsassigns each allocation a home scope; measured on the compiler, regions would hold 49.5% of objects and remove 42.5% of releases (no generated-code change yet).
Tools
strata diffin seconds (#544): versions compared by hash, only what changed written out: one commit of the compiler 39 s / 1.6 GB → 3.2 s / 300 MB.strata tour(#546): a pull request's tour (Markdown with structural diffs embedded) read in the terminal. Tours show each page's structural diffs (#550).strata viewin reading order (#547): imports, then types, then functions, each caller above what it uses; only the rendering changes.- Site: About page and tour slides on contracts over behaviour (#548).
- A test case viewing the wrong copy of core fixed (#541).
Known
- examples/tasks:
claim,record,release,expireandrun_workerare not fully proven yet (a full proof ofclaimexists but its queries exceed the memory limit; smaller per-element facts are the next step). strata diff --graphover examples/tasks against an older version exceeds 300 s.