-
Notifications
You must be signed in to change notification settings - Fork 8
G3: External-call / function-table closure in BridgedSafeStmts #1886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
7aecb60
G3 Phase 1: scaffold BridgedUserFunctionCall predicates in EvmYulLean…
Th0rgal 8153ee8
G3 Phase 1.5: parameterize call-closure predicates by BridgedFunction…
Th0rgal 4b66e01
chore: auto-refresh derived artifacts
github-actions[bot] 5044699
G3 Phase 2 (start): bridge lemmas + BridgedStmt user-call constructors
Th0rgal 96f6006
chore: auto-refresh derived artifacts
github-actions[bot] 8634e7f
G3 Phase 2: source-level closure for internalCall / internalCallAssign
Th0rgal deed611
chore: auto-refresh derived artifacts
github-actions[bot] 3cac31f
G3 Phase 2.3: source-level closure for externalCallBind
Th0rgal b8373bc
G3 Phase 2.4: source-level closure for Stmt.ecm with per-module oblig…
Th0rgal 4de2db2
chore: auto-refresh derived artifacts
github-actions[bot] 43431b8
G3 Phase 3: composition machinery for mixed bodies (append split + br…
Th0rgal 323e1a5
chore: auto-refresh derived artifacts
github-actions[bot] a780056
G3 Phase 4 (smoke): end-to-end closure demonstration for internalCall
Th0rgal ea6f121
chore: auto-refresh derived artifacts
github-actions[bot] 161c63e
G3 Phase 5: AUDIT.md + TRUST_ASSUMPTIONS.md describe call-family closure
Th0rgal a169f56
G3 cleanup: factor list-level closures via generic per-stmt-bridge he…
Th0rgal 8ec735d
G3 Phase 4: concrete ERC-20 + ERC-4626 native theorems
Th0rgal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| import Compiler.Codegen | ||
| import Compiler.Proofs.IRGeneration.Expr | ||
| import Compiler.Proofs.YulGeneration.Backends.EvmYulLeanNativeHarness | ||
|
|
||
| /-! | ||
| Computed native lowering witness for the G3 minimal ERC-20 IR fixture. | ||
|
|
||
| Mirrors `Compiler/SimpleStorageNativeWitness.lean`: this file is deliberately | ||
| outside `Compiler/Proofs` and `Contracts/` so the executable | ||
| `native_decide` packaging stays out of the proof-hygiene scope. Downstream | ||
| proof modules consume only the resulting equality. | ||
| -/ | ||
|
|
||
| namespace Compiler.ERC20MinimalNativeWitness | ||
|
|
||
| open Compiler.Proofs.IRGeneration | ||
|
|
||
| theorem lowerRuntimeContractNative_ok : | ||
| ∃ nativeContract, | ||
| Compiler.Proofs.YulGeneration.Backends.lowerRuntimeContractNative | ||
| (Compiler.emitYul erc20MinimalIRContract).runtimeCode = .ok nativeContract := by | ||
| have hOk : | ||
| (match | ||
| Compiler.Proofs.YulGeneration.Backends.lowerRuntimeContractNative | ||
| (Compiler.emitYul erc20MinimalIRContract).runtimeCode with | ||
| | .ok _ => true | ||
| | .error _ => false) = true := by | ||
| native_decide | ||
| cases hLower : | ||
| Compiler.Proofs.YulGeneration.Backends.lowerRuntimeContractNative | ||
| (Compiler.emitYul erc20MinimalIRContract).runtimeCode with | ||
| | ok nativeContract => | ||
| exact ⟨nativeContract, rfl⟩ | ||
| | error _ => | ||
| have := hOk | ||
| rw [hLower] at this | ||
| cases this | ||
|
|
||
| def nativeContract : EvmYul.Yul.Ast.YulContract := | ||
| match | ||
| Compiler.Proofs.YulGeneration.Backends.lowerRuntimeContractNative | ||
| (Compiler.emitYul erc20MinimalIRContract).runtimeCode with | ||
| | .ok nativeContract => nativeContract | ||
| | .error _ => { dispatcher := .Block [], functions := ∅ } | ||
|
|
||
| @[simp] theorem lowerRuntimeContractNative_eq : | ||
| Compiler.Proofs.YulGeneration.Backends.lowerRuntimeContractNative | ||
| (Compiler.emitYul erc20MinimalIRContract).runtimeCode = | ||
| .ok nativeContract := | ||
| by | ||
| have hOk : | ||
| (match | ||
| Compiler.Proofs.YulGeneration.Backends.lowerRuntimeContractNative | ||
| (Compiler.emitYul erc20MinimalIRContract).runtimeCode with | ||
| | .ok _ => true | ||
| | .error _ => false) = true := by | ||
| native_decide | ||
| cases hLower : | ||
| Compiler.Proofs.YulGeneration.Backends.lowerRuntimeContractNative | ||
| (Compiler.emitYul erc20MinimalIRContract).runtimeCode with | ||
| | ok lowered => | ||
| unfold nativeContract | ||
| rw [hLower] | ||
| | error err => | ||
| rw [hLower] at hOk | ||
| cases hOk | ||
|
|
||
| end Compiler.ERC20MinimalNativeWitness |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.