Skip to content

M1. Store and parser #2

Open
Open

Description

@tamnd

This milestone writes the data layer of the kernel: the term store, the Nat type and the NDJSON parser. Each part comes with its Lean twin and its refinement proof. It gives the release v0.2.0.

Spec: docs/spec/14-milestones.md, M1. See also 04, 07.1 and 10.5.

Acceptance

  • All Arena exports and the Mathlib export parse.
  • The parse of Mathlib uses at most 0.16 T instructions.
  • The memory of the store on Mathlib is measured and agrees with 04.9.
  • R2 is proved for the store and the parser.
  • A person other than the author reviewed Spec.parseStream.

Checklist

Activity

  1. added this to the M1 Store and parser milestone on Nov 21, 2026
  2. tamnd commented on Nov 21, 2026

    @tamnd
    OwnerAuthor

    PR #22 is merged. cargo xtask all now runs the deps, nonc and subset checks, so a local run gives the same result as the policy job in CI. This is a fix, so no checklist item changes.

  3. added a commit that references this issue on Nov 21, 2026
  4. tamnd commented on Nov 21, 2026

    @tamnd
    OwnerAuthor

    PR #23 is merged. rulean-nat now has the Nat type of spec 04.6: the 15 kernel operations, log2 and decimal conversion. Multiplication uses Karatsuba from 32 limbs, and division uses algorithm D of Knuth. The oracle tests compare each operation with num-bigint on random values, and one test makes sure that the add-back step of algorithm D runs. The extract job had not finished at merge time. If Aeneas does not accept a form in the crate, a follow-up PR will fix it.

  5. added a commit that references this issue on Nov 21, 2026
  6. tamnd commented on Nov 21, 2026

    @tamnd
    OwnerAuthor

    PR #24 is merged. It adds rulean-store: the handles, the per-kind arrays, the hash tables, and the name, level and expression tables. The store interns each node one time, so two equal terms have the same handle. The store is in the modelled subset, and cargo xtask subset accepts it. The Twin and R2 lemmas for the store are not done yet. They need the Aeneas output of the store, and they stay open on this issue.

  7. tamnd commented on Nov 21, 2026

    @tamnd
    OwnerAuthor

    PR #26 is merged. The extract job failed on rulean-nat because Aeneas binds its Fuel type to the Lean name Nat. Now scripts/extract.sh sets --cfg rulean_extract, and under this cfg the Rust type Nat gets the Lean name BigNat. A normal build does not change. The extract job passes on main for store, nat, format and core.

  8. tamnd commented on Nov 21, 2026

    @tamnd
    OwnerAuthor

    #25 is merged. rulean-format now parses the lean4export NDJSON 3.x format into the term store and returns the declaration stream of spec 04.7. All 225 Arena tests parse. The extract job passes on the crate. To make this possible, three functions changed: keys::code matches on the first byte of the key, ErrorKind::text is opaque to Aeneas, and the loop of skip_value keeps only two values in its state. The next M1 step is the --parse-only mode of the CLI and the parse measurement on Mathlib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    milestoneThe tracking issue of a milestone

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions