Add Aiur formal verification framework with #aiur_gen command#349
Open
arthurpaulino wants to merge 1 commit intomainfrom
Open
Add Aiur formal verification framework with #aiur_gen command#349arthurpaulino wants to merge 1 commit intomainfrom
arthurpaulino wants to merge 1 commit intomainfrom
Conversation
f87bdb5 to
90db3ff
Compare
| @[default_target] | ||
| lean_lib Ix where | ||
| moreLinkObjs := #[ix_rs] | ||
| precompileModules := true |
Member
There was a problem hiding this comment.
This has the side effect that downstream modules and users can use #eval for @[extern] FFI functions, which is nice for debugging!
Member
Author
There was a problem hiding this comment.
Yeah it was necessary to run G.ofNat at elaboration time (it does FFI).
90db3ff to
66e8c1d
Compare
Add G field arithmetic (Add, Sub, Mul, eqZero), u8/u32 semantic functions with range predicates, and commutativity theorems to Goldilocks.lean. Enable precompileModules on Ix library for native evaluation under Lean's `module` system. Add `#aiur_gen` command that evaluates an Aiur Toplevel at elaboration time and writes a .lean file with: - Semantic types: Lean inductives from Aiur enums with pointers erased, type aliases as abbrevs, topologically sorted by type references with mutual blocks for cyclic dependencies - Semantic propositions: one inductive per function, one constructor per control-flow path, with assertEq as Prop conjuncts, store/load erased, u8/u32 ops with range constraints, or-patterns expanded, IO operations as unconstrained fresh variables, data constructors inlined, nested match patterns resolved transitively - Topological sorting of both types and functions by dependency graph, with mutual blocks only for actual cycles Add multi-file example: - ExampleBase.lean: Expr type, eval, swap, double_eval (forward ref), simplify_neg (nested match) → ExampleBaseSem.lean - ExampleMain.lean: ExprList, Tree/Forest (mutual types), list_sum, assert_eval, tree_sum/forest_sum (mutual functions), is_even/is_odd (mutual recursion) → ExampleMainSem.lean (imports base) - Example.lean: 10 theorems over generated semantic propositions (determinism, totality, involution, assertEq semantics, spec soundness, mutual type/function soundness, mutual recursion path exclusivity)
66e8c1d to
61011b9
Compare
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 G field arithmetic (Add, Sub, Mul, eqZero), u8/u32 semantic functions with range predicates, and commutativity theorems to Goldilocks.lean. Enable precompileModules on Ix library for native evaluation under Lean's
modulesystem.Add
#aiur_gencommand that evaluates an Aiur Toplevel at elaboration time and writes a .lean file with:Add multi-file example: