Repository navigation
Releases
Releases · tamnd/rulean
v0.0.3
Added
rulean-nathas theNattype of spec 04.6 with the 15 kernel operations,log2and decimal conversion. Multiplication uses Karatsuba from 32 limbs, and division uses algorithm D of Knuth. The tests compare each operation withnum-bigint.rulean-storehas the term store of spec 04:u32handles with the kind in the handle, one node array for each kind, side records with the hash, the loose bound variable range and the flags, and hash-consing with an open-addressing table. It also interns strings, names, levels, level lists and natural number literals.rulean-formathas the lean4export NDJSON 3.x parser of spec 07.1. It is a hand-written scanner that writes into the term store and returns the declaration stream of spec 04.7. It checks the input rules of 07.1.2: index tables with a defined bit, no duplicate keys or indices, strict integers, UTF-8 and surrogate pairs,natValform and bound, andmdatastripping. All 225 Arena tests parse.rulean-corehas the universe level functions of spec 05.6, as a transcription oflevel.cppof the official kernel v4.35.0:mk_maxandmk_imaxwith their simplifications,normalizewith a cache for each level handle,is_equivalent,is_geq,normalizes_to_zero,instantiateand the name order of the kernel.rulean-corehas the expression operations of engine R, as a transcription ofinstantiate.cpp,abstract.cpp,expr.cppandexpr_eq_fn.cppof the official kernel v4.35.0:instantiate,instantiate_rev,abstract_fvars,lift_loose_bvars,lower_loose_bvars,has_loose_bvar,instantiate_lparams, the application spine functions,head_beta,cheap_beta_reduceandexpr_equal. Each operation has a cache keyed by the node and the binder offset.scripts/arena-fetch.shdownloads the Arena tests and results and keeps only the tests whose export has the hash of the results.- The
benchworkflow runs the official kernel of Lean v4.35.0 on the Arena tests each week and compares its instruction counts with the Arena numbers. docs/bench/baseline.mdrecords the first baseline run. The verdicts match the Arena on all 225 tests. The cachegrind counts are not within 2% of the Arena counts, so the 2% limit applies only toperf.rulean-corehas the environment and the type checker of engine R, as a transcription oftype_checker.cpp,inductive_reduce_recandquot_reduce_recof the official kernel v4.35.0. The checker infers types in the infer-only mode and in the check mode, reduces terms to weak head normal form in the official order (beta, zeta, projections, recursors, quotients, theNatextension and delta), and decides definitional equality with lazy delta reduction, eta, structure eta, proof irrelevance, unit-like types and theNatandStringliteral extensions. An error is a sticky fault, and a depth bound stops deep recursion. TheNatoperations check the size bound of 128 MiB.rulean-corehas the declaration checks of spec 05.9 and 06.5, as a transcription ofenvironment.cppandquot.cppof the official kernel v4.35.0: axioms, definitions, theorems, opaque constants, mutual blocks of unsafe or partial definitions and the quotient constants. An unsafe definition may refer to itself, and a safe declaration may not refer to an unsafe or partial constant. The first quotient declaration adds the four reference constants. Each exported quotient declaration must be equal to its reference constant. A rejected declaration does not change the environment.rulean check --parse-onlyparses an export into the term store and prints the counts, the store memory and the time. Without--parse-only,checkstill declines until M2. A parse reject exits with code 4, and a decline exits with code 2.scripts/arena-parse.shrunsrulean check --parse-onlyon every Arena test, and the newarena parseCI job runs it on the downloaded Arena.rulean-corehas the inductive checks of spec 06.2, as a transcription ofadd_inductiveininductive.cppof the official kernel v4.35.0: the type and constructor checks, the uniform parameter occurrences, strict positivity, the universe bound of the fields, the elimination level, the K flag and the recursor rules. The checker makes the recursors and compares the types, constructors and recursors of the export with its own declarations.rulean-corehas the nested inductive types of spec 06.3, as a transcription ofelim_nested_inductive_fnandrestore_nestedininductive.cppof the official kernel v4.35.0. The checker replaces each nested occurrence with an auxiliary type, checks the larger mutual block, and then restores the nested occurrences in the types, constructors and recursors. The export must have the auxiliary recursors with the namesI.rec_1,I.rec_2and so on. All 225 Arena tests give the expected verdict, and the full Init prelude is accepted.rulean-corehas the primitive pinning of spec 05.8. When the export declares aNatoperation,Nat,String,String.ofList,Char,Char.ofNat,ListoreagerReduce, the checker compares the SHA-256 digest of the declaration with the digest of the reference declaration of thev4.35profile. If the digests are not equal, the extension of that name is off, and the constant unfolds like any other definition. This is deviation D1.Checker::trust_primitiveskeeps the extensions on, as the official kernel does. TheChecker::pin_mismatchlist gives the names that are not equal to their reference.scripts/pin-digests.pycomputes the reference digests from lean4export files. Thearena parseCI job checks that the digests inpin_ref_v4_35.inare the digests of the Lean v4.36.0 exports of the Arena, and that engine R accepts the full Init prelude with no pin mismatch.docs/deviations.jsonis the deviation register of spec 05.12.
Changed
- The store hash of a
lam,piorletnode does not mix the binder name or the binder info. This is the method of Lean. Alpha-equivalent terms now have equal hashes, soexpr_equalcan use the hash to reject unequal terms.
Fixed
- The
extractjob failed onrulean-nat, because Aeneas binds itsFueltype to the Lean nameNat. The type now has the Lean nameBigNatin the extracted code. The Rust name does not change. cargo xtask allruns the subset check too. Before this change, thepolicyCI job did not check the Aeneas subset.
v0.0.2
Added
flake.nixpins Aeneas, Charon and the Rust nightly of Charon with one Aeneas commit.scripts/extract.shtranslates the four crates of the verified core to Lean with Charon and Aeneas, and theextractCI job runs it on each PR.- The Lean proof package in
proof/, with con-leche pinned by commit. TheproofCI job builds it, checks it with the official kernel and audits its axioms. scripts/proof-rules.shchecks the source rules of spec 10.9 on the Lean files.- A draft of
proof/RuleanProof/Statements.leanwith the theorems T1 to T6 of spec 10.1, stated over an interface of the objects that later milestones add. scripts/leanchecker.shchecks the proof package and all of its imports with the official kernel.rulean-bench runruns a checker on each test of a corpus and records the instructions, the wall time, the CPU time and the peak memory in the format of the Arena. It counts instructions withperf, valgrind cachegrind or the macOStime -l.rulean-bench comparecompares the instruction counts of two runs, or of a run and the Arenaresults.json.
Changed
- The
extractCI job keeps the Nix store in the Actions cache, so it does not build the Aeneas tools again on each run.
v0.0.1
Added
- The
ruleancommand line withhelpandversion. The other commands of the spec exit with code 2 and name the milestone that adds them. - The exit codes of spec section 09.3.
- CI on Linux (x86-64 and ARM), macOS and Windows, CodeQL, OpenSSF Scorecard, zizmor and Dependabot.
- A release workflow that builds the binaries, writes SHA-256 checksums and signs build provenance attestations.
- The specification in
docs/spec/. - The crates of spec section 03.3 as empty libraries. The four crates of the verified core are
no_std. cargo xtask deps, which checks the dependency rule of spec section 03.3, and thepolicyCI job that runs it.cargo xtask nonc, which checks the no-C policy of spec section 13.3: no banned crate and nolinkskey in the dependency graph, and no C, C++, assembly or prebuilt native file in the tree or in the vendored source of any dependency.deny.tomland acargo-denyCI job for advisories, licences, sources and banned crates.cargo xtask subsetchecks that the core crates stay in the Aeneas subset of spec 10.6.cargo xtask allruns it.- The core crates declare
#![forbid(unsafe_code)].