Ship the reference Rocq extraction setup (rocq/, ExtrEncore.v) - #24
Merged
Merged
Conversation
Add the Encore.Extraction Rocq theory (opam package rocq-encore, Rocq 9.1, dune >= 3.21), based on encore-benchmarks' EncoreExtraction.v and EncoreInput.v: - ExtrEncore.v: nat -> VM integer; add/mul/sub/pred/min/max/eqb/leb/ ltb/even/odd/div/modulo/div2/land/lor/lxor/shiftl/shiftr mapped to primitives for both Init.Nat and PeanoNat.Nat (with the reason written down); bool/list/prod constructor names pinned to the pre-registered False/True/Nil/Cons/Pair. Without the pin, a nat literal above 5000 pulls in Decimal.uint and Rocq renames list's Nil to Nil1. - ExtrEncoreBytes.v: abstract bytes type over the byte-string primitives; bytes_of_string is the identity on string literals folded by the frontend (#7), so ascii/string stay at their default extraction. - ExtrEncoreInput.v: the Parameter + (extern (slot N) ...) idiom, with its trust assumption. examples/gcd now extracts through the library (no more opaque wrappers) and a new examples/digits covers div/mod, lists and byte strings. Both .scm files are promoted by dune and committed. CI: a rocq job runs dune build in rocq/rocq-prover:9.1 and fails if the committed extraction differs; an extracted job compiles and runs both examples with the encore CLI. A Rust test checks the pinned names against CtorRegistry and runs the extracted examples. SCHEME.md gains "Extracting from Rocq" and "Trust assumptions" sections; README and CLAUDE.md point to them. Fixes #19 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0175AB987hvh5vSeisGfEpq7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the Encore.Extraction Rocq theory (opam package rocq-encore, Rocq
9.1, dune >= 3.21), based on encore-benchmarks' EncoreExtraction.v and
EncoreInput.v:
ltb/even/odd/div/modulo/div2/land/lor/lxor/shiftl/shiftr mapped to
primitives for both Init.Nat and PeanoNat.Nat (with the reason
written down); bool/list/prod constructor names pinned to the
pre-registered False/True/Nil/Cons/Pair. Without the pin, a nat
literal above 5000 pulls in Decimal.uint and Rocq renames list's Nil
to Nil1.
primitives; bytes_of_string is the identity on string literals
folded by the frontend (Compile-time folding of Rocq-extracted (String (Ascii ...)) to native byte sequences #7), so ascii/string stay at their default
extraction.
its trust assumption.
examples/gcd now extracts through the library (no more opaque wrappers)
and a new examples/digits covers div/mod, lists and byte strings. Both
.scm files are promoted by dune and committed.
CI: a rocq job runs dune build in rocq/rocq-prover:9.1 and fails if the
committed extraction differs; an extracted job compiles and runs both
examples with the encore CLI. A Rust test checks the pinned names
against CtorRegistry and runs the extracted examples.
SCHEME.md gains "Extracting from Rocq" and "Trust assumptions"
sections; README and CLAUDE.md point to them.
Fixes #19
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_0175AB987hvh5vSeisGfEpq7