From b4d7508ac922213c9721c4625a5cc8225888fa99 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Wed, 12 Aug 2026 16:58:05 +0000 Subject: [PATCH 01/20] chore: Update Lean to v4.33.0 Toolchain and dependencies bumped by lean-update. --- lake-manifest.json | 13 +++++++------ lakefile.lean | 4 ++-- lean-toolchain | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lake-manifest.json b/lake-manifest.json index 4080aa994..de07d4a22 100644 --- a/lake-manifest.json +++ b/lake-manifest.json @@ -1,4 +1,4 @@ -{"version": "1.1.0", +{"version": "1.2.0", "packagesDir": ".lake/packages", "packages": [{"url": "https://github.com/argumentcomputer/lean4lean", @@ -15,20 +15,20 @@ "type": "git", "subDir": null, "scope": "", - "rev": "756e3321fd3b02a85ffda19fef789916223e578c", + "rev": "4488d40d070b9700d4d5a6aa342f0d40c31b2a2d", "name": "batteries", "manifestFile": "lake-manifest.json", - "inputRev": "v4.29.0", + "inputRev": "v4.33.0", "inherited": false, "configFile": "lakefile.toml"}, {"url": "https://github.com/leanprover/lean4-cli", "type": "git", "subDir": null, "scope": "", - "rev": "7802da01beb530bf051ab657443f9cd9bc3e1a29", + "rev": "6130a47896ce867c6a4a55373441e59e565bad0f", "name": "Cli", "manifestFile": "lake-manifest.json", - "inputRev": "v4.29.0", + "inputRev": "v4.33.0", "inherited": false, "configFile": "lakefile.toml"}, {"url": "https://github.com/argumentcomputer/Blake3.lean", @@ -52,4 +52,5 @@ "inherited": false, "configFile": "lakefile.toml"}], "name": "ix", - "lakeDir": ".lake"} + "lakeDir": ".lake", + "fixedToolchain": false} diff --git a/lakefile.lean b/lakefile.lean index 65077fb0d..e2da393d7 100644 --- a/lakefile.lean +++ b/lakefile.lean @@ -11,10 +11,10 @@ require Blake3 from git "https://github.com/argumentcomputer/Blake3.lean" @ "c6db090374cb3c3c717691beb6cd18bb08936598" require Cli from git - "https://github.com/leanprover/lean4-cli" @ "v4.29.0" + "https://github.com/leanprover/lean4-cli" @ "v4.33.0" require batteries from git - "https://github.com/leanprover-community/batteries" @ "v4.29.0" + "https://github.com/leanprover-community/batteries" @ "v4.33.0" /- Reference Lean4-in-Lean4 theory and checker. `IxTcVerify` imports its Theory/Verify specification surface, while `bench-lean4lean` and the ignored diff --git a/lean-toolchain b/lean-toolchain index 14791d727..025e59548 100644 --- a/lean-toolchain +++ b/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:v4.29.0 +leanprover/lean4:v4.33.0 From e3ff30eef6b46181403bc90e13623e4a9c08ab28 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Wed, 12 Aug 2026 14:44:49 -0400 Subject: [PATCH 02/20] ci: Use lean-update's pr setting `pr: true` opens the update PR on any outcome and skips the updater's validation build by default; the PR's own CI is the authority on whether the update builds. --- .github/workflows/update.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 78293653d..391a8ffe7 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -32,6 +32,9 @@ jobs: # pinned to a commit hash is reported and left alone. - uses: argumentcomputer/lean-update@dev with: + # The root package and the compile benchmarks; Benchmarks/CompileFC + # is deliberately left on its old toolchain, so no glob here. + lake_package_directory: ". Benchmarks/Compile" bump_mode: pinned-tags - on_update_fails: pr + pr: true token: ${{ steps.app-token.outputs.token }} From d0a36782b302fc704317d492be05f1defd87c1ab Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Fri, 17 Jul 2026 17:50:09 -0400 Subject: [PATCH 03/20] chore: Adapt sources and pins to Lean v4.33.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Carries the v4.31 adaptation work forward: Std.HashMap `find?` renames to `get?` (including call sites added on main since), the ByteArray FFI helpers removed on the Lean and Rust sides, and assorted API fixes. Dependency pins move to v4.33.0: Cli and batteries by tag, LSpec to the merge commit of its v4.33.0 bump, and Blake3 to its v4.33.0 bump commit — the manifest entry for Blake3 still needs `lake update Blake3` once that commit is reachable on the remote. Benchmarks/Compile moves to the v4.33.0 toolchain with mathlib and FLT at their v4.33.0 tags. --- Benchmarks/Compile/lake-manifest.json | 63 ++++++++++++++------------- Benchmarks/Compile/lakefile.toml | 4 +- Benchmarks/Compile/lean-toolchain | 2 +- Cargo.lock | 4 +- Cargo.toml | 4 +- Ix/Address.lean | 1 - Ix/Aiur/Compiler.lean | 2 +- Ix/Aiur/Goldilocks.lean | 2 +- Ix/Benchmark/Bench.lean | 2 - Ix/ByteArray.lean | 18 -------- Ix/Common.lean | 1 + Ix/CompileM.lean | 12 ++--- Ix/Environment.lean | 7 +-- Ix/IxonUniv.lean | 4 +- Ix/Merkle.lean | 1 - Ix/Meta.lean | 3 +- Tests/ByteArray.lean | 24 ---------- Tests/Ix/Kernel/TutorialMeta.lean | 2 +- Tests/Keccak.lean | 1 - Tests/Main.lean | 2 - crates/ffi/src/byte_array.rs | 11 ----- crates/ffi/src/lib.rs | 1 - flake.lock | 12 ++--- lake-manifest.json | 18 ++++++-- lakefile.lean | 4 +- 25 files changed, 77 insertions(+), 128 deletions(-) delete mode 100644 Ix/ByteArray.lean delete mode 100644 Tests/ByteArray.lean delete mode 100644 crates/ffi/src/byte_array.rs diff --git a/Benchmarks/Compile/lake-manifest.json b/Benchmarks/Compile/lake-manifest.json index 0e93ed2c8..40bb5e64e 100644 --- a/Benchmarks/Compile/lake-manifest.json +++ b/Benchmarks/Compile/lake-manifest.json @@ -1,24 +1,24 @@ -{"version": "1.1.0", +{"version": "1.2.0", "packagesDir": ".lake/packages", "packages": [{"url": "https://github.com/leanprover-community/mathlib4", "type": "git", "subDir": null, "scope": "", - "rev": "8a178386ffc0f5fef0b77738bb5449d50efeea95", + "rev": "db584cd6d46c92f209a44c0f1c829460d327499d", "name": "mathlib", "manifestFile": "lake-manifest.json", - "inputRev": "v4.29.0", + "inputRev": "v4.33.0", "inherited": false, "configFile": "lakefile.lean"}, {"url": "https://github.com/ImperialCollegeLondon/FLT", "type": "git", "subDir": null, "scope": "", - "rev": "2d9083d31e10033122dedbcd9406389c2df5be86", + "rev": "45eb9afc55ce36516fc98ba10618c010fdced7dc", "name": "flt", "manifestFile": "lake-manifest.json", - "inputRev": "v4.29.0", + "inputRev": "v4.33.0", "inherited": false, "configFile": "lakefile.toml"}, {"type": "path", @@ -32,7 +32,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "83e90935a17ca19ebe4b7893c7f7066e266f50d3", + "rev": "b7eb3304aeae834b12dda98993a37f6a41f6f0bb", "name": "plausible", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -42,7 +42,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "c5d5b8fe6e5158def25cd28eb94e4141ad97c843", + "rev": "5f4d51b81cbd3f6b32b156bfad9056621a040404", "name": "LeanSearchClient", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -52,7 +52,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "48d5698bc464786347c1b0d859b18f938420f060", + "rev": "16f02aa7642864af59f1ff0e384a015994db9118", "name": "importGraph", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -62,17 +62,17 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "3c52dee17f0cd89c1ec14de78920d1bdaa3d26b3", + "rev": "4be2e3d5087eeb272cf5a8853b8f9dd025ef5957", "name": "proofwidgets", "manifestFile": "lake-manifest.json", - "inputRev": "v0.0.95", + "inputRev": "main", "inherited": true, "configFile": "lakefile.lean"}, {"url": "https://github.com/leanprover-community/aesop", "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "7152850e7b216a0d409701617721b6e469d34bf6", + "rev": "3448c0bcc5ce01b2d1546e483ec3620e32df3d0e", "name": "aesop", "manifestFile": "lake-manifest.json", "inputRev": "master", @@ -82,7 +82,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "707efb56d0696634e9e965523a1bbe9ac6ce141d", + "rev": "92c15be17b7caf78c2ad767ec40f89052d908d81", "name": "Qq", "manifestFile": "lake-manifest.json", "inputRev": "master", @@ -92,22 +92,12 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "756e3321fd3b02a85ffda19fef789916223e578c", + "rev": "4488d40d070b9700d4d5a6aa342f0d40c31b2a2d", "name": "batteries", "manifestFile": "lake-manifest.json", "inputRev": "main", "inherited": true, "configFile": "lakefile.toml"}, - {"url": "https://github.com/leanprover/lean4-cli", - "type": "git", - "subDir": null, - "scope": "leanprover", - "rev": "7802da01beb530bf051ab657443f9cd9bc3e1a29", - "name": "Cli", - "manifestFile": "lake-manifest.json", - "inputRev": "v4.29.0", - "inherited": true, - "configFile": "lakefile.toml"}, {"url": "https://github.com/PatrickMassot/checkdecls.git", "type": "git", "subDir": null, @@ -118,35 +108,46 @@ "inputRev": null, "inherited": true, "configFile": "lakefile.lean"}, - {"url": "https://github.com/digama0/lean4lean", + {"url": "https://github.com/argumentcomputer/lean4lean", "type": "git", "subDir": null, "scope": "", - "rev": "8865b155abbf68d3a827fb3568bf6839780163c2", + "rev": "5e5bb767b3491d21a71908d4c58bcbaa007283bb", "name": "lean4lean", "manifestFile": "lake-manifest.json", - "inputRev": "8865b155abbf68d3a827fb3568bf6839780163c2", + "inputRev": "5e5bb767b3491d21a71908d4c58bcbaa007283bb", + "inherited": true, + "configFile": "lakefile.toml"}, + {"url": "https://github.com/leanprover/lean4-cli", + "type": "git", + "subDir": null, + "scope": "leanprover", + "rev": "6130a47896ce867c6a4a55373441e59e565bad0f", + "name": "Cli", + "manifestFile": "lake-manifest.json", + "inputRev": "v4.33.0", "inherited": true, "configFile": "lakefile.toml"}, {"url": "https://github.com/argumentcomputer/Blake3.lean", "type": "git", "subDir": null, "scope": "", - "rev": "d15f36cf76eb5834b0e623e02b97fd4d95e56cc7", + "rev": "c9b2273fb9c2c33b94eba091dc4111163f5db2bc", "name": "Blake3", "manifestFile": "lake-manifest.json", - "inputRev": "d15f36cf76eb5834b0e623e02b97fd4d95e56cc7", + "inputRev": "c9b2273fb9c2c33b94eba091dc4111163f5db2bc", "inherited": true, "configFile": "lakefile.lean"}, {"url": "https://github.com/argumentcomputer/LSpec", "type": "git", "subDir": null, "scope": "", - "rev": "d3c15b93a1dd4e7c8d5c0c3825c9555737e55c3e", + "rev": "e780f4188c9649aef988270f4d126651460ca9c4", "name": "LSpec", "manifestFile": "lake-manifest.json", - "inputRev": "d3c15b93a1dd4e7c8d5c0c3825c9555737e55c3e", + "inputRev": "e780f4188c9649aef988270f4d126651460ca9c4", "inherited": true, "configFile": "lakefile.toml"}], "name": "Compile", - "lakeDir": ".lake"} + "lakeDir": ".lake", + "fixedToolchain": false} diff --git a/Benchmarks/Compile/lakefile.toml b/Benchmarks/Compile/lakefile.toml index 6f5720051..20bca5123 100644 --- a/Benchmarks/Compile/lakefile.toml +++ b/Benchmarks/Compile/lakefile.toml @@ -33,9 +33,9 @@ path = "../.." [[require]] name = "flt" git = "https://github.com/ImperialCollegeLondon/FLT" -rev = "v4.29.0" +rev = "v4.33.0" [[require]] name = "mathlib" git = "https://github.com/leanprover-community/mathlib4" -rev = "v4.29.0" +rev = "v4.33.0" diff --git a/Benchmarks/Compile/lean-toolchain b/Benchmarks/Compile/lean-toolchain index 14791d727..025e59548 100644 --- a/Benchmarks/Compile/lean-toolchain +++ b/Benchmarks/Compile/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:v4.29.0 +leanprover/lean4:v4.33.0 diff --git a/Cargo.lock b/Cargo.lock index 181e815d0..90750c4c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -190,7 +190,7 @@ checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" [[package]] name = "bignat" version = "0.1.0" -source = "git+https://github.com/argumentcomputer/lean-ffi.git?rev=839b405de708b80504fda39abe1402114b4135a5#839b405de708b80504fda39abe1402114b4135a5" +source = "git+https://github.com/argumentcomputer/lean-ffi.git?rev=a6e781bc55cec99b99fa7a4bee105c5000cec967#a6e781bc55cec99b99fa7a4bee105c5000cec967" dependencies = [ "num-bigint", ] @@ -1902,7 +1902,7 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lean-ffi" version = "0.1.0" -source = "git+https://github.com/argumentcomputer/lean-ffi.git?rev=839b405de708b80504fda39abe1402114b4135a5#839b405de708b80504fda39abe1402114b4135a5" +source = "git+https://github.com/argumentcomputer/lean-ffi.git?rev=a6e781bc55cec99b99fa7a4bee105c5000cec967#a6e781bc55cec99b99fa7a4bee105c5000cec967" dependencies = [ "bignat", "bindgen", diff --git a/Cargo.toml b/Cargo.toml index 90ac6ca5f..003d2d195 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,8 +38,8 @@ ixon = { path = "crates/ixon" } ix-kernel = { path = "crates/kernel" } # lean-ffi tree (lean-ffi crate + factored-out bignat sub-crate) -bignat = { git = "https://github.com/argumentcomputer/lean-ffi.git", rev = "839b405de708b80504fda39abe1402114b4135a5" } -lean-ffi = { git = "https://github.com/argumentcomputer/lean-ffi.git", rev = "839b405de708b80504fda39abe1402114b4135a5" } +bignat = { git = "https://github.com/argumentcomputer/lean-ffi.git", rev = "a6e781bc55cec99b99fa7a4bee105c5000cec967" } +lean-ffi = { git = "https://github.com/argumentcomputer/lean-ffi.git", rev = "a6e781bc55cec99b99fa7a4bee105c5000cec967" } # External shared deps anyhow = "1" diff --git a/Ix/Address.lean b/Ix/Address.lean index 22a61b110..a3a75bf25 100644 --- a/Ix/Address.lean +++ b/Ix/Address.lean @@ -1,6 +1,5 @@ module public import Lean.ToExpr -public import Ix.ByteArray public import Ix.Common public import Blake3.Rust diff --git a/Ix/Aiur/Compiler.lean b/Ix/Aiur/Compiler.lean index d85266632..cef51cdae 100644 --- a/Ix/Aiur/Compiler.lean +++ b/Ix/Aiur/Compiler.lean @@ -37,7 +37,7 @@ structure CompiledToplevel where bytecode : Bytecode.Toplevel nameMap : Std.HashMap Global Bytecode.FunIdx -@[inline, expose] +@[inline] def CompiledToplevel.getFuncIdx (ct : CompiledToplevel) (name : Lean.Name) : Option Bytecode.FunIdx := ct.nameMap[Global.mk name]? diff --git a/Ix/Aiur/Goldilocks.lean b/Ix/Aiur/Goldilocks.lean index 35c40b4b9..b9745f737 100644 --- a/Ix/Aiur/Goldilocks.lean +++ b/Ix/Aiur/Goldilocks.lean @@ -26,7 +26,7 @@ instance : OfNat G n := ⟨G.ofNat n⟩ let u64 := u8.toUInt64 have h : u64 < gSize := by have lt256 : u64 < 256 := by - simpa [UInt64.lt_iff_toNat_lt] using UInt8.toNat_lt _ + simpa [u64, UInt64.lt_iff_toNat_lt, UInt8.toNat_toUInt64] using UInt8.toNat_lt _ exact UInt64.lt_trans lt256 (by decide) ⟨u64, h⟩ diff --git a/Ix/Benchmark/Bench.lean b/Ix/Benchmark/Bench.lean index 4a77d1ccf..50a90cd53 100644 --- a/Ix/Benchmark/Bench.lean +++ b/Ix/Benchmark/Bench.lean @@ -9,8 +9,6 @@ public import Ix.Benchmark.Report public section -open Batteries (RBMap) - /-! # Benchmarking library modeled after Criterion in Rust and Haskell diff --git a/Ix/ByteArray.lean b/Ix/ByteArray.lean deleted file mode 100644 index 06f56e2b5..000000000 --- a/Ix/ByteArray.lean +++ /dev/null @@ -1,18 +0,0 @@ -module - -public section - -namespace ByteArray - -def beqNoFFI (a b : ByteArray) : Bool := - a.data == b.data - -@[extern "rs_byte_array_beq"] -def beq : @& ByteArray → @& ByteArray → Bool := - beqNoFFI - -instance : BEq ByteArray := ⟨ByteArray.beq⟩ - -end ByteArray - -end diff --git a/Ix/Common.lean b/Ix/Common.lean index 83a9b3a52..2fa53a9a6 100644 --- a/Ix/Common.lean +++ b/Ix/Common.lean @@ -297,6 +297,7 @@ def runFrontend (input : String) (filePath : FilePath) : IO Environment := do checkToolchain let inputCtx := Parser.mkInputContext input filePath.toString let (header, parserState, messages) ← Parser.parseHeader inputCtx + unsafe enableInitializersExecution -- required for `processHeader`'s `loadExts := true` import let (env, messages) ← processHeader header default messages inputCtx 0 let env := env.setMainModule default let commandState := Command.mkState env messages default diff --git a/Ix/CompileM.lean b/Ix/CompileM.lean index 529ca758e..a242dfa61 100644 --- a/Ix/CompileM.lean +++ b/Ix/CompileM.lean @@ -704,7 +704,7 @@ partial def compileExpr (e : Expr) : CompileM (Ixon.Expr × UInt64) := do let recordPatch (root : UInt64) : CompileM Unit := do if compiled.any (·.2.isSome) then pushUnivPatch root (compiled.map fun (cidx, orig?) => orig?.getD cidx) - match mutCtx.find? name with + match mutCtx.get? name with | some recIdx => let root ← allocArenaNode (.ref nameAddr) recordPatch root @@ -1253,7 +1253,7 @@ def collectExprTables (top : Expr) (ctxKey : Address) | .const name lvls _ => for lvl in lvls do univs := univs.push (← compileUniv lvl) - if (mutCtx.find? name).isNone then + if (mutCtx.get? name).isNone then refs := refs.push (← lookupConstAddr name) | .app func arg _ => stack := stack.push arg |>.push func @@ -1389,7 +1389,7 @@ partial def compareExpr (ctx : Ix.MutCtx) (xlvls ylvls : List Name) let univs ← SOrder.zipM (compareLevel xlvls ylvls) xls.toList yls.toList if univs.ord != .eq then pure univs else if x == y then pure ⟨true, .eq⟩ - else match ctx.find? x, ctx.find? y with + else match ctx.get? x, ctx.get? y with | some nx, some ny => pure ⟨false, compare nx ny⟩ | some _, none => pure ⟨true, .lt⟩ | none, some _ => pure ⟨true, .gt⟩ @@ -1423,7 +1423,7 @@ partial def compareExpr (ctx : Ix.MutCtx) (xlvls ylvls : List Name) | .lit .., _ => pure ⟨true, .lt⟩ | _, .lit .. => pure ⟨true, .gt⟩ | .proj tnx ix tx _, .proj tny iy ty _ => do - let tn ← match ctx.find? tnx, ctx.find? tny with + let tn ← match ctx.get? tnx, ctx.get? tny with | some nx, some ny => pure ⟨false, compare nx ny⟩ | none, some _ => pure ⟨true, .gt⟩ | some _, none => pure ⟨true, .lt⟩ @@ -2211,7 +2211,7 @@ def compileMutualBlock (classes : List (List MutConst)) /-- Build mutCtx for an inductive: includes the inductive and all its constructors. -/ def buildInductiveMutCtx (i : InductiveVal) (ctorVals : Array ConstructorVal) : Ix.MutCtx := Id.run do - let mut ctx : Ix.MutCtx := Batteries.RBMap.empty + let mut ctx : Ix.MutCtx := Std.TreeMap.empty -- Inductive at index 0 ctx := ctx.insert i.cnst.name 0 -- Constructors at indices 1, 2, ... @@ -2230,7 +2230,7 @@ def BlockResult.mk' (block : Ixon.Constant) (blockMeta : Ixon.ConstantMeta := .e Returns BlockResult with the constant and any projections needed. -/ def compileConstantInfo (const : ConstantInfo) : CompileM BlockResult := do let name := const.getCnst.name - let mutCtx : Ix.MutCtx := Batteries.RBMap.empty.insert name 0 + let mutCtx : Ix.MutCtx := Std.TreeMap.empty.insert name 0 withMutCtx mutCtx do match const with | .defnInfo d => diff --git a/Ix/Environment.lean b/Ix/Environment.lean index b7cf4da8f..4bb2c6c3f 100644 --- a/Ix/Environment.lean +++ b/Ix/Environment.lean @@ -8,7 +8,7 @@ module public import Blake3.Rust public import Std.Data.HashMap -public import Batteries.Data.RBMap +public import Std.Data.TreeMap public import Ix.Address public section @@ -662,14 +662,11 @@ def Environment.toRaw (env : Environment) : RawEnvironment := /-! ## Context Types for Compilation -/ /-- Mutual context mapping Name to index within block. -/ -abbrev MutCtx := Batteries.RBMap Name Nat nameCompare +abbrev MutCtx := Std.TreeMap Name Nat nameCompare instance : Ord MutCtx where compare a b := compare a.toList b.toList -/-- Set of Names (for tracking constants in a block). -/ -abbrev NameSet := Batteries.RBSet Name nameCompare - end Ix end diff --git a/Ix/IxonUniv.lean b/Ix/IxonUniv.lean index 62e7f9f00..192bb3824 100644 --- a/Ix/IxonUniv.lean +++ b/Ix/IxonUniv.lean @@ -403,12 +403,12 @@ def linearize (norm : CNorm) : Univ := Id.run do for j in [0:order.length] do let p := order[j]! let mctx := (order.take j).mergeSort (· ≤ ·) - if (groups.find? mctx).any (fun sg => sg.atoms.find? p == some 0) then + if (groups.get? mctx).any (fun sg => sg.atoms.get? p == some 0) then consumed := (mctx, p) :: consumed -- Emission. let mut terms : List Univ := [] let mut rootCAbsorbed := false - if let some top := groups.find? [] then + if let some top := groups.get? [] then for (i, k) in top.atoms.toList do if k == 0 && consumed.contains ([], i) then continue diff --git a/Ix/Merkle.lean b/Ix/Merkle.lean index 411ba1400..383989c82 100644 --- a/Ix/Merkle.lean +++ b/Ix/Merkle.lean @@ -34,7 +34,6 @@ module public import Ix.Address -public import Ix.ByteArray public section diff --git a/Ix/Meta.lean b/Ix/Meta.lean index 1e7e38351..7caf96ce2 100644 --- a/Ix/Meta.lean +++ b/Ix/Meta.lean @@ -35,6 +35,7 @@ def getFileEnv (path : FilePath) : IO Environment := do let source ← IO.FS.readFile path let inputCtx := Parser.mkInputContext source path.toString let (header, parserState, messages) ← Parser.parseHeader inputCtx + unsafe enableInitializersExecution -- required for `processHeaderCore`'s `loadExts := true` import let (env, messages) ← processHeaderCore (HeaderSyntax.startPos header) (HeaderSyntax.imports header) (isModule := false) default messages inputCtx 0 @@ -79,7 +80,7 @@ def fetchMathlibCache (cwd : Option FilePath) : IO Unit := do let root := cwd.getD "." let manifest := root / "lake-manifest.json" let contents ← IO.FS.readFile manifest - if contents.containsSubstr "leanprover-community/mathlib4" then + if contents.contains "leanprover-community/mathlib4" then let mathlibBuild := root / ".lake" / "packages" / "mathlib" / ".lake" / "build" if ← mathlibBuild.pathExists then println! "Mathlib cache already present, skipping fetch." diff --git a/Tests/ByteArray.lean b/Tests/ByteArray.lean deleted file mode 100644 index 92be1a47b..000000000 --- a/Tests/ByteArray.lean +++ /dev/null @@ -1,24 +0,0 @@ -module - -public import LSpec -public import Ix.ByteArray - -def arrays : List ByteArray := [ - ⟨#[]⟩, ⟨#[1]⟩, ⟨#[0, 3]⟩, ⟨#[1, 1, 1]⟩, ⟨#[3, 3, 3, 3]⟩, ⟨#[13]⟩ -] - -def arrays' : List ByteArray := [ - ⟨#[1]⟩, ⟨#[2]⟩, ⟨#[0, 3, 0]⟩, ⟨#[1, 2, 1]⟩, ⟨#[3, 3, 4, 3]⟩, ⟨#[13, 0]⟩ -] - -open LSpec - -def beq : TestSeq := - arrays.zip arrays |>.foldl (init := .done) fun tSeq (x, y) => - tSeq ++ (test s!"{x} == {y}" $ x.beq y && x.beqNoFFI y && y.beq x && y.beqNoFFI x) - -def neq : TestSeq := - arrays.zip arrays' |>.foldl (init := .done) fun tSeq (x, y) => - tSeq ++ (test s!"{x} != {y}" $ !x.beq y && !x.beqNoFFI y && !y.beq x && !y.beqNoFFI x) - -public def Tests.ByteArray.suite := [beq, neq] diff --git a/Tests/Ix/Kernel/TutorialMeta.lean b/Tests/Ix/Kernel/TutorialMeta.lean index 7bd6a027b..ac875fb13 100644 --- a/Tests/Ix/Kernel/TutorialMeta.lean +++ b/Tests/Ix/Kernel/TutorialMeta.lean @@ -194,7 +194,7 @@ def elabAndAddTestCaseDecl (name : TSyntax ``declId) (type value : Term) (outcom (declKind : ConstantKind) (skipTC := false) : CommandElabM Unit := liftTermElabM do let (declName, lparams) ← match name with | `(declId| $n:ident) => pure (n.getId, []) - | `(declId| $n:ident .{ $[$ls:ident],* }) => pure (n.getId, ls.toList.map (·.getId)) + | `(declId| $n:ident.{ $[$ls:ident],* }) => pure (n.getId, ls.toList.map (·.getId)) | _ => throwUnsupportedSyntax withLevelNames lparams do let typeExpr ← elabTermAndSynthesize type none diff --git a/Tests/Keccak.lean b/Tests/Keccak.lean index 98d614ef8..1110d329b 100644 --- a/Tests/Keccak.lean +++ b/Tests/Keccak.lean @@ -2,7 +2,6 @@ module public import Ix.Keccak public import LSpec -public import Ix.ByteArray open LSpec diff --git a/Tests/Main.lean b/Tests/Main.lean index 08a71f17b..d0abd4512 100644 --- a/Tests/Main.lean +++ b/Tests/Main.lean @@ -1,5 +1,4 @@ import Tests.Aiur -import Tests.ByteArray import Tests.Ix.Ixon import Tests.Ix.IxonCorpus import Tests.Ix.IxonSyntax @@ -66,7 +65,6 @@ opaque tmpDecodeConstMap : @& List (Lean.Name × Lean.ConstantInfo) → USize /-- Primary test suites - run by default -/ def primarySuites : Std.HashMap String (List LSpec.TestSeq) := .ofList [ ("ffi", Tests.FFI.suite), - ("byte-array", Tests.ByteArray.suite), ("ixon", Tests.Ixon.suite), ("ixon-syntax", Tests.IxonSyntax.suite), ("claim", Tests.Claim.suite), diff --git a/crates/ffi/src/byte_array.rs b/crates/ffi/src/byte_array.rs deleted file mode 100644 index ab53b2d8b..000000000 --- a/crates/ffi/src/byte_array.rs +++ /dev/null @@ -1,11 +0,0 @@ -use lean_ffi::object::{LeanBorrowed, LeanByteArray}; - -/// `@& ByteArray → @& ByteArray → Bool` -/// Efficient implementation for `BEq ByteArray` -#[unsafe(no_mangle)] -extern "C" fn rs_byte_array_beq( - a: LeanByteArray>, - b: LeanByteArray>, -) -> bool { - a.as_bytes() == b.as_bytes() -} diff --git a/crates/ffi/src/lib.rs b/crates/ffi/src/lib.rs index 38df7e1dd..5b404001c 100644 --- a/crates/ffi/src/lib.rs +++ b/crates/ffi/src/lib.rs @@ -8,7 +8,6 @@ ))] pub mod _iroh; pub mod aiur; -pub mod byte_array; #[cfg(all( feature = "net", not(all(target_os = "macos", target_arch = "aarch64")) diff --git a/flake.lock b/flake.lock index 7468797d5..f991113e3 100644 --- a/flake.lock +++ b/flake.lock @@ -33,11 +33,11 @@ ] }, "locked": { - "lastModified": 1776364162, - "narHash": "sha256-l3FectIPaz5Fq1q0YSG7wR7VyybZqt56Sj4kebEoZ+Q=", + "lastModified": 1784318821, + "narHash": "sha256-mgyIRIZAs5pKAD8HT1sATU9QibhEXXaCovjUFT0j3gg=", "owner": "argumentcomputer", "repo": "Blake3.lean", - "rev": "aaf530784082a2c00b0a93648741429d274102ca", + "rev": "2342f0d7f5af12e232b12b8815cd2ada5d0c2bb6", "type": "github" }, "original": { @@ -254,11 +254,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1775267043, - "narHash": "sha256-yUCn4Wc5kLboN9JHom/SJAknn7aoSEDyerqFq3k7g0I=", + "lastModified": 1784223297, + "narHash": "sha256-rmEX8SXvtT7Fi8hOZuCXCbpyzno3iTQYnV3WKzsAVHw=", "owner": "lenianiva", "repo": "lean4-nix", - "rev": "56e917e2766385d0b096ea8be9c40ae54bfe138a", + "rev": "82993165f5f30879fc9d40734615ec54cb541e61", "type": "github" }, "original": { diff --git a/lake-manifest.json b/lake-manifest.json index de07d4a22..2f490a921 100644 --- a/lake-manifest.json +++ b/lake-manifest.json @@ -35,21 +35,31 @@ "type": "git", "subDir": null, "scope": "", - "rev": "c6db090374cb3c3c717691beb6cd18bb08936598", + "rev": "c9b2273fb9c2c33b94eba091dc4111163f5db2bc", "name": "Blake3", "manifestFile": "lake-manifest.json", - "inputRev": "c6db090374cb3c3c717691beb6cd18bb08936598", + "inputRev": "c9b2273fb9c2c33b94eba091dc4111163f5db2bc", "inherited": false, "configFile": "lakefile.lean"}, {"url": "https://github.com/argumentcomputer/LSpec", "type": "git", "subDir": null, "scope": "", - "rev": "d3c15b93a1dd4e7c8d5c0c3825c9555737e55c3e", + "rev": "e780f4188c9649aef988270f4d126651460ca9c4", "name": "LSpec", "manifestFile": "lake-manifest.json", - "inputRev": "d3c15b93a1dd4e7c8d5c0c3825c9555737e55c3e", + "inputRev": "e780f4188c9649aef988270f4d126651460ca9c4", "inherited": false, + "configFile": "lakefile.toml"}, + {"url": "https://github.com/leanprover-community/plausible", + "type": "git", + "subDir": null, + "scope": "", + "rev": "b7eb3304aeae834b12dda98993a37f6a41f6f0bb", + "name": "plausible", + "manifestFile": "lake-manifest.json", + "inputRev": "v4.33.0", + "inherited": true, "configFile": "lakefile.toml"}], "name": "ix", "lakeDir": ".lake", diff --git a/lakefile.lean b/lakefile.lean index e2da393d7..f059b888c 100644 --- a/lakefile.lean +++ b/lakefile.lean @@ -5,10 +5,10 @@ package ix where version := v!"0.1.0" require LSpec from git - "https://github.com/argumentcomputer/LSpec" @ "d3c15b93a1dd4e7c8d5c0c3825c9555737e55c3e" + "https://github.com/argumentcomputer/LSpec" @ "e780f4188c9649aef988270f4d126651460ca9c4" require Blake3 from git - "https://github.com/argumentcomputer/Blake3.lean" @ "c6db090374cb3c3c717691beb6cd18bb08936598" + "https://github.com/argumentcomputer/Blake3.lean" @ "c9b2273fb9c2c33b94eba091dc4111163f5db2bc" require Cli from git "https://github.com/leanprover/lean4-cli" @ "v4.33.0" From 34ba87313f65a556cd20728d219eb00ae9d34002 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Wed, 12 Aug 2026 14:58:48 -0400 Subject: [PATCH 04/20] nix: Switch to the lean4-nix fork API Upstream lean4-nix stops at Lean v4.32.0 and builds toolchains from source behind an overlay; the fork provides released toolchains as plain derivations and removed the overlay API. The overlay block is replaced by `lib.${system}.fromToolchainFile`, and the Lean sysroot for bindgen, the Lake build inputs, the binary wrappers, and the dev shell take the toolchain derivation directly. The dev shell and the crane-side derivations evaluate now. The Lake packages remain blocked on the `blake3-lean` input: it follows this flake's lean4-nix, so Blake3.lean's own fork migration must be pushed and merged, after which `nix flake update blake3-lean` and `lake update Blake3` complete the move. --- flake.lock | 16 ++++++++-------- flake.nix | 22 +++++++++------------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/flake.lock b/flake.lock index f991113e3..faa15cb92 100644 --- a/flake.lock +++ b/flake.lock @@ -33,11 +33,11 @@ ] }, "locked": { - "lastModified": 1784318821, - "narHash": "sha256-mgyIRIZAs5pKAD8HT1sATU9QibhEXXaCovjUFT0j3gg=", + "lastModified": 1786554796, + "narHash": "sha256-4BDdZZ8JNAbPGU2d2hnIfc5gTjj0ZDpaAFLcA6EgMeI=", "owner": "argumentcomputer", "repo": "Blake3.lean", - "rev": "2342f0d7f5af12e232b12b8815cd2ada5d0c2bb6", + "rev": "c9b2273fb9c2c33b94eba091dc4111163f5db2bc", "type": "github" }, "original": { @@ -254,15 +254,15 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1784223297, - "narHash": "sha256-rmEX8SXvtT7Fi8hOZuCXCbpyzno3iTQYnV3WKzsAVHw=", - "owner": "lenianiva", + "lastModified": 1786543565, + "narHash": "sha256-zHMoHO85jizkIXH0OfnvabpNLTl90rR3GCc1h/e2sx4=", + "owner": "argumentcomputer", "repo": "lean4-nix", - "rev": "82993165f5f30879fc9d40734615ec54cb541e61", + "rev": "4026c657eecf16beea7d266ce32933ef3d7db2e5", "type": "github" }, "original": { - "owner": "lenianiva", + "owner": "argumentcomputer", "repo": "lean4-nix", "type": "github" } diff --git a/flake.nix b/flake.nix index ea6640914..b7487c7cf 100644 --- a/flake.nix +++ b/flake.nix @@ -15,7 +15,7 @@ nixpkgs.follows = "lean4-nix/nixpkgs"; # Lean 4 & Lake - lean4-nix.url = "github:lenianiva/lean4-nix"; + lean4-nix.url = "github:argumentcomputer/lean4-nix"; # Helper: flake-parts for easier outputs flake-parts.url = "github:hercules-ci/flake-parts"; @@ -48,7 +48,6 @@ outputs = inputs@{ - nixpkgs, flake-parts, lean4-nix, fenix, @@ -74,6 +73,9 @@ ... }: let + # Pins the Lean toolchain; a plain derivation, no overlay involved + lean = lean4-nix.lib.${system}.fromToolchainFile ./lean-toolchain; + # Pins the Rust toolchain rustToolchain = fenix.packages.${system}.fromToolchainFile { file = ./rust-toolchain.toml; @@ -90,7 +92,7 @@ strictDeps = true; # build.rs uses LEAN_SYSROOT to locate lean/lean.h for bindgen - LEAN_SYSROOT = "${pkgs.lean.lean-all}"; + LEAN_SYSROOT = "${lean}"; # bindgen needs libclang to parse C headers LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib"; @@ -149,7 +151,7 @@ ); # Lake package - lake2nix = pkgs.callPackage lean4-nix.lake { }; + lake2nix = pkgs.callPackage lean4-nix.lake { inherit lean; }; # Restrict the Lake build inputs to Lean-relevant files so edits to # unrelated files (flake.nix, CI, docs) don't invalidate the whole # Lean build. The Rust side gets the same via cleanCargoSource. @@ -199,7 +201,7 @@ ''; buildInputs = [ pkgs.gmp - pkgs.lean.lean-all + lean pkgs.rsync ]; }; @@ -233,7 +235,7 @@ for f in ${drv}/bin/*; do [ -x "$f" ] || continue makeWrapper "$f" "$out/bin/$(basename "$f")" \ - --set LEAN_SYSROOT "${pkgs.lean.lean-all}" \ + --set LEAN_SYSROOT "${lean}" \ --set LEAN_PATH "${drv}/.lake/build/lib/lean:${leanPath}" done ''; @@ -270,12 +272,6 @@ ); in { - # Lean overlay - _module.args.pkgs = import nixpkgs { - inherit system; - overlays = [ (lean4-nix.readToolchainFile ./lean-toolchain) ]; - }; - packages = { default = ixLib; ix = ixCLI; @@ -324,7 +320,7 @@ clang rustToolchain rust-analyzer - lean.lean-all + lean cargo-deny valgrind ]; From d6d046f6e62069d7181529f0c292565a25d844f7 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Wed, 12 Aug 2026 14:58:52 -0400 Subject: [PATCH 05/20] chore: Move from alejandra to nixfmt Formatting-only, plus the formatter declaration itself; nixfmt-tree wraps nixfmt so `nix fmt .` can still take a directory. --- flake.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index b7487c7cf..526a535bf 100644 --- a/flake.nix +++ b/flake.nix @@ -144,8 +144,7 @@ // { inherit cargoArtifacts; cargoExtraArgs = - "--locked --features parallel" - + pkgs.lib.optionalString (!pkgs.stdenv.isDarwin) ",net"; + "--locked --features parallel" + pkgs.lib.optionalString (!pkgs.stdenv.isDarwin) ",net"; doCheck = false; } ); @@ -352,7 +351,9 @@ # ]; # }; - formatter = pkgs.alejandra; + # The treefmt wrapper around `nixfmt`, so `nix fmt .` can take a + # directory; bare `nixfmt` only accepts individual files. + formatter = pkgs.nixfmt-tree; }; }; } From 07db29da1db4dd54dc673c990570e8fb551bb828 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Wed, 12 Aug 2026 16:04:20 -0400 Subject: [PATCH 06/20] fix(tc): classify Prop up to universe normalization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lean v4.33.0 fixed two kernel soundness bugs (leanprover/lean4#14613, leanprover/lean4#14615) where a sort spelled e.g. `Sort (imax 1 0)` was not recognized as `Prop` because the zero test was syntactic; a non-proof field could then be projected out of a proof, and the inductive checker could misclassify Prop-only elimination and K-like reduction. Both ix kernels had the same syntactic test. `KUniv.isSemanticZero` / `KUniv::is_semantic_zero` decide `u ≡ 0` through the existing Géran normal form (zero normalizes to empty entries only, and norm-level equality already ignores empty entries), and replace the syntactic test at the four affected sites, in lockstep across both kernels: - proof-irrelevance Prop classification (Tc/DefEq, kernel/def_eq) - the struct-eta H3 Prop-major guard (Tc/Whnf, kernel/whnf) - the A4 field-universe Prop exemption (Tc/Inductive, kernel/inductive) - recursor-generation isProp/isLarge (AuxGen/Recursor; compile-side, Lean only) The IxVM kernel model retains the syntactic test and needs the same treatment separately. --- Ix/AuxGen/Recursor.lean | 4 ++-- Ix/Tc/DefEq.lean | 2 +- Ix/Tc/Inductive.lean | 2 +- Ix/Tc/Level.lean | 8 ++++++++ Ix/Tc/Whnf.lean | 2 +- crates/kernel/src/def_eq.rs | 2 +- crates/kernel/src/inductive.rs | 2 +- crates/kernel/src/level.rs | 12 ++++++++++++ crates/kernel/src/whnf.rs | 3 ++- 9 files changed, 29 insertions(+), 8 deletions(-) diff --git a/Ix/AuxGen/Recursor.lean b/Ix/AuxGen/Recursor.lean index 010a71a32..a6587bbcf 100644 --- a/Ix/AuxGen/Recursor.lean +++ b/Ix/AuxGen/Recursor.lean @@ -1619,10 +1619,10 @@ def computeIsLargeAndK (classes : Array FlatInfo) (nClasses nParams : Nat) {classes[0]!.ind.cnst.name.pretty}: {e}") -- Spec-level override: non-Prop inductives always get large elimination. - let isLarge := if !isLarge && !resultKuniv.isZero then true else isLarge + let isLarge := if !isLarge && !resultKuniv.isSemanticZero then true else isLarge -- Prop determination from the WHNF-reduced kernel-derived level. - let isProp := resultKuniv.isZero + let isProp := resultKuniv.isSemanticZero -- C1 fix: Prop block with nested auxiliaries the KEnv didn't see → -- small elimination (Lean treats nested auxes as full mutual members). diff --git a/Ix/Tc/DefEq.lean b/Ix/Tc/DefEq.lean index 196baf93a..9be4d1999 100644 --- a/Ix/Tc/DefEq.lean +++ b/Ix/Tc/DefEq.lean @@ -814,7 +814,7 @@ def classifyPropTypeUncached (ty : KExpr m) : RecM m Bool := do | none => pure false | some sort => match (← try? (whnf sort)) with - | some (.sort u _) => pure u.isZero + | some (.sort u _) => pure u.isSemanticZero | _ => pure false /-- Is `ty : Sort 0`? Memoized on `(tyAddr, ctxAddr)`; inner-chain errors diff --git a/Ix/Tc/Inductive.lean b/Ix/Tc/Inductive.lean index dd5efd2de..c9f251f64 100644 --- a/Ix/Tc/Inductive.lean +++ b/Ix/Tc/Inductive.lean @@ -682,7 +682,7 @@ def checkNestedCtorFieldsLoopFuel : are exempt). -/ def checkFieldUniverses (ctorTy : KExpr m) (nParams : Nat) (indLevel : KUniv m) : RecM m Unit := do - if indLevel.isZero then + if indLevel.isSemanticZero then return () let saved := (← get).lctx.size let mut ty := ctorTy diff --git a/Ix/Tc/Level.lean b/Ix/Tc/Level.lean index b99735d03..ad6192b35 100644 --- a/Ix/Tc/Level.lean +++ b/Ix/Tc/Level.lean @@ -497,6 +497,14 @@ def univGeq (u v : KUniv m) : Bool := u == v || v.isZero || Level.normLevelLe (Level.normalizeLevel v) (Level.normalizeLevel u) +/-- Semantic Prop test: `u ≡ 0` under every parameter assignment. The + syntactic `KUniv.isZero` misses spellings like `imax 1 0`, which the + kernel must classify as `Prop` (leanprover/lean4#14613, #14615). Zero + normalizes to empty entries only and `normLevelEq` ignores empty + entries, so all-empty is exactly `univEq u zero`. -/ +def KUniv.isSemanticZero (u : KUniv m) : Bool := + u.isZero || (Level.normalizeLevel u).toList.all (!Level.entryNonEmpty ·) + end Ix.Tc end diff --git a/Ix/Tc/Whnf.lean b/Ix/Tc/Whnf.lean index 7b12c0ddf..56d425e97 100644 --- a/Ix/Tc/Whnf.lean +++ b/Ix/Tc/Whnf.lean @@ -1133,7 +1133,7 @@ def finishStructEtaResult (indId : KId m) (major rhs : KExpr m) this test pure makes the semantic boundary independently inspectable without moving any checker effects across it. -/ def structEtaSortRejected : KExpr m → Bool - | .sort u _ => u.isZero + | .sort u _ => u.isSemanticZero | _ => false /-- Apply the H3 Prop guard and, for an admissible major sort, instantiate diff --git a/crates/kernel/src/def_eq.rs b/crates/kernel/src/def_eq.rs index 3eea05073..bfbd0d1f4 100644 --- a/crates/kernel/src/def_eq.rs +++ b/crates/kernel/src/def_eq.rs @@ -875,7 +875,7 @@ impl TypeChecker<'_, M> { let result = match self.with_infer_only(|tc| tc.infer(ty)) { Ok(sort) => match self.whnf(&sort) { Ok(reduced) => match reduced.data() { - ExprData::Sort(u, _) => u.is_zero(), + ExprData::Sort(u, _) => u.is_semantic_zero(), _ => false, }, Err(_) => false, diff --git a/crates/kernel/src/inductive.rs b/crates/kernel/src/inductive.rs index 2d5e25fc9..7ac3168b5 100644 --- a/crates/kernel/src/inductive.rs +++ b/crates/kernel/src/inductive.rs @@ -2424,7 +2424,7 @@ peers={} flat={} rec_ids={} failed_gi={failed_gi}", ind_level: &KUniv, ) -> Result<(), TcError> { // Skip if inductive is Prop (Sort 0) — any universe is allowed - if ind_level.is_zero() { + if ind_level.is_semantic_zero() { return Ok(()); } diff --git a/crates/kernel/src/level.rs b/crates/kernel/src/level.rs index 3e4267432..d90d70cb7 100644 --- a/crates/kernel/src/level.rs +++ b/crates/kernel/src/level.rs @@ -113,6 +113,18 @@ impl KUniv { matches!(self.data(), UnivData::Zero(_)) } + /// Semantic Prop test: `u ≡ 0` under every parameter assignment. The + /// syntactic `is_zero` misses spellings like `imax 1 0`, which the + /// kernel must classify as `Prop` (leanprover/lean4#14613, #14615). + /// Zero normalizes to empty entries only and `norm_level_eq` ignores + /// empty entries, so all-empty is exactly `univ_eq(u, zero)`. + pub fn is_semantic_zero(&self) -> bool { + self.is_zero() + || normalize_level(self) + .values() + .all(|n| n.constant == 0 && n.var.is_empty()) + } + /// True if this level is an explicit numeral: `Succ^n(Zero)` for some n ≥ 0. pub fn is_explicit(&self) -> bool { match self.data() { diff --git a/crates/kernel/src/whnf.rs b/crates/kernel/src/whnf.rs index 57f5cd9d8..288f61c42 100644 --- a/crates/kernel/src/whnf.rs +++ b/crates/kernel/src/whnf.rs @@ -1881,7 +1881,8 @@ impl TypeChecker<'_, M> { Ok(w) => w, Err(_) => return Ok(None), }; - if matches!(major_sort_w.data(), ExprData::Sort(u, _) if u.is_zero()) { + if matches!(major_sort_w.data(), ExprData::Sort(u, _) if u.is_semantic_zero()) + { return Ok(None); } let rec_us_vec: Vec<_> = rec_us.to_vec(); From 630baba0f306cb2359764980bc64c429274df1af Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Wed, 12 Aug 2026 16:12:30 -0400 Subject: [PATCH 07/20] fix: Adapt to Lean/batteries v4.33 API changes Fallout of the v4.29 -> v4.33 bump that the skipped updater validation never surfaced: - batteries retired the `Batteries.Data.RBMap` umbrella module and moved the type to `RBTree.RBMap` in `Batteries.Recycling.RBTree`; ix keeps the recycled structure (the Verify layer proves theorems about it) rather than migrating `NormLevel`/`CNorm` to `Std.TreeMap`. - Two `groups`/`atoms` lookups in IxonUniv were RBMap sites caught in the earlier `Std.HashMap` `find?` -> `get?` rename; RBMap kept `find?`. - `do match` arms are non-dependent since v4.32 (leanprover/lean4#13305); the ShardMap size-invariant proofs need `match (dependent := true)`. - `Environment.addDeclCore` gained a `maxRecDepth` parameter (leanprover/lean4#13956); pass Lean's default. - The Canonicity alias fixtures need `@[expose]` under the module system's cross-module compilation-type check. --- Ix/Commit.lean | 3 +- Ix/IxonUniv.lean | 12 +++---- Ix/ShardMap.lean | 4 ++- Ix/Tc/Level.lean | 4 +-- Ix/Tc/Verify/Level.lean | 62 ++++++++++++++++---------------- Tests/Ix/Compile/Canonicity.lean | 7 ++-- 6 files changed, 49 insertions(+), 43 deletions(-) diff --git a/Ix/Commit.lean b/Ix/Commit.lean index bbd3ca533..fcb170a3d 100644 --- a/Ix/Commit.lean +++ b/Ix/Commit.lean @@ -143,7 +143,8 @@ def commitDef (compileEnv : CompileM.CompileEnv) (leanEnv : Lean.Environment) safety := .safe } let decl := Lean.Declaration.defnDecl defnVal - let leanEnv' ← match Lean.Environment.addDeclCore leanEnv 0 decl .none with + let leanEnv' ← match Lean.Environment.addDeclCore leanEnv 0 + Lean.defaultMaxRecDepth.toUSize decl .none with | .ok env => pure env | .error _e => throw $ IO.userError "commitDef: addDeclCore failed" diff --git a/Ix/IxonUniv.lean b/Ix/IxonUniv.lean index 192bb3824..922372c41 100644 --- a/Ix/IxonUniv.lean +++ b/Ix/IxonUniv.lean @@ -1,7 +1,7 @@ module public import Ix.Ixon -public import Batteries.Data.RBMap +public import Batteries.Recycling.RBTree.Basic /-! Universe-level canonicalization (canonicity §10.6). @@ -152,7 +152,7 @@ def CNode.isEmpty (n : CNode) : Bool := n.constant == 0 && n.vars.isEmpty /-- Canonical form: map from imax-paths to nodes (lexicographic). -/ -abbrev CNorm := Batteries.RBMap CPath CNode compare +abbrev CNorm := RBTree.RBMap CPath CNode compare instance : Inhabited CNorm := ⟨.empty⟩ @@ -343,7 +343,7 @@ recovery, marker consumption, emission order). -/ /-- Context-group accumulator. -/ structure CGroup where constant : UInt64 := 0 - atoms : Batteries.RBMap UInt64 UInt64 compare := .empty + atoms : RBTree.RBMap UInt64 UInt64 compare := .empty deriving Inhabited /-- Is a `u_i = 0` fallout of `k` dominated under `ctx`? Some entry at @@ -382,7 +382,7 @@ def maxChain (terms : List Univ) : Univ := def linearize (norm : CNorm) : Univ := Id.run do let cRoot := (norm.findD [] {}).constant -- Explode into per-atom items; self-strip under domination coverage. - let mut groups : Batteries.RBMap CPath CGroup compare := .empty + let mut groups : RBTree.RBMap CPath CGroup compare := .empty for (path, node) in norm.toList do if !path.isEmpty && node.constant > 0 then let g := groups.findD path {} @@ -403,12 +403,12 @@ def linearize (norm : CNorm) : Univ := Id.run do for j in [0:order.length] do let p := order[j]! let mctx := (order.take j).mergeSort (· ≤ ·) - if (groups.get? mctx).any (fun sg => sg.atoms.get? p == some 0) then + if (groups.find? mctx).any (fun sg => sg.atoms.find? p == some 0) then consumed := (mctx, p) :: consumed -- Emission. let mut terms : List Univ := [] let mut rootCAbsorbed := false - if let some top := groups.get? [] then + if let some top := groups.find? [] then for (i, k) in top.atoms.toList do if k == 0 && consumed.contains ([], i) then continue diff --git a/Ix/ShardMap.lean b/Ix/ShardMap.lean index ef1eca264..e3e5dd5f7 100644 --- a/Ix/ShardMap.lean +++ b/Ix/ShardMap.lean @@ -80,7 +80,9 @@ private def mkShardArrayWithCapacity (n : Nat) (capacity : Nat) : BaseIO { arr : Array (PaddedShard α β) // arr.size = n } := do let rec go (remaining : Nat) (acc : Array (PaddedShard α β)) (hacc : acc.size + remaining = n) : BaseIO { arr : Array (PaddedShard α β) // arr.size = n } := do - match remaining with + -- `dependent := true`: the proof arms need `hacc` refined by the + -- scrutinee, which `do match` stopped doing by default in v4.32. + match (dependent := true) remaining with | 0 => pure ⟨acc, by omega⟩ | r + 1 => let mutex ← Std.SharedMutex.new (Std.HashMap.emptyWithCapacity capacity) diff --git a/Ix/Tc/Level.lean b/Ix/Tc/Level.lean index ad6192b35..a57d19314 100644 --- a/Ix/Tc/Level.lean +++ b/Ix/Tc/Level.lean @@ -3,7 +3,7 @@ module public import Ix.Tc.Mode public import Ix.Address public import Ix.Unsigned -public import Batteries.Data.RBMap +public import Batteries.Recycling.RBTree.Basic /-! Mirror: crates/kernel/src/level.rs @@ -265,7 +265,7 @@ abbrev Path := List UInt64 /-- Canonical form: map from imax-paths to nodes. Rust `BTreeMap, Node>`; `Ord Path` is lexicographic in both. -/ -abbrev NormLevel := Batteries.RBMap Path NormNode compare +abbrev NormLevel := RBTree.RBMap Path NormNode compare instance : Inhabited NormLevel := ⟨.empty⟩ diff --git a/Ix/Tc/Verify/Level.lean b/Ix/Tc/Verify/Level.lean index f953866f1..589a1675f 100644 --- a/Ix/Tc/Verify/Level.lean +++ b/Ix/Tc/Verify/Level.lean @@ -1,5 +1,5 @@ import Ix.Tc.Level -import Batteries.Data.RBMap.Lemmas +import Batteries.Recycling.RBTree.Lemmas import Lean4Lean.Theory.VLevel /-! @@ -307,16 +307,16 @@ theorem evalPath_max {ρ : List Nat} {path : Path} {a b : Nat} : theorem NormLevel.eval_le {ρ : List Nat} {l : NormLevel} {x : Nat} : l.eval ρ ≤ x ↔ ∀ p n, l.find? p = some n → evalPath ρ p (n.eval ρ) ≤ x := by - rw [NormLevel.eval, Batteries.RBMap.foldl_eq_foldl_toList, foldl_max_le] + rw [NormLevel.eval, RBTree.RBMap.foldl_eq_foldl_toList, foldl_max_le] simp only [Nat.zero_le, true_and] constructor · intro H p n hf - obtain ⟨y, hy, hcmp⟩ := Batteries.RBMap.find?_some_mem_toList hf + obtain ⟨y, hy, hcmp⟩ := RBTree.RBMap.find?_some_mem_toList hf cases Std.LawfulEqCmp.eq_of_compare hcmp exact H (p, n) hy · intro H pn hpn exact H pn.1 pn.2 - (Batteries.RBMap.find?_some.mpr ⟨pn.1, hpn, Std.ReflCmp.compare_self⟩) + (RBTree.RBMap.find?_some.mpr ⟨pn.1, hpn, Std.ReflCmp.compare_self⟩) theorem NormLevel.le_eval {ρ : List Nat} {l : NormLevel} {p : Path} {n : NormNode} (h : l.find? p = some n) : @@ -574,7 +574,7 @@ theorem NormNode.addVar_eval {ρ : List Nat} {n : NormNode} {idx k : UInt64} : denotation. -/ private theorem findD_evalPath_le {ρ : List Nat} {l : NormLevel} {path : Path} : evalPath ρ path ((l.findD path {}).eval ρ) ≤ l.eval ρ := by - rw [Batteries.RBMap.findD] + rw [RBTree.RBMap.findD] cases hf : l.find? path with | some n => simpa using NormLevel.le_eval hf | none => @@ -594,7 +594,7 @@ private theorem insert_findD_eval {ρ : List Nat} {l : NormLevel} {path : Path} = max (l.eval ρ) (evalPath ρ path c) := by have hfind : ∀ p, (l.insert path v').find? p = if compare p path = .eq then some v' else l.find? p := fun p => by - rw [Batteries.RBMap.find?_insert] + rw [RBTree.RBMap.find?_insert] have ext : ∀ x, (NormLevel.eval ρ (l.insert path v') ≤ x ↔ max (l.eval ρ) (evalPath ρ path c) ≤ x) := by intro x @@ -608,7 +608,7 @@ private theorem insert_findD_eval {ρ : List Nat} {l : NormLevel} {path : Path} by_cases hcmp : compare p path = .eq · cases Std.LawfulEqCmp.eq_of_compare hcmp have hD : l.findD path {} = n := by - rw [Batteries.RBMap.findD, hf, Option.getD_some] + rw [RBTree.RBMap.findD, hf, Option.getD_some] rw [← hD] exact hpath.1 · exact H p n (by rw [hfind, if_neg hcmp]; exact hf) @@ -1212,13 +1212,13 @@ theorem subsumption_eq_model (acc : NormLevel) : theorem seed_eval {ρ : List Nat} : NormLevel.eval ρ ((∅ : NormLevel).insert [] {}) = 0 := by refine Nat.le_antisymm (NormLevel.eval_le.mpr fun p n hf => ?_) (Nat.zero_le _) - rw [Batteries.RBMap.find?_insert] at hf + rw [RBTree.RBMap.find?_insert] at hf split at hf · rename_i hcmp cases Std.LawfulEqCmp.eq_of_compare hcmp cases hf simp [evalPath, allNZ, NormNode.eval] - · obtain ⟨y, hy, -⟩ := Batteries.RBMap.find?_some_mem_toList hf + · obtain ⟨y, hy, -⟩ := RBTree.RBMap.find?_some_mem_toList hf simp at hy /-! #### Canonical-form comparison soundness -/ @@ -1308,7 +1308,7 @@ theorem normLevelEq_eval {ρ : List Nat} {l₁ l₂ : NormLevel} intro p n hf by_cases hne : entryNonEmpty (p, n) = true · have hmem : (p, n) ∈ la.toList := by - obtain ⟨y, hy, hcmp⟩ := Batteries.RBMap.find?_some_mem_toList hf + obtain ⟨y, hy, hcmp⟩ := RBTree.RBMap.find?_some_mem_toList hf cases Std.LawfulEqCmp.eq_of_compare hcmp exact hy have hmem₂ : (p, n) ∈ lb.toList := by @@ -1316,7 +1316,7 @@ theorem normLevelEq_eval {ρ : List Nat} {l₁ l₂ : NormLevel} rw [← hfe] exact List.mem_filter.mpr ⟨hmem, hne⟩ exact (List.mem_filter.mp hfmem).1 - exact NormLevel.le_eval (Batteries.RBMap.find?_some.mpr + exact NormLevel.le_eval (RBTree.RBMap.find?_some.mpr ⟨p, hmem₂, Std.ReflCmp.compare_self⟩) · rw [eval_of_not_entryNonEmpty (Bool.eq_false_iff.mpr hne)] exact evalPath_le.mpr fun _ => Nat.zero_le _ @@ -1340,7 +1340,7 @@ private theorem covering_entry_le {ρ : List Nat} {l₂ : NormLevel} (hnz₂ : allNZ ρ p₂ = true) : NormNode.eval ρ n₂ ≤ NormLevel.eval ρ l₂ := by have hfind : l₂.find? p₂ = some n₂ := - Batteries.RBMap.find?_some.mpr ⟨p₂, hmem, Std.ReflCmp.compare_self⟩ + RBTree.RBMap.find?_some.mpr ⟨p₂, hmem, Std.ReflCmp.compare_self⟩ simpa [evalPath, hnz₂] using NormLevel.le_eval (ρ := ρ) hfind /-- The coverage argument (level.rs:634-643, no upstream counterpart): @@ -1352,7 +1352,7 @@ theorem normLevelLe_eval {ρ : List Nat} {l₁ l₂ : NormLevel} rw [normLevelLe, List.all_eq_true] at h rw [NormLevel.eval_le] intro p₁ n₁ hf - obtain ⟨y, hymem, hycmp⟩ := Batteries.RBMap.find?_some_mem_toList hf + obtain ⟨y, hymem, hycmp⟩ := RBTree.RBMap.find?_some_mem_toList hf cases Std.LawfulEqCmp.eq_of_compare hycmp have h1 := h (p₁, n₁) hymem simp only at h1 @@ -1393,7 +1393,7 @@ theorem normLevelLe_eval {ρ : List Nat} {l₁ l₂ : NormLevel} have hvmem : n₂.vars[i] ∈ n₂.vars := Array.getElem_mem hi have hidx : n₂.vars[i].idx ∈ p₂ := by have hfind₂ : l₂.find? p₂ = some n₂ := - Batteries.RBMap.find?_some.mpr + RBTree.RBMap.find?_some.mpr ⟨p₂, hmem₂, Std.ReflCmp.compare_self⟩ exact hwf p₂ n₂ hfind₂ _ hvmem have h1ev : 1 ≤ evalParam ρ n₂.vars[i].idx := by @@ -1483,7 +1483,7 @@ theorem VarsOnPath.addVar {l : NormLevel} {idx k : UInt64} {path : Path} (hl : VarsOnPath l) (hidx : idx ∈ path) : VarsOnPath (l.addVar idx k path) := by intro p n hf v hv - rw [NormLevel.addVar, Batteries.RBMap.find?_insert] at hf + rw [NormLevel.addVar, RBTree.RBMap.find?_insert] at hf split at hf · rename_i hcmp cases Std.LawfulEqCmp.eq_of_compare hcmp @@ -1491,7 +1491,7 @@ theorem VarsOnPath.addVar {l : NormLevel} {idx k : UInt64} {path : Path} rcases NormNode.addVar_idx_mem v hv with rfl | ⟨v', hv', heq⟩ · exact hidx · rw [heq] - rw [Batteries.RBMap.findD] at hv' + rw [RBTree.RBMap.findD] at hv' cases hff : l.find? path with | some n₀ => rw [hff, Option.getD_some] at hv' @@ -1508,12 +1508,12 @@ theorem VarsOnPath.addConst {l : NormLevel} {k : UInt64} {path : Path} simp only [NormLevel.addConst] at hf split at hf · exact hl p n hf v hv - · rw [Batteries.RBMap.find?_insert] at hf + · rw [RBTree.RBMap.find?_insert] at hf split at hf · rename_i hcmp cases Std.LawfulEqCmp.eq_of_compare hcmp cases hf - rw [Batteries.RBMap.findD] at hv + rw [RBTree.RBMap.findD] at hv cases hff : l.find? path with | some n₀ => rw [hff, Option.getD_some] at hv @@ -1642,11 +1642,11 @@ end private theorem varsOnPath_seed : VarsOnPath ((∅ : NormLevel).insert [] ({} : NormNode)) := by intro p n hf v hv - rw [Batteries.RBMap.find?_insert] at hf + rw [RBTree.RBMap.find?_insert] at hf split at hf · cases hf simp at hv - · obtain ⟨y, hy, -⟩ := Batteries.RBMap.find?_some_mem_toList hf + · obtain ⟨y, hy, -⟩ := RBTree.RBMap.find?_some_mem_toList hf simp at hy /-- `subsumeVars` only filters: every survivor comes from the first @@ -1766,7 +1766,7 @@ private theorem VarsOnPath.insert_of_subset {res : NormLevel} {p1 : Path} (h0 : ∀ v ∈ n0.vars, v.idx ∈ p1) : VarsOnPath (res.insert p1 nf) := by intro p n hf v hv - rw [Batteries.RBMap.find?_insert] at hf + rw [RBTree.RBMap.find?_insert] at hf split at hf · rename_i hcmp cases Std.LawfulEqCmp.eq_of_compare hcmp @@ -1804,7 +1804,7 @@ theorem varsOnPath_subsumption {l : NormLevel} (hl : VarsOnPath l) : · exact hcur v hv · intro v hv have hf1 : l.find? p1 = some n1₀ := - Batteries.RBMap.find?_some.mpr ⟨p1, hmem, Std.ReflCmp.compare_self⟩ + RBTree.RBMap.find?_some.mpr ⟨p1, hmem, Std.ReflCmp.compare_self⟩ exact hl p1 n1₀ hf1 v hv /-! #### Subsumption: the `≤` half and the per-key characterization -/ @@ -1871,7 +1871,7 @@ private theorem processEntry_eval_le {ρ : List Nat} {p1 : Path} : /-- Keys of an `RBMap`'s `toList` are nodup (strict sortedness). -/ private theorem toList_keys_nodup (l : NormLevel) : (l.toList.map Prod.fst).Nodup := by - refine List.Pairwise.map _ ?_ Batteries.RBMap.toList_sorted + refine List.Pairwise.map _ ?_ RBTree.RBMap.toList_sorted intro a b hlt heq have hc := Batteries.RBNode.cmpLT_iff.mp hlt rw [heq] at hc @@ -1890,7 +1890,7 @@ private theorem foldl_insert_find?_of_not_mem | pn :: rest, res, p, h => by rw [List.foldl_cons, foldl_insert_find?_of_not_mem f rest _ p fun q hq => h q (List.mem_cons_of_mem _ hq)] - refine Batteries.RBMap.find?_insert_of_ne _ fun hcmp => ?_ + refine RBTree.RBMap.find?_insert_of_ne _ fun hcmp => ?_ exact h pn (List.mem_cons_self ..) (Std.LawfulEqCmp.eq_of_compare hcmp) /-- With nodup keys, the fold writes each entry exactly once. -/ @@ -1907,7 +1907,7 @@ private theorem foldl_insert_find?_self rcases List.mem_cons.mp hmem with rfl | hmem' · rw [foldl_insert_find?_of_not_mem f rest _ p fun q hq heq => hnd.1 (heq ▸ List.mem_map.mpr ⟨q, hq, rfl⟩)] - exact Batteries.RBMap.find?_insert_of_eq _ Std.ReflCmp.compare_self + exact RBTree.RBMap.find?_insert_of_eq _ Std.ReflCmp.compare_self · exact foldl_insert_find?_self f rest _ p n hmem' hnd.2 /-- Forward characterization: every entry of the model comes from an @@ -1917,7 +1917,7 @@ private theorem subsumptionModel_find?_some {l : NormLevel} {p : Path} ∃ n₀, l.find? p = some n₀ ∧ n = processEntry l.toList p n₀ := by cases hf₀ : l.find? p with | some n₀ => - obtain ⟨y, hy, hycmp⟩ := Batteries.RBMap.find?_some_mem_toList hf₀ + obtain ⟨y, hy, hycmp⟩ := RBTree.RBMap.find?_some_mem_toList hf₀ cases Std.LawfulEqCmp.eq_of_compare hycmp refine ⟨n₀, rfl, ?_⟩ rw [subsumptionModel, @@ -1927,7 +1927,7 @@ private theorem subsumptionModel_find?_some {l : NormLevel} {p : Path} | none => rw [subsumptionModel, foldl_insert_find?_of_not_mem _ l.toList l p (fun pn hpn heq => by - rw [heq, Batteries.RBMap.find?_some.mpr + rw [heq, RBTree.RBMap.find?_some.mpr ⟨pn.1, hpn, Std.ReflCmp.compare_self⟩] at hf₀ simp at hf₀), hf₀] at hf @@ -2215,14 +2215,14 @@ private theorem le_subsumptionModel_eval {ρ : List Nat} {l : NormLevel} intro p1 n1₀ hf hlen hnz v hv rcases processEntry_var_cases l.toList n1₀ v hv with hsurv | ⟨pn, hpn, hsub, hsame, y, hy, hidx, hoff⟩ - · obtain ⟨yy, hyy, hyycmp⟩ := Batteries.RBMap.find?_some_mem_toList hf + · obtain ⟨yy, hyy, hyycmp⟩ := RBTree.RBMap.find?_some_mem_toList hf cases Std.LawfulEqCmp.eq_of_compare hyycmp have hfm := subsumptionModel_find?_of_mem hyy refine Nat.le_trans (((NormNode.eval_le (ρ := ρ)).mp (Nat.le_refl _)).2 v hsurv) ?_ simpa [evalPath, hnz] using NormLevel.le_eval (ρ := ρ) hfm · have hf₂ : l.find? pn.1 = some pn.2 := - Batteries.RBMap.find?_some.mpr + RBTree.RBMap.find?_some.mpr ⟨pn.1, hpn, Std.ReflCmp.compare_self⟩ have hnz₂ : allNZ ρ pn.1 = true := allNZ_of_isSubset hsub hnz have hlt : pn.1.length < p1.length := by @@ -2248,7 +2248,7 @@ private theorem le_subsumptionModel_eval {ρ : List Nat} {l : NormLevel} intro p1 n1₀ hf hlen hnz rcases processEntry_const_cases l.toList n1₀ with hkeep | ⟨pn, hpn, hsub, m, hmc, hmv, hexp⟩ - · obtain ⟨yy, hyy, hyycmp⟩ := Batteries.RBMap.find?_some_mem_toList hf + · obtain ⟨yy, hyy, hyycmp⟩ := RBTree.RBMap.find?_some_mem_toList hf cases Std.LawfulEqCmp.eq_of_compare hyycmp have hfm := subsumptionModel_find?_of_mem hyy have hb : NormNode.eval ρ (processEntry l.toList p1 n1₀) @@ -2258,7 +2258,7 @@ private theorem le_subsumptionModel_eval {ρ : List Nat} {l : NormLevel} rw [← hkeep] exact ((NormNode.eval_le (ρ := ρ)).mp (Nat.le_refl _)).1 · have hf₂ : l.find? pn.1 = some pn.2 := - Batteries.RBMap.find?_some.mpr + RBTree.RBMap.find?_some.mpr ⟨pn.1, hpn, Std.ReflCmp.compare_self⟩ have hnz₂ : allNZ ρ pn.1 = true := allNZ_of_isSubset hsub hnz rw [Bool.and_eq_false_iff] at hexp diff --git a/Tests/Ix/Compile/Canonicity.lean b/Tests/Ix/Compile/Canonicity.lean index f3653ac10..3cf2a4fb4 100644 --- a/Tests/Ix/Compile/Canonicity.lean +++ b/Tests/Ix/Compile/Canonicity.lean @@ -625,8 +625,11 @@ namespace AliasProvenance universe u -public def WrapA (V : Type u) : Type u := V -public def WrapB (V : Type u) : Type u := V +-- `@[expose]`: the inductives below take these as (reducible) index +-- types; without exposed bodies the compiler infers a different +-- compilation type locally than importers would and refuses to compile. +@[expose] public def WrapA (V : Type u) : Type u := V +@[expose] public def WrapB (V : Type u) : Type u := V public abbrev RelOn (C : Type u) : Type u := C → C → Prop From 9a72824bb418c50ec6d0ca5f99413b6cb8e891df Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Wed, 12 Aug 2026 16:18:07 -0400 Subject: [PATCH 08/20] fix(ffi): decode Lean.Int by value, not as a constructor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `Lean.Int` is in the compiler's `builtinRuntimeTypes`, so at runtime it shares `Nat`'s representation — a tagged scalar or a GMP mpz object; `Int.ofNat` compiles to the identity `lean_nat_to_int` and no ctor cell ever exists. The mdata `DataValue.ofInt` decode path nevertheless read it through the `LeanIxInt` ctor layout, dereferencing a tagged scalar (or reading mpz limbs as ctor fields) whenever an `Expr.mdata` KVMap carried an integer. Decode by value instead: arithmetic-shift the tagged scalar to recover the signed payload, and for mpz objects take the sign from `lean_int_dec_lt` and the magnitude from `lean_nat_abs`. `LeanIxInt` remains in use for `Ix.Int`, a genuine two-ctor inductive. Pre-existing bug surfaced by the v4.33 FFI layout audit, which found no other divergence between the hardcoded layouts and Lean v4.33.0. --- crates/ffi/src/lean_env.rs | 49 +++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/crates/ffi/src/lean_env.rs b/crates/ffi/src/lean_env.rs index 021bd1375..477ffca3e 100644 --- a/crates/ffi/src/lean_env.rs +++ b/crates/ffi/src/lean_env.rs @@ -24,16 +24,16 @@ use std::sync::Arc; use lean_ffi::nat::Nat; use lean_ffi::object::LeanNat; use lean_ffi::object::{ - LeanArray, LeanBorrowed, LeanList, LeanRef, LeanShared, + LeanArray, LeanBorrowed, LeanList, LeanOwned, LeanRef, LeanShared, }; use crate::lean::{ LeanIxAxiomVal, LeanIxConstantInfo, LeanIxConstantVal, LeanIxConstructorVal, LeanIxDataValue, LeanIxDefinitionVal, LeanIxExpr, LeanIxInductiveVal, - LeanIxInt, LeanIxLevel, LeanIxLiteral, LeanIxName, LeanIxOpaqueVal, - LeanIxQuotVal, LeanIxRecursorRule, LeanIxRecursorVal, - LeanIxReducibilityHints, LeanIxSourceInfo, LeanIxSubstring, LeanIxSyntax, - LeanIxSyntaxPreresolved, LeanIxTheoremVal, + LeanIxLevel, LeanIxLiteral, LeanIxName, LeanIxOpaqueVal, LeanIxQuotVal, + LeanIxRecursorRule, LeanIxRecursorVal, LeanIxReducibilityHints, + LeanIxSourceInfo, LeanIxSubstring, LeanIxSyntax, LeanIxSyntaxPreresolved, + LeanIxTheoremVal, }; use ix_common::env::{ @@ -824,12 +824,39 @@ fn decode_name_data_value( 2 => DataValue::OfName(decode_name(dv.get_obj(0), cache.global)), 3 => DataValue::OfNat(LeanNat::to_nat(&dv.get_obj(0))), 4 => { - let i = LeanIxInt::from_ctor(dv.get_obj(0).as_ctor()); - let nat = LeanNat::to_nat(&i.get_obj(0)); - let int = match i.as_ctor().tag() { - 0 => Int::OfNat(nat), - 1 => Int::NegSucc(nat), - tag => unreachable!("Invalid Lean.Int tag: {tag}"), + // `Lean.Int` is a builtin runtime type sharing `Nat`'s + // representation — a tagged scalar or a GMP mpz object, never an + // `ofNat`/`negSucc` ctor cell (`Int.ofNat` compiles to the + // identity `lean_nat_to_int`). Decode by value and rebuild the + // ctor view; `LeanIxInt` describes only the `Ix.Int` mirror + // inductive, which really is a two-ctor object. + let iobj = dv.get_obj(0); + let int = if iobj.is_scalar() { + // Scalars box `v` as `(v << 1) | 1`; an arithmetic shift + // recovers the signed value. + let v = (iobj.as_raw() as isize) >> 1; + if v >= 0 { + Int::OfNat(Nat::from(v as u64)) + } else { + Int::NegSucc(Nat::from((-(v + 1)) as u64)) + } + } else { + let neg = unsafe { + lean_ffi::include::lean_int_dec_lt( + iobj.as_raw(), + lean_ffi::include::lean_box(0), + ) + } != 0; + let abs = unsafe { + LeanOwned::from_raw(lean_ffi::include::lean_nat_abs(iobj.as_raw())) + }; + let mag = LeanNat::to_nat(&abs); + if neg { + // negSucc n = -(n + 1), so n = |v| - 1 (|v| ≥ 1 here). + Int::NegSucc(Nat(mag.0 - 1u32)) + } else { + Int::OfNat(mag) + } }; DataValue::OfInt(int) }, From 495d3a6ef790fc26e4163c5eeebc6c0db981477f Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Wed, 12 Aug 2026 17:29:34 -0400 Subject: [PATCH 09/20] docs: Add v4.33 bump handoff Records the lean4lean integration steps and their verification queue, the open kernel-semantics divergences from upstream (theorem opacity, the IxVM syntactic zero test, the deliberately-unenforced mutual universe uniformity, missing regression fixtures), the divergences considered and cleared during the audit, and the non-blocking follow-ups (FFI pointer liveness, benchmark re-baselining, thread-pool stack ordering, OpenSSL link watch, setup-file JSON parsing). --- HANDOFF.md | 213 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100644 HANDOFF.md diff --git a/HANDOFF.md b/HANDOFF.md new file mode 100644 index 000000000..3bdecf3a6 --- /dev/null +++ b/HANDOFF.md @@ -0,0 +1,213 @@ +# Handoff: Lean v4.33.0 bump — remaining integration work + +Status of this branch (`update/lean-v4.33.0`): ix is adapted to Lean v4.33.0 +and verified as far as is possible without lean4lean. `lake build Ix` is +green, `cargo check --workspace` is clean, the Rust kernel's 674 tests pass, +and every ix-side test target compiles. The one dependency blocker is the +`lean4lean` pin (v4.31-era, does not compile under v4.33); the test suite and +lint gate execute lean4lean-linked binaries and are queued behind it. + +This file records everything still open from the v4.29 → v4.33 release-notes +audit: the lean4lean integration steps, kernel-semantics divergences between +ix's checkers and the upstream Lean kernel (open and cleared), and +non-blocking follow-ups. Ingest fully before starting integration. + +## 1. lean4lean: why the bump matters + +The pinned lean4lean (`5e5bb767`, in `lakefile.lean`) reproduces the kernel +soundness bug fixed upstream in Lean v4.32.1 (leanprover/lean4#14498): its +`addOpaque` (`Lean4Lean/Environment.lean:64-72` at the pinned rev) never +calls `checkNoMVarNoFVar` on the opaque's *value*, so it accepts the +axiom-free `False` construction from leanprover/lean4#14484. Reachable from +ix via `Benchmarks/Lean4Lean.lean:209` (`.opaqueInfo → addDeclAt`). + +Upstream `digama0/lean4lean` master has the complete v4.32/v4.33 hardening: +`779c51fde` (the #14498 value check + `Tests/DeclFVar.lean`), `d7e70a5f0` +(nested-inductive phantom params, #14577), `5518bf838` (mutual `levelParams` +uniformity #14608, reserved `_nested` prefix #14616, `checkNoMVarNoFVar` on +inductive/ctor types #14607, + `Tests/KernelHardening.lean`), and the +verified level-normalization algorithm enabled in the typechecker. + +The fork update is being done as `argumentcomputer/lean4lean` PR #4 +(`jcb/formalization2`) — formalization on top of latest upstream. Do not +integrate an intermediate state; wait for it to land on the fork's dev. + +## 2. Integration steps once lean4lean lands + +1. **Bump the pin.** In `lakefile.lean`, set the `lean4lean` rev to the new + dev tip; `lake update lean4lean`. Confirm its `lean-toolchain` is stable + `leanprover/lean4:v4.33.0` (upstream tracks rc toolchains). + +2. **Run the suite**: `lake test`. First actual execution on v4.33. + Watch-points from the audit: + - `Tests/FFI/Refcount.lean` — v4.30's borrow-inference overhaul + (leanprover/lean4#12830, #13136 RC coalescing) may shift caller-side + inc/dec counts. Diagnose with `trace.Compiler.inferBorrow` before + adjusting expectations. + - `Tests/Ix/Kernel/CheckEnv.lean:191-192` pins private `Std.Time` names + (`Std.Time.PlainTime.format._sparseCasesOn_1`); `Std.Time` was + refactored in v4.32 and the fixtures may not resolve. + - Decompile roundtrip — v4.30 #12987 introduced `foo._f` helper + constants for structural recursion. `classifyAuxGen` + (`Ix/CallSiteSurgery.lean`) deliberately routes unknown suffixes to the + plain-definition path and ix's own v4.33 oleans contain no `._f`, but + dependency environments may carry them; the roundtrip suite confirms. + - `Ix/Tc/Primitive.lean:221-222` hard-codes canonical addresses for + `PUnit._sizeOf_1` and `SizeOf.sizeOf`; v4.31 #13320 un-exposed + auto-generated `sizeOf` definitions, which can invalidate those hashes. + - Expect broad content-address churn vs v4.29-era artifacts and + re-baseline rather than debug: derived Prop instances flipped + `def`→`theorem` (v4.31 #13304), imported `partial` defs regain their + marking across module boundaries (v4.33 #14609), `Float`/`Float32` + were redefined around `Float.Model`, derived `BEq`/`Inhabited` bodies + changed, and several core decls changed exposure/reducibility. All + `.ixe` fixtures and pinned address tables from v4.29 will differ. + +3. **Run the lint gate**: `lake lint -- --wfail -v`. Not yet run on v4.33; + v4.31 enabled `linter.redundantVisibility` (ix: ~174 files with `public + section` + explicit `public`, ~800 `private` decls), + `linter.redundantExpose` (`Ix/Lib.lean:11`), and + `warning.simp.varHead`/`otherHead` (~257 `@[simp]`s). Escape hatch: + `leanOptions := #[⟨`linter.redundantVisibility, false⟩]`; prefer fixing + genuinely redundant modifiers. + +4. **Limits, only if they fire.** v4.31 #13030 made heartbeats accumulate + faster (upstream raised limits 20–50% in places); v4.33 #13956 bounded + kernel recursion by `maxRecDepth` instead of the physical stack. If + `IxTcVerify` or deep replays hit deterministic timeouts or + `(kernel) deep recursion`, raise the seven + `set_option maxHeartbeats 800000` sites under `Ix/Tc/Verify/` and add + `maxRecDepth` options before chasing phantom regressions. + +## 3. Kernel-semantics divergences vs upstream v4.33 — OPEN + +These are places where ix's checkers (Ix/Tc reference kernel, Rust +`crates/kernel`, IxVM model) knowingly differ from the upstream C++ kernel +after this branch. Each needs a decision or work; none is a known +unsoundness. + +- **Theorem delta-unfolding (v4.30 #12973).** Upstream made theorem bodies + kernel-opaque "in almost all ways"; ix still unfolds `.thm` like `.defn` + (`Ix/Tc/Whnf.lean:404,421`; IxVM `Ix/IxVM/Kernel/DefEq.lean:1002`, + `Whnf.lean:486,775`). Sound (theorem bodies are well-typed) but strictly + more permissive: ix can certify proofs Lean's kernel rejects. Do NOT gate + blindly — the kernel still unfolds theorems in iota-major position (see + the comment near `Ix/IxVM/Kernel/Whnf.lean:755` citing + `Rat.instEncodable._proof_1`), so a blanket gate rejects real mathlib. + The updated lean4lean is the executable spec for exactly where theorem + unfolding is allowed: replay a corpus (ix's env, then the + `Benchmarks/Compile` mathlib/FLT environments) through both checkers, + diff acceptance, then port lean4lean's exact rule into `Ix/Tc/Whnf.lean`, + the Rust kernel, and IxVM together, with a regression fixture. + +- **IxVM still uses the syntactic universe-zero test.** The Lean and Rust + kernels were fixed on this branch to classify Prop up to normalization + (`KUniv.isSemanticZero` / `is_semantic_zero`; see commit `fix(tc): + classify Prop up to universe normalization`, mirroring + leanprover/lean4#14613/#14615 — `Sort (imax 1 0)` is `Prop`). The IxVM + model retains the literal-`Zero` test (`Ix/IxVM/Kernel/DefEq.lean:647-669` + documents the old three-kernel lockstep, now stale). Until ported, IxVM + diverges from the other two ix kernels AND from upstream: proof + irrelevance, struct-eta's Prop guard, and Prop-elimination classification + can disagree on normalizable-zero universes. Port `isSemanticZero` into + the IxVM model and its fixtures as a dedicated change, and update the + lockstep comment. + +- **Mutual-block universe uniformity (v4.33 #14608) — deliberately not + enforced.** Upstream's kernel now requires identical `levelParams` across + a mutual block (only reachable via metaprogramming, only + `partial`/`unsafe`). ix checks members compositionally (cross-references + arity-checked at infer; per-member `lvls` in the `muts` form) and its own + block clustering may legitimately group members Lean never required to be + uniform — enforcing uniformity could reject valid content. Consequence: + ix accepts (metaprogrammed, unsafe) blocks upstream rejects. Revisit only + if lean4lean-parity replays surface a real case; otherwise this stands as + a documented, justified divergence. + +- **Regression-fixture ports.** ix has no fixtures for the v4.32/v4.33 + soundness-bug shapes. Port upstream's repros as Ix/Tc test fixtures: + `issue14484.lean` (opaque fvar; ix ingress rejects fvars/mvars at + `Ix/CompileM.lean:777` — the fixture pins that), `issue_14576_min.lean` + (nested phantom params; see cleared item below), and a + `Sort (imax 1 0)` Prop-classification case exercising `isSemanticZero` + end-to-end (the Rust unit tests cover `univ_eq`; an integration-level + fixture does not exist yet). + +## 4. Kernel-semantics divergences — CONSIDERED AND CLEARED + +Verified during this branch's audit; recorded so they are not re-derived. + +- **Nested-inductive phantom params (#14577/#14607): not vulnerable.** + Upstream's bug was checking ctor types only *after* nested elimination + (dropped `Ds` escaped checking). ix fully infers the declared ctor type + in its original nested form (`Ix/Tc/Check.lean:441`) before the + positivity walk (`Ix/Tc/Inductive.lean:585-624`), so the params are + checked as ordinary subterms; ix's aux expansion is ephemeral and + compile-side. The exploit's `Expr`-hash/approxDepth collision vector does + not map to Blake3 content addressing. + +- **Universe-arity at delta (v4.30 #12817): already defended.** Both + kernels check const arity at infer (`Ix/Tc/Infer.lean:63`, + `crates/kernel/src/infer.rs:99`) and error — never default — on + out-of-range substitution (`substUniv`, `tc.rs` `subst_univ`). The + egress-side `getD mkAnon` (`Ix/Tc/EgressLean.lean:63`) is display + metadata; Lean re-checks anything re-added. + +- **`_nested` reserved prefix (v4.33 #14616): no collision.** ix's + `._nested.` auxiliaries (`Ix/AuxGen/Nested.lean`) are ephemeral — never + persisted, never re-added to a Lean environment; the commit path + (`Ix/Commit.lean`) adds commitment-address names. Names are erased + metadata in anon-mode checking, so no checker-side rejection is needed. + +- **`isNeverZero` (`Ix/Tc/Inductive.lean:301`): sound as-is.** Its + true-cases are genuinely never-zero under any assignment; false just + falls through to the conservative single-ctor analysis, matching the + large-eliminator semantics. + +- **FFI/ABI across v4.29 → v4.33: no layout regression.** All 17 hardcoded + constructor layouts in `crates/ffi/src/lean.rs` were audited against + v4.33 declarations — byte-correct for both the `Ix.*` mirror types and + the real Lean kernel objects `lean_env.rs` decodes. The one real bug + found (pre-existing): `Lean.Int` decoded as a ctor when it is a + `Nat`-representation builtin — fixed on this branch (`fix(ffi): decode + Lean.Int by value`). `lean-ffi` needs no changes (bindings regenerate per + build; none of the removed/changed `lean.h` symbols are used). + +## 5. Non-blocking follow-ups + +- **FFI pointer-liveness hardening.** `crates/ffi/src/lean_env.rs:594,615` + key caches by raw `lean_object*` across a decode session; soundness rests + on callers keeping arguments alive, and v4.30's RC/borrow changes shift + free/reuse timing. v4.30 added `Runtime.hold` (#13270) for exactly this — + wrap the Lean-side callers of the env-decoding externs, or take explicit + refs in Rust. Related audit caveats: the `LeanIx*` layout types' `alloc` + path must never be pointed at real Lean types (the phantom trailing + `hash` object slot coincidentally overlays Lean's computed-field scalar, + which is safe to read one-below but wrong to allocate), and the + `assert!(i < num_obj)` bound cannot catch an off-by-one into that slot. + +- **Benchmark re-baselining.** Pre-v4.30 numbers are not comparable: the + LCNF backend rewrite landed end-to-end (~15% smaller binaries), LLVM + 19 → 22, DiscrTree fixes (~10% faster `import Mathlib`), `ByteArray` + equality is now `memcmp`, default 1GB stacks on all threads. Re-baseline + `bench.json` / CI benchmarks; do not chase cross-version deltas. + +- **Thread-pool interaction.** v4.32 #13123 reclaims idle pool workers + after 5s; reclaimed-and-respawned workers pick up the stack size current + at spawn. ix sets it via `rs_lean_set_thread_stack_size` + (`Ix/Tc/ParCheck.lean:57`) — verify it still runs before the parallel + check phase, and expect lower RSS with possible thread-churn in bursty + phases. + +- **OpenSSL now linked into the Lean runtime** (v4.32 #12030/#13988): a + plausible duplicate-symbol/version-skew source on the `net`-featured + `ix` exe, where iroh brings its own TLS stack. No breakage observed; + watch link errors on that target. + +- **`lake setup-file` JSON parsing.** `Ix/Common.lean:266-274` string-splits + the JSON and v4.33 #14300 enlarged `setup.json`; the code's own TODO asks + for a real JSON parse. + +- **`Benchmarks/CompileFC`** is deliberately frozen at Lean v4.27.0 on + upstream `lenianiva/lean4-nix` (its overlay API still works there). Do + not bump it as part of toolchain updates. From cee8934b9d50640c933359de05a432e1eec843c3 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 18 Aug 2026 10:31:18 -0400 Subject: [PATCH 10/20] chore: Bump lean4lean to dev 4844eda and Blake3 to native-decide-dynlib lean4lean 5e5bb767 -> 4844eda4. The old pin predated the v4.32.1 kernel soundness fix (leanprover/lean4#14498): its `addOpaque` never called `checkNoMVarNoFVar` on the opaque's value, so it accepted the axiom-free `False` construction from #14484 -- reachable from ix via `Benchmarks/Lean4Lean.lean:209`. The new pin also builds `--wfail` clean, which the ix lint gate needs, since 785 linter warnings and the 16 frontier sorries were cleared upstream in PR #5. Blake3 is pinned to the unmerged `native-decide-dynlib` branch: it builds `blake3-rs` as a cdylib and exposes `blake3_rs_shared`, which `ix_native_decide_dynlib` needs to supply the BLAKE3 backend to Lean's native evaluator, and that dynlib gates every `IxTcVerify` module. Move to Blake3 main once that branch merges. --- Benchmarks/Compile/lake-manifest.json | 8 ++++---- flake.nix | 2 +- lake-manifest.json | 8 ++++---- lakefile.lean | 16 +++++++++++----- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Benchmarks/Compile/lake-manifest.json b/Benchmarks/Compile/lake-manifest.json index 40bb5e64e..8b97e0dfa 100644 --- a/Benchmarks/Compile/lake-manifest.json +++ b/Benchmarks/Compile/lake-manifest.json @@ -112,10 +112,10 @@ "type": "git", "subDir": null, "scope": "", - "rev": "5e5bb767b3491d21a71908d4c58bcbaa007283bb", + "rev": "4844eda4fe376a7ab7e23a4b9755189d3c2ffe5b", "name": "lean4lean", "manifestFile": "lake-manifest.json", - "inputRev": "5e5bb767b3491d21a71908d4c58bcbaa007283bb", + "inputRev": "4844eda4fe376a7ab7e23a4b9755189d3c2ffe5b", "inherited": true, "configFile": "lakefile.toml"}, {"url": "https://github.com/leanprover/lean4-cli", @@ -132,10 +132,10 @@ "type": "git", "subDir": null, "scope": "", - "rev": "c9b2273fb9c2c33b94eba091dc4111163f5db2bc", + "rev": "730f910a59fe883cd71454bf186c7726a0c2d0d1", "name": "Blake3", "manifestFile": "lake-manifest.json", - "inputRev": "c9b2273fb9c2c33b94eba091dc4111163f5db2bc", + "inputRev": "730f910a59fe883cd71454bf186c7726a0c2d0d1", "inherited": true, "configFile": "lakefile.lean"}, {"url": "https://github.com/argumentcomputer/LSpec", diff --git a/flake.nix b/flake.nix index 526a535bf..c753ccb53 100644 --- a/flake.nix +++ b/flake.nix @@ -169,7 +169,7 @@ # lean4-nix guesses a dep's library target by capitalizing the # package name ("lean4lean" -> "Lean4lean"), but this package's # library is `Lean4Lean`. Build the stock default targets - # (Lean4Lean, the lean4lean exe, Theory, Verify) plus the + # (Lean4Lean, the lean4lean exe, Theory, Verify, Tests) plus the # shared/static facets so consumers linking exes find the # module `.o` files in the read-only store path. lean4lean = { diff --git a/lake-manifest.json b/lake-manifest.json index 2f490a921..21e937532 100644 --- a/lake-manifest.json +++ b/lake-manifest.json @@ -5,10 +5,10 @@ "type": "git", "subDir": null, "scope": "", - "rev": "5e5bb767b3491d21a71908d4c58bcbaa007283bb", + "rev": "4844eda4fe376a7ab7e23a4b9755189d3c2ffe5b", "name": "lean4lean", "manifestFile": "lake-manifest.json", - "inputRev": "5e5bb767b3491d21a71908d4c58bcbaa007283bb", + "inputRev": "4844eda4fe376a7ab7e23a4b9755189d3c2ffe5b", "inherited": false, "configFile": "lakefile.toml"}, {"url": "https://github.com/leanprover-community/batteries", @@ -35,10 +35,10 @@ "type": "git", "subDir": null, "scope": "", - "rev": "c9b2273fb9c2c33b94eba091dc4111163f5db2bc", + "rev": "730f910a59fe883cd71454bf186c7726a0c2d0d1", "name": "Blake3", "manifestFile": "lake-manifest.json", - "inputRev": "c9b2273fb9c2c33b94eba091dc4111163f5db2bc", + "inputRev": "730f910a59fe883cd71454bf186c7726a0c2d0d1", "inherited": false, "configFile": "lakefile.lean"}, {"url": "https://github.com/argumentcomputer/LSpec", diff --git a/lakefile.lean b/lakefile.lean index f059b888c..b87fbac49 100644 --- a/lakefile.lean +++ b/lakefile.lean @@ -7,8 +7,13 @@ package ix where require LSpec from git "https://github.com/argumentcomputer/LSpec" @ "e780f4188c9649aef988270f4d126651460ca9c4" +/- Pinned to the unmerged `native-decide-dynlib` branch, two commits ahead of +Blake3's main: they build `blake3-rs` as a `cdylib` in addition to the +staticlib and expose it as the `blake3_rs_shared` target, which +`ix_native_decide_dynlib` fetches to supply the BLAKE3 backend to Lean's +native evaluator. Move to main once that branch merges. -/ require Blake3 from git - "https://github.com/argumentcomputer/Blake3.lean" @ "c9b2273fb9c2c33b94eba091dc4111163f5db2bc" + "https://github.com/argumentcomputer/Blake3.lean" @ "730f910a59fe883cd71454bf186c7726a0c2d0d1" require Cli from git "https://github.com/leanprover/lean4-cli" @ "v4.33.0" @@ -20,11 +25,12 @@ require batteries from git Theory/Verify specification surface, while `bench-lean4lean` and the ignored `lean4lean` test runner exercise the implementation. The default `ix` target still does not build this dependency. Pin the audited Argument fork exactly: -this revision replaces the inductive specification placeholders with the -staged checked/generation/certificate development integrated by Pin A in -`plans/tc-verify-execution-plan.md`. -/ +this revision carries the upstream v4.32/v4.33 kernel hardening — including +the `checkNoMVarNoFVar` check on an opaque's value (leanprover/lean4#14498), +which the replay path in `Benchmarks/Lean4Lean.lean` reaches — on top of the +fork's certified inductive-environment and projection development. -/ require lean4lean from git - "https://github.com/argumentcomputer/lean4lean" @ "5e5bb767b3491d21a71908d4c58bcbaa007283bb" + "https://github.com/argumentcomputer/lean4lean" @ "4844eda4fe376a7ab7e23a4b9755189d3c2ffe5b" /-! ## FFI From 734009e6475c789a7d1e6e6199d797b07dd978e6 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 18 Aug 2026 10:31:18 -0400 Subject: [PATCH 11/20] fix(tc): Respell `try?` to keep its `EStateM.tryCatch` reachable v4.33 routes a `return` inside a `try` block through the early-return transformer, which buries the plain `EStateM.tryCatch` this reduces to and that `Ix/Tc/Verify/Whnf/Iota/ConstructorSynthesis.lean` reasons about. Spelled with `tryCatch`/`pure` instead. Both spellings denote the same function; `lake build Ix` confirms nothing downstream depended on the old elaboration. --- Ix/Tc/Whnf.lean | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Ix/Tc/Whnf.lean b/Ix/Tc/Whnf.lean index 56d425e97..dfd3666d6 100644 --- a/Ix/Tc/Whnf.lean +++ b/Ix/Tc/Whnf.lean @@ -169,12 +169,15 @@ where namespace RecM /-- Swallow any `TcError`, yielding `none` (Rust `Err(_) => return Ok(None)` - with state mutations surviving). -/ -@[inline] def try? (x : RecM m α) : RecM m (Option α) := do - try - return some (← x) - catch _ => - return none + with state mutations surviving). + +Spelled with `tryCatch` and `pure` rather than `try`/`catch` with `return`: +a `return` inside a `try` block elaborates through the early-return +transformer, burying the plain `EStateM.tryCatch` this reduces to and that +`Ix/Tc/Verify/Whnf/Iota/ConstructorSynthesis.lean` reasons about. Both +spellings denote the same function. -/ +@[inline] def try? (x : RecM m α) : RecM m (Option α) := + tryCatch (do let a ← x; pure (some a)) (fun _ => pure none) @[inline] def prims : RecM m (Primitives m) := do return (← get).prims From 27d62f010698e62da65e345e41990b51c56cc337 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 18 Aug 2026 10:31:18 -0400 Subject: [PATCH 12/20] fix(aiur): Migrate MemSizes off deprecated Lean.RBTree v4.33 deprecates `Lean.RBTree` in favour of `Std.TreeSet`, which fails the `--wfail` lint gate. `Bytecode.MemSizes` was the only Lean-side use; the API is identical except `fold` -> `foldl`. The `Batteries.Recycling.RBTree` uses in `Ix/Tc/Level.lean` and `Ix/IxonUniv.lean` are a different, non-deprecated type and are untouched. --- Ix/Aiur/Compiler/Layout.lean | 4 ++-- Ix/Aiur/Compiler/Lower.lean | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Ix/Aiur/Compiler/Layout.lean b/Ix/Aiur/Compiler/Layout.lean index ea3cc5bd8..a43f1469b 100644 --- a/Ix/Aiur/Compiler/Layout.lean +++ b/Ix/Aiur/Compiler/Layout.lean @@ -1,7 +1,7 @@ module public import Ix.Aiur.Stages.Concrete public import Ix.Aiur.Stages.Bytecode -public import Lean.Data.RBTree +public import Std.Data.TreeSet /-! Circuit layout computation for Aiur bytecode. @@ -101,7 +101,7 @@ def SharedData.maximals (a b : SharedData) : SharedData := { lookups := a.lookups.max b.lookups } -abbrev MemSizes := Lean.RBTree Nat compare +abbrev MemSizes := Std.TreeSet Nat structure LayoutMState where functionLayout : Aiur.Bytecode.FunctionLayout diff --git a/Ix/Aiur/Compiler/Lower.lean b/Ix/Aiur/Compiler/Lower.lean index 4cc3dc33b..2ae268bba 100644 --- a/Ix/Aiur/Compiler/Lower.lean +++ b/Ix/Aiur/Compiler/Lower.lean @@ -628,7 +628,7 @@ def Concrete.Decls.toBytecode (decls : Concrete.Decls) : let (body, layoutMState) ← function.compile layout let nameMap := nameMap.insert function.name functions.size let function := ⟨body, layoutMState.functionLayout, function.entry, false⟩ - let memSizes := layoutMState.memSizes.fold (·.insert ·) memSizes + let memSizes := layoutMState.memSizes.foldl (·.insert ·) memSizes pure (functions.push function, memSizes, nameMap) | _ => pure acc pure (⟨functions, memSizes.toArray⟩, nameMap) From 8caf2c866d65507ff0c60b975bf514ac1229ebd1 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 18 Aug 2026 10:31:18 -0400 Subject: [PATCH 13/20] fix: Clear the two remaining v4.33 lint warnings `BRecOn`'s `rtc` rebind after `popLocals` is dead -- nothing reads it past that point -- but the call must still run to balance the TC-side local context, so the value is discarded rather than the call removed. `wfTwoEqDef` stays a `def`: the fixture exists to pin the prop-valued-`def` constant class metaprograms emit, so `linter.defProp` is silenced at that declaration rather than obeyed. --- Ix/AuxGen/BRecOn.lean | 4 +++- Tests/Ix/Compile/LevelSpellings.lean | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Ix/AuxGen/BRecOn.lean b/Ix/AuxGen/BRecOn.lean index a6f20b6b6..95898edf8 100644 --- a/Ix/AuxGen/BRecOn.lean +++ b/Ix/AuxGen/BRecOn.lean @@ -1325,7 +1325,9 @@ TcScope::get_level on major domain returned {e}. This typically means \ let mut out : Array Level := #[] for d in indexDecls do out := out.push (← rtc.getLevel d.domain) - rtc ← rtc.popLocals indexDecls + -- The restored scope is dead — `rtc` is not read past this point — but + -- the pop still has to run to balance the TC-side local context. + _ ← rtc.popLocals indexDecls pure out let eqResult ← buildTypeBreconEqFvar ci targetIndName breconName goName recUnivs paramFvars motiveFvars motiveDecls indexFvars indexDecls diff --git a/Tests/Ix/Compile/LevelSpellings.lean b/Tests/Ix/Compile/LevelSpellings.lean index fbb4e8323..edf68641c 100644 --- a/Tests/Ix/Compile/LevelSpellings.lean +++ b/Tests/Ix/Compile/LevelSpellings.lean @@ -97,9 +97,12 @@ def wfTwo : Nat → Nat → Nat | m + 1, n => wfTwo m n termination_by m _ => m +set_option linter.defProp false in /-- Forces realization (and env persistence) of `wfTwo.eq_def`, the constant class where Lean's metaprograms store unnormalized level - spellings at Mathlib scale. -/ + spellings at Mathlib scale. Deliberately a `def` (not `theorem`): + the fixture pins the prop-valued-`def` constant class metaprograms + emit, so the `defProp` linter is silenced rather than obeyed. -/ def wfTwoEqDef := @wfTwo.eq_def end Tests.Ix.Compile.LevelSpellings From 162458b95e4210bf2aa62ce6e8002b47afbc43d1 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 18 Aug 2026 10:31:18 -0400 Subject: [PATCH 14/20] test(ixvm): Repin the Slice pattern-model entry to its v4.33 name v4.33 removed `String.Slice.Pattern.Model.NoPrefixForwardPatternModel`. `NoPrefixPatternModel` is the surviving class of the same shape -- a `Prop` class over a single forall-typed field -- which is what the entry exists to drive: it is the regression driver for `is_rec_field`'s per-peel whnf (#510). The FFT cost is still the removed constant's measurement and needs a re-baseline. --- Tests/Ix/IxVM.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Ix/IxVM.lean b/Tests/Ix/IxVM.lean index c4873db26..32a98f395 100644 --- a/Tests/Ix/IxVM.lean +++ b/Tests/Ix/IxVM.lean @@ -404,7 +404,7 @@ private def kernelCheckEntries : List (String × Nat) := [ ("IxVMInd.thmMajorUse", 496_208_616), ("IxVMInd.partialKRec", 148_779_400), ("IxVMInd.deepRebase", 208_806_873), - ("String.Slice.Pattern.Model.NoPrefixForwardPatternModel.rec", 3_262_061_945), + ("String.Slice.Pattern.Model.NoPrefixPatternModel.rec", 3_262_061_945), ("Lean.Widget.TaggedText.rec", 2_358_605_375), ("Lean.Doc.Part.rec", 2_397_535_586), ("Lean.Doc.Block.rec", 2_615_255_825), From bfc3e6ad9d05fb26018e3d12c3dfbc490061ae82 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 18 Aug 2026 10:31:18 -0400 Subject: [PATCH 15/20] chore(tc-verify): Retune the trust manifests to the new lean4lean pin The manifests are exact-match, so a *shrinking* trust boundary fails them too. Three movements at the new pin: `Lean4Lean.TrProj` no longer uses `sorryAx`, dropping it from 15 roots' `sorryOrigins`; ~56 roots no longer reach the `ctxAddrForLbrUncached` native axiom; and `canonicalAuxOrder`'s native axiom is `ax_9` rather than `ax_15`, that index being a count of `native_decide` sites in `Ix/Tc/Inductive.lean`. Both audits pass: 1796 roots in `Completed`, 7 in `Statements`. --- Ix/Tc/Verify/Audit/Completed.lean | 187 ++++++++++++++--------------- Ix/Tc/Verify/Audit/Statements.lean | 2 +- 2 files changed, 91 insertions(+), 98 deletions(-) diff --git a/Ix/Tc/Verify/Audit/Completed.lean b/Ix/Tc/Verify/Audit/Completed.lean index ca5c28b61..946c5102c 100644 --- a/Ix/Tc/Verify/Audit/Completed.lean +++ b/Ix/Tc/Verify/Audit/Completed.lean @@ -212,7 +212,7 @@ private def inductiveNative : Array Lean.Name := (inferNative.push (nativeAxiom `Ix.Environment `Ix.Name.mkStr._native.native_decide.ax_1)).push (nativeAxiom `Ix.Tc.Inductive - `Ix.Tc.RecM.canonicalAuxOrder._native.native_decide.ax_15) + `Ix.Tc.RecM.canonicalAuxOrder._native.native_decide.ax_9) private def enumerationFixtureNativeAxiom (name : Lean.Name) : Lean.Name := nativeAxiom `Ix.Tc.Verify.Inductive.EnumerationFixture name @@ -851,11 +851,10 @@ private def malformedBlobNative : Array Lean.Name := /- Direct upstream `sorryAx` origins. Listing the declarations, rather than merely allowing `sorryAx`, makes upstream debt movement visible in review. The certificate-bearing Lean4Lean pin discharges the former `VInductDecl.WF`, -`VEnv.addInduct`, and `VEnv.addInduct_WF` origins. -/ +`VEnv.addInduct`, `VEnv.addInduct_WF`, and `TrProj` origins. -/ private def forallEInv : Lean.Name := ``Lean4Lean.VEnv.IsDefEqU.forallE_inv_stratified private def sortInv : Lean.Name := ``Lean4Lean.VEnv.IsDefEqU.sort_inv -private def trProjSorry : Lean.Name := ``Lean4Lean.TrProj private def typingDebt : Array Lean.Name := #[forallEInv, sortInv] @@ -1068,59 +1067,59 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.CheckConstSupport.abstractFVars, standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.ExecutionRequests.bind, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standardWithoutChoice }, { root := ``Ix.Tc.ExecutionRequests.tryCatch, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standardWithoutChoice }, { root := ``Ix.Tc.ExecutionRequests.runRec, standardAxioms := standard, nativeAxioms := inferNative }, { root := ``Ix.Tc.ExecutionRequests.isolateCheckErrors, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standardWithoutChoice }, { root := ``Ix.Tc.ExecutionRequests.modify, standardAxioms := standard, nativeAxioms := inferNative }, { root := ``Ix.Tc.ExecutionRequests.weaken, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standardWithoutChoice }, { root := ``Ix.Tc.ExecutionRequests.of_eq, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standardWithoutChoice }, { root := ``Ix.Tc.ExecutionRequests.intern_eq_of_nil, standardAxioms := standard, nativeAxioms := inferNative }, { root := ``Ix.Tc.RunAssumptions.initial, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunAssumptions.requestBounds, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := expressionNative }, { root := ``Ix.Tc.RunAssumptions.internExpr_spec, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunAssumptions.internUniv_spec, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunSupport.CoversIntern.of_expr_univs, standardAxioms := standardWithoutChoice }, { root := ``Ix.Tc.RunAssumptions.lift_spec, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunAssumptions.subst_spec, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunAssumptions.simulSubst_spec, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunAssumptions.instRev_spec, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunAssumptions.abstractFVarsCached_spec, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunAssumptions.abstractFVars_spec, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunAssumptions.instantiateUnivParams_wf, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunAssumptions.runIntern_supported_wf, standardAxioms := standard, nativeAxioms := blake3Native }, { root := ``Ix.Tc.RunAssumptions.lift_wf, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunAssumptions.subst_wf, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunAssumptions.simulSubst_wf, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunAssumptions.instRev_wf, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunAssumptions.abstractFVars_wf, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunAssumptions.instUniv_wf, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.AmbientNat.supportExecution, standardAxioms := standard, nativeAxioms := inferNative, forbiddenDependencies := legacyWholeEnv }, @@ -1580,9 +1579,9 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.TcM.runIntern_whnf_eval, standardAxioms := standard, nativeAxioms := blake3Native }, { root := ``Ix.Tc.RunAssumptions.simulSubst_whnf_wf, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunAssumptions.simulSubst_whnf_eval, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.WhnfMeaning.beta, standardAxioms := standard, nativeAxioms := expressionNative }, { root := ``Ix.Tc.WhnfMeaning.letE, @@ -1636,9 +1635,9 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.TcM.lookupLetVal_eval, standardAxioms := standard, nativeAxioms := expressionNative }, { root := ``Ix.Tc.RunAssumptions.lift_whnf_wf, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunAssumptions.lift_whnf_eval, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.WhnfMeaning.zetaVar, standardAxioms := standard, nativeAxioms := expressionNative }, { root := ``Ix.Tc.WhnfMeaning.zetaFVar, @@ -1685,7 +1684,7 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.WhnfMeaning.registeredDefEq, standardAxioms := standard }, { root := ``Ix.Tc.InductiveReductionOracle.projection, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := expressionNative }, { root := ``Ix.Tc.InductiveReductionOracle.iota, standardAxioms := standard, nativeAxioms := inferNative }, { root := ``Ix.Tc.RecM.whnfCoreWithFlagsStep_projection, @@ -2427,10 +2426,10 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := inferNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RunAssumptions.subst_whnf_wf, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RunAssumptions.subst_whnf_eval, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.whnfCoreWithFlagsStep_letE, standardAxioms := standard, nativeAxioms := inferNative, @@ -2498,7 +2497,7 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.InternUpdateFrame.trans, standardAxioms := standardWithoutChoice }, { root := ``Ix.Tc.RunAssumptions.internExpr_whnf_eval, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.finishAppResult_eq_foldlM, standardAxioms := standard, nativeAxioms := expressionNative }, @@ -2508,12 +2507,12 @@ private def roots : Array RootAllowance := #[ standardAxioms := standardWithoutQuot, nativeAxioms := expressionNative }, { root := ``Ix.Tc.RecM.FinishAppRequests.support, - standardAxioms := standard, nativeAxioms := inferNative }, + standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RecM.FinishAppRequests.foldlM_eval, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.FinishAppRequests.eval, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.FinishAppRequests.final_eq_spec, standardAxioms := standard, nativeAxioms := expressionNative }, @@ -3298,13 +3297,13 @@ private def roots : Array RootAllowance := #[ -- and finite support from the exact projection/application request list. -- The registered Theory equation remains an explicit premise. { root := ``Ix.Tc.RecM.StructEtaFieldRequests.support, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.StructEtaFieldRequests.eval, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.StructEtaBuildRequests.eval, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.StructEtaIotaSuccessTrace.acceptance_of_requests, standardAxioms := standard, nativeAxioms := inferNative, @@ -3429,10 +3428,10 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.StructEtaBuildRequests.wf, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.finishStructEtaAfterSort_wf_of_requests, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, -- CacheShell: both structural-core cache partitions now have explicit @@ -3532,7 +3531,7 @@ private def roots : Array RootAllowance := #[ -- ApplicationRebuild: a finite census now executes each dynamic changed-head rebuild and -- returns its exact intern frame, support, and transported Theory meaning. { root := ``Ix.Tc.RecM.changedHeadFinish_acceptance, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, sorryOrigins := typingDebt, forbiddenDependencies := legacyWholeEnv }, @@ -3673,7 +3672,7 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.NatOffsetCleanupInputOracle, - standardAxioms := standard, nativeAxioms := expressionNative, + standardAxioms := standardWithoutChoice, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.cleanupNatOffsetMajor_state_wf, standardAxioms := standard, nativeAxioms := expressionNative, @@ -3711,10 +3710,10 @@ private def roots : Array RootAllowance := #[ standardAxioms := standardWithoutQuot, nativeAxioms := expressionNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.IotaArgsInternRequests.wfList, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.IotaArgsInternRequests.wfArray, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.applyIotaArg_true_state_wf, standardAxioms := standard, nativeAxioms := expressionNative, @@ -3723,19 +3722,17 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := expressionNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.IotaRuleRequests, - standardAxioms := standardWithoutQuot, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.IotaRuleRequestCensus, - standardAxioms := standardWithoutQuot, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.applyIotaRule_state_wf_of_requests, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryApplyIotaCtor_state_wf_of_requests, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.TryApplyIotaCtorPreserves.of_requests, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.StructEtaFinishRequests, standardAxioms := standardWithoutQuot, nativeAxioms := levelNative, @@ -3744,7 +3741,7 @@ private def roots : Array RootAllowance := #[ standardAxioms := standardWithoutQuot, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.StructEtaFinishPreserves.of_requests, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.StructEtaIotaPreserves.of_components, standardAxioms := standard, nativeAxioms := inferNative, @@ -3777,25 +3774,25 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := expressionNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.KSynthCandidateInputOracle, - standardAxioms := standard, nativeAxioms := expressionNative, + standardAxioms := standardWithoutChoice, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.FinishAppRequests.state_wf, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.verifyKSynthCandidate_state_wf_of_requests, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.selectKSynthCandidate_state_wf_of_requests, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.synthCtorWhenK_state_wf_of_requests, standardAxioms := standard, nativeAxioms := inferNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.verifyKSynthCandidate_state_wf_of_inputs, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.selectKSynthCandidate_state_wf_of_inputs, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.synthCtorWhenK_state_wf_of_inputs, standardAxioms := standard, nativeAxioms := inferNative, @@ -3856,12 +3853,12 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := expressionNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryProjAppReduceFinished_app_optional_wf, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, sorryOrigins := typingDebt, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryProjAppReduceFinished_optional_wf_of_contexts, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, sorryOrigins := typingDebt, forbiddenDependencies := legacyWholeEnv }, -- StringPrimitive: the production String primitive helper is exhaustive over every @@ -3885,8 +3882,6 @@ private def roots : Array RootAllowance := #[ -- exposes all intermediate support obligations instead of assuming that -- support for the final node retroactively makes those interns safe. { root := ``Ix.Tc.ProjectionDefinitionRequestCensus, - standardAxioms := standardWithoutQuot, - nativeAxioms := expressionNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.ProjectionDefinitionReflection, standardAxioms := standard, nativeAxioms := expressionNative, @@ -3895,14 +3890,14 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := expressionNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.FinishAppRequests.finishAppResult_wf, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryReduceProjectionDefinition_inv_wf, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryReduceProjectionDefinition_optional_wf_of_contexts, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, -- Quotient: quotient reduction derives the selected major's support and -- translation from its real application-spine position, executes the @@ -3919,13 +3914,13 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := expressionNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryQuotReduceSelected_inv_wf, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryQuotReduce_inv_wf, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryQuotReduce_optional_wf_of_contexts, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, -- BaseReductions: the five active no-acceleration reducers are assembled into the -- exact production base oracle for either successor policy. Native and @@ -3935,7 +3930,7 @@ private def roots : Array RootAllowance := #[ forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.NoDeltaBaseContext.oracle, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := legacyWholeEnv }, -- Reducer: Reducer's structural reducer and BaseReductions's active base oracle now feed -- the real bounded, keyed, transient-aware, cache-writing public @@ -3945,7 +3940,7 @@ private def roots : Array RootAllowance := #[ forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.NoDeltaDriverContext.wf, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := legacyWholeEnv }, -- FullStep--Closure: the exhaustive full-WHNF step is connected to exact -- definition/theorem certificates. Stable unfold-cache provenance covers @@ -3968,25 +3963,25 @@ private def roots : Array RootAllowance := #[ sorryOrigins := typingDebt, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.unfoldConstValue_trusted_wf, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, sorryOrigins := typingDebt, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.TrustedDeltaCensus, - standardAxioms := standard, nativeAxioms := univOnlyNative, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryDeltaUnfold_trusted_wf, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, sorryOrigins := typingDebt, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.deltaUnfoldOne_trusted_wf, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, sorryOrigins := typingDebt, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.TrustedDeltaContext, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.TrustedDeltaContext.wfAt, - standardAxioms := standard, nativeAxioms := inferNative, + standardAxioms := standard, nativeAxioms := levelNative, sorryOrigins := typingDebt, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.FullWhnfStepContext.ofTrustedDelta, @@ -4004,7 +3999,7 @@ private def roots : Array RootAllowance := #[ forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.K1ClosureContext.closedAt, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.AmbientNat.structEtaInferOnlyRun, standardAxioms := standard, nativeAxioms := expressionNameNative, @@ -4849,7 +4844,7 @@ private def roots : Array RootAllowance := #[ forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.NatCollapseRequestCensus.of_result_shape, standardAxioms := standard, nativeAxioms := contextNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.NatCollapseRequestCensus.certify, standardAxioms := standard, nativeAxioms := inferNative, @@ -4870,7 +4865,7 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.RecM.tryReduceNatWithSuccMode_collapse_optional_wf_of_boundaries, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryReduceNatWithSuccMode_stuck_short, standardAxioms := standard, nativeAxioms := contextNative, @@ -4882,17 +4877,17 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.RecM.tryReduceNatWithSuccMode_stuck_optional_wf_of_boundary, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryReduceNatWithSuccMode_optional_wf_of_boundaries, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryReduceNatWithSuccMode_optional_wf_of_lazy_boundaries, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.AmbientNat.succStuckReduction, standardAxioms := standard, @@ -5785,10 +5780,10 @@ private def roots : Array RootAllowance := #[ -- Inference and DefEq consume the same predecessor table and suffix model; -- their fixed-universe pair closes before it is joined to the four WHNF - -- fields. `TrProj` remains a separately named upstream debt origin. + -- fields. { root := ``Ix.Tc.UncachedInference.Context.nextInfer_wf, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.Methods.InferDefEqClosedAt, standardAxioms := standard, nativeAxioms := inferNative, @@ -5798,11 +5793,11 @@ private def roots : Array RootAllowance := #[ forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.InferDefEqClosureContext.layer, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.InferDefEqClosureContext.closedAt, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := k1ForbiddenDependencies }, -- Legacy all-depth six-field knot assembly under the canonical production @@ -5828,11 +5823,11 @@ private def roots : Array RootAllowance := #[ forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecursiveMethodClosureContext.closedAt, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecursiveMethodClosureContext.methodsN, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := k1ForbiddenDependencies }, -- The all-depth closure interface is provably unusable for a @@ -6008,11 +6003,11 @@ private def roots : Array RootAllowance := #[ forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.checkTypePipeline_sound, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.checkValuePipeline_sound, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.Methods.FullInferenceWFAtOn.ofTypedIngress, standardAxioms := standard, nativeAxioms := blake3Native, @@ -6101,11 +6096,9 @@ private def roots : Array RootAllowance := #[ forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.inferUncached_nat_full_wf, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := #[trProjSorry], forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.inferUncached_str_full_wf, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := #[trProjSorry], forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.FullInferenceStepContext, standardAxioms := standard, nativeAxioms := inferNative, @@ -6191,15 +6184,15 @@ private def roots : Array RootAllowance := #[ forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.inferUncached_full_wf, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.inferWith_full_wf, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.infer_full_wf, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.TcM.PreservesInferOnly.instantiateUnivParams, standardAxioms := standard, nativeAxioms := levelNative, @@ -6235,18 +6228,18 @@ private def roots : Array RootAllowance := #[ forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecursiveMethodClosureContext.next_fullInferenceWFAt, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.Methods.methodsOut_fullInferenceWFAt, standardAxioms := standard, nativeAxioms := blake3Native, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecursiveMethodClosureContext.methodsN_fullInferenceWFAt, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecursiveMethodClosureContext.publicInfer_full_wf, standardAxioms := standard, nativeAxioms := inferNative, - sorryOrigins := typingDebt.push trProjSorry, + sorryOrigins := typingDebt, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.TcM.checkConst.rollback_on_error, standardAxioms := standard, nativeAxioms := inductiveNative, diff --git a/Ix/Tc/Verify/Audit/Statements.lean b/Ix/Tc/Verify/Audit/Statements.lean index 207fd8393..4242776a3 100644 --- a/Ix/Tc/Verify/Audit/Statements.lean +++ b/Ix/Tc/Verify/Audit/Statements.lean @@ -87,7 +87,7 @@ private def checkConstNative : Array Lean.Name := #[ nativeAxiom `Ix.Environment `Ix.Name.mkStr._native.native_decide.ax_1, nativeAxiom `Ix.Tc.Inductive - `Ix.Tc.RecM.canonicalAuxOrder._native.native_decide.ax_15 + `Ix.Tc.RecM.canonicalAuxOrder._native.native_decide.ax_9 ] private def roots : Array RootAllowance := #[ From 1b28d7ec13ef18a05485ee7ae1603f71461ea920 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 18 Aug 2026 10:31:19 -0400 Subject: [PATCH 16/20] fix(tc-verify): Port IxTcVerify to v4.33 and the new lean4lean surface Nothing downstream of lean4lean compiled under the old pin, so all of this only surfaced once the dependency built. All 438 modules build, sorry-free. Recurring causes: v4.33 elaborator. A pure `let` in `do` is a term-level `have`, not `pure _ >>= _`, so `run_pure_bind`/`ReaderT.run_pure`/`pure_bind` steps and the matching `WF.bind (WF.pure ..)` proof layers became no-ops. `do` loops carry state as a `Prod`, not an `MProd`. Guard `if`s survive as `if false = true then ..`. v4.33 simp. `simpa [f] using h` closes with reducible transparency, so it now fails where the goal and `h` differ only by delta/iota on a plain `def` (`TcM.runRec`, `StepWFAtOn`, `BlockCatalog.Contains`, `KExpr.addr` on a literal); `exact` unfolds at default transparency and succeeds. Relatedly, `runRec`'s equation lemma is eta-expanded, so naming it in a simp set does nothing against an unapplied `runRec y`. simp also stopped unfolding semireducible definitions while matching, hence `KVLCtx` is now an `abbrev`. Core/batteries. `Nat.imax` moved into the `Lean` namespace; `Batteries.RBNode.cmpLT_iff` became `RBTree.RBNode.cmpLT_iff`; `Except` has no `DecidableEq`, so `Driver/Enumeration.lean` defines one for the `native_decide` fixtures. lean4lean API. `VEnv` gained `structEtas`; `VDecl.block` became `mutualDef`; `Checked` gained `kTarget`/`kTarget_eq`; `fieldsR`/`recArgsR`/ `resultIndicesR` gained an `ElimMode` argument; `instL_lamN`/`instN_lamN` are now upstream and the local copies are deleted. Two spec decisions where the new lean4lean models both elimination modes: `SingletonRecursor` is generalized to `generation.recUvars`, while `SingletonEnumeration` gains an explicit `largeElimination` field, since its proofs are built around the fresh motive universe. `PropositionClassifierContext` gains a `universes` field bounding the size of universes the run support covers. This is needed because the classifier now splits on `u.isSemanticZero` to match production, whose positive branch routes through `Level.normalizeLevel_eval` and its `size < UInt64.size` side condition. The structure is only ever a hypothesis, so this ADDS an assumption the eventual instantiation must discharge; it mirrors the convention in `DefEq/StructuralCongruence.lean` and `DefEq/SameHeadSpine.lean`. --- Ix/Tc/Verify/Cache.lean | 2 +- Ix/Tc/Verify/Check/Acceptance.lean | 4 +- Ix/Tc/Verify/Check/BlockClassification.lean | 8 +- Ix/Tc/Verify/Check/BlockRouting.lean | 9 +- Ix/Tc/Verify/Check/DefEqBasicPolicy.lean | 21 +- Ix/Tc/Verify/Check/DefEqEtaPolicy.lean | 3 +- Ix/Tc/Verify/Check/DefEqFinalWhnfPolicy.lean | 18 +- Ix/Tc/Verify/Check/DefEqLazyDeltaPolicy.lean | 5 +- Ix/Tc/Verify/Check/DefEqNatPolicy.lean | 6 +- .../Check/DefEqProjectionDeltaPolicy.lean | 3 +- .../Verify/Check/DefEqPropositionPolicy.lean | 3 +- Ix/Tc/Verify/Check/FullInferenceKnot.lean | 2 +- Ix/Tc/Verify/Check/InferencePolicy.lean | 3 +- Ix/Tc/Verify/Check/NatAcceptance.lean | 24 +- Ix/Tc/Verify/Check/PositiveFuelSort.lean | 4 +- Ix/Tc/Verify/Check/SafetyFrame.lean | 6 +- .../Verify/Check/ScopedPositiveFuelAxiom.lean | 4 +- .../Check/ScopedPositiveFuelCertificate.lean | 1 - .../Verify/Check/UncachedInferencePolicy.lean | 2 +- .../Check/UniverseInstantiationPolicy.lean | 30 +-- Ix/Tc/Verify/Check/ValidatorFrame.lean | 6 +- Ix/Tc/Verify/Check/ValidatorSoundness.lean | 12 +- Ix/Tc/Verify/Check/WhnfBasicHelperPolicy.lean | 6 +- Ix/Tc/Verify/Check/WhnfBitVecPolicy.lean | 3 +- Ix/Tc/Verify/Check/WhnfDecidablePolicy.lean | 7 +- Ix/Tc/Verify/Check/WhnfIotaBasePolicy.lean | 2 +- .../Verify/Check/WhnfIotaRecursionPolicy.lean | 4 +- .../Verify/Check/WhnfIotaSynthesisPolicy.lean | 2 +- Ix/Tc/Verify/Check/WhnfNatPolicy.lean | 19 +- Ix/Tc/Verify/Check/WhnfProjectionPolicy.lean | 2 +- Ix/Tc/Verify/Check/WhnfReductionPolicy.lean | 18 +- Ix/Tc/Verify/Ctx.lean | 3 +- Ix/Tc/Verify/DefEq.lean | 44 ++-- .../DefEq/FinalWhnf/StructuralPrefix.lean | 4 +- Ix/Tc/Verify/DefEq/ProofIrrelevance.lean | 2 +- Ix/Tc/Verify/DefEq/PropositionClassifier.lean | 28 ++- Ix/Tc/Verify/DefEq/SpineArguments.lean | 3 +- Ix/Tc/Verify/DefEq/StoppedContinuation.lean | 18 +- Ix/Tc/Verify/DefEq/Structural.lean | 2 +- Ix/Tc/Verify/Driver/BooleanAcceptance.lean | 20 +- Ix/Tc/Verify/Driver/Enumeration.lean | 12 +- Ix/Tc/Verify/Driver/SupportedAcceptance.lean | 3 +- Ix/Tc/Verify/Env.lean | 1 + Ix/Tc/Verify/EquivalenceManager.lean | 2 +- Ix/Tc/Verify/Frame.lean | 226 +++++++++--------- .../Inductive/EnumerationAcceptance.lean | 4 +- .../Verify/Inductive/EnumerationFixture.lean | 12 +- Ix/Tc/Verify/Inductive/RuleApplication.lean | 23 -- .../Inductive/SingletonEnumeration.lean | 23 +- Ix/Tc/Verify/Inductive/SingletonFamily.lean | 8 +- Ix/Tc/Verify/Inductive/SingletonRecursor.lean | 9 +- Ix/Tc/Verify/Infer.lean | 2 +- Ix/Tc/Verify/Infer/Callbacks.lean | 7 +- Ix/Tc/Verify/Infer/LeafCases.lean | 1 - Ix/Tc/Verify/Infer/Literals.lean | 9 +- .../Infer/ProjectionClassification.lean | 1 - Ix/Tc/Verify/Infer/ProjectionTelescope.lean | 1 - Ix/Tc/Verify/Ingress/SerializedBoolean.lean | 22 +- Ix/Tc/Verify/InstL.lean | 2 +- Ix/Tc/Verify/InstUniv.lean | 42 ++-- Ix/Tc/Verify/Knot.lean | 4 +- Ix/Tc/Verify/Level.lean | 127 +++++++--- Ix/Tc/Verify/NatFixture.lean | 101 ++++---- .../Verify/RecursiveMethods/CallDomains.lean | 2 +- .../FiniteSupportBoundary.lean | 4 +- Ix/Tc/Verify/RecursiveMethods/Public.lean | 18 +- .../RecursiveMethods/ScopedCallDomains.lean | 2 +- .../RecursiveMethods/ScopedSortInference.lean | 7 +- .../RecursiveMethods/SortInference.lean | 6 +- Ix/Tc/Verify/ScopedSuffix/ClosedContext.lean | 6 +- Ix/Tc/Verify/Subst.lean | 102 ++++---- Ix/Tc/Verify/Totalization.lean | 2 - Ix/Tc/Verify/Trans.lean | 3 +- Ix/Tc/Verify/VLCtx.lean | 2 +- Ix/Tc/Verify/Whnf.lean | 111 ++++----- Ix/Tc/Verify/Whnf/Beta/DependentContexts.lean | 2 +- Ix/Tc/Verify/Whnf/Beta/Translation.lean | 3 +- .../Verify/Whnf/Delta/ClosedTranslation.lean | 14 +- .../Verify/Whnf/Iota/ConstructorDispatch.lean | 10 +- .../Whnf/Iota/ConstructorSynthesis.lean | 15 +- Ix/Tc/Verify/Whnf/Iota/Ingress.lean | 3 +- Ix/Tc/Verify/Whnf/Iota/NatOffset.lean | 8 +- Ix/Tc/Verify/Whnf/Iota/RuleInstantiation.lean | 2 +- Ix/Tc/Verify/Whnf/Iota/StringLiteral.lean | 1 + Ix/Tc/Verify/Whnf/Iota/StructEtaControl.lean | 10 +- Ix/Tc/Verify/Whnf/Iota/Substitution.lean | 10 + .../Whnf/NoDelta/ProjectionApplication.lean | 4 - Ix/Tc/Verify/Whnf/NoDelta/Quotient.lean | 4 +- Ix/Tc/Verify/Whnf/RuntimeContracts.lean | 2 - .../Verify/Whnf/StructEta/CallbackPrefix.lean | 2 +- .../Whnf/StructEta/RecursionClassifier.lean | 4 +- .../Whnf/StructEta/ScopedTelescope.lean | 2 +- .../Whnf/Structural/ApplicationStep.lean | 4 +- .../Whnf/Structural/ApplicationTails.lean | 2 +- .../Whnf/Structural/RecursiveCallbacks.lean | 2 +- .../Verify/Whnf/Structural/VariableStep.lean | 1 - 96 files changed, 685 insertions(+), 690 deletions(-) diff --git a/Ix/Tc/Verify/Cache.lean b/Ix/Tc/Verify/Cache.lean index 74386e089..307893095 100644 --- a/Ix/Tc/Verify/Cache.lean +++ b/Ix/Tc/Verify/Cache.lean @@ -473,7 +473,7 @@ theorem isRec_of_trusted {semantics : CacheSemantics} change idAddr = indAddr at href cases href rfl - simpa [hid] using htrusted + simpa [hid, CacheAuthority.stable] using htrusted theorem mono {semantics : CacheSemantics} {before after : CacheAuthority} {support : RunSupport} diff --git a/Ix/Tc/Verify/Check/Acceptance.lean b/Ix/Tc/Verify/Check/Acceptance.lean index 42419a804..37fc999c4 100644 --- a/Ix/Tc/Verify/Check/Acceptance.lean +++ b/Ix/Tc/Verify/Check/Acceptance.lean @@ -80,7 +80,7 @@ before freshness is used to install it in a new Theory environment. -/ def StandaloneAccepted (env : VEnv) : VDecl → Prop | .axiom ci => ci.toVConstant.WF env | .def ci | .opaque ci => ci.WF env - | .block _ | .example _ | .quot | .induct _ => False + | .mutualDef _ | .example _ | .quot | .induct _ => False /-- The semantic evidence retained from the two production checker paths. The type-check result is recorded for definitions as well as axioms because @@ -165,7 +165,7 @@ theorem wfOfAccepted else env.constants candidate } have hadd : env.addConst name ci = some env' := by simp [VEnv.addConst, hfresh hname, env', ci] - exact ⟨env', VDecl.WF.axiom (by simpa [ci] using haccepted) hadd⟩ + exact ⟨env', VDecl.WF.axiom (by simpa [ci, StandaloneAccepted] using haccepted) hadd⟩ | @defn nm lps kind safety hints lvls ty val leanAll block name tyV valV d hname hty hval hkind => let ci : VDefVal := diff --git a/Ix/Tc/Verify/Check/BlockClassification.lean b/Ix/Tc/Verify/Check/BlockClassification.lean index f5ba46a5d..c74b7b60c 100644 --- a/Ix/Tc/Verify/Check/BlockClassification.lean +++ b/Ix/Tc/Verify/Check/BlockClassification.lean @@ -90,7 +90,7 @@ theorem collectBlockClassFlags_wf intro concrete after _ cases hnote : flags.note member concrete with | error err => - simpa only using + exact (TcM.WF.throw (I := I) (s := after) fun _ => trivial) | ok next => simpa only using ih next after @@ -188,8 +188,10 @@ theorem classifyBlock_exact_wf simpa using congrArg List.length hempty exact hsize this rw [hflags, BlockClassFlags.foldl_mark_empty_of_nonempty kind hlist] - simpa [BlockClassFlags.finish_only] using - (TcM.WF.pure (I := I) (s := after) (a := kind) fun _ => rfl) + simp only [BlockClassFlags.finish_only] + exact + (TcM.WF.pure (I := I) (s := after) (a := kind) + (Q := fun result _ => result = kind) fun _ => rfl) /-- Concrete success corollary used to refine an existential body trace to the exact catalog kind. -/ diff --git a/Ix/Tc/Verify/Check/BlockRouting.lean b/Ix/Tc/Verify/Check/BlockRouting.lean index a35f11f74..07598a2da 100644 --- a/Ix/Tc/Verify/Check/BlockRouting.lean +++ b/Ix/Tc/Verify/Check/BlockRouting.lean @@ -79,12 +79,9 @@ private theorem tryQuestion_some_eq (hrun : (try? x).run methods before = .ok (some value) after) : x.run methods before = .ok value after := by unfold try? at hrun - rw [ReaderT.run_bind] at hrun - change EStateM.bind - (EStateM.tryCatch - (EStateM.bind (x.run methods) - (fun a state => EStateM.Result.ok (some a) state)) _) - _ before = _ at hrun + change EStateM.tryCatch + (EStateM.bind (x.run methods) + (fun a state => EStateM.Result.ok (some a) state)) _ before = _ at hrun unfold EStateM.bind EStateM.tryCatch at hrun cases hx : x.run methods before with | ok found reached => diff --git a/Ix/Tc/Verify/Check/DefEqBasicPolicy.lean b/Ix/Tc/Verify/Check/DefEqBasicPolicy.lean index 05451c52f..c4a596911 100644 --- a/Ix/Tc/Verify/Check/DefEqBasicPolicy.lean +++ b/Ix/Tc/Verify/Check/DefEqBasicPolicy.lean @@ -53,7 +53,7 @@ theorem isDefEqCall_preservesInferOnly (left right : KExpr .anon) : ((isDefEqCall left right).run methods).PreservesInferOnly := by unfold isDefEqCall - simpa using hmethods.isDefEq left right + exact hmethods.isDefEq left right /-- Infer-only validation restores the policy value which was in force at the call site, irrespective of the callback outcome. -/ @@ -72,14 +72,10 @@ theorem tryQuestion_preservesInferOnly (hx : (x.run methods).PreservesInferOnly) : ((try? x).run methods).PreservesInferOnly := by unfold try? - simp only [ReaderT.run_bind] - apply TcM.PreservesInferOnly.bind - · exact TcM.PreservesInferOnly.tryCatch - (TcM.PreservesInferOnly.bind hx - (fun value => TcM.PreservesInferOnly.pure (some value))) - (fun _ => TcM.PreservesInferOnly.pure none) - · intro result - exact TcM.PreservesInferOnly.pure result + exact TcM.PreservesInferOnly.tryCatch + (TcM.PreservesInferOnly.bind hx + (fun value => TcM.PreservesInferOnly.pure (some value))) + (fun _ => TcM.PreservesInferOnly.pure none) /-- Cheap-recursion depth is balanced by `finally`, including on errors. -/ theorem withCheapRecursionDepth_preservesInferOnly @@ -148,8 +144,7 @@ theorem natSuccOf_preservesInferOnly simp only split · exact TcM.PreservesInferOnly.pure none - · simp only [pure_bind] - refine bindIntern_preservesInferOnly + · refine bindIntern_preservesInferOnly (natExprFromValue (value - 1) : KExpr .anon) ?_ intro result simpa using TcM.PreservesInferOnly.pure (some result) @@ -180,7 +175,6 @@ theorem boolTrueReductionAllowed_preservesInferOnly {methods : Methods .anon} (source : KExpr .anon) : ((boolTrueReductionAllowed source).run methods).PreservesInferOnly := by unfold boolTrueReductionAllowed - simp only split · exact TcM.PreservesInferOnly.pure true · simp only [ReaderT.run_bind] @@ -378,8 +372,7 @@ theorem trySameHeadSpineCached_preservesInferOnly intro state split · exact TcM.PreservesInferOnly.pure none - · simp only [pure_bind] - apply TcM.PreservesInferOnly.bind + · apply TcM.PreservesInferOnly.bind (trySameHeadSpine_preservesInferOnly hmethods left right) intro result cases result with diff --git a/Ix/Tc/Verify/Check/DefEqEtaPolicy.lean b/Ix/Tc/Verify/Check/DefEqEtaPolicy.lean index 4e53c30b5..b2d0f9021 100644 --- a/Ix/Tc/Verify/Check/DefEqEtaPolicy.lean +++ b/Ix/Tc/Verify/Check/DefEqEtaPolicy.lean @@ -280,8 +280,7 @@ theorem tryEtaStructAfterConstructor_preservesInferOnly unfold tryEtaStructAfterConstructor split · exact TcM.PreservesInferOnly.pure false - · simp only [pure_bind] - refine bind_preservesInferOnly + · refine bind_preservesInferOnly (isStructLike_preservesInferOnly hmethods inductiveId) ?_ intro isStructure cases isStructure with diff --git a/Ix/Tc/Verify/Check/DefEqFinalWhnfPolicy.lean b/Ix/Tc/Verify/Check/DefEqFinalWhnfPolicy.lean index d966c4842..086e4cfe4 100644 --- a/Ix/Tc/Verify/Check/DefEqFinalWhnfPolicy.lean +++ b/Ix/Tc/Verify/Check/DefEqFinalWhnfPolicy.lean @@ -97,12 +97,9 @@ theorem tryDefEqWhnfStructural_preservesInferOnly | app leftFunction leftArgument leftInfo => cases right with | app rightFunction rightArgument rightInfo => - simp only [tryDefEqWhnfStructural, ReaderT.run_bind] - apply TcM.PreservesInferOnly.bind - (tryDefEqWhnfApp_preservesInferOnly hmethods leftFunction - leftArgument rightFunction rightArgument) - intro result - exact TcM.PreservesInferOnly.pure result + simp only [tryDefEqWhnfStructural] + exact tryDefEqWhnfApp_preservesInferOnly hmethods leftFunction + leftArgument rightFunction rightArgument | var | fvar | sort | const | lam | all | letE | prj | nat | str => simp only [tryDefEqWhnfStructural] exact TcM.PreservesInferOnly.pure none @@ -134,12 +131,9 @@ theorem tryDefEqWhnfStructural_preservesInferOnly cases right with | letE rightName rightType rightValue rightBody rightNonDependent rightInfo => - simp only [tryDefEqWhnfStructural, ReaderT.run_bind] - apply TcM.PreservesInferOnly.bind - (tryDefEqWhnfLet_preservesInferOnly hmethods name leftType leftValue - leftBody rightType rightValue rightBody) - intro result - exact TcM.PreservesInferOnly.pure result + simp only [tryDefEqWhnfStructural] + exact tryDefEqWhnfLet_preservesInferOnly hmethods name leftType + leftValue leftBody rightType rightValue rightBody | var | fvar | sort | const | app | lam | all | prj | nat | str => simp only [tryDefEqWhnfStructural] exact TcM.PreservesInferOnly.pure none diff --git a/Ix/Tc/Verify/Check/DefEqLazyDeltaPolicy.lean b/Ix/Tc/Verify/Check/DefEqLazyDeltaPolicy.lean index 9a3598303..a304299d9 100644 --- a/Ix/Tc/Verify/Check/DefEqLazyDeltaPolicy.lean +++ b/Ix/Tc/Verify/Check/DefEqLazyDeltaPolicy.lean @@ -427,10 +427,7 @@ theorem isDefEqAfterLazyDeltaStopped_preservesInferOnly by_cases hchanged : (leftCore.addr != left.addr) || (rightCore.addr != right.addr) · simp only [hchanged, if_true] - refine bind_preservesInferOnly - (isDefEqCall_preservesInferOnly hmethods leftCore rightCore) ?_ - intro answer - exact TcM.PreservesInferOnly.pure answer + exact isDefEqCall_preservesInferOnly hmethods leftCore rightCore · simp only [hchanged, Bool.false_eq_true, if_false] by_cases haddress : leftCore.addr == rightCore.addr · simp only [haddress, if_true] diff --git a/Ix/Tc/Verify/Check/DefEqNatPolicy.lean b/Ix/Tc/Verify/Check/DefEqNatPolicy.lean index ce7741290..21675013f 100644 --- a/Ix/Tc/Verify/Check/DefEqNatPolicy.lean +++ b/Ix/Tc/Verify/Check/DefEqNatPolicy.lean @@ -23,8 +23,7 @@ theorem natOffsetDecompose_preservesInferOnly intro primitives split · exact TcM.PreservesInferOnly.pure _ - · simp only [pure_bind] - refine bind_preservesInferOnly + · refine bind_preservesInferOnly (natOffset_preservesInferOnly source 0) ?_ intro result cases result with @@ -143,8 +142,7 @@ theorem tryDefEqOffsetAfterZeroMiss_preservesInferOnly intro primitives split · exact TcM.PreservesInferOnly.pure none - · simp only [pure_bind] - exact tryDefEqOffsetAfterCandidates_preservesInferOnly hmethods left right + · exact tryDefEqOffsetAfterCandidates_preservesInferOnly hmethods left right theorem tryDefEqOffsetAfterLiteral_preservesInferOnly {methods : Methods .anon} (hmethods : methods.PreservesInferOnly) diff --git a/Ix/Tc/Verify/Check/DefEqProjectionDeltaPolicy.lean b/Ix/Tc/Verify/Check/DefEqProjectionDeltaPolicy.lean index e4240fddf..809fa548d 100644 --- a/Ix/Tc/Verify/Check/DefEqProjectionDeltaPolicy.lean +++ b/Ix/Tc/Verify/Check/DefEqProjectionDeltaPolicy.lean @@ -390,8 +390,7 @@ theorem tryStructuralCongruence_preservesInferOnly simp only [tryStructuralCongruence] split · exact TcM.PreservesInferOnly.pure false - · simp only [pure_bind] - exact lazyDeltaProjReduction_preservesInferOnly hmethods hcore + · exact lazyDeltaProjReduction_preservesInferOnly hmethods hcore hnoDelta structureId field value rightValue | var | fvar | sort | const | app | lam | all | letE | nat | str => exact TcM.PreservesInferOnly.pure false diff --git a/Ix/Tc/Verify/Check/DefEqPropositionPolicy.lean b/Ix/Tc/Verify/Check/DefEqPropositionPolicy.lean index 48e2e88d5..6681c55fb 100644 --- a/Ix/Tc/Verify/Check/DefEqPropositionPolicy.lean +++ b/Ix/Tc/Verify/Check/DefEqPropositionPolicy.lean @@ -52,8 +52,7 @@ theorem isPropType_preservesInferOnly intro state split · exact TcM.PreservesInferOnly.pure _ - · simp only [pure_bind] - apply TcM.PreservesInferOnly.bind + · apply TcM.PreservesInferOnly.bind (classifyPropTypeUncached_preservesInferOnly hmethods hwhnf type) intro result intro before diff --git a/Ix/Tc/Verify/Check/FullInferenceKnot.lean b/Ix/Tc/Verify/Check/FullInferenceKnot.lean index 35b27b4e0..62bf3218d 100644 --- a/Ix/Tc/Verify/Check/FullInferenceKnot.lean +++ b/Ix/Tc/Verify/Check/FullInferenceKnot.lean @@ -220,7 +220,7 @@ theorem publicInfer_full_wf (kernelCacheSemantics proposition.model.keys trProj) trProj world support proposition.model.keys.uvars methods := context.methodsN_fullInferenceWFAt s.recFuel.toNat - simpa [TcM.infer, TcM.runRec, methods] using + exact (RecM.infer_full_wf (context.fullInferenceContext methods hmethods hpolicy hfull) hsourceSupport hsource hbefore) diff --git a/Ix/Tc/Verify/Check/InferencePolicy.lean b/Ix/Tc/Verify/Check/InferencePolicy.lean index 2345c64df..e4cde5e74 100644 --- a/Ix/Tc/Verify/Check/InferencePolicy.lean +++ b/Ix/Tc/Verify/Check/InferencePolicy.lean @@ -301,8 +301,7 @@ theorem lookupLetVal (idx : UInt64) : · exact pure _ · split · exact pure _ - · simp only [pure_bind] - apply bind (runIntern _) + · apply bind (runIntern _) intro result exact pure (some result) diff --git a/Ix/Tc/Verify/Check/NatAcceptance.lean b/Ix/Tc/Verify/Check/NatAcceptance.lean index e91c5deb8..becb4322b 100644 --- a/Ix/Tc/Verify/Check/NatAcceptance.lean +++ b/Ix/Tc/Verify/Check/NatAcceptance.lean @@ -84,18 +84,14 @@ theorem acceptanceSupport_collisionFree : acceptanceSupport.CollisionFree := by · intro left hleft right hright haddr rcases hleft with rfl | rfl <;> rcases hright with rfl | rfl · rfl - · exact False.elim (zeroAddress_ne_natAddress (by - simpa [natRef, natType, info] using haddr)) - · exact False.elim (zeroAddress_ne_natAddress (by - simpa [natRef, natType, info] using haddr.symm)) + · exact False.elim (zeroAddress_ne_natAddress haddr) + · exact False.elim (zeroAddress_ne_natAddress haddr.symm) · rfl · intro left hleft right hright haddr rcases hleft with rfl | rfl <;> rcases hright with rfl | rfl · rfl - · exact False.elim (zeroAddress_ne_natAddress (by - simpa [zeroLevel, oneLevel] using haddr.symm)) - · exact False.elim (zeroAddress_ne_natAddress (by - simpa [zeroLevel, oneLevel] using haddr)) + · exact False.elim (zeroAddress_ne_natAddress haddr.symm) + · exact False.elim (zeroAddress_ne_natAddress haddr) · rfl theorem initial_reset : TcM.reset initialState = .ok () resetState := by @@ -133,7 +129,8 @@ theorem loadedEnv_good : loadedEnv.get? goodId = some goodConcrete := by theorem reset_loaded_good : resetState.env.get? goodId = some goodConcrete := by - simpa [resetState, initialState, acceptanceEnv] using loadedEnv_good + change loadedEnv.get? goodId = some goodConcrete + exact loadedEnv_good theorem reset_loaded_nat : resetState.env.get? natId = some natConcrete := by @@ -213,7 +210,7 @@ theorem natType_translation : theorem natReference_type : worldNat.venv.HasType 0 [] (.const natName []) (.sort oneLevel.toVLevel) := by - simpa [worldNat, natConstant, oneLevel, zeroLevel] using + exact (Lean4Lean.VEnv.HasType.const (env := natEnv) (U := 0) (Γ := []) (ci := natConstant) (ls := []) natEnv_nat (by simp) rfl) @@ -235,7 +232,7 @@ theorem goodTypeEvidence : goodConstant.type := by refine ⟨natType, .sort oneLevel.toVLevel, natType_translation, ?_, oneLevel, oneLevel_view⟩ - simpa [goodConstant] using natReference_type + exact natReference_type theorem goodCheckEvidence : StandaloneCheckEvidence RawProjRel.none worldNat acceptanceSupport goodDecl := by @@ -333,7 +330,8 @@ theorem initial_fresh_member : theorem initial_loaded_good : initialState.env.get? goodId = some goodConcrete := by - simpa [initialState, acceptanceEnv] using loadedEnv_good + change loadedEnv.get? goodId = some goodConcrete + exact loadedEnv_good theorem initial_try_get_good : TcM.tryGetConst goodId initialState = .ok (some goodConcrete) initialState := by @@ -504,7 +502,7 @@ theorem reset_bad_public : have hbody : TcM.runRec (RecM.checkConst IllTypedPending.targetId) resetState = .error (.univParamOutOfRange 0 0) resetState := by - simpa [TcM.runRec, resetState] using reset_bad_body + exact reset_bad_body have hrestore : resetState.restoreCheckCachesOnError resetState = resetState := by simp [TcState.restoreCheckCachesOnError, diff --git a/Ix/Tc/Verify/Check/PositiveFuelSort.lean b/Ix/Tc/Verify/Check/PositiveFuelSort.lean index 62c8b1b4c..866747f0f 100644 --- a/Ix/Tc/Verify/Check/PositiveFuelSort.lean +++ b/Ix/Tc/Verify/Check/PositiveFuelSort.lean @@ -195,7 +195,7 @@ theorem scopedPublicInference_wf (separation : AddressSeparation) : (fun inferred _ => support inferred ∧ InferPost RawProjRel.none VerifyWorld.empty scopedModel.keys.uvars [] (.sort .zero) inferred) := by - simpa [source, result, resultUniv] using + exact (TcM.infer.sort_scoped_wf_fuel_one (initial := scopedInitialState) (model := scopedModel) (u := sourceUniv) (info := source.info) @@ -237,7 +237,7 @@ theorem scopedPublicInference_execution (RecM.inferUncached RecM.inferCall false source).run (Ix.Tc.methodsN (m := .anon) 1) scopedInitialState = .ok result afterIntern := by - simpa [source, result, resultUniv] using hintern + exact hintern have hshell := RecM.inferWith_fullMiss_success (inferRec := RecM.inferCall) (methods := Ix.Tc.methodsN (m := .anon) 1) diff --git a/Ix/Tc/Verify/Check/SafetyFrame.lean b/Ix/Tc/Verify/Check/SafetyFrame.lean index 2fcfafef9..a142a95f2 100644 --- a/Ix/Tc/Verify/Check/SafetyFrame.lean +++ b/Ix/Tc/Verify/Check/SafetyFrame.lean @@ -33,8 +33,7 @@ theorem checkNoUnsafeRefs_go_frame : state => by rw [RecM.checkNoUnsafeRefs.go] split - · simp only [bind_pure] - exact checkNoUnsafeRefs_go_frame callerSafety stack seenExprs + · exact checkNoUnsafeRefs_go_frame callerSafety stack seenExprs seenConsts methods I hfault state · cases expr with | var idx name info => @@ -65,8 +64,7 @@ theorem checkNoUnsafeRefs_go_frame : | const id levels info => simp only [pure_bind] split - · simp only [bind_pure] - exact checkNoUnsafeRefs_go_frame callerSafety stack + · exact checkNoUnsafeRefs_go_frame callerSafety stack (seenExprs.insert (KExpr.const id levels info).addr) seenConsts methods I hfault state · simp only [ReaderT.run_bind, ReaderT.run_monadLift] diff --git a/Ix/Tc/Verify/Check/ScopedPositiveFuelAxiom.lean b/Ix/Tc/Verify/Check/ScopedPositiveFuelAxiom.lean index 61a8174c7..772dc6d8b 100644 --- a/Ix/Tc/Verify/Check/ScopedPositiveFuelAxiom.lean +++ b/Ix/Tc/Verify/Check/ScopedPositiveFuelAxiom.lean @@ -281,7 +281,7 @@ theorem publicInference_wf (separation : AddressSeparation) : (fun inferred _ => support inferred ∧ InferPost RawProjRel.none world model.keys.uvars [] (.sort .zero) inferred) := by - simpa [source, result, resultUniv] using + exact (TcM.infer.sort_scoped_wf_fuel_one (initial := initialState) (model := model) (u := sourceUniv) (info := source.info) @@ -302,7 +302,7 @@ theorem inference_run (separation : AddressSeparation) : have hbody : (RecM.inferUncached RecM.inferCall false source).run methods initialState = .ok result afterIntern := by - simpa [methods, source, result, resultUniv] using hintern + exact hintern have hshell := RecM.inferWith_fullMiss_success (inferRec := RecM.inferCall) (methods := methods) (source := source) (ty := result) (key := inferKey) diff --git a/Ix/Tc/Verify/Check/ScopedPositiveFuelCertificate.lean b/Ix/Tc/Verify/Check/ScopedPositiveFuelCertificate.lean index d1f1a4f53..b9060b27e 100644 --- a/Ix/Tc/Verify/Check/ScopedPositiveFuelCertificate.lean +++ b/Ix/Tc/Verify/Check/ScopedPositiveFuelCertificate.lean @@ -148,7 +148,6 @@ theorem inference_requests : cases hget rw [initial_inferMiss] simp only - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] have hinferOnly : initialState.inferOnly = false := by rfl rw [hinferOnly] simp only [Bool.false_eq_true, if_false, ReaderT.run_pure, pure_bind, diff --git a/Ix/Tc/Verify/Check/UncachedInferencePolicy.lean b/Ix/Tc/Verify/Check/UncachedInferencePolicy.lean index 531141c0d..047063dab 100644 --- a/Ix/Tc/Verify/Check/UncachedInferencePolicy.lean +++ b/Ix/Tc/Verify/Check/UncachedInferencePolicy.lean @@ -48,7 +48,7 @@ theorem inferUncached_preservesInferOnly · exact TcM.PreservesInferOnly.pure _ · exact TcM.PreservesInferOnly.throw _ | sort u info => - simpa [inferUncached] using + simpa [inferUncached, TcM.intern] using (TcM.PreservesInferOnly.runIntern (internExprM (KExpr.mkSort (KUniv.mkSucc u)))) | const id levels info => diff --git a/Ix/Tc/Verify/Check/UniverseInstantiationPolicy.lean b/Ix/Tc/Verify/Check/UniverseInstantiationPolicy.lean index a418ed365..32b2c7e55 100644 --- a/Ix/Tc/Verify/Check/UniverseInstantiationPolicy.lean +++ b/Ix/Tc/Verify/Check/UniverseInstantiationPolicy.lean @@ -146,9 +146,7 @@ theorem instantiateUnivParams (e : KExpr .anon) intro memo split · exact statePure _ - · apply stateBind (statePure PUnit.unit) - intro _ - apply stateBind (stateLift (ofExcept (substUniv u us))) + · apply stateBind (stateLift (ofExcept (substUniv u us))) intro resultUniv apply stateBind (statePure (KExpr.mkSort resultUniv)) intro result @@ -160,9 +158,7 @@ theorem instantiateUnivParams (e : KExpr .anon) intro memo split · exact statePure _ - · apply stateBind (statePure PUnit.unit) - intro _ - apply stateBind + · apply stateBind (stateForInArray levels (Array.mkEmpty levels.size) (fun level current => do let instantiated ← @@ -175,8 +171,6 @@ theorem instantiateUnivParams (e : KExpr .anon) apply stateBind (stateLift (ofExcept (substUniv level us))) intro instantiated - apply stateBind (statePure PUnit.unit) - intro _ exact statePure (ForInStep.yield (current.push instantiated)))) intro newLevels @@ -190,9 +184,7 @@ theorem instantiateUnivParams (e : KExpr .anon) intro memo split · exact statePure _ - · apply stateBind (statePure PUnit.unit) - intro _ - apply stateBind ihf + · apply stateBind ihf intro resultF apply stateBind iha intro resultA @@ -206,9 +198,7 @@ theorem instantiateUnivParams (e : KExpr .anon) intro memo split · exact statePure _ - · apply stateBind (statePure PUnit.unit) - intro _ - apply stateBind ihty + · apply stateBind ihty intro resultTy apply stateBind ihbody intro resultBody @@ -223,9 +213,7 @@ theorem instantiateUnivParams (e : KExpr .anon) intro memo split · exact statePure _ - · apply stateBind (statePure PUnit.unit) - intro _ - apply stateBind ihty + · apply stateBind ihty intro resultTy apply stateBind ihbody intro resultBody @@ -240,9 +228,7 @@ theorem instantiateUnivParams (e : KExpr .anon) intro memo split · exact statePure _ - · apply stateBind (statePure PUnit.unit) - intro _ - apply stateBind ihty + · apply stateBind ihty intro resultTy apply stateBind ihvalue intro resultValue @@ -261,9 +247,7 @@ theorem instantiateUnivParams (e : KExpr .anon) intro memo split · exact statePure _ - · apply stateBind (statePure PUnit.unit) - intro _ - apply stateBind ih + · apply stateBind ih intro resultValue apply stateBind (statePure (KExpr.mkPrj id field resultValue)) diff --git a/Ix/Tc/Verify/Check/ValidatorFrame.lean b/Ix/Tc/Verify/Check/ValidatorFrame.lean index 57c8e56f4..dc4b37e0d 100644 --- a/Ix/Tc/Verify/Check/ValidatorFrame.lean +++ b/Ix/Tc/Verify/Check/ValidatorFrame.lean @@ -30,8 +30,7 @@ theorem validateUnivParamsSeen_go_frame : | bound, level :: stack, seen, methods, I, state => by rw [RecM.validateUnivParamsSeen.go] split - · simp only [bind_pure] - exact validateUnivParamsSeen_go_frame bound stack seen methods I state + · exact validateUnivParamsSeen_go_frame bound stack seen methods I state · cases level with | zero addr => simp only [pure_bind] @@ -181,8 +180,7 @@ theorem validateExprWellScoped_go_frame : hfault, state => by rw [RecM.validateExprWellScoped.go] split - · simp only [bind_pure] - exact validateExprWellScoped_go_frame bound stack seenExprs seenUnivs + · exact validateExprWellScoped_go_frame bound stack seenExprs seenUnivs methods I hfault state · cases expr with | var idx name info => diff --git a/Ix/Tc/Verify/Check/ValidatorSoundness.lean b/Ix/Tc/Verify/Check/ValidatorSoundness.lean index 0f4bb5e7b..9b23fd76e 100644 --- a/Ix/Tc/Verify/Check/ValidatorSoundness.lean +++ b/Ix/Tc/Verify/Check/ValidatorSoundness.lean @@ -319,7 +319,6 @@ theorem validateUnivParamsSeen_go_sound : rw [RecM.validateUnivParamsSeen.go] at hrun split at hrun · rename_i hhit - simp only [bind_pure] at hrun have htailDomain : UnivStackInDomain domain stack := by intro candidate hmem exact hstack (List.mem_cons.mpr (.inr hmem)) @@ -348,7 +347,7 @@ theorem validateUnivParamsSeen_go_sound : validateUnivParamsSeen_go_sound hdomain hcollision bound stack (seen.insert addr) (by simpa [KUniv.validationChildren] using hchildrenDomain) hlocal' - (by simpa [KUniv.validationChildren] using hexpandedFrontier) + (by simpa [KUniv.validationChildren, KUniv.addr] using hexpandedFrontier) methods state finalSeen after hrun | succ child addr => simp only [pure_bind] at hrun @@ -359,7 +358,7 @@ theorem validateUnivParamsSeen_go_sound : (child :: stack) (seen.insert addr) (by simpa [KUniv.validationChildren] using hchildrenDomain) hlocal' - (by simpa [KUniv.validationChildren] using hexpandedFrontier) + (by simpa [KUniv.validationChildren, KUniv.addr] using hexpandedFrontier) methods state finalSeen after hrun | max left right addr => simp only [pure_bind] at hrun @@ -370,7 +369,7 @@ theorem validateUnivParamsSeen_go_sound : (right :: left :: stack) (seen.insert addr) (by simpa [KUniv.validationChildren] using hchildrenDomain) hlocal' - (by simpa [KUniv.validationChildren] using hexpandedFrontier) + (by simpa [KUniv.validationChildren, KUniv.addr] using hexpandedFrontier) methods state finalSeen after hrun | imax left right addr => simp only [pure_bind] at hrun @@ -381,7 +380,7 @@ theorem validateUnivParamsSeen_go_sound : (right :: left :: stack) (seen.insert addr) (by simpa [KUniv.validationChildren] using hchildrenDomain) hlocal' - (by simpa [KUniv.validationChildren] using hexpandedFrontier) + (by simpa [KUniv.validationChildren, KUniv.addr] using hexpandedFrontier) methods state finalSeen after hrun | param idx name addr => simp only [pure_bind] at hrun @@ -396,7 +395,7 @@ theorem validateUnivParamsSeen_go_sound : (seen.insert addr) (by simpa [KUniv.validationChildren] using hchildrenDomain) hlocal' - (by simpa [KUniv.validationChildren] using hexpandedFrontier) + (by simpa [KUniv.validationChildren, KUniv.addr] using hexpandedFrontier) methods state finalSeen after hrun termination_by _ _ _ _ _ stack _ _ _ _ _ _ _ _ _ => RecM.univWorkSize stack @@ -936,7 +935,6 @@ theorem validateExprWellScoped_go_sound : rw [RecM.validateExprWellScoped.go] at hrun split at hrun · rename_i hhit - simp only [bind_pure] at hrun have htailReach : ExprStackInReach root stack := by intro item hmem exact hstack (List.mem_cons.mpr (.inr hmem)) diff --git a/Ix/Tc/Verify/Check/WhnfBasicHelperPolicy.lean b/Ix/Tc/Verify/Check/WhnfBasicHelperPolicy.lean index 7b79519ee..75c10e05c 100644 --- a/Ix/Tc/Verify/Check/WhnfBasicHelperPolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfBasicHelperPolicy.lean @@ -21,7 +21,7 @@ theorem liftTcM_preservesInferOnly {methods : Methods .anon} {x : TcM .anon alpha} (hx : x.PreservesInferOnly) : ((liftM x : RecM .anon alpha).run methods).PreservesInferOnly := by - simpa only [ReaderT.run_monadLift] using hx + exact hx /-- Compose two recursive-method actions without exposing the reader implementation at each helper proof. -/ @@ -433,7 +433,7 @@ theorem tryQuotReduce_preservesInferOnly · simp only [hsize, if_pos] exact TcM.PreservesInferOnly.pure none · simp only [hsize, if_false] - simpa only [tryQuotReduceSelected] using + exact tryQuotReduceSelected_preservesInferOnly hmethods p args 3 5 | false => simp only [Bool.false_eq_true, if_false] @@ -444,7 +444,7 @@ theorem tryQuotReduce_preservesInferOnly · simp only [hsize, if_pos] exact TcM.PreservesInferOnly.pure none · simp only [hsize, if_false] - simpa only [tryQuotReduceSelected] using + exact tryQuotReduceSelected_preservesInferOnly hmethods p args 3 4 | false => simp only [Bool.false_eq_true, if_false] diff --git a/Ix/Tc/Verify/Check/WhnfBitVecPolicy.lean b/Ix/Tc/Verify/Check/WhnfBitVecPolicy.lean index 2856c8a5a..c161a1354 100644 --- a/Ix/Tc/Verify/Check/WhnfBitVecPolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfBitVecPolicy.lean @@ -398,8 +398,7 @@ theorem tryReduceBitvecLtProp_preservesInferOnly simp only [] split · exact TcM.PreservesInferOnly.pure none - · simp only [pure_bind] - rcases htypeSpine : args[0]!.collectSpine with + · rcases htypeSpine : args[0]!.collectSpine with ⟨typeHead, typeArgs⟩ cases typeHead with | const typeId typeLevels typeInfo => diff --git a/Ix/Tc/Verify/Check/WhnfDecidablePolicy.lean b/Ix/Tc/Verify/Check/WhnfDecidablePolicy.lean index 8aa52f2c8..c3a07dc68 100644 --- a/Ix/Tc/Verify/Check/WhnfDecidablePolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfDecidablePolicy.lean @@ -258,11 +258,8 @@ theorem tryReduceDecidable_preservesInferOnly id.addr == p.intDecEq.addr || id.addr == p.intDecLt.addr with | true => simp only [if_true] - refine bind_preservesInferOnly - (tryNormalizeIntDecidable_preservesInferOnly hmethods id.addr - args) ?_ - intro result - exact TcM.PreservesInferOnly.pure result + exact tryNormalizeIntDecidable_preservesInferOnly hmethods + id.addr args | false => simp only [Bool.false_eq_true, if_false] cases hknown : !isDecLe && !isDecEq && !isDecLt with diff --git a/Ix/Tc/Verify/Check/WhnfIotaBasePolicy.lean b/Ix/Tc/Verify/Check/WhnfIotaBasePolicy.lean index fd8fcc729..5b085de0c 100644 --- a/Ix/Tc/Verify/Check/WhnfIotaBasePolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfIotaBasePolicy.lean @@ -91,7 +91,7 @@ theorem tryApplyIotaCtor_preservesInferOnly · simp only [hfields, if_pos] exact TcM.PreservesInferOnly.pure none · simp only [hfields, if_false] - simpa only [pure_bind] using + simpa only [Bool.false_eq_true, if_false, pure_bind] using (bind_preservesInferOnly (methods := methods) (next := fun result => pure (some result)) diff --git a/Ix/Tc/Verify/Check/WhnfIotaRecursionPolicy.lean b/Ix/Tc/Verify/Check/WhnfIotaRecursionPolicy.lean index d450c8f8a..15597b74f 100644 --- a/Ix/Tc/Verify/Check/WhnfIotaRecursionPolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfIotaRecursionPolicy.lean @@ -122,7 +122,7 @@ theorem computeIsRecFieldStepAfterWhnf_preservesInferOnly · simp only [hmentions, if_pos] exact TcM.PreservesInferOnly.pure (BoundedStep.done true) · simp only [hmentions] - simpa only [pure_bind] using + simpa only [Bool.false_eq_true, if_false, pure_bind] using (bindTcM_preservesInferOnly (methods := methods) (next := fun _ => pure (BoundedStep.next body)) @@ -182,7 +182,7 @@ theorem computeIsRec_preservesInferOnly refine bind_preservesInferOnly (forInArray_preservesInferOnly (methods := methods) (items := ctors) - (initial := (⟨none, PUnit.unit⟩ : MProd (Option Bool) PUnit)) ?_) ?_ + (initial := ((none, ()) : Option Bool × PUnit)) ?_) ?_ · intro ctorId state refine bindTcM_preservesInferOnly (TcM.PreservesInferOnly.tryGetConst ctorId) ?_ diff --git a/Ix/Tc/Verify/Check/WhnfIotaSynthesisPolicy.lean b/Ix/Tc/Verify/Check/WhnfIotaSynthesisPolicy.lean index 6a1e27103..ebfed6f46 100644 --- a/Ix/Tc/Verify/Check/WhnfIotaSynthesisPolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfIotaSynthesisPolicy.lean @@ -105,7 +105,7 @@ theorem finishStructEtaAfterSort_preservesInferOnly (spine.extract (recr.majorIdx + 1) spine.size)) ?_ intro result exact TcM.PreservesInferOnly.pure (some result) - simpa only [pure_bind] using htail + simpa only [Bool.false_eq_true, if_false, pure_bind] using htail theorem tryStructEtaAfterInductive_preservesInferOnly {methods : Methods .anon} (hmethods : methods.PreservesInferOnly) diff --git a/Ix/Tc/Verify/Check/WhnfNatPolicy.lean b/Ix/Tc/Verify/Check/WhnfNatPolicy.lean index 0f51d0da6..98ec1977c 100644 --- a/Ix/Tc/Verify/Check/WhnfNatPolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfNatPolicy.lean @@ -253,11 +253,8 @@ theorem tryReduceNatSuccAfterWhnf_preservesInferOnly cases hsucc : isSucc with | true => simp only [if_true] - refine bind_preservesInferOnly - (tryReduceNatSuccPeel_preservesInferOnly normalized args[0]! - offset visited) ?_ - intro result - exact TcM.PreservesInferOnly.pure result + exact tryReduceNatSuccPeel_preservesInferOnly normalized args[0]! + offset visited | false => simp only [Bool.false_eq_true, if_false] refine bind_preservesInferOnly @@ -361,10 +358,7 @@ theorem tryReduceNatWithSuccMode_preservesInferOnly exact TcM.PreservesInferOnly.pure none | false => simp only [Bool.false_eq_true, if_false, pure_bind] - refine bind_preservesInferOnly - (tryReduceNatSuccIter_preservesInferOnly hmethods args[0]!) ?_ - intro result - exact TcM.PreservesInferOnly.pure result + exact tryReduceNatSuccIter_preservesInferOnly hmethods args[0]! | false => simp only [Bool.false_eq_true, if_false, pure_bind] by_cases hsmall : args.size < 2 @@ -387,11 +381,8 @@ theorem tryReduceNatWithSuccMode_preservesInferOnly cases hpred : isPred with | true => simp only [if_true] - refine bind_preservesInferOnly - (tryReduceNatPredicate_preservesInferOnly hmethods - id.addr args) ?_ - intro result - exact TcM.PreservesInferOnly.pure result + exact tryReduceNatPredicate_preservesInferOnly hmethods + id.addr args | false => simp only [Bool.false_eq_true, if_false] refine bind_preservesInferOnly diff --git a/Ix/Tc/Verify/Check/WhnfProjectionPolicy.lean b/Ix/Tc/Verify/Check/WhnfProjectionPolicy.lean index 761e4adb5..21b1fb210 100644 --- a/Ix/Tc/Verify/Check/WhnfProjectionPolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfProjectionPolicy.lean @@ -85,7 +85,7 @@ theorem strLitToConstructor_preservesInferOnly strLitToConstructorWithPrimitives_preservesInferOnly (methods := methods) before.prims value before unfold prims - simpa only [ReaderT.run_bind, EStateM.bind, get] using htail + exact htail theorem projectDecidableFinValMinor_preservesInferOnly {methods : Methods .anon} (id : KId .anon) (field : UInt64) diff --git a/Ix/Tc/Verify/Check/WhnfReductionPolicy.lean b/Ix/Tc/Verify/Check/WhnfReductionPolicy.lean index a9aec51dc..5e5696d7d 100644 --- a/Ix/Tc/Verify/Check/WhnfReductionPolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfReductionPolicy.lean @@ -30,21 +30,21 @@ theorem whnfRec_preservesInferOnly (source : KExpr .anon) : ((whnfRec source).run methods).PreservesInferOnly := by unfold whnfRec - simpa using hmethods.whnf source + exact hmethods.whnf source theorem whnfModeRec_preservesInferOnly {methods : Methods .anon} (hmethods : methods.PreservesInferOnly) (source : KExpr .anon) (mode : NatSuccMode) : ((whnfModeRec source mode).run methods).PreservesInferOnly := by unfold whnfModeRec - simpa using hmethods.whnfMode source mode + exact hmethods.whnfMode source mode theorem whnfCoreFlagsRec_preservesInferOnly {methods : Methods .anon} (hmethods : methods.PreservesInferOnly) (source : KExpr .anon) (flags : WhnfFlags) : ((whnfCoreFlagsRec source flags).run methods).PreservesInferOnly := by unfold whnfCoreFlagsRec - simpa using hmethods.whnfCoreFlags source flags + exact hmethods.whnfCoreFlags source flags theorem inferOnlyRec_preservesInferOnly {methods : Methods .anon} (_hmethods : methods.PreservesInferOnly) @@ -59,14 +59,10 @@ private theorem tryQuestion_preservesInferOnly (hx : (x.run methods).PreservesInferOnly) : ((try? x).run methods).PreservesInferOnly := by unfold try? - simp only [ReaderT.run_bind] - apply TcM.PreservesInferOnly.bind - · exact TcM.PreservesInferOnly.tryCatch - (TcM.PreservesInferOnly.bind hx - (fun value => TcM.PreservesInferOnly.pure (some value))) - (fun _ => TcM.PreservesInferOnly.pure none) - · intro result - exact TcM.PreservesInferOnly.pure result + exact TcM.PreservesInferOnly.tryCatch + (TcM.PreservesInferOnly.bind hx + (fun value => TcM.PreservesInferOnly.pure (some value))) + (fun _ => TcM.PreservesInferOnly.pure none) theorem tryOptional_preservesInferOnly {methods : Methods .anon} {x : RecM .anon alpha} diff --git a/Ix/Tc/Verify/Ctx.lean b/Ix/Tc/Verify/Ctx.lean index f86b63090..10b1e4097 100644 --- a/Ix/Tc/Verify/Ctx.lean +++ b/Ix/Tc/Verify/Ctx.lean @@ -642,7 +642,8 @@ theorem fvars_nodup (h : CtxRecon env uvars nameOf trProj s Δ) : have h2 : List.Pairwise (fun p q : FVarId × LocalDecl .anon => p.1 ≠ q.1) s.lctx.decls.toList := h.incr.imp fun hlt heq => absurd (heq ▸ hlt) (Nat.lt_irrefl _) - simpa using List.pairwise_map.mpr h2 + simpa [List.Nodup, List.pairwise_reverse, ne_comm] using + List.pairwise_map.mpr h2 /-- The payoff: a reconciled context is well-formed at the typing level. -/ diff --git a/Ix/Tc/Verify/DefEq.lean b/Ix/Tc/Verify/DefEq.lean index 2cb1f27d3..fbf11c65d 100644 --- a/Ix/Tc/Verify/DefEq.lean +++ b/Ix/Tc/Verify/DefEq.lean @@ -1326,19 +1326,25 @@ theorem kernelInferMeaningOfMatches {keys : WhnfContextKeys} cases hkind with | infer => apply InferCacheValid.expr - (fallback := defEqCacheSemantics keys trProj - CacheSemantics.blockErrorsOnly) .infer (hsource := hsource) + (fallback := defEqCacheSemantics keys trProj <| + isPropCacheSemantics keys trProj <| + isRecCacheSemantics CacheSemantics.blockErrorsOnly) .infer (hsource := hsource) (haddr := hmatch.sourceAddr) (hctx := hmatch.2.1) simpa [kernelCacheSemantics, k1CacheSemantics, whnfCacheSemantics, - WhnfCacheValid, unfoldCacheSemantics, UnfoldCacheValid] using + WhnfCacheValid, unfoldCacheSemantics, UnfoldCacheValid, + inferCacheSemantics, InferCacheValid, defEqCacheSemantics, + DefEqCacheValid] using h.valid | inferOnly => apply InferCacheValid.expr - (fallback := defEqCacheSemantics keys trProj - CacheSemantics.blockErrorsOnly) .inferOnly (hsource := hsource) + (fallback := defEqCacheSemantics keys trProj <| + isPropCacheSemantics keys trProj <| + isRecCacheSemantics CacheSemantics.blockErrorsOnly) .inferOnly (hsource := hsource) (haddr := hmatch.sourceAddr) (hctx := hmatch.2.1) simpa [kernelCacheSemantics, k1CacheSemantics, whnfCacheSemantics, - WhnfCacheValid, unfoldCacheSemantics, UnfoldCacheValid] using + WhnfCacheValid, unfoldCacheSemantics, UnfoldCacheValid, + inferCacheSemantics, InferCacheValid, defEqCacheSemantics, + DefEqCacheValid] using h.valid theorem kernelDefEqMeaning {keys : WhnfContextKeys} @@ -1354,12 +1360,14 @@ theorem kernelDefEqMeaning {keys : WhnfContextKeys} (hctx : keys.Represents (max a.lbr b.lbr) key.2.2 Delta) : DefEqMeaning trProj authority.world keys.uvars Delta a b answer := by apply DefEqCacheValid.result (keys := keys) (trProj := trProj) - (fallback := CacheSemantics.blockErrorsOnly) (kind := kind) + (fallback := isPropCacheSemantics keys trProj <| + isRecCacheSemantics CacheSemantics.blockErrorsOnly) (kind := kind) (ha := ha) (haddrA := haddrA) (hb := hb) (haddrB := haddrB) (hctx := hctx) simpa [kernelCacheSemantics, k1CacheSemantics, whnfCacheSemantics, WhnfCacheValid, unfoldCacheSemantics, UnfoldCacheValid, - inferCacheSemantics, InferCacheValid] using h.valid + inferCacheSemantics, InferCacheValid, defEqCacheSemantics, + DefEqCacheValid] using h.valid /-- Eliminate a physical DefEq cache entry in the caller's original order. The production key stores the canonical address order, so the swapped branch @@ -1590,7 +1598,9 @@ theorem inferProvenance {trProj : RawProjRel} {world : VerifyWorld} (CacheAuthority.stable world) support (.expr .infer key ty) := hall simpa [kernelCacheSemantics, k1CacheSemantics, whnfCacheSemantics, - WhnfCacheValid, unfoldCacheSemantics, UnfoldCacheValid] using + WhnfCacheValid, unfoldCacheSemantics, UnfoldCacheValid, + inferCacheSemantics, InferCacheValid, defEqCacheSemantics, + DefEqCacheValid] using hvalid | inferOnly => have hvalid : InferCacheValid model.keys trProj @@ -1599,7 +1609,9 @@ theorem inferProvenance {trProj : RawProjRel} {world : VerifyWorld} (CacheAuthority.stable world) support (.expr .inferOnly key ty) := hall simpa [kernelCacheSemantics, k1CacheSemantics, whnfCacheSemantics, - WhnfCacheValid, unfoldCacheSemantics, UnfoldCacheValid] using + WhnfCacheValid, unfoldCacheSemantics, UnfoldCacheValid, + inferCacheSemantics, InferCacheValid, defEqCacheSemantics, + DefEqCacheValid] using hvalid /-- Turn one executed DefEq result into collision-robust provenance for the @@ -1643,7 +1655,8 @@ theorem defEqProvenance {trProj : RawProjRel} {world : VerifyWorld} exact model.defEqTransport hctx hrepresented hmeaning simpa [kernelCacheSemantics, k1CacheSemantics, whnfCacheSemantics, WhnfCacheValid, unfoldCacheSemantics, UnfoldCacheValid, - inferCacheSemantics, InferCacheValid] using hvalid + inferCacheSemantics, InferCacheValid, defEqCacheSemantics, + DefEqCacheValid] using hvalid · have hpair : canonicalPair a.addr b.addr = (b.addr, a.addr) := by simp [canonicalPair, horder] rw [hpair] at hreferences ⊢ @@ -1666,7 +1679,8 @@ theorem defEqProvenance {trProj : RawProjRel} {world : VerifyWorld} exact model.defEqTransport hctx' hrepresented hmeaning.symm simpa [kernelCacheSemantics, k1CacheSemantics, whnfCacheSemantics, WhnfCacheValid, unfoldCacheSemantics, UnfoldCacheValid, - inferCacheSemantics, InferCacheValid] using hvalid + inferCacheSemantics, InferCacheValid, defEqCacheSemantics, + DefEqCacheValid] using hvalid /-- A narrow same-head failure marker is rejection-only, so it needs no semantic transport. It still records finite source witnesses and explicit @@ -1695,7 +1709,8 @@ theorem defEqFailureProvenance {trProj : RawProjRel} {world : VerifyWorld} (.defEqFailure (a.addr, b.addr, ctxAddr)) := trivial simpa [kernelCacheSemantics, k1CacheSemantics, whnfCacheSemantics, WhnfCacheValid, unfoldCacheSemantics, UnfoldCacheValid, - inferCacheSemantics, InferCacheValid] using hvalid + inferCacheSemantics, InferCacheValid, defEqCacheSemantics, + DefEqCacheValid] using hvalid · have hpair : canonicalPair a.addr b.addr = (b.addr, a.addr) := by simp [canonicalPair, horder] rw [hpair] at hreferences ⊢ @@ -1705,7 +1720,8 @@ theorem defEqFailureProvenance {trProj : RawProjRel} {world : VerifyWorld} (.defEqFailure (b.addr, a.addr, ctxAddr)) := trivial simpa [kernelCacheSemantics, k1CacheSemantics, whnfCacheSemantics, WhnfCacheValid, unfoldCacheSemantics, UnfoldCacheValid, - inferCacheSemantics, InferCacheValid] using hvalid + inferCacheSemantics, InferCacheValid, defEqCacheSemantics, + DefEqCacheValid] using hvalid end KernelSuffixTransports diff --git a/Ix/Tc/Verify/DefEq/FinalWhnf/StructuralPrefix.lean b/Ix/Tc/Verify/DefEq/FinalWhnf/StructuralPrefix.lean index 045b3a3d2..8a48063bd 100644 --- a/Ix/Tc/Verify/DefEq/FinalWhnf/StructuralPrefix.lean +++ b/Ix/Tc/Verify/DefEq/FinalWhnf/StructuralPrefix.lean @@ -108,7 +108,7 @@ theorem tryDefEqWhnfStructural_wf (resources.constants.universes hrightSupport) hleft hright hid hlevels · rename_i leftFn leftArg leftInfo rightFn rightArg rightInfo - simpa only [bind_pure] using + exact (TryDefEqWhnfApp.ofResources resources.applications hleftSupport hrightSupport hleft hright) · apply RecM.WF.bind <| by @@ -137,7 +137,7 @@ theorem tryDefEqWhnfStructural_wf exact RecM.WF.pure fun _ => hanswer · rename_i leftName leftTy leftVal leftBody leftNondep leftInfo rightName rightTy rightVal rightBody rightNondep rightInfo - simpa only [bind_pure] using + exact (TryDefEqWhnfLet.ofResources resources.theory resources.collision resources.lets hleftSupport hrightSupport hleft hright) · rename_i leftNat leftBlob leftInfo rightNat rightBlob rightInfo diff --git a/Ix/Tc/Verify/DefEq/ProofIrrelevance.lean b/Ix/Tc/Verify/DefEq/ProofIrrelevance.lean index 399b47ab7..0dc6175be 100644 --- a/Ix/Tc/Verify/DefEq/ProofIrrelevance.lean +++ b/Ix/Tc/Verify/DefEq/ProofIrrelevance.lean @@ -32,7 +32,7 @@ theorem tryOptionalInferOnlyCall_wf | some ty => support ty ∧ InferPost trProj world uvars Delta sourceV ty | none => True) := by - simpa only [inferOnlyCall, inferOnlyRec] using + exact (tryOptionalInferOnlyRec_wf (layer := layer) (semantics := semantics) (s := state) hsourceSupport hsource) diff --git a/Ix/Tc/Verify/DefEq/PropositionClassifier.lean b/Ix/Tc/Verify/DefEq/PropositionClassifier.lean index 9cadf8b35..ddc66951b 100644 --- a/Ix/Tc/Verify/DefEq/PropositionClassifier.lean +++ b/Ix/Tc/Verify/DefEq/PropositionClassifier.lean @@ -26,6 +26,12 @@ structure PropositionClassifierContext world support model.keys.uvars references : forall {source : KExpr .anon} {id : KId .anon}, support source -> source.References id -> world.trusted id + /-- The semantic `Prop` test normalizes the universe it is handed, and + normalization only computes the `VLevel` denotation below the `UInt64` + size bound. The classifier applies it to sorts produced by direct WHNF, + which the run support already covers. -/ + universes : forall {u : KUniv .anon} {info : ExprInfo .anon}, + support (.sort u info) -> u.size < UInt64.size namespace PropositionClassifierContext @@ -51,9 +57,11 @@ end PropositionClassifierContext namespace RecM -/-- If direct WHNF exposes an inferred type as `Sort 0`, transport the -original typing derivation through both the quotient translation and the -reduction equality. -/ +/-- If direct WHNF exposes an inferred type as a semantically zero sort, +transport the original typing derivation through both the quotient +translation and the reduction equality. The exposed universe need not be +syntactically `zero`: `Sort (imax 1 0)` is `Prop` too, so the last step +goes through `sortDF` rather than a rewrite. -/ private theorem hasTypeSortZero_of_whnf {trProj : RawProjRel} {world : VerifyWorld} {uvars : Nat} {Delta : KVLCtx} (hDelta : KVLCtx.WF world.venv uvars Delta) @@ -62,14 +70,17 @@ private theorem hasTypeSortZero_of_whnf (hsourceType : world.venv.HasType uvars Delta.toCtx sourceV sortV) (hsortEq : world.venv.IsDefEqU uvars Delta.toCtx sortCoreV sortV) (hwhnf : WhnfPost trProj world uvars Delta sortCoreV (.sort u info)) - (hzero : u.isZero = true) : + (hsize : u.size < UInt64.size) + (hzero : u.isSemanticZero = true) : world.venv.HasType uvars Delta.toCtx sourceV (.sort .zero) := by obtain ⟨reducedV, hreduced, hsortReduced⟩ := hwhnf cases hreduced with | sort hlevel => have htype := hsourceType.defeqU_r world.venvWF hDelta <| hsortEq.symm.trans world.venvWF hDelta hsortReduced - simpa only [KUniv.toVLevel_of_isZero hzero] using htype + exact htype.defeqU_r world.venvWF hDelta + ⟨_, .sortDF hlevel trivial + (KUniv.toVLevel_equiv_zero_of_isSemanticZero hsize hzero)⟩ /-- The uncached classifier is conservative on every failure and non-sort result. Its sole positive case proves that the original concrete query has @@ -110,18 +121,19 @@ private theorem classifyPropTypeUncached_wf simp only exact RecM.WF.pure fun _ => IsPropMeaning.false | some reduced => - rcases hreduced with ⟨hIWhnf, _hreducedSupport, hwhnfPost⟩ + rcases hreduced with ⟨hIWhnf, hreducedSupport, hwhnfPost⟩ cases reduced with | sort u info => simp only - cases hzero : u.isZero with + cases hzero : u.isSemanticZero with | false => exact RecM.WF.pure fun _ => IsPropMeaning.false | true => exact RecM.WF.pure fun _ _ => ⟨sourceV, hsource, hasTypeSortZero_of_whnf hIWhnf.2.1.wf hsourceType - hsortEq hwhnfPost hzero⟩ + hsortEq hwhnfPost (context.universes hreducedSupport) + hzero⟩ | var | fvar | const | app | lam | all | letE | prj | nat | str => simp only exact RecM.WF.pure fun _ => IsPropMeaning.false diff --git a/Ix/Tc/Verify/DefEq/SpineArguments.lean b/Ix/Tc/Verify/DefEq/SpineArguments.lean index 42a436d0f..78cac35f7 100644 --- a/Ix/Tc/Verify/DefEq/SpineArguments.lean +++ b/Ix/Tc/Verify/DefEq/SpineArguments.lean @@ -187,7 +187,8 @@ theorem defEq_of_zip (leftPrefix ++ [leftArg]).zip (rightPrefix ++ [rightArg]) = leftPrefix.zip rightPrefix ++ [(leftArg, rightArg)] := by - simpa using List.zip_append hprefixLength + rw [List.zip_append hprefixLength] + rfl have hprefixArgs : ∀ pair, pair ∈ leftPrefix.zip rightPrefix → SpineArgDefEq trProj world uvars Delta pair.1 pair.2 := by diff --git a/Ix/Tc/Verify/DefEq/StoppedContinuation.lean b/Ix/Tc/Verify/DefEq/StoppedContinuation.lean index 7abd12ca5..dde2cdbc3 100644 --- a/Ix/Tc/Verify/DefEq/StoppedContinuation.lean +++ b/Ix/Tc/Verify/DefEq/StoppedContinuation.lean @@ -93,17 +93,15 @@ theorem isDefEqAfterLazyDeltaStopped_wf (leftCore.addr != left.addr || rightCore.addr != right.addr) with | true => simp only [if_true, pure_bind] - apply RecM.WF.bind (RecM.WF.withInv <| + refine RecM.WF.mono (RecM.WF.withInv <| RecM.isDefEqCall_wf hleftCoreSupport hrightCoreSupport - hleftCoreTr hrightCoreTr) - intro answer final hpost - rcases hpost with ⟨hI, hanswer⟩ - exact RecM.WF.pure fun _ htrue => - hleftEq.trans world.venvWF hI.2.1.wf <| - hleftCoreEq.trans world.venvWF hI.2.1.wf <| - (hanswer htrue).trans world.venvWF hI.2.1.wf <| - hrightCoreEq.symm.trans world.venvWF hI.2.1.wf - hrightEq.symm + hleftCoreTr hrightCoreTr) ?_ (fun _ _ h => h) + rintro answer final ⟨hI, hanswer⟩ htrue + exact hleftEq.trans world.venvWF hI.2.1.wf <| + hleftCoreEq.trans world.venvWF hI.2.1.wf <| + (hanswer htrue).trans world.venvWF hI.2.1.wf <| + hrightCoreEq.symm.trans world.venvWF hI.2.1.wf + hrightEq.symm | false => simp only [Bool.false_eq_true, if_false] cases haddr : leftCore.addr == rightCore.addr with diff --git a/Ix/Tc/Verify/DefEq/Structural.lean b/Ix/Tc/Verify/DefEq/Structural.lean index 42b54b18b..195fc3905 100644 --- a/Ix/Tc/Verify/DefEq/Structural.lean +++ b/Ix/Tc/Verify/DefEq/Structural.lean @@ -220,7 +220,7 @@ theorem quickDefEq_wf have hbodyTyped : world.venv.IsDefEq uvars (ty1V :: Delta.toCtx) body1V body2V bodyTy := hbodyEq.of_l world.venvWF hDeltaBody.toCtx (by - simpa [KVLCtx.toCtx] using hbody1Typed) + simpa [KVLCtx.toCtx, Lean4Lean.VEnv.HasType] using hbody1Typed) exact (Lean4Lean.VEnv.IsDefEq.lamDF hdomainTyped hbodyTyped).toU · intro _ _ _ diff --git a/Ix/Tc/Verify/Driver/BooleanAcceptance.lean b/Ix/Tc/Verify/Driver/BooleanAcceptance.lean index c7380b4ae..85a62caab 100644 --- a/Ix/Tc/Verify/Driver/BooleanAcceptance.lean +++ b/Ix/Tc/Verify/Driver/BooleanAcceptance.lean @@ -373,15 +373,13 @@ def stagedExactRecursor : theorem familyWorkCatalog : familyItem.MatchesBlockCatalog stagedWorld.blocks := by refine ⟨familyId, #[falseId, trueId], ?_, rfl, ?_⟩ - · simpa [stagedWorld, familyMembers_eq] using - stagedExactFamily.blockLookup + · exact stagedExactFamily.blockLookup · simp theorem recursorWorkCatalog : recursorItem.MatchesBlockCatalog stagedWorld.blocks := by refine ⟨recursorId, #[], ?_, rfl, ?_⟩ - · simpa [stagedWorld, recursorMembers_eq] using - stagedExactRecursor.blockLookup + · exact stagedExactRecursor.blockLookup · simp /-! ## Closed dependency graph -/ @@ -489,7 +487,8 @@ def familyResidualResources simpa [stagedWorld] using hle.nameOf let reindexed := familyBlockOracle.reindex hcatalog hnameOf have henv : reindexed.after ≤ current.venv := by - simpa [reindexed, stagedWorld] using hle.venv + simp only [reindexed, InductiveOracle.reindex_after] + exact hle.venv let oracle := reindexed.restageMissing henv current.venvWF current.trusted (by simpa [reindexed] using hmissing) @@ -506,9 +505,7 @@ def familyResidualResources dsimp only [oracle] rw [InductiveOracle.restageMissing_members_iff, InductiveOracle.reindex_members] - exact and_congr (by - simpa only [familyBlockOracle] using - familyLink.oracle_members_iff id) Iff.rfl + exact and_congr (familyLink.oracle_members_iff id) Iff.rfl } /-- Recursor analogue of `familyResidualResources`, including the E2 proof @@ -532,7 +529,8 @@ def recursorResidualResources simpa [stagedWorld] using hle.nameOf let reindexed := recursorBlockOracle.reindex hcatalog hnameOf have henv : reindexed.after ≤ current.venv := by - simpa [reindexed, stagedWorld] using hle.venv + simp only [reindexed, InductiveOracle.reindex_after] + exact hle.venv let oracle := reindexed.restageMissing henv current.venvWF current.trusted (by simpa [reindexed] using hmissing) @@ -549,9 +547,7 @@ def recursorResidualResources dsimp only [oracle] rw [InductiveOracle.restageMissing_members_iff, InductiveOracle.reindex_members] - exact and_congr (by - simpa only [recursorBlockOracle] using - recursorLink.oracle_members_iff enumerationShape id) Iff.rfl + exact and_congr (recursorLink.oracle_members_iff enumerationShape id) Iff.rfl } /-! ## Supported production calls -/ diff --git a/Ix/Tc/Verify/Driver/Enumeration.lean b/Ix/Tc/Verify/Driver/Enumeration.lean index 75a0066c3..16411f32b 100644 --- a/Ix/Tc/Verify/Driver/Enumeration.lean +++ b/Ix/Tc/Verify/Driver/Enumeration.lean @@ -16,6 +16,16 @@ collapses to its work item's root. namespace Ix.Tc +/-- `Except` carries no `DecidableEq` instance, so the `get`/`peekTag` +equations of `ExactAnonEntry` cannot otherwise build the instance the +`native_decide` fixtures need. -/ +instance {ε α : Type} [DecidableEq ε] [DecidableEq α] : + DecidableEq (Except ε α) + | .error _, .ok _ => isFalse (by simp) + | .ok _, .error _ => isFalse (by simp) + | .error a, .error b => decidable_of_iff (a = b) (by simp) + | .ok a, .ok b => decidable_of_iff (a = b) (by simp) + /-- Exact lazy entry used by the production classifier. This is a proposition, rather than a data-bearing structure, so the lazy implementation witness cannot escape the structural environment contract. -/ @@ -40,7 +50,7 @@ theorem getConst {env : Ixon.Env} {addr : Address} cases hcache : lazy.cache with | none => simp only [hcache] at hmaterialize ⊢ - simpa using congrArg Except.toOption hmaterialize + simpa [Except.toOption] using congrArg Except.toOption hmaterialize | some cached => simp only [hcache] at hmaterialize ⊢ cases hmaterialize diff --git a/Ix/Tc/Verify/Driver/SupportedAcceptance.lean b/Ix/Tc/Verify/Driver/SupportedAcceptance.lean index b5f0e51ba..8aee83791 100644 --- a/Ix/Tc/Verify/Driver/SupportedAcceptance.lean +++ b/Ix/Tc/Verify/Driver/SupportedAcceptance.lean @@ -294,8 +294,7 @@ theorem accepts (⟨blockAddr, ()⟩ : KId .anon) := by refine ⟨resources.members, ?_, resources.exactBlock.nonempty, htrusted⟩ - simpa only [admittedWorld, VerifyWorld.admitOracle] using - resources.exactBlock.blockLookup + exact resources.exactBlock.blockLookup refine ⟨admittedWorld, hle, haccepted, ?_⟩ obtain ⟨workMembers, hworkBlock, _hnonempty, _hprimary, htargets⟩ := resources.workCatalog.block_targets diff --git a/Ix/Tc/Verify/Env.lean b/Ix/Tc/Verify/Env.lean index 28ef0fe92..977558d8e 100644 --- a/Ix/Tc/Verify/Env.lean +++ b/Ix/Tc/Verify/Env.lean @@ -954,6 +954,7 @@ def promotedVEnv : VEnv where constants := fun name => if targetName = name then some theoryConstant.toVConstant else none defeqs := fun _ => False + structEtas := fun _ => False theorem raw : RawDeclRel world.venv world.nameOf RawProjRel.none targetId concrete theoryDecl := by diff --git a/Ix/Tc/Verify/EquivalenceManager.lean b/Ix/Tc/Verify/EquivalenceManager.lean index c70ec6d8d..7cc2c4719 100644 --- a/Ix/Tc/Verify/EquivalenceManager.lean +++ b/Ix/Tc/Verify/EquivalenceManager.lean @@ -240,7 +240,7 @@ theorem empty {R : EqKey → EqKey → Prop} : WF R EquivManager.empty := by /-- Resetting the manager restores the empty invariant. -/ theorem clear {R : EqKey → EqKey → Prop} (em : EquivManager) : WF R em.clear := by - simpa [EquivManager.clear] using (empty (R := R)) + simpa [EquivManager.clear, EquivManager.empty] using (empty (R := R)) /-- Pointwise strengthening of the semantic relation preserves manager validity. -/ diff --git a/Ix/Tc/Verify/Frame.lean b/Ix/Tc/Verify/Frame.lean index 76107197a..94948ac13 100644 --- a/Ix/Tc/Verify/Frame.lean +++ b/Ix/Tc/Verify/Frame.lean @@ -85,10 +85,11 @@ private theorem liftCached_preservesUnivs (e : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => by + | none => by + simp only split · exact .bind (.pure _) fun result => .bind (.internExpr result) fun interned => @@ -99,40 +100,40 @@ private theorem liftCached_preservesUnivs (e : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | sort u info => rw [liftCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | const id us info => rw [liftCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | app f a info ihf iha => rw [liftCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihf cutoff) fun rf => .bind (iha cutoff) fun ra => .bind (.pure _) fun result => @@ -143,10 +144,10 @@ private theorem liftCached_preservesUnivs (e : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihty cutoff) fun rty => .bind (ihbody (cutoff + 1)) fun rbody => .bind (.pure _) fun result => @@ -157,10 +158,10 @@ private theorem liftCached_preservesUnivs (e : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihty cutoff) fun rty => .bind (ihbody (cutoff + 1)) fun rbody => .bind (.pure _) fun result => @@ -171,10 +172,10 @@ private theorem liftCached_preservesUnivs (e : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihty cutoff) fun rty => .bind (ihval cutoff) fun rval => .bind (ihbody (cutoff + 1)) fun rbody => @@ -186,10 +187,10 @@ private theorem liftCached_preservesUnivs (e : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihval cutoff) fun rval => .bind (.pure _) fun result => .bind (.internExpr result) fun interned => @@ -199,20 +200,20 @@ private theorem liftCached_preservesUnivs (e : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | str v blob info => rw [liftCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ theorem lift_preservesUnivs (e : KExpr .anon) (shift cutoff : UInt64) : @@ -233,10 +234,11 @@ private theorem substCached_preservesUnivs (body arg : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => by + | none => by + simp only split · exact .bind (.liftIntern (lift_preservesUnivs arg depth 0)) fun result => @@ -252,40 +254,40 @@ private theorem substCached_preservesUnivs (body arg : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | sort u info => rw [substCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | const id us info => rw [substCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | app f a info ihf iha => rw [substCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihf depth) fun rf => .bind (iha depth) fun ra => .bind (.pure _) fun result => @@ -296,10 +298,10 @@ private theorem substCached_preservesUnivs (body arg : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihty depth) fun rty => .bind (ihinner (depth + 1)) fun rinner => .bind (.pure _) fun result => @@ -310,10 +312,10 @@ private theorem substCached_preservesUnivs (body arg : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihty depth) fun rty => .bind (ihinner (depth + 1)) fun rinner => .bind (.pure _) fun result => @@ -324,10 +326,10 @@ private theorem substCached_preservesUnivs (body arg : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihty depth) fun rty => .bind (ihval depth) fun rval => .bind (ihinner (depth + 1)) fun rinner => @@ -339,10 +341,10 @@ private theorem substCached_preservesUnivs (body arg : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihval depth) fun rval => .bind (.pure _) fun result => .bind (.internExpr result) fun interned => @@ -352,20 +354,20 @@ private theorem substCached_preservesUnivs (body arg : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | str v blob info => rw [substCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ theorem subst_preservesUnivs (body arg : KExpr .anon) (depth : UInt64) : @@ -386,10 +388,11 @@ private theorem simulSubstCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => by + | none => by + simp only split · exact .bind (.liftIntern (lift_preservesUnivs _ depth 0)) fun result => @@ -404,40 +407,40 @@ private theorem simulSubstCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | sort u info => rw [simulSubstCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | const id us info => rw [simulSubstCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | app f a info ihf iha => rw [simulSubstCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihf depth) fun rf => .bind (iha depth) fun ra => .bind (.pure _) fun result => @@ -448,10 +451,10 @@ private theorem simulSubstCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihty depth) fun rty => .bind (ihinner (depth + 1)) fun rinner => .bind (.pure _) fun result => @@ -462,10 +465,10 @@ private theorem simulSubstCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihty depth) fun rty => .bind (ihinner (depth + 1)) fun rinner => .bind (.pure _) fun result => @@ -476,10 +479,10 @@ private theorem simulSubstCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihty depth) fun rty => .bind (ihval depth) fun rval => .bind (ihinner (depth + 1)) fun rinner => @@ -491,10 +494,10 @@ private theorem simulSubstCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihval depth) fun rval => .bind (.pure _) fun result => .bind (.internExpr result) fun interned => @@ -504,20 +507,20 @@ private theorem simulSubstCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | str v blob info => rw [simulSubstCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ theorem simulSubst_preservesUnivs (body : KExpr .anon) @@ -539,10 +542,11 @@ private theorem instantiateRevCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => by + | none => by + simp only split · exact .bind (.scratchInsert _ _) fun _ => .pure _ · split @@ -555,40 +559,40 @@ private theorem instantiateRevCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | sort u info => rw [instantiateRevCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | const id us info => rw [instantiateRevCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | app f a info ihf iha => rw [instantiateRevCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihf depth) fun rf => .bind (iha depth) fun ra => .bind (.pure _) fun result => @@ -599,10 +603,10 @@ private theorem instantiateRevCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihty depth) fun rty => .bind (ihinner (depth + 1)) fun rinner => .bind (.pure _) fun result => @@ -613,10 +617,10 @@ private theorem instantiateRevCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihty depth) fun rty => .bind (ihinner (depth + 1)) fun rinner => .bind (.pure _) fun result => @@ -627,10 +631,10 @@ private theorem instantiateRevCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihty depth) fun rty => .bind (ihval depth) fun rval => .bind (ihinner (depth + 1)) fun rinner => @@ -642,10 +646,10 @@ private theorem instantiateRevCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihval depth) fun rval => .bind (.pure _) fun result => .bind (.internExpr result) fun interned => @@ -655,20 +659,20 @@ private theorem instantiateRevCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | str v blob info => rw [instantiateRevCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ theorem instantiateRev_preservesUnivs (body : KExpr .anon) @@ -690,10 +694,11 @@ private theorem abstractFVarsCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => by + | none => by + simp only split · exact .bind (.pure _) fun result => .bind (.internExpr result) fun interned => @@ -704,10 +709,11 @@ private theorem abstractFVarsCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => by + | none => by + simp only split · exact .bind (.internExpr _) fun interned => .bind (.scratchInsert _ interned) fun _ => .pure interned @@ -717,30 +723,30 @@ private theorem abstractFVarsCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | const id us info => rw [abstractFVarsCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | app f a info ihf iha => rw [abstractFVarsCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihf depth) fun rf => .bind (iha depth) fun ra => .bind (.pure _) fun result => @@ -751,10 +757,10 @@ private theorem abstractFVarsCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihty depth) fun rty => .bind (ihinner (depth + 1)) fun rinner => .bind (.pure _) fun result => @@ -765,10 +771,10 @@ private theorem abstractFVarsCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihty depth) fun rty => .bind (ihinner (depth + 1)) fun rinner => .bind (.pure _) fun result => @@ -779,10 +785,10 @@ private theorem abstractFVarsCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihty depth) fun rty => .bind (ihval depth) fun rval => .bind (ihinner (depth + 1)) fun rinner => @@ -794,10 +800,10 @@ private theorem abstractFVarsCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (ihval depth) fun rval => .bind (.pure _) fun result => .bind (.internExpr result) fun interned => @@ -807,20 +813,20 @@ private theorem abstractFVarsCached_preservesUnivs (body : KExpr .anon) simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ | str v blob info => rw [abstractFVarsCached] simp only split · exact .pure _ - · exact .bind (.pure _) fun _ => + · exact .bind (.scratchGet _) fun | some cached => .pure cached - | none => .bind (.pure _) fun _ => + | none => .bind (.scratchInsert _ _) fun _ => .pure _ theorem abstractFVars_preservesUnivs (body : KExpr .anon) diff --git a/Ix/Tc/Verify/Inductive/EnumerationAcceptance.lean b/Ix/Tc/Verify/Inductive/EnumerationAcceptance.lean index 9bdb75a95..8fc96164c 100644 --- a/Ix/Tc/Verify/Inductive/EnumerationAcceptance.lean +++ b/Ix/Tc/Verify/Inductive/EnumerationAcceptance.lean @@ -504,12 +504,12 @@ theorem recursorCoordinated_iff (id : KId .anon) : theorem world_family_block : world.blocks familyBlockId = some familyMembers := by change recursorIngressAfter.getBlock? familyBlockId = some familyMembers - simpa [checkerInitial] using familyBlockLoaded + simpa [checkerInitial, TcState.ofEnvAnon] using familyBlockLoaded theorem world_recursor_block : world.blocks recursorBlockId = some recursorMembers := by change recursorIngressAfter.getBlock? recursorBlockId = some recursorMembers - simpa [checkerInitial] using recursorBlockLoaded + simpa [checkerInitial, TcState.ofEnvAnon] using recursorBlockLoaded def exactFamilyBlock : ExactCheckBlock world familyBlockId familyMembers .inductive' where diff --git a/Ix/Tc/Verify/Inductive/EnumerationFixture.lean b/Ix/Tc/Verify/Inductive/EnumerationFixture.lean index 166aebd4c..4bd6febf3 100644 --- a/Ix/Tc/Verify/Inductive/EnumerationFixture.lean +++ b/Ix/Tc/Verify/Inductive/EnumerationFixture.lean @@ -38,6 +38,8 @@ def checked : boolDecl.Checked where result_eq := rfl elimination := .large elimination_eq := rfl + kTarget := VInductDecl.isKTarget 0 (.succ .zero) boolType + kTarget_eq := rfl names := VInductDecl.generatedNames boolType names_eq := rfl constructors := boolType.ctors.map @@ -57,7 +59,7 @@ theorem declarationWF : boolDecl.WF VEnv.empty := by · trivial · intro ctor hctor simp [boolType] at hctor - rcases hctor with rfl | rfl <;> exact ⟨trivial, rfl⟩ + rcases hctor with rfl | rfl <;> exact ⟨trivial, .nil⟩ theorem generationWF : generation.WF VEnv.empty := by exact (checked.wf_of_decl declarationWF).identityGeneration .empty @@ -80,7 +82,7 @@ def transaction : CertifiedGenerationTransaction boolDecl VEnv.empty private theorem enumerationShapeNative : CertifiedSingletonGeneration.IsEnumeration generation := by - refine ⟨rfl, rfl, rfl, by decide, ?_⟩ + refine ⟨rfl, rfl, rfl, rfl, by decide, ?_⟩ intro index normalized hnormalized have hindex : index = 0 ∨ index = 1 := by have hlt : index < generation.block.ctorPairs.length := @@ -1090,11 +1092,13 @@ def familyInterpretation : SingletonFamilyIngressInterpretation · refine ⟨falseSource, falseConcrete, falseSourceAt, ?_, falseShape, ?_, falseType⟩ · simpa [constructorIds] using falseEntry - · simpa [constructorIds, falseSource] using nameOf_false + · simpa [constructorIds, falseSource, generation, checked, boolDecl, + boolType] using nameOf_false · refine ⟨trueSource, trueConcrete, trueSourceAt, ?_, trueShape, ?_, trueType⟩ · simpa [constructorIds] using trueEntry - · simpa [constructorIds, trueSource] using nameOf_true + · simpa [constructorIds, trueSource, generation, checked, boolDecl, + boolType] using nameOf_true /-! ## One immutable world for both physical blocks -/ diff --git a/Ix/Tc/Verify/Inductive/RuleApplication.lean b/Ix/Tc/Verify/Inductive/RuleApplication.lean index fe456cc57..67bdc8037 100644 --- a/Ix/Tc/Verify/Inductive/RuleApplication.lean +++ b/Ix/Tc/Verify/Inductive/RuleApplication.lean @@ -17,29 +17,6 @@ the exact telescope arguments and use the lemmas below. namespace Lean4Lean.VExpr -/-- Universe instantiation commutes with the lambda-telescope constructor. -/ -theorem instL_lamN (levels : List VLevel) : - ∀ (binders : List VExpr) (body : VExpr), - (VExpr.lamN binders body).instL levels = - VExpr.lamN (binders.map (VExpr.instL levels)) - (body.instL levels) - | [], _ => rfl - | binder :: binders, body => by - simp [VExpr.lamN, VExpr.instL, instL_lamN levels binders body] - -/-- Instantiation commutes with the lambda-telescope constructor. -/ -theorem instN_lamN (replacement : VExpr) : - ∀ (binders : List VExpr) (body : VExpr) (depth : Nat), - (VExpr.lamN binders body).inst replacement depth = - VExpr.lamN (VExpr.instTelN replacement binders depth) - (body.inst replacement (depth + binders.length)) - | [], _, _ => rfl - | binder :: binders, body, depth => by - simp only [VExpr.lamN, VExpr.inst, VExpr.instTelN] - rw [instN_lamN replacement binders body (depth + 1)] - congr 2 - simp [Nat.add_comm, Nat.add_left_comm] - /-- Positional lookup in the reverse de Bruijn range used by generated rule telescopes. -/ theorem bvarRevRange_getElem? (off arity index : Nat) diff --git a/Ix/Tc/Verify/Inductive/SingletonEnumeration.lean b/Ix/Tc/Verify/Inductive/SingletonEnumeration.lean index d9b7ac1e6..f5eb7a8a5 100644 --- a/Ix/Tc/Verify/Inductive/SingletonEnumeration.lean +++ b/Ix/Tc/Verify/Inductive/SingletonEnumeration.lean @@ -28,6 +28,11 @@ structure IsEnumeration {source : VInductDecl} noUniverses : source.uvars = 0 noParameters : source.nparams = 0 noIndices : generation.block.rawIndices = [] + /-- The fresh motive universe the generated recursor and equations below + assume. Small elimination inserts no such universe, so a `Prop`-valued + enumeration falls outside this fragment rather than being generated + incorrectly. -/ + largeElimination : generation.elimination = .large nonempty : 0 < generation.block.ctorPairs.length constructor : ∀ {index : Nat} {normalized : VInductDecl.NormalizedCtor}, @@ -57,7 +62,9 @@ theorem rawParams_nil {source : VInductDecl} {generation : source.GenerationChecked} (shape : IsEnumeration generation) : generation.paramsTel = [] := by - simp [VInductDecl.GenerationChecked.paramsTel, shape.rawParams_nil] + simp [VInductDecl.GenerationChecked.paramsTel, + VInductDecl.NormalizedChecked.generationParams, + VInductDecl.generationParams, shape.rawParams_nil] @[simp] theorem idxTel_nil {source : VInductDecl} {generation : source.GenerationChecked} @@ -116,11 +123,12 @@ theorem rule_lhs {source : VInductDecl} (generation.block.ctorPairs.length + 1))) (.const normalized.raw.name [])) := by unfold VInductDecl.GenerationChecked.rule + rw [shape.largeElimination] rw [shape.paramsTel_nil, shape.fields_nil hconstructor, shape.resultIndices_nil hconstructor] simp [ruleBinders, VExpr.liftTelN, VExpr.appN, VExpr.bvarRevRange, shape.noUniverses, shape.noParameters, - Lean4Lean.VLevel.params'] + shape.largeElimination, Lean4Lean.VLevel.params'] /-- Exact generated right-hand side: enum rule `index` is the corresponding minor variable and has no field/IH application suffix. -/ @@ -133,6 +141,7 @@ theorem rule_rhs {source : VInductDecl} VExpr.lamN (ruleBinders generation) (.bvar (generation.block.ctorPairs.length - 1 - index)) := by unfold VInductDecl.GenerationChecked.rule + rw [shape.largeElimination] rw [shape.paramsTel_nil, shape.fields_nil hconstructor, shape.recursive_nil hconstructor] simp [ruleBinders, VExpr.liftTelN, VExpr.appN, @@ -184,6 +193,7 @@ theorem ruleType_instantiated {source : VInductDecl} (.bvar generation.block.ctorPairs.length) (.const normalized.raw.name [])) := by unfold VInductDecl.GenerationChecked.rule + rw [shape.largeElimination] rw [shape.paramsTel_nil, shape.fields_nil hconstructor, shape.resultIndices_nil hconstructor] simp [ruleBinders, VExpr.forallN, VExpr.appN, VExpr.instL, @@ -457,6 +467,7 @@ theorem enumerationPatternSound intro future hfuture hfutureWF uvars Gamma matched levels captures A hGamma hmatches htype _hchecks let generation := tx.certificate.generation + have helim : generation.elimination = .large := shape.largeElimination have hcount : family.constructorIds.size = generation.block.ctorPairs.length := by rw [family.constructorCount, ← generation.rawCtors_eq] @@ -489,7 +500,7 @@ theorem enumerationPatternSound subst recursorConstant have hlevelsLength : levels.length = 1 := by simpa [VInductDecl.GenerationChecked.recursor, - shape.noUniverses] using hlevelsArity + shape.noUniverses, helim] using hlevelsArity rw [hconstructorArguments] at hconstructorApplied simp only [VExpr.appN] at hconstructorApplied @@ -531,7 +542,7 @@ theorem enumerationPatternSound hregisteredFuture have hlevelsRuleArity : levels.length = (generation.rule index normalized).uvars := by - simpa [VInductDecl.GenerationChecked.rule, shape.noUniverses] using + simpa [VInductDecl.GenerationChecked.rule, shape.noUniverses, helim] using hlevelsLength have hequation : future.IsDefEq uvars Gamma ((generation.rule index normalized).lhs.instL levels) @@ -672,7 +683,9 @@ theorem enumerationPatternSound simpa only [VExpr.appN] using hmatched rw [hmatchedExact] simpa [SingletonRecursorCatalogLink.enumerationPattern, selected, - RecursorIotaPattern.recursorArgumentRhs_apply] using hresult + RecursorIotaPattern.recursorArgumentRhs_apply, + RecursorIotaPattern.recursorArgumentRhs, + Lean4Lean.Pattern.RHS.apply] using hresult /-- Package the finite pattern metadata and its registered-equation proof as the exact historical relation consumed by the production iota verifier. -/ diff --git a/Ix/Tc/Verify/Inductive/SingletonFamily.lean b/Ix/Tc/Verify/Inductive/SingletonFamily.lean index 96d65fcd2..1d103680f 100644 --- a/Ix/Tc/Verify/Inductive/SingletonFamily.lean +++ b/Ix/Tc/Verify/Inductive/SingletonFamily.lean @@ -39,7 +39,8 @@ theorem checkedTypeUvars {decl : VInductDecl} (checked : decl.Checked) : checked.type.uvars = decl.uvars := by rcases checked with ⟨type, typesEq, params, paramsEq, indices, indicesEq, - resultLevel, resultEq, elimination, eliminationEq, names, namesEq, + resultLevel, resultEq, elimination, eliminationEq, kTarget, kTargetEq, + names, namesEq, constructors, constructorsEq, accepted⟩ cases decl with | mk uvars nparams types => @@ -49,7 +50,7 @@ theorem checkedTypeUvars {decl : VInductDecl} simp only [VInductDecl.stage3Core, VInductDecl.stage3DirectCore, Bool.and_eq_true, beq_iff_eq] at accepted change type.uvars = uvars - exact accepted.1.1.1.1.1.1 + exact accepted.1.1.1.1.1 /-- Every checked constructor retains the declaration universe arity. -/ theorem checkedConstructorUvars {decl : VInductDecl} @@ -58,7 +59,8 @@ theorem checkedConstructorUvars {decl : VInductDecl} constructor.uvars = decl.uvars := by rcases checked with ⟨type, typesEq, params, paramsEq, indices, indicesEq, - resultLevel, resultEq, elimination, eliminationEq, names, namesEq, + resultLevel, resultEq, elimination, eliminationEq, kTarget, kTargetEq, + names, namesEq, constructors, constructorsEq, accepted⟩ cases decl with | mk uvars nparams types => diff --git a/Ix/Tc/Verify/Inductive/SingletonRecursor.lean b/Ix/Tc/Verify/Inductive/SingletonRecursor.lean index 03f238c85..6a1b4a6bf 100644 --- a/Ix/Tc/Verify/Inductive/SingletonRecursor.lean +++ b/Ix/Tc/Verify/Inductive/SingletonRecursor.lean @@ -75,14 +75,19 @@ end CertifiedSingletonGeneration `motives = 1` is the explicit no-mutual/no-nested boundary of this adapter. The exact rule count is retained, and `RecursorMajorIdxCoherent` rules out the wrapping-`UInt64` disagreement between production's ordinary iota path and -its Nat descriptor path. -/ +its Nat descriptor path. + +The universe arity is taken from `generation.recUvars` rather than spelled as +`source.uvars + 1`: the fresh motive universe exists only under large +elimination, so a small-eliminating (`Prop`-valued) family's recursor carries +exactly the source universes. -/ def KConst.IsCertifiedSingletonRecursor (source : VInductDecl) (generation : source.GenerationChecked) (constructorIds : Array (KId .anon)) : KConst .anon → Prop | concrete@(.recr (lvls := levels) (params := params) (indices := indices) (motives := motives) (minors := minors) (memberIdx := memberIdx) (rules := rules) ..) => - levels.toNat = source.uvars + 1 ∧ + levels.toNat = generation.recUvars ∧ params.toNat = source.nparams ∧ indices.toNat = generation.block.rawIndices.length ∧ motives.toNat = 1 ∧ diff --git a/Ix/Tc/Verify/Infer.lean b/Ix/Tc/Verify/Infer.lean index 2947abcda..8cd6aeab9 100644 --- a/Ix/Tc/Verify/Infer.lean +++ b/Ix/Tc/Verify/Infer.lean @@ -47,7 +47,7 @@ theorem inferKey_operational_matches_wf (fun key s' => (operationalWhnfContextKeys trProj world uvars).Matches trProj world s Delta source key ∧ ContextKeyFrame s s') := by - simpa using + simpa [operationalWhnfContextKeys] using (TcM.whnfKey_matches_wf (layer := layer) (semantics := semantics) (trProj := trProj) (world := world) (support := support) (keys := operationalWhnfContextKeys trProj world uvars) diff --git a/Ix/Tc/Verify/Infer/Callbacks.lean b/Ix/Tc/Verify/Infer/Callbacks.lean index d429b077c..fe79547e2 100644 --- a/Ix/Tc/Verify/Infer/Callbacks.lean +++ b/Ix/Tc/Verify/Infer/Callbacks.lean @@ -45,8 +45,7 @@ theorem inferCall_wf (fun ty _ => support ty /\ InferPost trProj world uvars Delta sourceV ty) := by intro methods hmethods - simpa only [inferCall, ReaderT.run_bind, ReaderT.run_monadLift, - pure_bind] using hmethods.infer hsource htr + exact hmethods.infer hsource htr /-- The ordinary recursive DefEq edge is exactly the predecessor table's soundness contract. -/ @@ -63,9 +62,7 @@ theorem isDefEqCall_wf (fun answer _ => answer = true -> world.venv.IsDefEqU uvars Delta.toCtx va vb) := by intro methods hmethods - simpa only [isDefEqCall, ReaderT.run_bind, ReaderT.run_monadLift, - pure_bind] using - hmethods.isDefEq haSupport hbSupport ha hb + exact hmethods.isDefEq haSupport hbSupport ha hb end RecM diff --git a/Ix/Tc/Verify/Infer/LeafCases.lean b/Ix/Tc/Verify/Infer/LeafCases.lean index 3043f4a54..9ae843527 100644 --- a/Ix/Tc/Verify/Infer/LeafCases.lean +++ b/Ix/Tc/Verify/Infer/LeafCases.lean @@ -27,7 +27,6 @@ theorem lookupVar_eval {idx : UInt64} {ty result : KExpr .anon} rw [show (get : TcM .anon (TcState .anon)) s = .ok s s from rfl] simp only rw [if_neg (by omega)] - simp only [pure_bind] rw [hty] exact hlift diff --git a/Ix/Tc/Verify/Infer/Literals.lean b/Ix/Tc/Verify/Infer/Literals.lean index bd2f87e65..e3caab00f 100644 --- a/Ix/Tc/Verify/Infer/Literals.lean +++ b/Ix/Tc/Verify/Infer/Literals.lean @@ -38,7 +38,7 @@ theorem nat_tr (KExpr.mkConst prims.nat #[]) Lean4Lean.VExpr.nat := by rw [KExpr.mkConst_shape] obtain ⟨ci, hlookup⟩ := htable.nat.contains hcatalog - simpa [Lean4Lean.VExpr.nat, htable.natArity hlookup] using + exact (TrKExprS.const (Δ := Delta) (uvars := uvars) htable.nat.2 hlookup (by simp) (by simp [htable.natArity hlookup])) @@ -52,7 +52,7 @@ theorem string_tr (KExpr.mkConst prims.string #[]) Lean4Lean.VExpr.string := by rw [KExpr.mkConst_shape] obtain ⟨ci, hlookup⟩ := htable.string.contains hcatalog - simpa [Lean4Lean.VExpr.string, htable.stringArity hlookup] using + exact (TrKExprS.const (Δ := Delta) (uvars := uvars) htable.string.2 hlookup (by simp) (by simp [htable.stringArity hlookup])) @@ -116,7 +116,7 @@ theorem inferUncached_nat_wf hIfinal.2.1.wf · have htype0 : world.venv.HasType uvars [] (.natLit n) Lean4Lean.VExpr.nat := by - simpa using + simpa [Lean4Lean.VLCtx.toCtx] using (Lean4Lean.TrExprS.natLit (Us := List.replicate uvars Lean.Name.anonymous) (Δ := []) context.theoryPrimitives hcontains n).2 @@ -166,7 +166,8 @@ theorem inferUncached_str_wf hIfinal.2.1.wf · have htype0 : world.venv.HasType uvars [] (.trLiteral (.strVal value)) Lean4Lean.VExpr.string := by - simpa [Lean4Lean.VExpr.string] using + simpa [Lean4Lean.VExpr.string, Lean4Lean.VLCtx.toCtx, + Lean.Literal.typeName] using (Lean4Lean.TrExprS.trLiteral world.venvWF.ordered (Us := List.replicate uvars Lean.Name.anonymous) (Δ := []) context.theoryPrimitives (.strVal value) hcontains).2 diff --git a/Ix/Tc/Verify/Infer/ProjectionClassification.lean b/Ix/Tc/Verify/Infer/ProjectionClassification.lean index 4f098350d..f4d490b6d 100644 --- a/Ix/Tc/Verify/Infer/ProjectionClassification.lean +++ b/Ix/Tc/Verify/Infer/ProjectionClassification.lean @@ -117,7 +117,6 @@ private theorem ensureSortDirect_state_wf case sort => exact RecM.WF.pure fun _ => trivial all_goals unfold ensureSortWhnf - simp only [pure_bind] apply RecM.WF.bind (hwhnf _ s) intro reduced after _ cases reduced <;> simp only diff --git a/Ix/Tc/Verify/Infer/ProjectionTelescope.lean b/Ix/Tc/Verify/Infer/ProjectionTelescope.lean index 50e07fe9b..177ac930d 100644 --- a/Ix/Tc/Verify/Infer/ProjectionTelescope.lean +++ b/Ix/Tc/Verify/Infer/ProjectionTelescope.lean @@ -62,7 +62,6 @@ theorem peelProjForall_wf exact ⟨_, _, hdomSupport, hcodSupport, hdomType, hcodType, hdomTr, hcodTr, hinputEq.symm⟩ all_goals - simp only [pure_bind] apply RecM.WF.bind (hwhnf hinputSupport hinputCore) intro reduced after hred rcases hred with diff --git a/Ix/Tc/Verify/Ingress/SerializedBoolean.lean b/Ix/Tc/Verify/Ingress/SerializedBoolean.lean index ffabd970e..370557ac3 100644 --- a/Ix/Tc/Verify/Ingress/SerializedBoolean.lean +++ b/Ix/Tc/Verify/Ingress/SerializedBoolean.lean @@ -556,16 +556,16 @@ theorem eagerConstants : rcases eagerKeyCases hkey with rfl | rfl | rfl | rfl · have hc := Option.some.inj (hget.symm.trans eagerFamilyNative) subst constant - simpa [stagedWorld] using catalog_family + exact catalog_family · have hc := Option.some.inj (hget.symm.trans eagerFalseNative) subst constant - simpa [stagedWorld] using catalog_false + exact catalog_false · have hc := Option.some.inj (hget.symm.trans eagerTrueNative) subst constant - simpa [stagedWorld] using catalog_true + exact catalog_true · have hc := Option.some.inj (hget.symm.trans eagerRecursorNative) subst constant - simpa [stagedWorld] using catalog_recursor + exact catalog_recursor def isCataloguedBlock (id : KId .anon) : Bool := id == familyBlockId || id == recursorBlockId @@ -687,13 +687,13 @@ theorem lazyFamilyConstants : rcases lazyFamilyKeyCases hkey with rfl | rfl | rfl · have hc := Option.some.inj (hget.symm.trans lazyFamilyLoadedNative) subst constant - simpa [stagedWorld] using catalog_family + exact catalog_family · have hc := Option.some.inj (hget.symm.trans lazyFalseLoadedNative) subst constant - simpa [stagedWorld] using catalog_false + exact catalog_false · have hc := Option.some.inj (hget.symm.trans lazyTrueLoadedNative) subst constant - simpa [stagedWorld] using catalog_true + exact catalog_true private theorem lazyFamilyBlockKeysNative : lazyFamilyAfter.blocks.keys.all (fun id => id == familyBlockId) = true := by @@ -790,16 +790,16 @@ theorem lazyFinalConstants : rcases lazyRecursorKeyCases hkey with rfl | rfl | rfl | rfl · have hc := Option.some.inj (hget.symm.trans lazyFinalFamilyNative) subst constant - simpa [stagedWorld] using catalog_family + exact catalog_family · have hc := Option.some.inj (hget.symm.trans lazyFinalFalseNative) subst constant - simpa [stagedWorld] using catalog_false + exact catalog_false · have hc := Option.some.inj (hget.symm.trans lazyFinalTrueNative) subst constant - simpa [stagedWorld] using catalog_true + exact catalog_true · have hc := Option.some.inj (hget.symm.trans lazyFinalRecursorNative) subst constant - simpa [stagedWorld] using catalog_recursor + exact catalog_recursor private theorem lazyFinalBlockKeysClassifiedNative : lazyRecursorAfter.blocks.keys.all isCataloguedBlock = true := by diff --git a/Ix/Tc/Verify/InstL.lean b/Ix/Tc/Verify/InstL.lean index 5fe67fadd..c01cc9cc2 100644 --- a/Ix/Tc/Verify/InstL.lean +++ b/Ix/Tc/Verify/InstL.lean @@ -321,7 +321,7 @@ theorem TrKExprS.instL {env : VEnv} {uvars U' : Nat} have harr := array_mapM_ok hmus have hsize : vs.size = curUs.size := by rw [← Array.length_toList, ← Array.length_toList] - exact harr.length_eq.symm + exact (Lean4Lean.List.Forall₂.length_eq harr).symm have hwf : ∀ w ∈ vs, (KUniv.toVLevel w).WF U' := by intro w hw obtain ⟨a, _, hab⟩ := forall₂_mem_right harr w (by simpa using hw) diff --git a/Ix/Tc/Verify/InstUniv.lean b/Ix/Tc/Verify/InstUniv.lean index a1f1a3dc0..2dff7aa99 100644 --- a/Ix/Tc/Verify/InstUniv.lean +++ b/Ix/Tc/Verify/InstUniv.lean @@ -481,7 +481,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} = .error err s := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_liftM_ofExcept_bind, hu] + rw [run_liftM_ofExcept_bind, hu] try rfl rw [hrun] exact .refl hwf hsup @@ -494,7 +494,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} intern := (s.env.intern.internExpr (KExpr.mkSort v)).2 } } := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_liftM_ofExcept_bind, hu] + rw [run_liftM_ofExcept_bind, hu] try rfl have hspec : KExpr.instUnivSpec (KExpr.sort u info) us = .ok (KExpr.mkSort v) := by @@ -520,7 +520,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} = .error err s := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_bind, run_substUnivLoopArray, hmus] + rw [run_bind, run_substUnivLoopArray, hmus] try rfl rw [hrun] exact .refl hwf hsup @@ -533,7 +533,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} intern := (s.env.intern.internExpr (KExpr.mkConst id arr)).2 } } := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_bind, run_substUnivLoopArray, hmus] + rw [run_bind, run_substUnivLoopArray, hmus] try rfl have hspec : KExpr.instUnivSpec (KExpr.const id curUs info) us = .ok (KExpr.mkConst id arr) := by @@ -562,7 +562,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} = .error err sf := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_bind, hrecf] + rw [run_bind, hrecf] try rfl rw [hrun] exact postf @@ -579,7 +579,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} = .error err sa := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_bind, hrecf] + rw [run_bind, hrecf] try simp only [] rw [run_bind, hreca] try rfl @@ -597,7 +597,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} intern := (sa.env.intern.internExpr (KExpr.mkApp rf ra)).2 } } := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_bind, hrecf] + rw [run_bind, hrecf] try simp only [] rw [run_bind, hreca] try rfl @@ -630,7 +630,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} = .error err st := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_bind, hrecty] + rw [run_bind, hrecty] try rfl rw [hrun] exact postty @@ -647,7 +647,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} = .error err sb := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_bind, hrecty] + rw [run_bind, hrecty] try simp only [] rw [run_bind, hrecbody] try rfl @@ -665,7 +665,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} intern := (sb.env.intern.internExpr (KExpr.mkLam n bi rt rb)).2 } } := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_bind, hrecty] + rw [run_bind, hrecty] try simp only [] rw [run_bind, hrecbody] try rfl @@ -698,7 +698,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} = .error err st := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_bind, hrecty] + rw [run_bind, hrecty] try rfl rw [hrun] exact postty @@ -715,7 +715,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} = .error err sb := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_bind, hrecty] + rw [run_bind, hrecty] try simp only [] rw [run_bind, hrecbody] try rfl @@ -733,7 +733,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} intern := (sb.env.intern.internExpr (KExpr.mkAll n bi rt rb)).2 } } := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_bind, hrecty] + rw [run_bind, hrecty] try simp only [] rw [run_bind, hrecbody] try rfl @@ -766,7 +766,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} = .error err st := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_bind, hrecty] + rw [run_bind, hrecty] try rfl rw [hrun] exact postty @@ -784,7 +784,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} = .error err sv := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_bind, hrecty] + rw [run_bind, hrecty] try simp only [] rw [run_bind, hrecval] try rfl @@ -804,7 +804,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} = .error err sb := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_bind, hrecty] + rw [run_bind, hrecty] try simp only [] rw [run_bind, hrecval] try simp only [] @@ -824,7 +824,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} intern := (sb.env.intern.internExpr (KExpr.mkLet n rt rv rb nd)).2 } } := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_bind, hrecty] + rw [run_bind, hrecty] try simp only [] rw [run_bind, hrecval] try simp only [] @@ -861,7 +861,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} = .error err sv := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_bind, hrecval] + rw [run_bind, hrecval] try rfl rw [hrun] exact postval @@ -877,7 +877,7 @@ theorem TcM.instUnivInner_spec {S : KExpr .anon → Prop} intern := (sv.env.intern.internExpr (KExpr.mkPrj id field rv)).2 } } := by rw [TcM.instUnivInner, run_get_bind, hget] simp (config := { proj := false }) only [] - rw [run_pure_bind, run_bind, hrecval] + rw [run_bind, hrecval] try rfl have hspec : KExpr.instUnivSpec (KExpr.prj id field val info) us = .ok (KExpr.mkPrj id field rv) := by @@ -1128,8 +1128,8 @@ theorem TcM.substUniv_toVLevel {m : Mode} {us : Array (KUniv m)} : have h2 := VLevel.equiv_def.mp ihha ρ have h3 := VLevel.equiv_def.mp ihhb ρ rw [h1] - show Nat.imax (ra.toVLevel.eval ρ) (rb.toVLevel.eval ρ) - = Nat.imax + show Lean.Nat.imax (ra.toVLevel.eval ρ) (rb.toVLevel.eval ρ) + = Lean.Nat.imax (((KUniv.toVLevel a).inst (us.toList.map KUniv.toVLevel)).eval ρ) (((KUniv.toVLevel b).inst diff --git a/Ix/Tc/Verify/Knot.lean b/Ix/Tc/Verify/Knot.lean index d18bdccfd..f09d54e96 100644 --- a/Ix/Tc/Verify/Knot.lean +++ b/Ix/Tc/Verify/Knot.lean @@ -327,7 +327,7 @@ theorem runRec_wf {layer : WhnfLayer} {semantics : CacheSemantics} (hx : RecM.WF layer semantics trProj world support uvars Δ s x Q E) : TcM.WF (WhnfStateInv layer semantics trProj world support uvars Δ) s (TcM.runRec x) Q E := by - simpa [TcM.runRec] using + exact hx (methodsN s.recFuel.toNat) (Methods.WF.atUvars (Methods.methodsN_wf hclosed s.recFuel.toNat) uvars) @@ -347,7 +347,7 @@ theorem runRec_wfAt TcM.WF (WhnfStateInv layer semantics trProj world support uvars Delta) s (TcM.runRec x) Q E := by - simpa [TcM.runRec] using + exact hx (methodsN s.recFuel.toNat) (Methods.methodsN_wfAt hclosed s.recFuel.toNat) diff --git a/Ix/Tc/Verify/Level.lean b/Ix/Tc/Verify/Level.lean index 589a1675f..d4f2e486f 100644 --- a/Ix/Tc/Verify/Level.lean +++ b/Ix/Tc/Verify/Level.lean @@ -448,16 +448,16 @@ theorem EvalPaths.one_le {ρ : List Nat} {path : Path} {n : Nat} /-- `imax` distributes over `max` in the second argument — the semantic content of the `normalizeImaxMax` rewrite. -/ private theorem imax_max (a b c : Nat) : - Nat.imax a (max b c) = max (Nat.imax a b) (Nat.imax a c) := by + Lean.Nat.imax a (max b c) = max (Lean.Nat.imax a b) (Lean.Nat.imax a c) := by by_cases hb : b = 0 <;> by_cases hc : c = 0 <;> - simp [Nat.imax, hb, hc, Nat.max_eq_max, Nat.max_eq_zero_iff] <;> omega + simp [Lean.Nat.imax, hb, hc, Nat.max_eq_max, Nat.max_eq_zero_iff] <;> omega /-- `imax(a, imax(b, c)) = max(imax(a, c), imax(b, c))` — the semantic content of the `normalizeImaxImax` rewrite. -/ private theorem imax_imax (a b c : Nat) : - Nat.imax a (Nat.imax b c) = max (Nat.imax a c) (Nat.imax b c) := by + Lean.Nat.imax a (Lean.Nat.imax b c) = max (Lean.Nat.imax a c) (Lean.Nat.imax b c) := by by_cases hc : c = 0 <;> by_cases hb : b = 0 <;> - simp [Nat.imax, hb, hc, Nat.max_eq_max, Nat.max_eq_zero_iff] <;> omega + simp [Lean.Nat.imax, hb, hc, Nat.max_eq_max, Nat.max_eq_zero_iff] <;> omega /-! #### Insert-eval lemmas -/ @@ -738,7 +738,7 @@ private theorem normalizeAux_eval' {ρ : List Nat} : | .imax u (.zero b_ad) ad, path, k, acc, hk, hp => by simp only [normalizeAux] rw [NormLevel.addConst_eval hp] - simp [KUniv.toVLevel, VLevel.eval, Nat.imax] + simp [KUniv.toVLevel, VLevel.eval, Lean.Nat.imax] | .imax u (.succ v b_ad) ad, path, k, acc, hk, hp => by have hk1 : (k + 1).toNat = k.toNat + 1 := toNat_add_one (by simp [KUniv.size] at hk; omega) @@ -755,13 +755,13 @@ private theorem normalizeAux_eval' {ρ : List Nat} : simp only [normalizeAux] rw [ihV, ihU, hk1, show (KUniv.toVLevel (.imax u (.succ v b_ad) ad)).eval ρ - = Nat.imax ((KUniv.toVLevel u).eval ρ) + = Lean.Nat.imax ((KUniv.toVLevel u).eval ρ) ((KUniv.toVLevel v).eval ρ + 1) from rfl, - show Nat.imax ((KUniv.toVLevel u).eval ρ) + show Lean.Nat.imax ((KUniv.toVLevel u).eval ρ) ((KUniv.toVLevel v).eval ρ + 1) = max ((KUniv.toVLevel u).eval ρ) ((KUniv.toVLevel v).eval ρ + 1) from by - simp [Nat.imax, Nat.max_eq_max], + simp [Lean.Nat.imax, Nat.max_eq_max], show (KUniv.toVLevel v).eval ρ + (k.toNat + 1) = (KUniv.toVLevel v).eval ρ + 1 + k.toNat from by omega, ← Nat.add_max_add_right, evalPath_max] @@ -859,15 +859,15 @@ theorem normalizeImaxMax_eval {ρ : List Nat} {u v w : KUniv m} {path : Path} simp only [normalizeImaxMax] rw [ihW, ihV, show (VLevel.imax u.toVLevel (VLevel.max v.toVLevel w.toVLevel)).eval ρ - = Nat.imax ((KUniv.toVLevel u).eval ρ) + = Lean.Nat.imax ((KUniv.toVLevel u).eval ρ) (max ((KUniv.toVLevel v).eval ρ) ((KUniv.toVLevel w).eval ρ)) from rfl, imax_max, ← Nat.add_max_add_right, evalPath_max, show (VLevel.imax u.toVLevel v.toVLevel).eval ρ - = Nat.imax ((KUniv.toVLevel u).eval ρ) ((KUniv.toVLevel v).eval ρ) + = Lean.Nat.imax ((KUniv.toVLevel u).eval ρ) ((KUniv.toVLevel v).eval ρ) from rfl, show (VLevel.imax u.toVLevel w.toVLevel).eval ρ - = Nat.imax ((KUniv.toVLevel u).eval ρ) ((KUniv.toVLevel w).eval ρ) + = Lean.Nat.imax ((KUniv.toVLevel u).eval ρ) ((KUniv.toVLevel w).eval ρ) from rfl] refine ext_le fun x => ?_ simp only [Nat.max_le] @@ -898,15 +898,15 @@ theorem normalizeImaxImax_eval {ρ : List Nat} {u v w : KUniv m} {path : Path} simp only [normalizeImaxImax] rw [ihVW, ihUW, show (VLevel.imax u.toVLevel (VLevel.imax v.toVLevel w.toVLevel)).eval ρ - = Nat.imax ((KUniv.toVLevel u).eval ρ) - (Nat.imax ((KUniv.toVLevel v).eval ρ) ((KUniv.toVLevel w).eval ρ)) + = Lean.Nat.imax ((KUniv.toVLevel u).eval ρ) + (Lean.Nat.imax ((KUniv.toVLevel v).eval ρ) ((KUniv.toVLevel w).eval ρ)) from rfl, imax_imax, ← Nat.add_max_add_right, evalPath_max, show (VLevel.imax u.toVLevel w.toVLevel).eval ρ - = Nat.imax ((KUniv.toVLevel u).eval ρ) ((KUniv.toVLevel w).eval ρ) + = Lean.Nat.imax ((KUniv.toVLevel u).eval ρ) ((KUniv.toVLevel w).eval ρ) from rfl, show (VLevel.imax v.toVLevel w.toVLevel).eval ρ - = Nat.imax ((KUniv.toVLevel v).eval ρ) ((KUniv.toVLevel w).eval ρ) + = Lean.Nat.imax ((KUniv.toVLevel v).eval ρ) ((KUniv.toVLevel w).eval ρ) from rfl] refine ext_le fun x => ?_ simp only [Nat.max_le] @@ -928,7 +928,7 @@ private theorem normalizeImaxDispatch_eval' {ρ : List Nat} : | a, .zero b_ad, path, k, acc, hk, hp => by simp only [normalizeImaxDispatch] rw [NormLevel.addConst_eval hp] - simp [KUniv.toVLevel, VLevel.eval, Nat.imax] + simp [KUniv.toVLevel, VLevel.eval, Lean.Nat.imax] | a, .succ v b_ad, path, k, acc, hk, hp => by have hsza := KUniv.size_pos a have hk1 : (k + 1).toNat = k.toNat + 1 := @@ -946,13 +946,13 @@ private theorem normalizeImaxDispatch_eval' {ρ : List Nat} : simp only [normalizeImaxDispatch] rw [ihV, ihA, hk1, show (VLevel.imax a.toVLevel (KUniv.toVLevel (.succ v b_ad))).eval ρ - = Nat.imax ((KUniv.toVLevel a).eval ρ) + = Lean.Nat.imax ((KUniv.toVLevel a).eval ρ) ((KUniv.toVLevel v).eval ρ + 1) from rfl, - show Nat.imax ((KUniv.toVLevel a).eval ρ) + show Lean.Nat.imax ((KUniv.toVLevel a).eval ρ) ((KUniv.toVLevel v).eval ρ + 1) = max ((KUniv.toVLevel a).eval ρ) ((KUniv.toVLevel v).eval ρ + 1) from by - simp [Nat.imax, Nat.max_eq_max], + simp [Lean.Nat.imax, Nat.max_eq_max], show (KUniv.toVLevel v).eval ρ + (k.toNat + 1) = (KUniv.toVLevel v).eval ρ + 1 + k.toNat from by omega, ← Nat.add_max_add_right, evalPath_max] @@ -993,7 +993,7 @@ private theorem normalize_param_some_eval {ρ : List Nat} {u : KUniv m} ((acc.addConst k path).addVar idx k newPath)) = max (NormLevel.eval ρ acc) (evalPath ρ path - (Nat.imax ((KUniv.toVLevel u).eval ρ) (evalParam ρ idx) + (Lean.Nat.imax ((KUniv.toVLevel u).eval ρ) (evalParam ρ idx) + k.toNat)) := by have hconst : NormLevel.eval ρ (acc.addConst k path) = max (NormLevel.eval ρ acc) (evalPath ρ path k.toNat) := @@ -1020,14 +1020,14 @@ private theorem normalize_param_some_eval {ρ : List Nat} {u : KUniv m} hvar, hconst, evalPath_orderedInsert h₁, evalPath_orderedInsert h₁] by_cases hnz : allNZ ρ path = true <;> by_cases hz : 0 < evalParam ρ idx · rw [if_pos hz, if_pos hz] - simp only [evalPath, if_pos hnz, Nat.imax, + simp only [evalPath, if_pos hnz, Lean.Nat.imax, if_neg (Nat.pos_iff_ne_zero.mp hz), Nat.max_eq_max, ← Nat.add_max_add_right] refine ext_le fun x => ?_ simp only [Nat.max_le] omega · rw [if_neg hz, if_neg hz, Nat.eq_zero_of_not_pos hz] - simp only [evalPath, if_pos hnz, Nat.imax, reduceIte, Nat.zero_add] + simp only [evalPath, if_pos hnz, Lean.Nat.imax, reduceIte, Nat.zero_add] refine ext_le fun x => ?_ simp only [Nat.max_le] omega @@ -1056,7 +1056,7 @@ private theorem normalize_param_none_eval {ρ : List Nat} {u : KUniv m} (if k != 0 then acc.addVar idx k path else acc)) = max (NormLevel.eval ρ acc) (evalPath ρ path - (Nat.imax ((KUniv.toVLevel u).eval ρ) (evalParam ρ idx) + (Lean.Nat.imax ((KUniv.toVLevel u).eval ρ) (evalParam ρ idx) + k.toNat)) := by have hmem : idx ∈ path := orderedInsert_none h₁ split @@ -1074,7 +1074,7 @@ private theorem normalize_param_none_eval {ρ : List Nat} {u : KUniv m} · have hz : 0 < evalParam ρ idx := by simp only [allNZ, List.all_eq_true, decide_eq_true_eq] at hnz exact hnz idx hmem - simp only [evalPath, if_pos hnz, Nat.imax, + simp only [evalPath, if_pos hnz, Lean.Nat.imax, if_neg (Nat.pos_iff_ne_zero.mp hz), Nat.max_eq_max, ← Nat.add_max_add_right] refine ext_le fun x => ?_ @@ -1095,7 +1095,7 @@ private theorem normalize_param_none_eval {ρ : List Nat} {u : KUniv m} exact hnz idx hmem have hle : evalParam ρ idx ≤ NormLevel.eval ρ acc := hp.mem_le hmem hnz - simp only [evalPath, if_pos hnz, Nat.imax, + simp only [evalPath, if_pos hnz, Lean.Nat.imax, if_neg (Nat.pos_iff_ne_zero.mp hz), Nat.max_eq_max] refine ext_le fun x => ?_ simp only [Nat.max_le] @@ -1398,7 +1398,8 @@ theorem normLevelLe_eval {ρ : List Nat} {l₁ l₂ : NormLevel} exact hwf p₂ n₂ hfind₂ _ hvmem have h1ev : 1 ≤ evalParam ρ n₂.vars[i].idx := by rw [allNZ, List.all_eq_true] at hnz₂ - simpa using hnz₂ _ hidx + have h0 : 0 < evalParam ρ n₂.vars[i].idx := by simpa using hnz₂ _ hidx + omega have hoff : n₁.constant.toNat ≤ n₂.vars[i].offset.toNat + 1 := by refine Nat.le_trans (UInt64.le_iff_toNat_le.mp (of_decide_eq_true hvle)) ?_ @@ -1708,7 +1709,7 @@ private theorem forIn_id_invariant {α β : Type _} {P : β → Prop} : P (match f a b with | .yield b' => b' | .done b' => b')) → P (forIn (m := Id) l init f) | [], init, f, hinit, _ => by - simpa using hinit + exact hinit | a :: as, init, f, hinit, hstep => by rw [List.forIn_cons] have h0 := hstep a (List.mem_cons_self ..) init hinit @@ -1873,7 +1874,7 @@ private theorem toList_keys_nodup (l : NormLevel) : (l.toList.map Prod.fst).Nodup := by refine List.Pairwise.map _ ?_ RBTree.RBMap.toList_sorted intro a b hlt heq - have hc := Batteries.RBNode.cmpLT_iff.mp hlt + have hc := RBTree.RBNode.cmpLT_iff.mp hlt rw [heq] at hc have hself : compare b.1 b.1 = .eq := Std.ReflCmp.compare_self rw [hself] at hc @@ -2370,8 +2371,60 @@ theorem normalizeLevel_eval {ρ : List Nat} {u : KUniv m} subsumption_eval (varsOnPath_normalizeAux u [] 0 _ varsOnPath_seed), normalizeAux_eval (by simpa using hu) EvalPaths.nil, seed_eval] simp [evalPath, allNZ] + +/-- A canonical form whose entries are all empty denotes `0`: each entry + contributes `0`, and `eval` is their max. -/ +theorem NormLevel.eval_eq_zero_of_all_empty {ρ : List Nat} {l : NormLevel} + (h : ∀ e ∈ l.toList, entryNonEmpty e = false) : + NormLevel.eval ρ l = 0 := by + refine Nat.le_zero.mp (NormLevel.eval_le.mpr ?_) + intro p n hf + have hmem : (p, n) ∈ l.toList := by + obtain ⟨y, hy, hcmp⟩ := RBTree.RBMap.find?_some_mem_toList hf + cases Std.LawfulEqCmp.eq_of_compare hcmp + exact hy + rw [eval_of_not_entryNonEmpty (h _ hmem)] + exact evalPath_le.mpr fun _ => Nat.zero_le _ + end Level +/-- A universe with a nonzero denotation at some assignment is not `Prop`. + The semantic test cannot be evaluated by `decide`: `normalizeLevel` is + well-founded (its `imax` cases rebuild the level), so it has no kernel + normal form. This routes the fact through `normalizeLevel_eval` + instead, which is how any concrete `isSemanticZero = false` obligation + should be discharged. -/ +theorem KUniv.isSemanticZero_eq_false {m : Mode} {u : KUniv m} + {ρ : List Nat} (hu : u.size < UInt64.size) + (hpos : 0 < (KUniv.toVLevel u).eval ρ) : u.isSemanticZero = false := by + rw [KUniv.isSemanticZero, Bool.or_eq_false_iff] + refine ⟨?_, ?_⟩ + · cases u <;> simp_all [KUniv.isZero, KUniv.toVLevel, + Lean4Lean.VLevel.eval] + · rw [Bool.eq_false_iff, ne_eq, List.all_eq_true] + intro hall + have hzero : Level.NormLevel.eval ρ (Level.normalizeLevel u) = 0 := + Level.NormLevel.eval_eq_zero_of_all_empty fun e he => by + simpa using hall e he + rw [Level.normalizeLevel_eval hu] at hzero + omega + +/-- A universe the semantic `Prop` test accepts denotes `0` at every + assignment. `isZero` is the syntactic fast path; otherwise every + canonical entry is empty, and `normalizeLevel_eval` transports that + back to the denotation. -/ +theorem KUniv.toVLevel_equiv_zero_of_isSemanticZero {m : Mode} {u : KUniv m} + (hu : u.size < UInt64.size) (hzero : u.isSemanticZero = true) : + KUniv.toVLevel u ≈ .zero := by + rw [KUniv.isSemanticZero, Bool.or_eq_true] at hzero + refine Lean4Lean.VLevel.equiv_def.mpr fun ρ => ?_ + show _ = 0 + rcases hzero with h | h + · rw [KUniv.toVLevel_of_isZero h]; rfl + · rw [← Level.normalizeLevel_eval (ρ := ρ) hu] + exact Level.NormLevel.eval_eq_zero_of_all_empty fun e he => by + simpa using List.all_eq_true.mp h e he + /-! ### The canonical-form frontier, assembled -/ /-- Canonical-form equality is semantically sound. -/ @@ -2531,8 +2584,8 @@ theorem isNeverZero_eval (ρ : List Nat) : ∀ {u : KUniv m}, split <;> omega | .imax a b _, h => by have hb := isNeverZero_eval ρ (u := b) (by simpa [isNeverZero] using h) - show 0 < Nat.imax ((toVLevel a).eval ρ) ((toVLevel b).eval ρ) - simp only [Nat.imax] + show 0 < Lean.Nat.imax ((toVLevel a).eval ρ) ((toVLevel b).eval ρ) + simp only [Lean.Nat.imax] rw [if_neg (by omega)] simp only [Nat.max_eq_max, Nat.max_def] split <;> omega @@ -2750,7 +2803,7 @@ theorem toVLevel_mkIMax {a b : KUniv m} | _ => false) then b else if a == b then a else mkIMaxRaw a b).toVLevel.eval ρ - = Nat.imax ((toVLevel a).eval ρ) ((toVLevel b).eval ρ) + = Lean.Nat.imax ((toVLevel a).eval ρ) ((toVLevel b).eval ρ) generalize hc1 : (match a with | .succ inner _ => inner.isZero | _ => false) = aOne @@ -2760,19 +2813,19 @@ theorem toVLevel_mkIMax {a b : KUniv m} have hmax := VLevel.equiv_def.mp (toVLevel_mkMax hinj ha hb) ρ have hpos := isNeverZero_eval ρ (u := b) hnz rw [hmax] - simp only [Nat.imax] + simp only [Lean.Nat.imax] rw [if_neg (by omega)] rfl · split · -- b is zero: imax _ 0 = 0 next hz => rw [toVLevel_of_isZero hz, show (VLevel.zero.eval ρ) = 0 from rfl] - simp [Nat.imax] + simp [Lean.Nat.imax] · split · -- a is zero: imax 0 x = x next hz => rw [toVLevel_of_isZero hz, show (VLevel.zero.eval ρ) = 0 from rfl] - simp only [Nat.imax] + simp only [Lean.Nat.imax] split · next h0 => omega · simp only [Nat.max_eq_max, Nat.max_def] @@ -2788,9 +2841,9 @@ theorem toVLevel_mkIMax {a b : KUniv m} rw [toVLevel_of_isZero (by simpa using hM)] rfl show (toVLevel b).eval ρ - = Nat.imax ((toVLevel inner).eval ρ + 1) + = Lean.Nat.imax ((toVLevel inner).eval ρ + 1) ((toVLevel b).eval ρ) - simp only [Nat.imax] + simp only [Lean.Nat.imax] split · next h0 => omega · simp only [Nat.max_eq_max, Nat.max_def] @@ -2807,7 +2860,7 @@ theorem toVLevel_mkIMax {a b : KUniv m} have heq := (hinj a b (.inl .refl) (.inr .refl)).toVLevel_eq hbeq rw [heq] - simp only [Nat.imax] + simp only [Lean.Nat.imax] split · next h0 => omega · simp only [Nat.max_eq_max, Nat.max_def] diff --git a/Ix/Tc/Verify/NatFixture.lean b/Ix/Tc/Verify/NatFixture.lean index f60fd4209..acfa75803 100644 --- a/Ix/Tc/Verify/NatFixture.lean +++ b/Ix/Tc/Verify/NatFixture.lean @@ -259,16 +259,19 @@ def natEnv₁ : VEnv where constants := fun name => if natName = name then some natConstant else none defeqs := fun _ => False + structEtas := fun _ => False def natEnv₂ : VEnv where constants := fun name => if zeroName = name then some zeroConstant else natEnv₁.constants name defeqs := fun _ => False + structEtas := fun _ => False def natEnv : VEnv where constants := fun name => if succName = name then some succConstant else natEnv₂.constants name defeqs := fun _ => False + structEtas := fun _ => False theorem addNat : VEnv.empty.addConst natName natConstant = some natEnv₁ := by @@ -493,6 +496,7 @@ def goodEnv : VEnv where if goodName = name then some goodConstant.toVConstant else natEnv.constants name defeqs := natEnv.defeqs + structEtas := natEnv.structEtas theorem addGood : natEnv.addConst goodName goodConstant.toVConstant = some goodEnv := by @@ -912,14 +916,14 @@ theorem supportExpr_whnfMeaning : obtain ⟨name, ci, hresolved⟩ := trustedCatalogRelNat.resolve nat_trusted catalog_nat have huvars : ci.uvars = 0 := by - simpa [natConcrete] using hresolved.uvars.symm + simpa [natConcrete, KConst.lvls] using hresolved.uvars.symm have htr0 := hresolved.trKExprS_const (ctx := []) (us := #[]) (info := supportExpr.info) (by simp) (by rfl) have htr : TrKExprS worldNat.venv 0 worldNat.nameOf RawProjRel.none [] supportExpr (.const name []) := by - simpa [supportExpr, huvars] using htr0 + simpa [supportExpr, ← KExpr.mkConst_shape, huvars] using htr0 have hwf0 : VExpr.WF worldNat.venv ci.uvars [] (.const name []) := by refine ⟨_, VEnv.HasType.const hresolved.lookup (by simp) ?_⟩ @@ -1163,7 +1167,7 @@ theorem warmKey_matches_wf (prims : Primitives .anon) : rw [hexact] at hrun cases hrun simp [whnfContextKeys] - simpa [whnfContextKeys] using + simpa [whnfContextKeys, WhnfContextKeys.closed] using (TcM.whnfKey_matches_wf (layer := .accelerated) (semantics := whnfSemantics) (trProj := RawProjRel.none) (world := worldGood) (support := support) (keys := whnfContextKeys) @@ -1459,7 +1463,7 @@ theorem bvarZetaCtxRecon (prims : Primitives .anon) : CtxRecon' worldGood.venv 0 worldGood.nameOf RawProjRel.none [(supportExpr, some betaArg)] [] bvarZetaCtx := .bvar_let .nil betaTy_tr betaArg_tr betaArg_type - simpa [bvarZetaState, noAccelState] using hrec + simpa [state, bvarZetaState, noAccelState] using hrec theorem bvarZetaStateInv (prims : Primitives .anon) : WhnfStateInv .structuralNoAccel whnfSemantics RawProjRel.none worldGood support @@ -1568,7 +1572,7 @@ theorem fvarZetaCtxRecon (prims : Primitives .anon) : CtxRecon' worldGood.venv 0 worldGood.nameOf RawProjRel.none [] [(fvarZetaId, .ldecl () supportExpr betaArg)] fvarZetaCtx := .fvar .nil (.vlet betaTy_tr betaArg_tr betaArg_type) (by simp) - simpa [fvarZetaState, noAccelState, LocalContext.push] using hrec + simpa [state, fvarZetaState, noAccelState, LocalContext.push] using hrec · apply LocalContext.WF.push .empty simp [fvarZetaId] · intro p hp @@ -1693,9 +1697,10 @@ theorem projectionReduceEval (prims : Primitives .anon) : rw [RecM.tryProjReduce_eq, RecM.tryProjPrepare_eq] unfold projectionValue rw [KExpr.mkApp_shape, KExpr.mkConst_shape] - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] - unfold RecM.tryProjReduceTail rw [ReaderT.run_bind] + unfold RecM.tryProjReduceTail + simp only + rw [ReaderT.run_pure, pure_bind, ReaderT.run_bind] change EStateM.bind (ReaderT.run (RecM.tryReduceFinValDecidableRec natId 0 @@ -1705,7 +1710,6 @@ theorem projectionReduceEval (prims : Primitives .anon) : unfold EStateM.bind rw [RecM.tryReduceFinValDecidableRec_noAccel rfl] simp only - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] simp only [KExpr.collectSpine, KExpr.collectSpine.go] rw [ReaderT.run_bind, ReaderT.run_monadLift] change EStateM.bind (TcM.tryGetConst succId) _ (noAccelState prims) = _ @@ -1788,7 +1792,7 @@ theorem iotaStateInv (prims : Primitives .anon) : · have hcat : worldGood.catalog iotaId = some iotaConcrete := by exact catalog_iota simpa [iotaState] using hbase.1.core.load hcat - · simpa [iotaState] using hbase.1.internSupport + · simpa [iotaState, KEnv.insert] using hbase.1.internSupport · intro entry hentry apply hbase.1.caches cases hentry <;> (constructor; assumption) @@ -1830,7 +1834,7 @@ theorem iotaGetZero (prims : Primitives .anon) : Std.HashMap.getElem?_insert] split · next h => exact False.elim (hne (eq_of_beq h)) - · simpa [noAccelState, state] using loadedEnv_zero_k1e + · simpa [KEnv.get?, noAccelState, state] using loadedEnv_zero_k1e rw [henv] rfl @@ -1853,6 +1857,7 @@ theorem iotaCleanup (prims : Primitives .anon) : (RecM.evalNatOffsetLiteral iotaResult 0).run betaHarnessMethods (iotaState prims) = .ok (some 0) (iotaState prims) := by unfold RecM.evalNatOffsetLiteral RecM.evalNatOffsetLiteralFuel + rw [show (256 - 0 : Nat) = Nat.succ 255 from rfl] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run RecM.prims betaHarnessMethods) _ (iotaState prims) = _ @@ -1904,6 +1909,7 @@ theorem iotaCleanupOfNatValue (prims : Primitives .anon) (RecM.evalNatOffsetLiteral e 0).run betaHarnessMethods (iotaState prims) = .ok (some value) (iotaState prims) := by unfold RecM.evalNatOffsetLiteral RecM.evalNatOffsetLiteralFuel + rw [show (256 - 0 : Nat) = Nat.succ 255 from rfl] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run RecM.prims betaHarnessMethods) _ (iotaState prims) = _ @@ -2147,7 +2153,7 @@ theorem iotaStringGetZeroOfFrame {s' : TcState .anon} rw [Std.HashMap.getElem?_insert] split · next h => exact False.elim (hneIota (eq_of_beq h)) - · simpa [noAccelState, state] using loadedEnv_zero_k1e + · simpa [KEnv.get?, noAccelState, state] using loadedEnv_zero_k1e have hget : s'.env.get? zeroId = iotaStringState.env.get? zeroId := by unfold KEnv.get? rw [hconsts] @@ -2453,6 +2459,7 @@ theorem kIotaSynthCleanup : (RecM.evalNatOffsetLiteral kSynthCtor 0).run kIotaHarnessMethods kIotaAfterIntern = .ok (some 0) kIotaAfterIntern := by unfold RecM.evalNatOffsetLiteral RecM.evalNatOffsetLiteralFuel + rw [show (256 - 0 : Nat) = Nat.succ 255 from rfl] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run RecM.prims kIotaHarnessMethods) _ kIotaAfterIntern = _ @@ -3106,9 +3113,15 @@ theorem structEtaIotaSuccess : probes := structEtaProbeTrace rhs := structEtaRhs sInst := structEtaState - admissible := by rfl + admissible := by + simp only [RecM.StructEtaSortAdmissible, structEtaProbeTrace, + RecM.structEtaSortRejected, structEtaType] + exact KUniv.isSemanticZero_eq_false (ρ := []) (by decide) (by decide) instantiation := structEtaInstantiate - rebuild := by simpa using hbuild } + rebuild := by + simpa [structEtaSelectionTrace, structEtaProbeTrace, structEtaInfo, + structEtaRule] + using hbuild } exact ⟨result, sf, trace, trace.eval⟩ /-- The final constructor dispatcher genuinely takes its non-constructor @@ -3306,7 +3319,7 @@ theorem structuralNatLit_type (n : Nat) : (U := 0) (Γ := []) (ci := succConstant) (ls := []) (by simpa [worldGood, goodEnv, goodName, succName] using natEnv_succ) (by intro l hl; simp at hl) rfl - simpa [VExpr.natLit, VExpr.natSucc, succName] using + simpa [Lean4Lean.VExpr.inst, VExpr.natLit, VExpr.natSucc, succName] using Lean4Lean.VEnv.HasType.app hsucc ih /-- The finite Nat world supplies the uniform literal/projection facts needed @@ -3336,7 +3349,7 @@ theorem structuralBetaSource_type : worldGood.venv.HasType 0 [] (.app (.lam (.const natName []) (.bvar 0)) (.const zeroName [])) (.const natName []) := by - simpa using Lean4Lean.VEnv.HasType.app + simpa [Lean4Lean.VExpr.inst] using Lean4Lean.VEnv.HasType.app (Lean4Lean.VEnv.HasType.lam betaA_type betaBody_type) betaArg_type theorem structuralBetaSource_constructed : KExpr.Constructed betaSource := by @@ -3387,7 +3400,7 @@ theorem structuralLoopCtxRecon (prims : Primitives .anon) : .fvar .nil (.vlet betaTy_tr structuralBetaSource_tr structuralBetaSource_type) (by simp) - simpa [structuralLoopState, noAccelState, LocalContext.push] using hrec + simpa [state, structuralLoopState, noAccelState, LocalContext.push] using hrec · apply LocalContext.WF.push .empty simp [fvarZetaId] · intro p hp @@ -3447,18 +3460,18 @@ theorem structuralLoopArg_tr : theorem structuralLoopA_type : worldGood.venv.HasType 0 structuralLoopCtx.toCtx (.const natName []) (.sort (.succ .zero)) := by - simpa [structuralLoopCtx] using betaA_type + simpa [KVLCtx.toCtx, structuralLoopCtx] using betaA_type theorem structuralLoopBody_type : worldGood.venv.HasType 0 ((.const natName []) :: structuralLoopCtx.toCtx) (.bvar 0) (.const natName []) := by - simpa [structuralLoopCtx] using betaBody_type + simpa [KVLCtx.toCtx, structuralLoopCtx] using betaBody_type theorem structuralLoopArg_type : worldGood.venv.HasType 0 structuralLoopCtx.toCtx (.const zeroName []) (.const natName []) := by - simpa [structuralLoopCtx] using betaArg_type + simpa [KVLCtx.toCtx, structuralLoopCtx] using betaArg_type /-- Second local meaning: beta reduces the exposed identity application to `Nat.zero` in the same mixed context. -/ @@ -3777,7 +3790,7 @@ theorem fullCoreColdAcceptance (prims : Primitives .anon) : WhnfStateInv .structuralNoAccel whnfSemantics RawProjRel.none worldGood coreCacheSupport 0 [] (fullCoreWarmState prims) ∧ WhnfMeaning RawProjRel.none worldGood 0 [] betaSource betaArg := by - simpa [whnfSemantics, fullCoreWarmState] using + simpa [whnfContextKeys, WhnfContextKeys.closed, betaSource, KExpr.mkApp, whnfSemantics, fullCoreWarmState] using (RecM.whnfCoreWithFlags_fullMiss_acceptance (keys := whnfContextKeys) (fallback := CacheSemantics.blockErrorsOnly) structuralWhnfTheory (.direct RecM.WhnfCoreNonLeaf.app) rfl @@ -3795,7 +3808,7 @@ theorem fullCoreWarmAcceptance (prims : Primitives .anon) : WhnfStateInv .structuralNoAccel whnfSemantics RawProjRel.none worldGood coreCacheSupport 0 [] (fullCoreWarmState prims) ∧ WhnfMeaning RawProjRel.none worldGood 0 [] betaSource betaArg := by - simpa [whnfSemantics] using + simpa [whnfContextKeys, WhnfContextKeys.closed, betaSource, KExpr.mkApp, whnfSemantics] using (RecM.whnfCoreWithFlags_fullHit_acceptance (keys := whnfContextKeys) (fallback := CacheSemantics.blockErrorsOnly) (.direct RecM.WhnfCoreNonLeaf.app) rfl @@ -3815,7 +3828,7 @@ theorem cheapCorePolicyMissAcceptance (prims : Primitives .anon) : WhnfStateInv .structuralNoAccel whnfSemantics RawProjRel.none worldGood coreCacheSupport 0 [] (bothCoreWarmState prims) ∧ WhnfMeaning RawProjRel.none worldGood 0 [] betaSource betaArg := by - simpa [whnfSemantics, bothCoreWarmState] using + simpa [whnfContextKeys, WhnfContextKeys.closed, betaSource, KExpr.mkApp, whnfSemantics, bothCoreWarmState] using (RecM.whnfCoreWithFlags_cheapMiss_acceptance (keys := whnfContextKeys) (fallback := CacheSemantics.blockErrorsOnly) structuralWhnfTheory (.direct RecM.WhnfCoreNonLeaf.app) rfl @@ -3833,7 +3846,7 @@ theorem cheapCoreWarmAcceptance (prims : Primitives .anon) : WhnfStateInv .structuralNoAccel whnfSemantics RawProjRel.none worldGood coreCacheSupport 0 [] (bothCoreWarmState prims) ∧ WhnfMeaning RawProjRel.none worldGood 0 [] betaSource betaArg := by - simpa [whnfSemantics] using + simpa [whnfContextKeys, WhnfContextKeys.closed, betaSource, KExpr.mkApp, whnfSemantics] using (RecM.whnfCoreWithFlags_cheapHit_acceptance (keys := whnfContextKeys) (fallback := CacheSemantics.blockErrorsOnly) (.direct RecM.WhnfCoreNonLeaf.app) rfl @@ -3887,7 +3900,7 @@ theorem fullCoreWarm_getZero (prims : Primitives .anon) : simp only have henv : (fullCoreWarmState prims).env.get? zeroId = some zeroConcrete := by - simpa [fullCoreWarmState, noAccelState, state] using loadedEnv_zero_k1e + simpa [KEnv.get?, fullCoreWarmState, noAccelState, state] using loadedEnv_zero_k1e rw [henv] rfl @@ -4437,7 +4450,7 @@ theorem fullNoDeltaColdAcceptance (prims : Primitives .anon) : WhnfStateInv .structuralNoAccel whnfSemantics RawProjRel.none worldGood coreCacheSupport 0 [] (fullNoDeltaWarmState prims) ∧ WhnfMeaning RawProjRel.none worldGood 0 [] betaSource betaArg := by - simpa [RecM.whnfNoDelta, whnfSemantics, fullNoDeltaWarmState] using + simpa [whnfContextKeys, WhnfContextKeys.closed, betaSource, KExpr.mkApp, RecM.whnfNoDelta, whnfSemantics, fullNoDeltaWarmState] using (RecM.whnfNoDeltaImpl_fullMiss_acceptance (keys := whnfContextKeys) (fallback := CacheSemantics.blockErrorsOnly) structuralWhnfTheory (.direct RecM.WhnfDriverNonLeaf.app) rfl @@ -4453,7 +4466,7 @@ theorem fullNoDeltaWarmAcceptance (prims : Primitives .anon) : WhnfStateInv .structuralNoAccel whnfSemantics RawProjRel.none worldGood coreCacheSupport 0 [] (fullNoDeltaWarmState prims) ∧ WhnfMeaning RawProjRel.none worldGood 0 [] betaSource betaArg := by - simpa [RecM.whnfNoDelta, whnfSemantics] using + simpa [whnfContextKeys, WhnfContextKeys.closed, betaSource, KExpr.mkApp, RecM.whnfNoDelta, whnfSemantics] using (RecM.whnfNoDeltaImpl_fullHit_acceptance (keys := whnfContextKeys) (fallback := CacheSemantics.blockErrorsOnly) (.direct RecM.WhnfDriverNonLeaf.app) rfl @@ -4564,7 +4577,7 @@ theorem betaFullChargedGetZero (prims : Primitives .anon) : simp only have henv : (fullWhnfChargedState prims).env.get? zeroId = some zeroConcrete := by - simpa [fullWhnfChargedState, fullNoDeltaWarmState, fullCoreWarmState, + simpa [KEnv.get?, fullWhnfChargedState, fullNoDeltaWarmState, fullCoreWarmState, noAccelState, state] using loadedEnv_zero_k1e rw [henv] rfl @@ -4758,7 +4771,7 @@ theorem fullWhnfColdAcceptance (prims : Primitives .anon) : WhnfStateInv .structuralNoAccel whnfSemantics RawProjRel.none worldGood coreCacheSupport 0 [] (fullWhnfWarmState prims) ∧ WhnfMeaning RawProjRel.none worldGood 0 [] betaSource betaArg := by - simpa [RecM.whnf, whnfSemantics, fullWhnfWarmState] using + simpa [whnfContextKeys, WhnfContextKeys.closed, betaSource, KExpr.mkApp, RecM.whnf, whnfSemantics, fullWhnfWarmState] using (RecM.whnfWithNatSuccMode_miss_acceptance (keys := whnfContextKeys) (fallback := CacheSemantics.blockErrorsOnly) structuralWhnfTheory (.direct RecM.WhnfDriverNonLeaf.app) @@ -4777,7 +4790,7 @@ theorem fullWhnfWarmAcceptance (prims : Primitives .anon) : WhnfStateInv .structuralNoAccel whnfSemantics RawProjRel.none worldGood coreCacheSupport 0 [] (fullWhnfWarmState prims) ∧ WhnfMeaning RawProjRel.none worldGood 0 [] betaSource betaArg := by - simpa [RecM.whnf, whnfSemantics] using + simpa [whnfContextKeys, WhnfContextKeys.closed, betaSource, KExpr.mkApp, RecM.whnf, whnfSemantics] using (RecM.whnfWithNatSuccMode_hit_acceptance (keys := whnfContextKeys) (fallback := CacheSemantics.blockErrorsOnly) (.direct RecM.WhnfDriverNonLeaf.app) (fullWhnfPrefixWarm prims) @@ -4861,7 +4874,7 @@ theorem bvarStuckCtxRecon (prims : Primitives .anon) : CtxRecon' worldGood.venv 0 worldGood.nameOf RawProjRel.none [(supportExpr, none)] [] bvarStuckCtx := .bvar_lam .nil betaTy_tr ⟨_, betaA_type⟩ - simpa [bvarStuckState, noAccelState] using hrec + simpa [state, bvarStuckState, noAccelState] using hrec theorem bvarStuckStateInv (prims : Primitives .anon) : WhnfStateInv .structuralNoAccel whnfSemantics RawProjRel.none worldGood @@ -4938,7 +4951,7 @@ theorem fvarStuckCtxRecon (prims : Primitives .anon) : CtxRecon' worldGood.venv 0 worldGood.nameOf RawProjRel.none [] [(fvarZetaId, .cdecl () () supportExpr)] fvarStuckCtx := .fvar .nil (.vlam betaTy_tr ⟨_, betaA_type⟩) (by simp) - simpa [fvarStuckState, noAccelState, LocalContext.push] using hrec + simpa [state, fvarStuckState, noAccelState, LocalContext.push] using hrec · apply LocalContext.WF.push .empty simp [fvarZetaId] · intro p hp @@ -5064,7 +5077,7 @@ theorem appStuckIotaTransient (methods : Methods .anon) (s : TcState .anon) : (sourceInfo := (KExpr.mkApp appStuckHead betaArg).info) appStuckHead_iotaNonLambda methods s appStuckHead_type betaArg_type appStuckHead_tr betaArg_tr - simpa [appStuckSource] using h + simpa [← KExpr.mkApp_shape, appStuckSource] using h theorem appStuckSourceWitness : RecM.WhnfStep.Source RawProjRel.none worldGood fallbackSupport 0 [] @@ -5244,9 +5257,10 @@ theorem reduceMiss : rw [RecM.tryProjReduce_eq, RecM.tryProjPrepare_eq] unfold value rw [KExpr.mkSort_shape] - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] - unfold RecM.tryProjReduceTail rw [ReaderT.run_bind] + unfold RecM.tryProjReduceTail + simp only + rw [ReaderT.run_pure, pure_bind] change EStateM.bind (ReaderT.run (RecM.tryReduceFinValDecidableRec AmbientNat.natId 0 @@ -5255,7 +5269,6 @@ theorem reduceMiss : AmbientNat.betaHarnessMethods) _ state = _ unfold EStateM.bind rw [RecM.tryReduceFinValDecidableRec_noAccel rfl] - rfl /-- Non-vacuous projection fallback acceptance: the source translates under the live projection relation, the value callback succeeds, and the production @@ -5435,13 +5448,13 @@ theorem multiBetaApp1Type : (.forallE (.const natName []) (.forallE (.const natName []) (.const natName []))) := by unfold multiBetaApp1V - simpa using Lean4Lean.VEnv.HasType.app multiBetaLamType appStuckHead_type + simpa [Lean4Lean.VExpr.inst] using Lean4Lean.VEnv.HasType.app multiBetaLamType appStuckHead_type theorem multiBetaApp2Type : worldGood.venv.HasType 0 [] multiBetaApp2V (.forallE (.const natName []) (.const natName [])) := by unfold multiBetaApp2V - simpa using Lean4Lean.VEnv.HasType.app multiBetaApp1Type betaArg_type + simpa [Lean4Lean.VExpr.inst] using Lean4Lean.VEnv.HasType.app multiBetaApp1Type betaArg_type theorem multiBetaSourceTr : TrKExprS worldGood.venv 0 worldGood.nameOf RawProjRel.none [] @@ -5460,7 +5473,7 @@ theorem multiBetaSourceType : worldGood.venv.HasType 0 [] multiBetaSourceV (.const natName []) := by unfold multiBetaSourceV - simpa using Lean4Lean.VEnv.HasType.app multiBetaApp2Type betaArg_type + simpa [Lean4Lean.VExpr.inst] using Lean4Lean.VEnv.HasType.app multiBetaApp2Type betaArg_type /-- The one dynamically generated trailing application is a real execution request, not an unindexed support assumption. -/ @@ -5556,7 +5569,7 @@ theorem appStuckIotaInterned (prims : Primitives .anon) (sourceInfo := (KExpr.mkApp appStuckHead betaArg).info) hcollision hsupport (multiBetaStateInv prims) methods appStuckHead_type betaArg_type appStuckHead_tr betaArg_tr - simpa [appStuckSource] using h + simpa [← KExpr.mkApp_shape, appStuckSource] using h /-! ### ArgumentExecution iota-argument list execution -/ @@ -5786,7 +5799,7 @@ theorem multiIotaFirstTrace (prims : Primitives .anon) (by rw [multiIotaFirstResult] exact multiIotaSupport_intermediate) - simpa [multiBetaApp1V, multiIotaFirstResult] using hfirst + simpa [multiBetaLam, ← KExpr.mkLam_shape, multiBetaApp1V, multiIotaFirstResult] using hfirst theorem multiIotaSecondTrace (prims : Primitives .anon) (methods : Methods .anon) : @@ -5824,7 +5837,7 @@ theorem multiIotaThirdTrace (prims : Primitives .anon) RawProjRel.none worldGood multiIotaSupport 0 [] methods true appStuckHead multiBetaApp2V (noAccelState prims) [betaArg] appStuckSource multiBetaSourceV (noAccelState prims) := by - simpa [multiBetaSourceV] using + simpa [appStuckSource, multiBetaLam, KExpr.mkLam_shape, multiBetaSourceV] using (RecM.ApplyIotaArgsTrace.transientNonLambdaSingletonQuot (support := multiIotaSupport) (methods := methods) (expectedV := multiBetaApp2V) @@ -5966,7 +5979,7 @@ theorem multiIotaRuleAcceptance (prims : Primitives .anon) structuralWhnfTheory.projections.wf (by trivial))) obtain ⟨hrun, hfinalI, hframe, hfinalSupport, hfinalTr, hmeaning⟩ := h exact ⟨hrun, hfinalI, hframe, hfinalSupport, by - simpa [multiIotaPrefixSlice, multiIotaFieldSlice, + simpa [multiIotaRuleTrace, multiBetaLam, ← KExpr.mkLam_shape, multiIotaPrefixSlice, multiIotaFieldSlice, multiIotaTrailingSlice, multiIotaRule, multiBetaSource] using hmeaning⟩ theorem multiIotaCtorAcceptance (prims : Primitives .anon) @@ -5990,7 +6003,7 @@ theorem multiIotaCtorAcceptance (prims : Primitives .anon) structuralWhnfTheory.projections.wf (by trivial))) obtain ⟨hrun, hfinalI, hframe, hfinalSupport, hfinalTr, hmeaning⟩ := h exact ⟨hrun, hfinalI, hframe, hfinalSupport, by - simpa [multiIotaPrefixSlice, multiIotaFieldSlice, + simpa [multiIotaCtorTrace, multiIotaRuleTrace, multiBetaLam, ← KExpr.mkLam_shape, multiIotaPrefixSlice, multiIotaFieldSlice, multiIotaTrailingSlice, multiIotaRule, multiBetaSource] using hmeaning⟩ theorem multiBetaFinishRequests : @@ -6182,7 +6195,7 @@ theorem changedHeadIotaMiss (prims : Primitives .anon) unfold EStateM.bind have hget : s'.env.get? succId = some succConcrete := by rw [hframe] - simpa [noAccelState, state] using loadedEnv_succ_k1e + simpa [KEnv.get?, noAccelState, state] using loadedEnv_succ_k1e have hlookup : TcM.tryGetConst succId s' = .ok (some succConcrete) s' := by unfold TcM.tryGetConst diff --git a/Ix/Tc/Verify/RecursiveMethods/CallDomains.lean b/Ix/Tc/Verify/RecursiveMethods/CallDomains.lean index fa8d94d6f..d9bd2afa1 100644 --- a/Ix/Tc/Verify/RecursiveMethods/CallDomains.lean +++ b/Ix/Tc/Verify/RecursiveMethods/CallDomains.lean @@ -478,7 +478,7 @@ theorem runRec_wfAtOn (calls s.recFuel.toNat) Delta s action Q E) : TcM.WF (WhnfStateInv layer semantics trProj world scope uvars Delta) s (TcM.runRec action) Q E := by - simpa [TcM.runRec] using + exact haction (Ix.Tc.methodsN (m := .anon) s.recFuel.toNat) schedule.selected end TcM diff --git a/Ix/Tc/Verify/RecursiveMethods/FiniteSupportBoundary.lean b/Ix/Tc/Verify/RecursiveMethods/FiniteSupportBoundary.lean index 23322321a..19bc4d6b9 100644 --- a/Ix/Tc/Verify/RecursiveMethods/FiniteSupportBoundary.lean +++ b/Ix/Tc/Verify/RecursiveMethods/FiniteSupportBoundary.lean @@ -29,7 +29,9 @@ private theorem iterSucc_size (u : KUniv .anon) (n : Nat) : induction n with | zero => rfl | succ n ih => - simp only [iterSucc, KUniv.mkSucc, KUniv.size, ih] + have hstep : (KUniv.mkSucc (iterSucc u n)).size + = (iterSucc u n).size + 1 := rfl + simp only [iterSucc, hstep, ih] omega /-- A measure that observes precisely the universe carried by a sort. -/ diff --git a/Ix/Tc/Verify/RecursiveMethods/Public.lean b/Ix/Tc/Verify/RecursiveMethods/Public.lean index 3987fdaa9..bd927fd9c 100644 --- a/Ix/Tc/Verify/RecursiveMethods/Public.lean +++ b/Ix/Tc/Verify/RecursiveMethods/Public.lean @@ -103,8 +103,7 @@ theorem wf_legacy WhnfPost trProj world context.proposition.model.keys.uvars Delta sourceV result) := by have hnext := context.schedule.nextSelected - simpa [TcM.whnf, TcM.runRec, Methods.next] using - hnext.whnf hcall hsource + exact hnext.whnf hcall hsource /-- Public full-WHNF soundness over one finite suffix-state domain. -/ theorem wf @@ -122,8 +121,7 @@ theorem wf WhnfPost trProj world context.model.keys.uvars Delta sourceV result) := by have hnext := context.schedule.nextSelected - simpa [TcM.whnf, TcM.runRec, Methods.next] using - hnext.whnf hcall hsource + exact hnext.whnf hcall hsource end TcM.whnf @@ -147,8 +145,7 @@ theorem wf_legacy InferPost trProj world context.proposition.model.keys.uvars Delta sourceV ty) := by have hnext := context.schedule.nextSelected - simpa [TcM.infer, TcM.runRec, Methods.next] using - hnext.infer hcall hsource + exact hnext.infer hcall hsource /-- Public inference soundness over one finite suffix-state domain. -/ theorem wf @@ -165,8 +162,7 @@ theorem wf (fun ty _ => support ty ∧ InferPost trProj world context.model.keys.uvars Delta sourceV ty) := by have hnext := context.schedule.nextSelected - simpa [TcM.infer, TcM.runRec, Methods.next] using - hnext.infer hcall hsource + exact hnext.infer hcall hsource end TcM.infer @@ -192,8 +188,7 @@ theorem wf_legacy world.venv.IsDefEqU context.proposition.model.keys.uvars Delta.toCtx va vb) := by have hnext := context.schedule.nextSelected - simpa [TcM.isDefEq, TcM.runRec, Methods.next] using - hnext.isDefEq hcall ha hb + exact hnext.isDefEq hcall ha hb /-- Public definitional-equality soundness over one finite suffix-state domain. Scope preservation holds on both answers and on partial errors. -/ @@ -213,8 +208,7 @@ theorem wf (fun answer _ => answer = true → world.venv.IsDefEqU context.model.keys.uvars Delta.toCtx va vb) := by have hnext := context.schedule.nextSelected - simpa [TcM.isDefEq, TcM.runRec, Methods.next] using - hnext.isDefEq hcall ha hb + exact hnext.isDefEq hcall ha hb end TcM.isDefEq diff --git a/Ix/Tc/Verify/RecursiveMethods/ScopedCallDomains.lean b/Ix/Tc/Verify/RecursiveMethods/ScopedCallDomains.lean index 6a1af55af..a10318c27 100644 --- a/Ix/Tc/Verify/RecursiveMethods/ScopedCallDomains.lean +++ b/Ix/Tc/Verify/RecursiveMethods/ScopedCallDomains.lean @@ -309,7 +309,7 @@ theorem runRec_scoped_wfAtOn (calls s.recFuel.toNat) Delta s action Q E) : TcM.WF (ScopedWhnfStateInv model layer semantics scope Delta) s (TcM.runRec action) Q E := by - simpa [TcM.runRec] using + exact haction (Ix.Tc.methodsN (m := .anon) s.recFuel.toNat) schedule.selected end TcM diff --git a/Ix/Tc/Verify/RecursiveMethods/ScopedSortInference.lean b/Ix/Tc/Verify/RecursiveMethods/ScopedSortInference.lean index ec900b324..3111a9e0e 100644 --- a/Ix/Tc/Verify/RecursiveMethods/ScopedSortInference.lean +++ b/Ix/Tc/Verify/RecursiveMethods/ScopedSortInference.lean @@ -124,7 +124,8 @@ theorem finite let context := ScopedInferenceCallDomainContext.sort hcollision hsourceSupport hresultSupport theory references (calls (.sort u info) n) - simpa [calls] using (next_sort_scopedWFAtOn context) + simpa [calls, Methods.ScopedStepWFAtOn] using + (next_sort_scopedWFAtOn context) /-- Recursion fuel one selects a depth-one callback table and requires the outer sort body at depth two. -/ @@ -173,9 +174,7 @@ theorem sort_scoped_wf_bounded hsourceSupport hresultSupport theory references (initial.recFuel.toNat + 1) have hnext := schedule.nextSelected - simpa [TcM.infer, TcM.runRec, Methods.next, - Methods.ScopedSortSchedule.calls] using - hnext.infer (by rfl) hsource + exact hnext.infer (by rfl) hsource /-- Explicit fuel-one specialization of the scoped public sort run. -/ theorem sort_scoped_wf_fuel_one diff --git a/Ix/Tc/Verify/RecursiveMethods/SortInference.lean b/Ix/Tc/Verify/RecursiveMethods/SortInference.lean index 2e4d849be..0cac65417 100644 --- a/Ix/Tc/Verify/RecursiveMethods/SortInference.lean +++ b/Ix/Tc/Verify/RecursiveMethods/SortInference.lean @@ -106,9 +106,7 @@ theorem one | succ n => exact context.currentWithin step n hn := by cases n with - | zero => - simpa [calls] using - (next_sort_wfAtOn context) + | zero => exact next_sort_wfAtOn context | succ n => omega /-- The selected depth-one production table satisfies the exact singleton @@ -148,7 +146,7 @@ theorem finite step n hn := by let context := InferenceCallDomainContext.sort hcollision hsourceSupport hresultSupport theory references (calls (.sort u info) n) - simpa [calls] using (next_sort_wfAtOn context) + exact next_sort_wfAtOn context /-- In particular, recursion fuel one has two justified body layers: the public body and its one-layer callback table. -/ diff --git a/Ix/Tc/Verify/ScopedSuffix/ClosedContext.lean b/Ix/Tc/Verify/ScopedSuffix/ClosedContext.lean index 1a3123f57..c07e5a8db 100644 --- a/Ix/Tc/Verify/ScopedSuffix/ClosedContext.lean +++ b/Ix/Tc/Verify/ScopedSuffix/ClosedContext.lean @@ -106,8 +106,10 @@ theorem scope_collisionFree (scope (trProj := trProj) (world := world) (uvars := uvars)).CollisionFree := by intro left right hleft hright hdigest simp [ContextDigestScope.Contains, scope] at hleft hright - subst left - subst right + have hl : left = [] := List.eq_of_mem_singleton hleft + have hr : right = [] := List.eq_of_mem_singleton hright + subst hl + subst hr rfl /-- Every possible suffix-key request from a closed reconciled state lands in diff --git a/Ix/Tc/Verify/Subst.lean b/Ix/Tc/Verify/Subst.lean index 5b6c1c116..e716a7684 100644 --- a/Ix/Tc/Verify/Subst.lean +++ b/Ix/Tc/Verify/Subst.lean @@ -485,8 +485,8 @@ private theorem liftPost_hit {S : KExpr .anon → Prop} {e r : KExpr .anon} (hsc : LiftScratchInv S shift sc) : LiftPost S shift cutoff e (liftCached e shift cutoff (it, sc)) := by have hrun : liftCached e shift cutoff (it, sc) = (r, (it, sc)) := by - rw [liftCached, if_neg hfast, run_pure_bind] - simp only [] + rw [liftCached, if_neg hfast] + try simp only [] rw [run_scratchGet_bind, hget] rfl rw [hrun] @@ -577,7 +577,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} sc.insert ((KExpr.var idx name (KExpr.mkVar idx name md).info).addr, cutoff) (it.internExpr (KExpr.mkVar (idx + shift) name)).1)) := by - rw [liftCached, if_neg hfast, run_pure_bind] + rw [liftCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -602,7 +602,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} (it, sc.insert ((KExpr.var idx name (KExpr.mkVar idx name md).info).addr, cutoff) (.var idx name (KExpr.mkVar idx name md).info))) := by - rw [liftCached, if_neg hfast, run_pure_bind] + rw [liftCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -633,7 +633,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} (it, sc.insert ((KExpr.fvar id name (KExpr.mkFVar id name md).info).addr, cutoff) (.fvar id name (KExpr.mkFVar id name md).info))) := by - rw [liftCached, if_neg hfast, run_pure_bind] + rw [liftCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] rfl @@ -659,7 +659,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} (it, sc.insert ((KExpr.sort u (KExpr.mkSort u md).info).addr, cutoff) (.sort u (KExpr.mkSort u md).info))) := by - rw [liftCached, if_neg hfast, run_pure_bind] + rw [liftCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] rfl @@ -687,7 +687,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} ((KExpr.const id us (KExpr.mkConst id us md).info).addr, cutoff) (.const id us (KExpr.mkConst id us md).info))) := by - rw [liftCached, if_neg hfast, run_pure_bind] + rw [liftCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] rfl @@ -732,7 +732,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} sc2.insert ((KExpr.app f a (KExpr.mkApp f a md).info).addr, cutoff) (it2.internExpr (KExpr.mkApp rf ra)).1)) := by - rw [liftCached, if_neg hfast, run_pure_bind] + rw [liftCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -798,7 +798,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} sc2.insert ((KExpr.lam n bi ty body (KExpr.mkLam n bi ty body md).info).addr, cutoff) (it2.internExpr (KExpr.mkLam n bi rty rbody)).1)) := by - rw [liftCached, if_neg hfast, run_pure_bind] + rw [liftCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -865,7 +865,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} sc2.insert ((KExpr.all n bi ty body (KExpr.mkAll n bi ty body md).info).addr, cutoff) (it2.internExpr (KExpr.mkAll n bi rty rbody)).1)) := by - rw [liftCached, if_neg hfast, run_pure_bind] + rw [liftCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -941,7 +941,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} sc3.insert ((KExpr.letE n ty val body nd (KExpr.mkLet n ty val body nd md).info).addr, cutoff) (it3.internExpr (KExpr.mkLet n rty rval rbody nd)).1)) := by - rw [liftCached, if_neg hfast, run_pure_bind] + rw [liftCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -999,7 +999,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} sc1.insert ((KExpr.prj id field val (KExpr.mkPrj id field val md).info).addr, cutoff) (it1.internExpr (KExpr.mkPrj id field rval)).1)) := by - rw [liftCached, if_neg hfast, run_pure_bind] + rw [liftCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -1039,7 +1039,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} ((KExpr.nat v blob (KExpr.mkNat v blob md).info).addr, cutoff) (.nat v blob (KExpr.mkNat v blob md).info))) := by - rw [liftCached, if_neg hfast, run_pure_bind] + rw [liftCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] rfl @@ -1067,7 +1067,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} ((KExpr.str v blob (KExpr.mkStr v blob md).info).addr, cutoff) (.str v blob (KExpr.mkStr v blob md).info))) := by - rw [liftCached, if_neg hfast, run_pure_bind] + rw [liftCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] rfl @@ -1392,8 +1392,8 @@ private theorem substPost_hit {S : KExpr .anon → Prop} WalkPost S (KExpr.substSpec · arg ·) depth body (substCached body arg depth (it, sc)) := by have hrun : substCached body arg depth (it, sc) = (r, (it, sc)) := by - rw [substCached, if_neg hfast, run_pure_bind] - simp only [] + rw [substCached, if_neg hfast] + try simp only [] rw [run_scratchGet_bind, hget] rfl rw [hrun] @@ -1454,7 +1454,7 @@ theorem substCached_spec {S : KExpr .anon → Prop} {arg : KExpr .anon} sc.insert ((KExpr.var idx name (KExpr.mkVar idx name md).info).addr, depth) (it1.internExpr rl).1)) := by - rw [substCached, if_neg hfast, run_pure_bind] + rw [substCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -1483,7 +1483,7 @@ theorem substCached_spec {S : KExpr .anon → Prop} {arg : KExpr .anon} sc.insert ((KExpr.var idx name (KExpr.mkVar idx name md).info).addr, depth) (it.internExpr (KExpr.mkVar (idx - 1) name)).1)) := by - rw [substCached, if_neg hfast, run_pure_bind] + rw [substCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -1561,7 +1561,7 @@ theorem substCached_spec {S : KExpr .anon → Prop} {arg : KExpr .anon} sc2.insert ((KExpr.app f a (KExpr.mkApp f a md).info).addr, depth) (it2.internExpr (KExpr.mkApp rf ra)).1)) := by - rw [substCached, if_neg hfast, run_pure_bind] + rw [substCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -1628,7 +1628,7 @@ theorem substCached_spec {S : KExpr .anon → Prop} {arg : KExpr .anon} sc2.insert ((KExpr.lam n bi ty body (KExpr.mkLam n bi ty body md).info).addr, depth) (it2.internExpr (KExpr.mkLam n bi rty rbody)).1)) := by - rw [substCached, if_neg hfast, run_pure_bind] + rw [substCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -1696,7 +1696,7 @@ theorem substCached_spec {S : KExpr .anon → Prop} {arg : KExpr .anon} sc2.insert ((KExpr.all n bi ty body (KExpr.mkAll n bi ty body md).info).addr, depth) (it2.internExpr (KExpr.mkAll n bi rty rbody)).1)) := by - rw [substCached, if_neg hfast, run_pure_bind] + rw [substCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -1773,7 +1773,7 @@ theorem substCached_spec {S : KExpr .anon → Prop} {arg : KExpr .anon} sc3.insert ((KExpr.letE n ty val body nd (KExpr.mkLet n ty val body nd md).info).addr, depth) (it3.internExpr (KExpr.mkLet n rty rval rbody nd)).1)) := by - rw [substCached, if_neg hfast, run_pure_bind] + rw [substCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -1832,7 +1832,7 @@ theorem substCached_spec {S : KExpr .anon → Prop} {arg : KExpr .anon} sc1.insert ((KExpr.prj id field val (KExpr.mkPrj id field val md).info).addr, depth) (it1.internExpr (KExpr.mkPrj id field rval)).1)) := by - rw [substCached, if_neg hfast, run_pure_bind] + rw [substCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -2110,8 +2110,8 @@ private theorem simulPost_hit {S : KExpr .anon → Prop} (simulSubstCached body substs depth (it, sc)) := by have hrun : simulSubstCached body substs depth (it, sc) = (r, (it, sc)) := by - rw [simulSubstCached, if_neg hfast, run_pure_bind] - simp only [] + rw [simulSubstCached, if_neg hfast] + try simp only [] rw [run_scratchGet_bind, hget] rfl rw [hrun] @@ -2201,7 +2201,7 @@ theorem simulSubstCached_spec {S : KExpr .anon → Prop} (it, sc) = (rl, (it1, sc.insert ((KExpr.var idx name (KExpr.mkVar idx name md).info).addr, depth) rl)) := by - rw [simulSubstCached, if_neg hfast, run_pure_bind] + rw [simulSubstCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -2235,7 +2235,7 @@ theorem simulSubstCached_spec {S : KExpr .anon → Prop} (it.internExpr (KExpr.mkVar (idx - substs.size.toUInt64) (anonName (m := .anon)))).1)) := by - rw [simulSubstCached, if_neg hfast, run_pure_bind] + rw [simulSubstCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -2319,7 +2319,7 @@ theorem simulSubstCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.app f a (KExpr.mkApp f a md).info).addr, depth) (it2.internExpr (KExpr.mkApp rf ra)).1)) := by - rw [simulSubstCached, if_neg hfast, run_pure_bind] + rw [simulSubstCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -2389,7 +2389,7 @@ theorem simulSubstCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.lam n bi ty body (KExpr.mkLam n bi ty body md).info).addr, depth) (it2.internExpr (KExpr.mkLam n bi rty rbody)).1)) := by - rw [simulSubstCached, if_neg hfast, run_pure_bind] + rw [simulSubstCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -2460,7 +2460,7 @@ theorem simulSubstCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.all n bi ty body (KExpr.mkAll n bi ty body md).info).addr, depth) (it2.internExpr (KExpr.mkAll n bi rty rbody)).1)) := by - rw [simulSubstCached, if_neg hfast, run_pure_bind] + rw [simulSubstCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -2541,7 +2541,7 @@ theorem simulSubstCached_spec {S : KExpr .anon → Prop} (KExpr.mkLet n ty val body nd md).info).addr, depth) (it3.internExpr (KExpr.mkLet n rty rval rbody nd)).1)) := by - rw [simulSubstCached, if_neg hfast, run_pure_bind] + rw [simulSubstCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -2603,7 +2603,7 @@ theorem simulSubstCached_spec {S : KExpr .anon → Prop} sc1.insert ((KExpr.prj id field val (KExpr.mkPrj id field val md).info).addr, depth) (it1.internExpr (KExpr.mkPrj id field rval)).1)) := by - rw [simulSubstCached, if_neg hfast, run_pure_bind] + rw [simulSubstCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -2915,8 +2915,8 @@ private theorem instRevPost_hit {S : KExpr .anon → Prop} (instantiateRevCached body fvars depth (it, sc)) := by have hrun : instantiateRevCached body fvars depth (it, sc) = (r, (it, sc)) := by - rw [instantiateRevCached, if_neg hfast, run_pure_bind] - simp only [] + rw [instantiateRevCached, if_neg hfast] + try simp only [] rw [run_scratchGet_bind, hget] rfl rw [hrun] @@ -2980,7 +2980,7 @@ theorem instantiateRevCached_spec {S : KExpr .anon → Prop} (KExpr.mkVar idx name md).info).addr, depth) fvars[(fvars.size.toUInt64 - 1 - (idx - depth)).toNat]!)) := by - rw [instantiateRevCached, if_neg hfast, run_pure_bind] + rw [instantiateRevCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3013,7 +3013,7 @@ theorem instantiateRevCached_spec {S : KExpr .anon → Prop} (it.internExpr (KExpr.mkVar (idx - fvars.size.toUInt64) (anonName (m := .anon)))).1)) := by - rw [instantiateRevCached, if_neg hfast, run_pure_bind] + rw [instantiateRevCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3097,7 +3097,7 @@ theorem instantiateRevCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.app f a (KExpr.mkApp f a md).info).addr, depth) (it2.internExpr (KExpr.mkApp rf ra)).1)) := by - rw [instantiateRevCached, if_neg hfast, run_pure_bind] + rw [instantiateRevCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3167,7 +3167,7 @@ theorem instantiateRevCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.lam n bi ty body (KExpr.mkLam n bi ty body md).info).addr, depth) (it2.internExpr (KExpr.mkLam n bi rty rbody)).1)) := by - rw [instantiateRevCached, if_neg hfast, run_pure_bind] + rw [instantiateRevCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3238,7 +3238,7 @@ theorem instantiateRevCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.all n bi ty body (KExpr.mkAll n bi ty body md).info).addr, depth) (it2.internExpr (KExpr.mkAll n bi rty rbody)).1)) := by - rw [instantiateRevCached, if_neg hfast, run_pure_bind] + rw [instantiateRevCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3319,7 +3319,7 @@ theorem instantiateRevCached_spec {S : KExpr .anon → Prop} (KExpr.mkLet n ty val body nd md).info).addr, depth) (it3.internExpr (KExpr.mkLet n rty rval rbody nd)).1)) := by - rw [instantiateRevCached, if_neg hfast, run_pure_bind] + rw [instantiateRevCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3381,7 +3381,7 @@ theorem instantiateRevCached_spec {S : KExpr .anon → Prop} sc1.insert ((KExpr.prj id field val (KExpr.mkPrj id field val md).info).addr, depth) (it1.internExpr (KExpr.mkPrj id field rval)).1)) := by - rw [instantiateRevCached, if_neg hfast, run_pure_bind] + rw [instantiateRevCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3710,8 +3710,8 @@ private theorem absPost_hit {S : KExpr .anon → Prop} {body r : KExpr .anon} (abstractFVarsCached body pos n depth (it, sc)) := by have hrun : abstractFVarsCached body pos n depth (it, sc) = (r, (it, sc)) := by - rw [abstractFVarsCached, if_neg hfast, run_pure_bind] - simp only [] + rw [abstractFVarsCached, if_neg hfast] + try simp only [] rw [run_scratchGet_bind, hget] rfl rw [hrun] @@ -3761,7 +3761,7 @@ theorem abstractFVarsCached_spec {S : KExpr .anon → Prop} sc.insert ((KExpr.var idx name (KExpr.mkVar idx name md).info).addr, depth) (it.internExpr (KExpr.mkVar (idx + n) name)).1)) := by - rw [abstractFVarsCached, if_neg hfast, run_pure_bind] + rw [abstractFVarsCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3821,7 +3821,7 @@ theorem abstractFVarsCached_spec {S : KExpr .anon → Prop} (KExpr.mkFVar id name md).info).addr, depth) (it.internExpr (KExpr.mkVar (depth + p) (anonName (m := .anon)))).1)) := by - rw [abstractFVarsCached, if_neg hfast, run_pure_bind] + rw [abstractFVarsCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3849,7 +3849,7 @@ theorem abstractFVarsCached_spec {S : KExpr .anon → Prop} (it, sc.insert ((KExpr.fvar id name (KExpr.mkFVar id name md).info).addr, depth) (.fvar id name (KExpr.mkFVar id name md).info))) := by - rw [abstractFVarsCached, if_neg hfast, run_pure_bind] + rw [abstractFVarsCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3918,7 +3918,7 @@ theorem abstractFVarsCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.app f a (KExpr.mkApp f a md).info).addr, depth) (it2.internExpr (KExpr.mkApp rf ra)).1)) := by - rw [abstractFVarsCached, if_neg hfast, run_pure_bind] + rw [abstractFVarsCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3989,7 +3989,7 @@ theorem abstractFVarsCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.lam nm bi ty body (KExpr.mkLam nm bi ty body md).info).addr, depth) (it2.internExpr (KExpr.mkLam nm bi rty rbody)).1)) := by - rw [abstractFVarsCached, if_neg hfast, run_pure_bind] + rw [abstractFVarsCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -4061,7 +4061,7 @@ theorem abstractFVarsCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.all nm bi ty body (KExpr.mkAll nm bi ty body md).info).addr, depth) (it2.internExpr (KExpr.mkAll nm bi rty rbody)).1)) := by - rw [abstractFVarsCached, if_neg hfast, run_pure_bind] + rw [abstractFVarsCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -4145,7 +4145,7 @@ theorem abstractFVarsCached_spec {S : KExpr .anon → Prop} (KExpr.mkLet nm ty val body nd md).info).addr, depth) (it3.internExpr (KExpr.mkLet nm rty rval rbody nd)).1)) := by - rw [abstractFVarsCached, if_neg hfast, run_pure_bind] + rw [abstractFVarsCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -4208,7 +4208,7 @@ theorem abstractFVarsCached_spec {S : KExpr .anon → Prop} sc1.insert ((KExpr.prj id field val (KExpr.mkPrj id field val md).info).addr, depth) (it1.internExpr (KExpr.mkPrj id field rval)).1)) := by - rw [abstractFVarsCached, if_neg hfast, run_pure_bind] + rw [abstractFVarsCached, if_neg hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] diff --git a/Ix/Tc/Verify/Totalization.lean b/Ix/Tc/Verify/Totalization.lean index 37c6a6984..73fcd5288 100644 --- a/Ix/Tc/Verify/Totalization.lean +++ b/Ix/Tc/Verify/Totalization.lean @@ -692,7 +692,6 @@ theorem RecM.checkNoUnsafeRefs_go_app RecM.checkNoUnsafeRefs.go callerSafety (a :: f :: stack) (seenExprs.insert (.app f a info : KExpr m).addr) seenConsts := by rw [RecM.checkNoUnsafeRefs.go] - split <;> simp /-! ## Tier A/B: total inductive validation and telescope scans -/ @@ -745,7 +744,6 @@ theorem RecM.validateExprWellScoped_go_app (seenExprs.insert ((.app f a info : KExpr m).addr, depth)) seenUnivs := by rw [RecM.validateExprWellScoped.go] - split <;> simp @[simp] theorem RecM.peelRuleIhForalls_equation (root : KExpr m) (flat : Array (FlatBlockMember m)) : diff --git a/Ix/Tc/Verify/Trans.lean b/Ix/Tc/Verify/Trans.lean index fcb8f3ebc..0cc7cd446 100644 --- a/Ix/Tc/Verify/Trans.lean +++ b/Ix/Tc/Verify/Trans.lean @@ -1824,7 +1824,8 @@ theorem IsDefEq.find?_uniq {env : VEnv} {U : Nat} (henv : VEnv.WF env) : exact ⟨⟨_, h4⟩, h3⟩ · simp rintro d₁' n₁' H1' rfl rfl d₂' n₂' H2' rfl rfl - simpa [Lean4Lean.VLocalDecl.depth] using find?_uniq henv hΔ H1' H2' + simpa [Lean4Lean.VLocalDecl.depth, KVLCtx.toCtx] using + find?_uniq henv hΔ H1' H2' /-- Transport of `find?`-success along a context defeq (upstream `VLCtx.IsDefEq.find?_defeqDFC`): a variable resolvable in `Δ₁` is diff --git a/Ix/Tc/Verify/VLCtx.lean b/Ix/Tc/Verify/VLCtx.lean index 4dd18bf29..c59e2aaa0 100644 --- a/Ix/Tc/Verify/VLCtx.lean +++ b/Ix/Tc/Verify/VLCtx.lean @@ -52,7 +52,7 @@ instance : LawfulHashable FVarId where /-- Translation-side local context: declarations optionally addressable by an `FVarId` (with its dependency list), innermost first. -/ -def KVLCtx := List (Option (FVarId × List FVarId) × VLocalDecl) +abbrev KVLCtx := List (Option (FVarId × List FVarId) × VLocalDecl) namespace KVLCtx diff --git a/Ix/Tc/Verify/Whnf.lean b/Ix/Tc/Verify/Whnf.lean index 95d21ff1e..c1a3d06bc 100644 --- a/Ix/Tc/Verify/Whnf.lean +++ b/Ix/Tc/Verify/Whnf.lean @@ -1068,7 +1068,6 @@ theorem lookupLetVal_eval {idx : UInt64} unfold TcM.lookupLetVal rw [get_bind_run] rw [if_neg (by omega)] - simp only [pure_bind] rw [hval] change EStateM.bind (TcM.runIntern (lift val (idx + 1) 0)) (fun r => pure (some r)) s = _ @@ -1083,17 +1082,18 @@ theorem lookupLetVal_none_state {idx : UInt64} {s s' : TcState .anon} (h : TcM.lookupLetVal idx s = .ok none s') : s' = s := by unfold TcM.lookupLetVal at h - change EStateM.bind (get : TcM .anon (TcState .anon)) _ s = _ at h - unfold EStateM.bind at h - rw [show (get : TcM .anon (TcState .anon)) s = .ok s s from rfl] at h - simp only at h + rw [get_bind_run] at h split at h · cases h rfl - · split at h - · cases h + · simp only [letFun] at h + cases hval : s.letVals[s.ctx.size - 1 - idx.toNat]! with + | none => + rw [hval] at h + cases h rfl - · rename_i val hval + | some val => + rw [hval] at h change EStateM.bind (TcM.runIntern (lift val (idx + 1) 0)) (fun r => pure (some r)) s = _ at h unfold EStateM.bind at h @@ -1112,22 +1112,12 @@ theorem ctxAddrForLbr_wf {I : TcState .anon → Prop} apply TcM.WF.bind (Q₁ := fun read s' => read = s ∧ s' = s) (TcM.WF.get fun _ => ⟨rfl, rfl⟩) rintro read before ⟨rfl, rfl⟩ + simp only [letFun] split · exact TcM.WF.pure fun _ => rfl - · apply TcM.WF.bind - (Q₁ := fun _ after => after = before) - (TcM.WF.pure fun _ => rfl) - intro _ after hafter - subst after - simp only - split + · split · exact TcM.WF.pure fun _ => rfl - · apply TcM.WF.bind - (Q₁ := fun _ after => after = before) - (TcM.WF.pure fun _ => rfl) - intro _ after hafter - subst after - refine TcM.WF.bind + · refine TcM.WF.bind (Q₁ := fun _ after => ContextKeyFrame before after) ?_ ?_ · exact TcM.WF.modifyGet (fun hI => hframe hI @@ -2062,7 +2052,7 @@ theorem whnfRec_wf (fun result _ => support result ∧ WhnfPost trProj world uvars Δ sourceV result) := by intro methods hmethods - simpa only [whnfRec] using hmethods.whnf hsource htr + exact hmethods.whnf hsource htr /-- The policy-sensitive recursive WHNF callback inherits the corresponding method-table contract. This is the callback used by the successor-collapse @@ -2079,7 +2069,7 @@ theorem whnfModeRec_wf (fun result _ => support result ∧ WhnfPost trProj world uvars Δ sourceV result) := by intro methods hmethods - simpa only [whnfModeRec] using hmethods.whnfMode hsource htr + exact hmethods.whnfMode hsource htr /-- Reading the production primitive table is state-transparent. Naming the exact reader frame avoids repeatedly unfolding `get` in primitive helpers. -/ @@ -2191,22 +2181,18 @@ theorem whnfNatReducerArg_post_wf (RecM.WF.get fun _ => rfl) intro saved s₁ hsaved subst saved - apply RecM.WF.bind - (Q₁ := fun observed after => observed = after) - (RecM.WF.get fun _ => rfl) - intro savedState afterSaved hsavedState - subst afterSaved + simp only [letFun] apply RecM.WF.bind (Q₁ := fun _ after => after = - {savedState with recFuel := - (min savedState.recFuel natReducerOpenArgRecFuel)}) + {s₁ with recFuel := + (min s₁.recFuel natReducerOpenArgRecFuel)}) · exact RecM.WF.modify (Q := fun _ after => after = - {savedState with recFuel := - (min savedState.recFuel natReducerOpenArgRecFuel)}) + {s₁ with recFuel := + (min s₁.recFuel natReducerOpenArgRecFuel)}) (f := fun state => {state with - recFuel := min savedState.recFuel natReducerOpenArgRecFuel}) + recFuel := min s₁.recFuel natReducerOpenArgRecFuel}) (fun hI => hI.set_recFuel _) (fun _ => rfl) · intro _ limited hlimited @@ -2232,20 +2218,20 @@ theorem whnfNatReducerArg_post_wf subst observed apply RecM.WF.bind (Q₁ := fun _ restored => restored = - {afterRead with recFuel := savedState.recFuel - - (min savedState.recFuel - (min savedState.recFuel natReducerOpenArgRecFuel - + {afterRead with recFuel := s₁.recFuel - + (min s₁.recFuel + (min s₁.recFuel natReducerOpenArgRecFuel - afterRead.recFuel))}) · exact RecM.WF.modify (Q := fun _ restored => restored = - {afterRead with recFuel := savedState.recFuel - - (min savedState.recFuel - (min savedState.recFuel natReducerOpenArgRecFuel - + {afterRead with recFuel := s₁.recFuel - + (min s₁.recFuel + (min s₁.recFuel natReducerOpenArgRecFuel - afterRead.recFuel))}) (f := fun state => - {state with recFuel := savedState.recFuel - - (min savedState.recFuel - (min savedState.recFuel natReducerOpenArgRecFuel - + {state with recFuel := s₁.recFuel - + (min s₁.recFuel + (min s₁.recFuel natReducerOpenArgRecFuel - afterRead.recFuel))}) (fun hI => hI.set_recFuel _) (fun _ => rfl) @@ -5861,8 +5847,9 @@ theorem finishAppResult_one (hintern : TcM.intern (KExpr.mkApp result arg) s = .ok final s') : (finishAppResult result #[arg] 0).run methods s = .ok final s' := by rw [finishAppResult_eq_foldlM] - change EStateM.bind (TcM.intern _) _ s = _ - simpa [EStateM.bind] using hintern + change EStateM.bind (TcM.intern (KExpr.mkApp result arg)) EStateM.Result.ok s = _ + simp only [EStateM.bind] + rw [hintern] /-- Finite execution certificate for rebuilding an application suffix. Each node records the exact dynamically generated application passed to @@ -6083,7 +6070,7 @@ theorem whnfCoreWithFlagsStep_betaOne (.app (.lam nm bi ty body lamMd) arg appMd) flags).run methods s = .ok (.next result) s' := by unfold whnfCoreWithFlagsStep - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] + rw [ReaderT.run_bind] simp only [KExpr.collectSpine, KExpr.collectSpine.go] change EStateM.bind (methods.whnfCoreFlags (.lam nm bi ty body lamMd) flags) _ s = _ @@ -6127,7 +6114,7 @@ theorem whnfCoreWithFlagsStep_betaMany (whnfCoreWithFlagsStep (.app f arg appInfo) flags).run methods s = .ok (.next result) s₃ := by unfold whnfCoreWithFlagsStep - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] + rw [ReaderT.run_bind] rw [hspine] change EStateM.bind (methods.whnfCoreFlags head flags) _ s = _ unfold EStateM.bind @@ -6292,7 +6279,7 @@ theorem whnfCoreWithFlagsStep_iota (whnfCoreWithFlagsStep (.app f arg appInfo) flags).run methods s = .ok (.next result) s₂ := by unfold whnfCoreWithFlagsStep - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] + rw [ReaderT.run_bind] rw [hspine] change EStateM.bind (methods.whnfCoreFlags (.const recId us headInfo) flags) _ s = _ @@ -6322,7 +6309,7 @@ theorem whnfCoreWithFlagsStep_appUnchangedDone (whnfCoreWithFlagsStep (.app f arg info) flags).run methods s = .ok (.done (.app f arg info)) s₂ := by unfold whnfCoreWithFlagsStep - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] + rw [ReaderT.run_bind] rw [hspine] change EStateM.bind (methods.whnfCoreFlags head flags) _ s = _ unfold EStateM.bind @@ -6349,7 +6336,7 @@ theorem whnfCoreWithFlagsStep_appHeadError (whnfCoreWithFlagsStep (.app f arg info) flags).run methods s = .error err s₁ := by unfold whnfCoreWithFlagsStep - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] + rw [ReaderT.run_bind] rw [hspine] change EStateM.bind (methods.whnfCoreFlags head flags) _ s = _ unfold EStateM.bind @@ -6371,7 +6358,7 @@ theorem whnfCoreWithFlagsStep_appUnchangedIotaError (whnfCoreWithFlagsStep (.app f arg info) flags).run methods s = .error err s₂ := by unfold whnfCoreWithFlagsStep - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] + rw [ReaderT.run_bind] rw [hspine] change EStateM.bind (methods.whnfCoreFlags head flags) _ s = _ unfold EStateM.bind @@ -6403,7 +6390,7 @@ theorem whnfCoreWithFlagsStep_appChangedIota (whnfCoreWithFlagsStep (.app f arg info) flags).run methods s = .ok (.next result) s₃ := by unfold whnfCoreWithFlagsStep - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] + rw [ReaderT.run_bind] rw [hspine] change EStateM.bind (methods.whnfCoreFlags head flags) _ s = _ unfold EStateM.bind @@ -6440,7 +6427,7 @@ theorem whnfCoreWithFlagsStep_appChangedDone (whnfCoreWithFlagsStep (.app f arg info) flags).run methods s = .ok (.done rebuilt) s₃ := by unfold whnfCoreWithFlagsStep - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] + rw [ReaderT.run_bind] rw [hspine] change EStateM.bind (methods.whnfCoreFlags head flags) _ s = _ unfold EStateM.bind @@ -6477,7 +6464,7 @@ theorem whnfCoreWithFlagsStep_appChangedIotaError (whnfCoreWithFlagsStep (.app f arg info) flags).run methods s = .error err s₃ := by unfold whnfCoreWithFlagsStep - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] + rw [ReaderT.run_bind] rw [hspine] change EStateM.bind (methods.whnfCoreFlags head flags) _ s = _ unfold EStateM.bind @@ -8203,7 +8190,7 @@ theorem boolExprFromDecision obtain ⟨ci, hlookup⟩ := htable.boolFalse.contains hcatalog have hci := hprims.boolFalse hlookup subst ci - simpa [VExpr.boolLit, VExpr.boolFalse] using + exact (TrKExprS.const (Δ := Δ) (uvars := uvars) htable.boolFalse.2 hlookup (by simp) (by simp)) | true => @@ -8211,7 +8198,7 @@ theorem boolExprFromDecision obtain ⟨ci, hlookup⟩ := htable.boolTrue.contains hcatalog have hci := hprims.boolTrue hlookup subst ci - simpa [VExpr.boolLit, VExpr.boolTrue] using + exact (TrKExprS.const (Δ := Δ) (uvars := uvars) htable.boolTrue.2 hlookup (by simp) (by simp)) @@ -8384,7 +8371,7 @@ theorem mkAppN (args.toList.foldl KExpr.mkApp source) sourceV := by simpa only [Array.foldl_toList] using hsource have hresult := foldlMkApp theory hΔ hsource' hmeaning - simpa only [Array.foldl_toList] using hresult + simpa only [Array.foldl_toList, KExpr.mkAppN] using hresult /-- Replace the concrete source of a meaning proof when both concrete expressions translate to the same Theory expression. This is the metadata @@ -12077,7 +12064,7 @@ theorem of_result_shape rw [KExpr.mkApp_shape, KExpr.mkApp_shape] exact hbaseMeaningExact have hnatType₀ : world.venv.HasType uvars [] (.natLit value) .nat := by - simpa using + simpa [Lean4Lean.VLCtx.toCtx] using (Lean4Lean.TrExprS.natLit (Us := List.replicate uvars Lean.Name.anonymous) (Δ := []) context.theoryPrimitives (htable.nat.contains hcatalog) value).2 @@ -12195,7 +12182,7 @@ theorem of_result_shape exact hbaseMeaningExact have hboolType₀ : world.venv.HasType uvars [] (.boolLit decision) .bool := by - simpa using + simpa [Lean4Lean.VLCtx.toCtx] using (Lean4Lean.TrExprS.boolLit (Us := List.replicate uvars Lean.Name.anonymous) (Δ := []) context.theoryPrimitives (htable.boolType.contains hcatalog) @@ -12795,7 +12782,7 @@ theorem tryReduceNatWithSuccMode_succ_collapse rw [hprims] rw [hprimsRun] simp [haddr] - simpa using hiter + simpa [show (NatSuccMode.collapse == NatSuccMode.stuck) = false from rfl] using hiter /-! ### Semantic successor-loop closure -/ @@ -13407,7 +13394,6 @@ theorem tryReduceNatSuccPeelAfterKey_wf (Q₁ := fun observed after => observed = s ∧ after = s) (RecM.WF.get (s := s) fun _ => ⟨rfl, rfl⟩) rintro observed after ⟨rfl, rfl⟩ - simp only split · apply RecM.WF.bind (recordNatSuccStuck_wf visited hvisited) intro _ after _ @@ -13527,11 +13513,9 @@ theorem tryReduceNatSuccAfterWhnf_wf rw [hwV, natSuccIterV_peel] at hlift exact hlift rw [hcurAt] - simp only [bind_pure] exact tryReduceNatSuccPeel_wf writes hw hnext hnextTr hnextType hnextEq hvisited - · simp only [pure_bind] - apply RecM.WF.bind (recordNatSuccStuck_wf visited hvisited) + · apply RecM.WF.bind (recordNatSuccStuck_wf visited hvisited) intro _ committed _ exact RecM.WF.pure fun _ => trivial @@ -13720,7 +13704,6 @@ theorem natArgs_eq_binaryPrefix_append_extract simp [Array.getElem_extract] · subst i simp [Array.getElem_extract] - rfl calc args = args.extract 0 args.size := by simp _ = args.extract 0 2 ++ args.extract 2 args.size := by diff --git a/Ix/Tc/Verify/Whnf/Beta/DependentContexts.lean b/Ix/Tc/Verify/Whnf/Beta/DependentContexts.lean index fa5c6fa81..1eaa43b3c 100644 --- a/Ix/Tc/Verify/Whnf/Beta/DependentContexts.lean +++ b/Ix/Tc/Verify/Whnf/Beta/DependentContexts.lean @@ -194,7 +194,7 @@ theorem find?_above | nil => simpa using hfind | @cons arg arguments A dk k source middle target hstep harg htail ih => have habove : dk + arguments.length < index := by - simpa only [List.length_cons] using hindex + simp only [List.length_cons] at hindex; omega have hfirst := hstep.find?_gt habove hfind have hrest : dk + arguments.length ≤ index - 1 := by omega have hfinal := ih hrest hfirst diff --git a/Ix/Tc/Verify/Whnf/Beta/Translation.lean b/Ix/Tc/Verify/Whnf/Beta/Translation.lean index 6964604f2..b6f9a4346 100644 --- a/Ix/Tc/Verify/Whnf/Beta/Translation.lean +++ b/Ix/Tc/Verify/Whnf/Beta/Translation.lean @@ -278,7 +278,8 @@ theorem TrKExprS.simulSubstBeta VExpr.instBetaArgs_forallE] exact .all (hinsts.isType henv hty) (by - simpa [tyV', VLocalDecl.instBetaArgs, VLocalDecl.depth] using + simpa [tyV', VLocalDecl.instBetaArgs, VLocalDecl.depth, + KVLCtx.toCtx] using hinstsBody.isType henv hbodyTy) (ihty hinsts hlift htyBounds hdepth) (by diff --git a/Ix/Tc/Verify/Whnf/Delta/ClosedTranslation.lean b/Ix/Tc/Verify/Whnf/Delta/ClosedTranslation.lean index 92db9d639..8c266eb07 100644 --- a/Ix/Tc/Verify/Whnf/Delta/ClosedTranslation.lean +++ b/Ix/Tc/Verify/Whnf/Delta/ClosedTranslation.lean @@ -97,9 +97,9 @@ theorem weakRight {env : VEnv} {uvars : Nat} Lean4Lean.VEnv.CtxWF.closed henv hinner.toCtx refine .app (A := A) (B := B) ?_ ?_ (ihfun hinner outer) (iharg hinner outer) - · simpa only [KVLCtx.toCtx_appendOuter] using + · simpa only [KVLCtx.toCtx_appendOuter, Lean4Lean.VEnv.HasType] using hfunTy.weakR henv hclosed outer.toCtx - · simpa only [KVLCtx.toCtx_appendOuter] using + · simpa only [KVLCtx.toCtx_appendOuter, Lean4Lean.VEnv.HasType] using hargTy.weakR henv hclosed outer.toCtx | @lam inner name bi ty body info ty' body' hty htyTr hbodyTr ihty ihbody => @@ -110,7 +110,7 @@ theorem weakRight {env : VEnv} {uvars : Nat} have hty' : env.IsType uvars (KVLCtx.appendOuter inner outer).toCtx ty' := by refine ⟨level, ?_⟩ - simpa only [KVLCtx.toCtx_appendOuter] using + simpa only [KVLCtx.toCtx_appendOuter, Lean4Lean.VEnv.HasType] using htyHasType.weakR henv hclosed outer.toCtx have hbodyInner : KVLCtx.WF env uvars ((none, .vlam ty') :: inner) := @@ -125,7 +125,7 @@ theorem weakRight {env : VEnv} {uvars : Nat} have hty' : env.IsType uvars (KVLCtx.appendOuter inner outer).toCtx ty' := by refine ⟨level, ?_⟩ - simpa only [KVLCtx.toCtx_appendOuter] using + simpa only [KVLCtx.toCtx_appendOuter, Lean4Lean.VEnv.HasType] using htyHasType.weakR henv hclosed outer.toCtx have hbodyInner : KVLCtx.WF env uvars ((none, .vlam ty') :: inner) := @@ -141,7 +141,7 @@ theorem weakRight {env : VEnv} {uvars : Nat} ((none, Lean4Lean.VLocalDecl.vlam ty') :: inner) outer).toCtx body' := by refine ⟨bodyLevel, ?_⟩ - simpa only [KVLCtx.toCtx_appendOuter] using + simpa only [KVLCtx.toCtx_appendOuter, Lean4Lean.VEnv.HasType] using hbodyHasType.weakR henv hbodyClosed outer.toCtx exact .all hty' hbodyTy' (ihty hinner outer) (ihbody hbodyInner outer) @@ -151,7 +151,7 @@ theorem weakRight {env : VEnv} {uvars : Nat} Lean4Lean.VEnv.CtxWF.closed henv hinner.toCtx have hvalTy' : env.HasType uvars (KVLCtx.appendOuter inner outer).toCtx val' ty' := by - simpa only [KVLCtx.toCtx_appendOuter] using + simpa only [KVLCtx.toCtx_appendOuter, Lean4Lean.VEnv.HasType] using hvalTy.weakR henv hclosed outer.toCtx have hbodyInner : KVLCtx.WF env uvars ((none, .vlet ty' val') :: inner) := @@ -210,7 +210,7 @@ theorem weakRight {env : VEnv} {uvars : Nat} Lean4Lean.VEnv.CtxWF.closed henv hinner.toCtx refine ⟨structural, hstructural.weakRight henv hlit htp hinner outer, targetTy, ?_⟩ - simpa only [KVLCtx.toCtx_appendOuter] using + simpa only [KVLCtx.toCtx_appendOuter, Lean4Lean.VEnv.HasType] using htarget.weakR henv hclosed outer.toCtx end TrKExpr diff --git a/Ix/Tc/Verify/Whnf/Iota/ConstructorDispatch.lean b/Ix/Tc/Verify/Whnf/Iota/ConstructorDispatch.lean index 0f4d1284b..da8d98de5 100644 --- a/Ix/Tc/Verify/Whnf/Iota/ConstructorDispatch.lean +++ b/Ix/Tc/Verify/Whnf/Iota/ConstructorDispatch.lean @@ -85,7 +85,6 @@ theorem eval rw [hlevels] simp only [Bool.false_eq_true, ↓reduceIte] rw [if_neg (Nat.not_lt.mpr h.fieldBound)] - simp only [pure_bind] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run @@ -368,14 +367,7 @@ theorem tryIotaCtorOrStructEta_regular unfold EStateM.bind rw [hctorLookup] simp only [hctorInfo, pure_bind] - rw [ReaderT.run_bind] - change EStateM.bind - (ReaderT.run - (tryApplyIotaCtor recr recUs spine ctorArgs cidx ctorFields transient) - methods) _ sCtor = _ - unfold EStateM.bind - rw [hdispatch] - rfl + exact hdispatch /-- Exact regular, non-literal path through post-WHNF preprocessing. -/ theorem tryIotaAfterMajorWhnf_regular diff --git a/Ix/Tc/Verify/Whnf/Iota/ConstructorSynthesis.lean b/Ix/Tc/Verify/Whnf/Iota/ConstructorSynthesis.lean index cf6f8fb6d..4b76df2de 100644 --- a/Ix/Tc/Verify/Whnf/Iota/ConstructorSynthesis.lean +++ b/Ix/Tc/Verify/Whnf/Iota/ConstructorSynthesis.lean @@ -28,14 +28,10 @@ theorem tryOptional_success (h : x.run methods s = .ok a sf) : (tryOptional x).run methods s = .ok (some a) sf := by unfold tryOptional try? - rw [ReaderT.run_bind] - change EStateM.bind - (EStateM.tryCatch - (EStateM.bind (x.run methods) (fun a s => .ok (some a) s)) _) - _ s = _ + change EStateM.tryCatch + (EStateM.bind (x.run methods) (fun a s => .ok (some a) s)) _ s = _ unfold EStateM.bind EStateM.tryCatch simp only [h] - rfl /-- A caught optional-probe error becomes absence while retaining the error-side state, as required by the Rust `&mut` execution model. -/ @@ -45,11 +41,8 @@ theorem tryOptional_error (h : x.run methods s = .error err sf) : (tryOptional x).run methods s = .ok none sf := by unfold tryOptional try? - rw [ReaderT.run_bind] - change EStateM.bind - (EStateM.tryCatch - (EStateM.bind (x.run methods) (fun a s => .ok (some a) s)) _) - _ s = _ + change EStateM.tryCatch + (EStateM.bind (x.run methods) (fun a s => .ok (some a) s)) _ s = _ unfold EStateM.bind EStateM.tryCatch simp only [h] rfl diff --git a/Ix/Tc/Verify/Whnf/Iota/Ingress.lean b/Ix/Tc/Verify/Whnf/Iota/Ingress.lean index 651281181..2742e7f3c 100644 --- a/Ix/Tc/Verify/Whnf/Iota/Ingress.lean +++ b/Ix/Tc/Verify/Whnf/Iota/Ingress.lean @@ -91,7 +91,8 @@ theorem tryIotaWithFlags_state_wf_of_contexts | none => exact ⟨majorV, hmajorSupport, hmajorTr⟩ | some result => - simpa only [cleanedMajor, Option.getD_some] using hcleaned + simpa only [cleanedMajor, Option.getD_some, OptionalGeneratedInput] + using hcleaned cases hcheap : flags.cheapRec with | false => simp only [Bool.false_eq_true, if_false] diff --git a/Ix/Tc/Verify/Whnf/Iota/NatOffset.lean b/Ix/Tc/Verify/Whnf/Iota/NatOffset.lean index 99911808e..69a561423 100644 --- a/Ix/Tc/Verify/Whnf/Iota/NatOffset.lean +++ b/Ix/Tc/Verify/Whnf/Iota/NatOffset.lean @@ -382,12 +382,8 @@ theorem tryIotaCtorOrStructEta_state_wf | some pair => rcases pair with ⟨cidx, ctorFields⟩ simp only [hinfo, pure_bind] - rw [ReaderT.run_bind] - apply TcM.WF.bind - (happly recr recUs spine ctorArgs cidx ctorFields transient - afterLookup) - intro result afterApply _ - exact TcM.WF.pure (fun _ => trivial) + exact happly recr recUs spine ctorArgs cidx ctorFields transient + afterLookup | _ => exact hstruct s /-- A StringExpansion finite String plan can be selected at the state where expansion diff --git a/Ix/Tc/Verify/Whnf/Iota/RuleInstantiation.lean b/Ix/Tc/Verify/Whnf/Iota/RuleInstantiation.lean index 2a14d0992..95b13258d 100644 --- a/Ix/Tc/Verify/Whnf/Iota/RuleInstantiation.lean +++ b/Ix/Tc/Verify/Whnf/Iota/RuleInstantiation.lean @@ -76,7 +76,7 @@ theorem instUnivSpec (defeq.rhs.instL (us.toList.map KUniv.toVLevel)) := by have hresult := TrKExprS.instL henv hlit htp hus harity h.rhsStructural (by trivial) hspec hfaithful hsize - simpa using hresult + simpa [KVLCtx.instL] using hresult /-- Carry the registered RHS through an observed successful production universe-instantiation run. The walker Hoare theorem supplies the exact pure diff --git a/Ix/Tc/Verify/Whnf/Iota/StringLiteral.lean b/Ix/Tc/Verify/Whnf/Iota/StringLiteral.lean index 4c752fc94..88c530e6e 100644 --- a/Ix/Tc/Verify/Whnf/Iota/StringLiteral.lean +++ b/Ix/Tc/Verify/Whnf/Iota/StringLiteral.lean @@ -183,6 +183,7 @@ theorem evalNatOffsetLiteral_str (evalNatOffsetLiteral (.str value blob info) 0).run methods s = .ok none s := by unfold evalNatOffsetLiteral evalNatOffsetLiteralFuel + rw [show (256 - 0 : Nat) = Nat.succ 255 from rfl] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run prims methods) _ s = _ unfold EStateM.bind diff --git a/Ix/Tc/Verify/Whnf/Iota/StructEtaControl.lean b/Ix/Tc/Verify/Whnf/Iota/StructEtaControl.lean index eed06f43d..199e21469 100644 --- a/Ix/Tc/Verify/Whnf/Iota/StructEtaControl.lean +++ b/Ix/Tc/Verify/Whnf/Iota/StructEtaControl.lean @@ -274,7 +274,8 @@ theorem finishStructEtaAfterSort_prop (hzero : u.isZero = true) : (finishStructEtaAfterSort recUs spine recr rule indId major (.sort u info)).run methods s = .ok none s := by - simp [finishStructEtaAfterSort, structEtaSortRejected, hzero] + simp [finishStructEtaAfterSort, structEtaSortRejected, + KUniv.isSemanticZero, hzero] /-- Any admissible sort/non-sort shape forwards successful universe instantiation and rebuilding with their exact intermediate states. -/ @@ -1030,14 +1031,7 @@ theorem tryIotaCtorOrStructEta_constructor unfold EStateM.bind rw [hlookup] simp only [hinfo, pure_bind] - rw [ReaderT.run_bind] - change EStateM.bind - (ReaderT.run - (tryApplyIotaCtor recr recUs spine ctorArgs cidx ctorFields transient) - methods) _ sLookup = _ - unfold EStateM.bind rw [hdispatch] - cases outcome <;> rfl end RecM diff --git a/Ix/Tc/Verify/Whnf/Iota/Substitution.lean b/Ix/Tc/Verify/Whnf/Iota/Substitution.lean index 269191c79..a8eb642c8 100644 --- a/Ix/Tc/Verify/Whnf/Iota/Substitution.lean +++ b/Ix/Tc/Verify/Whnf/Iota/Substitution.lean @@ -47,14 +47,17 @@ theorem Constructed.liftNoIntern_eq_liftSpec rw [mkFVar_shape] simp only [substNoIntern.liftNoIntern, KExpr.liftSpec, KExpr.lbr, ite_self] + exact ite_self _ | @sort u md => rw [mkSort_shape] simp only [substNoIntern.liftNoIntern, KExpr.liftSpec, KExpr.lbr, ite_self] + exact ite_self _ | @const id us md => rw [mkConst_shape] simp only [substNoIntern.liftNoIntern, KExpr.liftSpec, KExpr.lbr, ite_self] + exact ite_self _ | @app f a md hf ha ihf iha => rw [mkApp_shape, size] at hcut rw [mkApp_shape] @@ -141,10 +144,12 @@ theorem Constructed.liftNoIntern_eq_liftSpec rw [mkNat_shape] simp only [substNoIntern.liftNoIntern, KExpr.liftSpec, KExpr.lbr, ite_self] + exact ite_self _ | @str v blob md => rw [mkStr_shape] simp only [substNoIntern.liftNoIntern, KExpr.liftSpec, KExpr.lbr, ite_self] + exact ite_self _ /-- The complete non-interning substitution computes `substSpec`. Its body bound is the memoized walker's `depth + size` premise; its argument bound is @@ -170,12 +175,15 @@ theorem Constructed.substNoIntern_eq_substSpec | @fvar id name md => rw [mkFVar_shape] simp only [substNoIntern, KExpr.substSpec, KExpr.lbr, ite_self] + exact ite_self _ | @sort u md => rw [mkSort_shape] simp only [substNoIntern, KExpr.substSpec, KExpr.lbr, ite_self] + exact ite_self _ | @const id us md => rw [mkConst_shape] simp only [substNoIntern, KExpr.substSpec, KExpr.lbr, ite_self] + exact ite_self _ | @app f a md hf ha ihf iha => rw [mkApp_shape, size] at hcut rw [mkApp_shape] @@ -241,9 +249,11 @@ theorem Constructed.substNoIntern_eq_substSpec | @nat v blob md => rw [mkNat_shape] simp only [substNoIntern, KExpr.substSpec, KExpr.lbr, ite_self] + exact ite_self _ | @str v blob md => rw [mkStr_shape] simp only [substNoIntern, KExpr.substSpec, KExpr.lbr, ite_self] + exact ite_self _ end KExpr diff --git a/Ix/Tc/Verify/Whnf/NoDelta/ProjectionApplication.lean b/Ix/Tc/Verify/Whnf/NoDelta/ProjectionApplication.lean index 43f8afa8f..95a18174d 100644 --- a/Ix/Tc/Verify/Whnf/NoDelta/ProjectionApplication.lean +++ b/Ix/Tc/Verify/Whnf/NoDelta/ProjectionApplication.lean @@ -60,7 +60,6 @@ theorem tryProjAppReduce_projectionWhnfError cases hcheap : flags.cheapProj <;> simp only [hcheap, Bool.false_eq_true, ↓reduceIte] at hwhnf ⊢ all_goals - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] rw [ReaderT.run_bind] change EStateM.bind _ _ s = _ unfold EStateM.bind @@ -85,7 +84,6 @@ theorem tryProjAppReduce_projectionReduceError cases hcheap : flags.cheapProj <;> simp only [hcheap, Bool.false_eq_true, ↓reduceIte] at hwhnf ⊢ all_goals - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] rw [ReaderT.run_bind] change EStateM.bind _ _ s = _ unfold EStateM.bind @@ -116,7 +114,6 @@ theorem tryProjAppReduce_projectionNone cases hcheap : flags.cheapProj <;> simp only [hcheap, Bool.false_eq_true, ↓reduceIte] at hwhnf ⊢ all_goals - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] rw [ReaderT.run_bind] change EStateM.bind _ _ s = _ unfold EStateM.bind @@ -150,7 +147,6 @@ theorem tryProjAppReduce_projectionSome cases hcheap : flags.cheapProj <;> simp only [hcheap, Bool.false_eq_true, ↓reduceIte] at hwhnf ⊢ all_goals - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] rw [ReaderT.run_bind] change EStateM.bind _ _ s = _ unfold EStateM.bind diff --git a/Ix/Tc/Verify/Whnf/NoDelta/Quotient.lean b/Ix/Tc/Verify/Whnf/NoDelta/Quotient.lean index c7bd758c9..96eb1258d 100644 --- a/Ix/Tc/Verify/Whnf/NoDelta/Quotient.lean +++ b/Ix/Tc/Verify/Whnf/NoDelta/Quotient.lean @@ -193,7 +193,7 @@ theorem tryQuotReduce_inv_wf · simp only [hsize, if_false] have hfIdx : 3 < args.size := by omega have hmajorIdx : 5 < args.size := by omega - simpa only [tryQuotReduceSelected] using + exact tryQuotReduceSelected_inv_wf hrun census inputs (semantics := semantics) (trProj := trProj) (world := world) hsourceSupport hsource hspine hfIdx hmajorIdx @@ -211,7 +211,7 @@ theorem tryQuotReduce_inv_wf · simp only [hsize, if_false] have hfIdx : 3 < args.size := by omega have hmajorIdx : 4 < args.size := by omega - simpa only [tryQuotReduceSelected] using + exact tryQuotReduceSelected_inv_wf hrun census inputs (semantics := semantics) (trProj := trProj) (world := world) hsourceSupport hsource hspine diff --git a/Ix/Tc/Verify/Whnf/RuntimeContracts.lean b/Ix/Tc/Verify/Whnf/RuntimeContracts.lean index 40c989a67..04bdf6ff3 100644 --- a/Ix/Tc/Verify/Whnf/RuntimeContracts.lean +++ b/Ix/Tc/Verify/Whnf/RuntimeContracts.lean @@ -306,7 +306,6 @@ theorem isTransientNatLiteralWork_wf {I : TcState .anon → Prop} cases head <;> simp only all_goals try exact TcM.WF.pure fun _ => trivial case const id us info => - simp only [pure_bind] rw [ReaderT.run_bind] apply TcM.WF.bind (Q₁ := fun p state => p = state.prims) @@ -384,7 +383,6 @@ theorem isTransientNatLiteralWork_noLazy {methods : Methods .anon} cases head <;> simp only all_goals try exact ⟨false, rfl⟩ case const id us info => - simp only [pure_bind] rw [ReaderT.run_bind] change ∃ answer, EStateM.bind ((RecM.prims : RecM .anon (Primitives .anon)).run methods) _ s = diff --git a/Ix/Tc/Verify/Whnf/StructEta/CallbackPrefix.lean b/Ix/Tc/Verify/Whnf/StructEta/CallbackPrefix.lean index 3283032cd..d639f48a7 100644 --- a/Ix/Tc/Verify/Whnf/StructEta/CallbackPrefix.lean +++ b/Ix/Tc/Verify/Whnf/StructEta/CallbackPrefix.lean @@ -212,7 +212,7 @@ theorem tryOptionalWhnfRec_wf (Q := fun reduced _ => support reduced ∧ WhnfPost trProj world uvars Delta sourceV reduced) (by intro methods hmethods - simpa only [whnfRec_run] using + exact (hmethods.whnf (s := s) hsource htr))) · intro result after hresult cases result <;> exact hresult diff --git a/Ix/Tc/Verify/Whnf/StructEta/RecursionClassifier.lean b/Ix/Tc/Verify/Whnf/StructEta/RecursionClassifier.lean index 223cc5a65..fc8a72020 100644 --- a/Ix/Tc/Verify/Whnf/StructEta/RecursionClassifier.lean +++ b/Ix/Tc/Verify/Whnf/StructEta/RecursionClassifier.lean @@ -598,14 +598,14 @@ theorem computeIsRec_wf cases answer with | none => simp only - simpa only [ReaderT.run] using + exact (TcM.WF.pure (I := WhnfStateInv layer semantics trProj world support uvars Delta) (s := after) (Q := fun _ _ => True) (fun _ => trivial)) | some value => simp only - simpa only [ReaderT.run] using + exact (TcM.WF.pure (I := WhnfStateInv layer semantics trProj world support uvars Delta) (s := after) diff --git a/Ix/Tc/Verify/Whnf/StructEta/ScopedTelescope.lean b/Ix/Tc/Verify/Whnf/StructEta/ScopedTelescope.lean index f79a86159..9931a5689 100644 --- a/Ix/Tc/Verify/Whnf/StructEta/ScopedTelescope.lean +++ b/Ix/Tc/Verify/Whnf/StructEta/ScopedTelescope.lean @@ -71,7 +71,7 @@ theorem scratch_lam_back rw [List.map_reverse, List.map_snd_zip (by simpa [h.size_eq])] at hmap have hhead := congrArg List.head? hmap - simpa only [List.head?_reverse, List.head?_cons, + simpa only [List.head?_reverse, List.head?_cons, List.map_cons, Array.getLast?_toList] using hhead theorem scratch_popLocal_run diff --git a/Ix/Tc/Verify/Whnf/Structural/ApplicationStep.lean b/Ix/Tc/Verify/Whnf/Structural/ApplicationStep.lean index b7d1f206b..2e0af9769 100644 --- a/Ix/Tc/Verify/Whnf/Structural/ApplicationStep.lean +++ b/Ix/Tc/Verify/Whnf/Structural/ApplicationStep.lean @@ -55,14 +55,14 @@ theorem whnfCoreWithFlagsStep_app_wf | .error err s1 => have hcallbackRun : (whnfCoreFlagsRec head flags).run methods s = .error err s1 := by - simpa only [whnfCoreFlagsRec] using hheadRun + exact hheadRun rw [hcallbackRun] at hcallbackPost rw [whnfCoreWithFlagsStep_appHeadError hspine hheadRun] exact ⟨hcallbackPost.1, trivial⟩ | .ok changed s1 => have hcallbackRun : (whnfCoreFlagsRec head flags).run methods s = .ok changed s1 := by - simpa only [whnfCoreFlagsRec] using hheadRun + exact hheadRun rw [hcallbackRun] at hcallbackPost have hI1 := hcallbackPost.1 have hchangedSupport := hcallbackPost.2.1 diff --git a/Ix/Tc/Verify/Whnf/Structural/ApplicationTails.lean b/Ix/Tc/Verify/Whnf/Structural/ApplicationTails.lean index 87fe99a5c..669994afe 100644 --- a/Ix/Tc/Verify/Whnf/Structural/ApplicationTails.lean +++ b/Ix/Tc/Verify/Whnf/Structural/ApplicationTails.lean @@ -31,7 +31,7 @@ theorem whnfCoreWithFlagsStep_appUnchangedIota (whnfCoreWithFlagsStep (.app f arg info) flags).run methods s = .ok (.next result) s2 := by unfold whnfCoreWithFlagsStep - rw [ReaderT.run_bind, ReaderT.run_pure, pure_bind] + rw [ReaderT.run_bind] rw [hspine] change EStateM.bind (methods.whnfCoreFlags head flags) _ s = _ unfold EStateM.bind diff --git a/Ix/Tc/Verify/Whnf/Structural/RecursiveCallbacks.lean b/Ix/Tc/Verify/Whnf/Structural/RecursiveCallbacks.lean index d9d718205..708bcf076 100644 --- a/Ix/Tc/Verify/Whnf/Structural/RecursiveCallbacks.lean +++ b/Ix/Tc/Verify/Whnf/Structural/RecursiveCallbacks.lean @@ -48,7 +48,7 @@ theorem whnfCoreFlagsRec_wf (fun result _ => support result /\ WhnfPost trProj world uvars Delta sourceV result) := by intro methods hmethods - simpa only [whnfCoreFlagsRec] using + exact hmethods.whnfCoreFlags hsource htr namespace TrAppSpine diff --git a/Ix/Tc/Verify/Whnf/Structural/VariableStep.lean b/Ix/Tc/Verify/Whnf/Structural/VariableStep.lean index d20727dbd..e81b293f5 100644 --- a/Ix/Tc/Verify/Whnf/Structural/VariableStep.lean +++ b/Ix/Tc/Verify/Whnf/Structural/VariableStep.lean @@ -28,7 +28,6 @@ theorem lookupLetVal_noLet rw [show (get : TcM .anon (TcState .anon)) s = .ok s s from rfl] simp only rw [if_neg (by omega)] - simp only [pure_bind] rw [hval] rfl From 576ad932f74ea06cffd6d6b1e6e27251ae7ddfe5 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 18 Aug 2026 10:31:19 -0400 Subject: [PATCH 17/20] docs: Record v4.33 integration status and the ixvm OOM diagnosis --- HANDOFF.md | 251 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 213 insertions(+), 38 deletions(-) diff --git a/HANDOFF.md b/HANDOFF.md index 3bdecf3a6..dc9317d27 100644 --- a/HANDOFF.md +++ b/HANDOFF.md @@ -1,45 +1,185 @@ # Handoff: Lean v4.33.0 bump — remaining integration work Status of this branch (`update/lean-v4.33.0`): ix is adapted to Lean v4.33.0 -and verified as far as is possible without lean4lean. `lake build Ix` is -green, `cargo check --workspace` is clean, the Rust kernel's 674 tests pass, -and every ix-side test target compiles. The one dependency blocker is the -`lean4lean` pin (v4.31-era, does not compile under v4.33); the test suite and -lint gate execute lean4lean-linked binaries and are queued behind it. +and the `lean4lean` pin now tracks the fork's v4.33 dev tip (§1). `lake +build` is green across every target, `cargo check --workspace` is clean, +the Rust kernel's 674 tests pass, and `IxTcVerify` builds all 438 modules +with both trust audits (`Audit.Completed`, `Audit.Statements`) passing. +`lake test` is green (2640 assertions) and `lake test -- cli` passes. + +Two gates are not satisfied. `lake lint -- --wfail` passes, but that gate +excludes `IxTcVerify`; building that library under `--wfail` still logs +331 warnings, now entirely ix's own (§2.4). And `lake test -- --ignored +ixvm` OOMs inside the Aiur toplevel build (§2.3). This file records everything still open from the v4.29 → v4.33 release-notes audit: the lean4lean integration steps, kernel-semantics divergences between ix's checkers and the upstream Lean kernel (open and cleared), and non-blocking follow-ups. Ingest fully before starting integration. -## 1. lean4lean: why the bump matters +## 1. lean4lean: the bump — DONE + +`lakefile.lean` pins `4844eda4`, the fork's `dev` tip after PR #5. That +revision clears every non-`sorry` warning the v4.33 linters logged (785 of +them) and annotates the 16 frontier `sorry`s with `set_option warn.sorry +false`, so the whole library is `--wfail` clean and its CI now gates on it +(`build-args: --wfail`). The certified inductive-environment and projection +development came in PR #4 (`3d1390ae`), which this builds on. Its +`lean-toolchain` is stable `leanprover/lean4:v4.33.0` and it requires +batteries at the same rev ix already pins, so no other dependency moved. +`Benchmarks/Compile/lake-manifest.json` inherits the pin through the `ix` +path require and was synced to match. + +The previous pin (`5e5bb767`) reproduced the kernel soundness bug fixed +upstream in Lean v4.32.1 (leanprover/lean4#14498): its `addOpaque` never +called `checkNoMVarNoFVar` on the opaque's *value*, so it accepted the +axiom-free `False` construction from leanprover/lean4#14484 — reachable +from ix via `Benchmarks/Lean4Lean.lean:209` (`.opaqueInfo → addDeclAt`). + +Hardening confirmed present at the new pin: + +- `checkNoMVarNoFVar` on an opaque's value (#14498); +- `checkNoMVarNoFVar` on inductive *and* constructor types, before nested + elimination (#14577/#14607); +- rejection of the reserved `_nested` name prefix (#14616); +- mutual-block `levelParams` uniformity (#14608) — note ix deliberately + does not enforce this; see §3. + +Green against the new pin: the `lean4lean` package itself, +`Lean4LeanBench`, `bench-lean4lean`, and `Ix/Tc/Verify/Level.lean` (the +lean4lean-interop spike, and the only ix module the new Theory/Verify +surface actually broke). + +## 2. Integration steps — remaining + +0. **The `IxTcVerify` v4.33/lean4lean port — DONE.** Nothing downstream of + lean4lean could compile under the old pin, so all of this only surfaced + once the dependency built. All 438 modules build; the recurring causes, + for whoever hits them again: + + *v4.33 elaborator.* A pure `let` in `do` no longer emits + `pure _ >>= _` — it is a term-level `have`, so `run_pure_bind` / + `ReaderT.run_pure` / `pure_bind` steps and the matching + `WF.bind (WF.pure …)` proof layers became no-ops and were dropped. A + `return` inside `try` now routes through the early-return transformer; + `RecM.try?` was respelled with `tryCatch`/`pure` to keep the plain + `EStateM.tryCatch` its proofs reason about. `do` loops carry their + state as a `Prod`, not an `MProd`. Guard `if`s survive as + `if false = true then …` and need explicit reduction. + + *v4.33 `simp`.* Many `simpa … using h` no longer bridge a gap the + elaborator closes anyway; those became `exact`. `simp` also stopped + unfolding semireducible definitions during matching — `KVLCtx` is now + an `abbrev` for that reason, and assorted call sites name the + definition explicitly. The largest single class: `simpa [f] using h` + where the goal and `h` differ only by delta/iota on a plain `def` + (`TcM.runRec`, `StepWFAtOn`, `BlockCatalog.Contains`, `KExpr.addr` on a + literal). `simpa` closes with reducible transparency and now fails; + `exact` unfolds at default transparency and succeeds. Reach for `exact` + before growing the simp set. A related trap: `runRec`'s equation lemma + is eta-expanded (`runRec x s = …`), so naming it in a simp set does + nothing against an unapplied `runRec y`. + + *Audit manifests.* `Audit/Completed.lean` and `Audit/Statements.lean` + are exact-match, so a *shrinking* trust boundary fails them too. The + new pin discharges `Lean4Lean.TrProj`'s `sorryAx` (15 roots), ~56 roots + no longer reach the `ctxAddrForLbrUncached` native axiom, and the + `canonicalAuxOrder` native axiom is `ax_9`, not `ax_15` — that index + counts `native_decide` sites in `Ix/Tc/Inductive.lean` and shifts + whenever one is added or removed. To re-derive a whole manifest at + once, make `Audit.check` `logError` instead of `throwError` for one + build; it otherwise stops at the first mismatch. + + *Core/batteries.* `Nat.imax` → `Lean.Nat.imax` (moved into the `Lean` + namespace, same definition); `Batteries.RBNode.cmpLT_iff` → + `RBTree.RBNode.cmpLT_iff`; `Except` has no `DecidableEq`, so + `Ingress/LiteralBlobs.lean` defines a private one for its + `native_decide` obligations. -The pinned lean4lean (`5e5bb767`, in `lakefile.lean`) reproduces the kernel -soundness bug fixed upstream in Lean v4.32.1 (leanprover/lean4#14498): its -`addOpaque` (`Lean4Lean/Environment.lean:64-72` at the pinned rev) never -calls `checkNoMVarNoFVar` on the opaque's *value*, so it accepts the -axiom-free `False` construction from leanprover/lean4#14484. Reachable from -ix via `Benchmarks/Lean4Lean.lean:209` (`.opaqueInfo → addDeclAt`). + *lean4lean API.* `VEnv` gained `structEtas`; `VDecl.block` became + `mutualDef`; `Checked` gained `kTarget`/`kTarget_eq`; + `fieldsR`/`recArgsR`/`resultIndicesR` gained an `ElimMode` argument; + `List.Forall₂.length_eq` moved into the `Lean4Lean` namespace; ix's + local `instL_lamN`/`instN_lamN` are now upstream and were deleted. -Upstream `digama0/lean4lean` master has the complete v4.32/v4.33 hardening: -`779c51fde` (the #14498 value check + `Tests/DeclFVar.lean`), `d7e70a5f0` -(nested-inductive phantom params, #14577), `5518bf838` (mutual `levelParams` -uniformity #14608, reserved `_nested` prefix #14616, `checkNoMVarNoFVar` on -inductive/ctor types #14607, + `Tests/KernelHardening.lean`), and the -verified level-normalization algorithm enabled in the typechecker. +1. **Blake3 `blake3_rs_shared` — resolved, on an unmerged branch.** + `lakefile.lean:190` fetches that target to build + `ix_native_decide_dynlib`, which gates *every* `IxTcVerify` module. The + target and the `cdylib` crate-type live only on Blake3.lean's + `native-decide-dynlib` branch, now rebased onto v4.33 and pinned here + at `730f910a` (two commits ahead of Blake3 main, zero behind). Do not + merge this branch until that one merges to Blake3 main; then re-pin to + main. Nothing to do with lean4lean. -The fork update is being done as `argumentcomputer/lean4lean` PR #4 -(`jcb/formalization2`) — formalization on top of latest upstream. Do not -integrate an intermediate state; wait for it to land on the fork's dev. +2. **`DefEq/PropositionClassifier.lean` — RESOLVED, but it added an + assumption; review it.** Fallout from this branch's own `fix(tc): + classify Prop up to universe normalization`, not from v4.33 or + lean4lean: the classifier case-split on `u.isZero` while production + returns `u.isSemanticZero`. It now splits on `isSemanticZero`, whose + `true` branch must show `toVLevel u ≈ .zero`. -## 2. Integration steps once lean4lean lands + That routes through `Level.normalizeLevel_eval`, which needs + `u.size < UInt64.size` — a load-bearing bound (see the note at + `Ix/Tc/Verify/Level.lean:127`: a 2⁶⁴-succ tower really would wrap and + mis-normalize), and there is no `support x → x.size < UInt64.size` + lemma. So `PropositionClassifierContext` gained a `universes` field: -1. **Bump the pin.** In `lakefile.lean`, set the `lean4lean` rev to the new - dev tip; `lake update lean4lean`. Confirm its `lean-toolchain` is stable - `leanprover/lean4:v4.33.0` (upstream tracks rc toolchains). + universes : ∀ {u info}, support (.sort u info) → u.size < UInt64.size -2. **Run the suite**: `lake test`. First actual execution on v4.33. - Watch-points from the audit: + This mirrors the convention at `DefEq/StructuralCongruence.lean:24` and + `DefEq/SameHeadSpine.lean:28`, and the `u` it constrains is always + covered by the run support (direct WHNF hands back `support (.sort u + info)` alongside the reduced expression). But the structure is only + ever a hypothesis, never constructed, so this **adds an assumption the + eventual instantiation has to discharge** rather than proving anything. + Supporting lemma: `KUniv.toVLevel_equiv_zero_of_isSemanticZero` + (`Ix/Tc/Verify/Level.lean`), beside the existing negative direction. + +3. **The suite — run, with one tier unreachable locally.** `lake test` is + green (2640 assertions, exit 0) and `lake test -- cli` passes. None of + the audit watch-points below fired. + + The `ixvm` runner OOMs, and the cause is now localized. It is **not** + the pin list, **not** any pinned constant, and **not** the shared + `--ignored` setup. Phase markers through the runner body show every + step completing — `kernelChecks`, `loadIxonEnv Nat.add_comm`, all six + claim builders, `claimContains`, `serdeNatAddComm` — and the kill + landing on the next line: + + match AiurTestEnv.build IxVM.ixVM, AiurTestEnv.build IxVM.ixVMFull + + i.e. `toplevel.compile` + `AiurSystem.build`/`circuitShapes` over both + IxVM toplevels. Peak RSS 42–44 GB locally; a larger machine reached + ~79 GB, so it grows rather than needing a fixed budget. Zero assertions + ever print. + + Ruled out by measurement, so nobody repeats them: + - Pin-list size: trimming `kernelCheckEntries` to one tiny constant + (`IxVMInd.Even`) reproduces the same OOM at the same point. + - Any individual pinned constant, including the + `Int8.toInt64_ne_minValue._proof_1_2` entry suspected on + `jcb/lean-v4.33.0-rebase` — it is not in this branch's 72-entry + table at all, yet this branch OOMs identically. + - The shared `--ignored` setup (`get_env!` + forcing `ignoredSuites`): + `lake test -- --ignored shard-map` completes in 722 MB. + - The `MemSizes` `Lean.RBTree` → `Std.TreeSet` migration below: + reverting it reproduces the OOM unchanged (42.05 GB). + + Consequences for review: + + - `Tests/Ix/IxVM.lean` pinned + `String.Slice.Pattern.Model.NoPrefixForwardPatternModel.rec`, which + v4.33 removed. It is repinned to `NoPrefixPatternModel.rec` — the + surviving class of the same shape (a `Prop` class over a `∀`-typed + field, which is what the pin exists to drive: it is the regression + driver for `is_rec_field`'s per-peel whnf, added in #510). + - **Its FFT cost is still the old constant's number and is certainly + wrong.** Re-pin it, and expect the other core-derived pins to have + drifted too — the checked constants' bodies changed with the + toolchain. The failure message prints the actual value. + + Watch-points from the release-notes audit, none of which fired in the + suites that did run: - `Tests/FFI/Refcount.lean` — v4.30's borrow-inference overhaul (leanprover/lean4#12830, #13136 RC coalescing) may shift caller-side inc/dec counts. Diagnose with `trace.Compiler.inferBorrow` before @@ -63,15 +203,48 @@ integrate an intermediate state; wait for it to land on the fork's dev. changed, and several core decls changed exposure/reducibility. All `.ixe` fixtures and pinned address tables from v4.29 will differ. -3. **Run the lint gate**: `lake lint -- --wfail -v`. Not yet run on v4.33; - v4.31 enabled `linter.redundantVisibility` (ix: ~174 files with `public - section` + explicit `public`, ~800 `private` decls), - `linter.redundantExpose` (`Ix/Lib.lean:11`), and - `warning.simp.varHead`/`otherHead` (~257 `@[simp]`s). Escape hatch: - `leanOptions := #[⟨`linter.redundantVisibility, false⟩]`; prefer fixing - genuinely redundant modifiers. +4. **The lint gate — passing; `IxTcVerify` still excluded.** + `lake lint -- --wfail` reports nothing in ix. None of the v4.31 + linters the audit worried about (`redundantVisibility`, + `redundantExpose`, `simp.varHead`) fired. What did: + + - `Lean.RBTree` is deprecated in favour of `Std.TreeSet`. The only + Lean-side use was `Bytecode.MemSizes` (`Ix/Aiur/Compiler/Layout.lean`), + migrated; the API is identical except `fold` → `foldl`. The remaining + `RBTree` hits in the tree are unrelated: `Batteries.Recycling.RBTree` + (`Ix/Tc/Level.lean`, `Ix/IxonUniv.lean` — a different, non-deprecated + type that `IxTcVerify` reasons about) and `Ix/IxVM/RBTreeMap.lean` + (a red-black tree written in the *guest* DSL). + - `linter.unusedVariables` on a dead `rtc ←` rebind in + `Ix/AuxGen/BRecOn.lean`, and `linter.defProp` on + `Tests/Ix/Compile/LevelSpellings.lean`'s `wfTwoEqDef`. The latter is + suppressed with a scoped `set_option`: the fixture deliberately pins + the prop-valued-`def` constant class metaprograms emit, so `defProp` + is silenced rather than obeyed. + + `lake lint -- --wfail` now passes: the six `Lean4Lean/Inductive/Add.lean` + warnings that blocked it are gone at the new pin (§1), and ix's own + non-`IxTcVerify` targets are clean. + + `IxTcVerify` is still excluded from the `build-all` lint driver — a + pre-existing decision from main (`a0537747c`, 2026-07-24, refined by + `7ff054b56`). Its stated reason, that the dependency's `sorry` warnings + would fail `--wfail`, no longer holds: lean4lean is warning-free at this + pin, including the 16 frontier sorries, which upstream annotated with + `set_option warn.sorry false`. `lake build IxTcVerify --wfail` now logs + 331 warnings and **all of them are ix's own** — 287 `unusedSimpArgs`, + 33 `defProp`, 7 deprecations, 3 assorted — across 93 modules, with zero + `sorry` warnings from anywhere. `Ix.Tc.Verify.Audit.SorryFrontier` + independently confirms no ix declaration uses `sorryAx`. + + So the exclusion is now purely about ix's own lint debt, and clearing + those 331 would let `IxTcVerify` join the gate. Most are the same v4.33 + simp change as the port (§2.0): simp sets that no longer need + `pure_bind`/`ReaderT.run_pure`. The linter names the exact argument to + drop in each case. Update the `lean_lib IxTcVerify` comment when this + changes — as written it blames the dependency. -4. **Limits, only if they fire.** v4.31 #13030 made heartbeats accumulate +5. **Limits, only if they fire.** v4.31 #13030 made heartbeats accumulate faster (upstream raised limits 20–50% in places); v4.33 #13956 bounded kernel recursion by `maxRecDepth` instead of the physical stack. If `IxTcVerify` or deep replays hit deterministic timeouts or @@ -120,9 +293,11 @@ unsoundness. arity-checked at infer; per-member `lvls` in the `muts` form) and its own block clustering may legitimately group members Lean never required to be uniform — enforcing uniformity could reject valid content. Consequence: - ix accepts (metaprogrammed, unsafe) blocks upstream rejects. Revisit only - if lean4lean-parity replays surface a real case; otherwise this stands as - a documented, justified divergence. + ix accepts (metaprogrammed, unsafe) blocks upstream rejects. The pinned + lean4lean now enforces it in `addMutual`, so a parity replay will report + this divergence by construction — treat that as expected, not as a + finding, unless a *non*-metaprogrammed case shows up. Otherwise this + stands as a documented, justified divergence. - **Regression-fixture ports.** ix has no fixtures for the v4.32/v4.33 soundness-bug shapes. Port upstream's repros as Ix/Tc test fixtures: From f48ecffefcac4865af636784ecebaadba357856e Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 18 Aug 2026 10:52:16 -0400 Subject: [PATCH 18/20] Clippy --- crates/ffi/src/lean_env.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/ffi/src/lean_env.rs b/crates/ffi/src/lean_env.rs index 477ffca3e..a092e0abe 100644 --- a/crates/ffi/src/lean_env.rs +++ b/crates/ffi/src/lean_env.rs @@ -835,10 +835,15 @@ fn decode_name_data_value( // Scalars box `v` as `(v << 1) | 1`; an arithmetic shift // recovers the signed value. let v = (iobj.as_raw() as isize) >> 1; + // Both magnitudes below are non-negative by construction -- the + // branch settles the sign, and `negSucc n = -(n + 1)` so `n` is + // `-(v + 1)` for `v < 0` -- and an `isize` magnitude always fits + // `u64` on supported targets, so neither conversion can fail. + let mag = |n: isize| u64::try_from(n).expect("isize magnitude fits u64"); if v >= 0 { - Int::OfNat(Nat::from(v as u64)) + Int::OfNat(Nat::from(mag(v))) } else { - Int::NegSucc(Nat::from((-(v + 1)) as u64)) + Int::NegSucc(Nat::from(mag(-(v + 1)))) } } else { let neg = unsafe { From 8de8e4dd3852d998fc1ef0ff47a1f34eb81787d2 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 18 Aug 2026 11:19:01 -0400 Subject: [PATCH 19/20] fmt --- crates/ffi/src/lean_env.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ffi/src/lean_env.rs b/crates/ffi/src/lean_env.rs index a092e0abe..925fe6599 100644 --- a/crates/ffi/src/lean_env.rs +++ b/crates/ffi/src/lean_env.rs @@ -839,7 +839,8 @@ fn decode_name_data_value( // branch settles the sign, and `negSucc n = -(n + 1)` so `n` is // `-(v + 1)` for `v < 0` -- and an `isize` magnitude always fits // `u64` on supported targets, so neither conversion can fail. - let mag = |n: isize| u64::try_from(n).expect("isize magnitude fits u64"); + let mag = + |n: isize| u64::try_from(n).expect("isize magnitude fits u64"); if v >= 0 { Int::OfNat(Nat::from(mag(v))) } else { From c3775978e4df4cea501f2271d9272c5b22fbb8c2 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 18 Aug 2026 14:42:13 -0400 Subject: [PATCH 20/20] Fix stale Ixon addresses --- Ix/CompileM.lean | 4 +- Ix/IxVM/Kernel/Infer.lean | 88 +- Ix/IxVM/Kernel/InferOnly.lean | 8 +- Ix/IxVM/Kernel/NatPrim.lean | 232 +-- Ix/Tc/Primitive.lean | 102 +- Tests/Ix/IxVM.lean | 122 +- Tests/Ix/Kernel/BuildPrimOrigs.lean | 73 +- Tests/Ix/Kernel/BuildPrimitives.lean | 25 +- Tests/Main.lean | 6 +- crates/common/src/prim_addrs.rs | 144 +- crates/ffi/src/kernel.rs | 14 + crates/ixvm-codegen/src/aiur_ixvm.rs | 2492 +++++++++++++------------- 12 files changed, 1704 insertions(+), 1606 deletions(-) diff --git a/Ix/CompileM.lean b/Ix/CompileM.lean index a242dfa61..899862b43 100644 --- a/Ix/CompileM.lean +++ b/Ix/CompileM.lean @@ -2889,8 +2889,8 @@ opaque rsCompileEnvFFI : @& List (Lean.Name × Lean.ConstantInfo) → IO Ixon.Ra in `src/ix/env.rs`. This is the addressing scheme under which `orig_kenv` stores KIds in the kernel — two constants with the same Lean name but different content get distinct addresses. Used by - `Tests.Ix.Kernel.BuildPrimOrigs` to regenerate `PrimOrigAddrs` in - the Rust kernel. -/ + `Tests.Ix.Kernel.BuildPrimOrigs` to regenerate `PrimAddrs::new_orig` + in the Rust kernel. -/ @[extern "rs_leon_hashes"] opaque rsLeonHashesFFI : @& List (Lean.Name × Lean.ConstantInfo) → IO (Array (Ix.Name × Address)) diff --git a/Ix/IxVM/Kernel/Infer.lean b/Ix/IxVM/Kernel/Infer.lean index d2e0a11c4..1a54e3ed1 100644 --- a/Ix/IxVM/Kernel/Infer.lean +++ b/Ix/IxVM/Kernel/Infer.lean @@ -204,10 +204,10 @@ def infer := ⟦ } fn str_addr() -> Addr { - store([0x4au8, 0xc0u8, 0x9eu8, 0xd8u8, 0xffu8, 0x61u8, 0xe4u8, 0x4fu8, - 0x11u8, 0x59u8, 0xbcu8, 0x6fu8, 0xb0u8, 0x0fu8, 0xd7u8, 0xe7u8, - 0x2cu8, 0x15u8, 0xdeu8, 0xefu8, 0xeau8, 0x56u8, 0x9du8, 0x75u8, - 0x5du8, 0x8bu8, 0x1du8, 0x05u8, 0xf5u8, 0xd1u8, 0x91u8, 0xf7u8]) + store([0xfdu8, 0x53u8, 0xe8u8, 0xdcu8, 0xe8u8, 0x2du8, 0x56u8, 0x8bu8, + 0x56u8, 0xe9u8, 0xb1u8, 0x6cu8, 0x39u8, 0x0bu8, 0x56u8, 0x93u8, + 0xc1u8, 0x37u8, 0xb4u8, 0xe5u8, 0x4du8, 0x12u8, 0xacu8, 0x09u8, + 0xaau8, 0x55u8, 0x98u8, 0x63u8, 0x95u8, 0x4bu8, 0x65u8, 0x87u8]) } fn k_infer_lit(lit: KLiteral) -> KExpr { @@ -413,24 +413,24 @@ def infer := ⟦ -- ============================================================================ fn nat_dec_le_addr_dec() -> Addr { - store([0x08u8, 0xfau8, 0xadu8, 0x5eu8, 0x92u8, 0x31u8, 0x6eu8, 0x17u8, - 0xe5u8, 0xf8u8, 0x08u8, 0x04u8, 0x98u8, 0x2cu8, 0x6fu8, 0x85u8, - 0x3eu8, 0x32u8, 0xbcu8, 0x43u8, 0xf4u8, 0xdcu8, 0x41u8, 0x06u8, - 0x19u8, 0xecu8, 0x13u8, 0xdfu8, 0x15u8, 0x23u8, 0x77u8, 0xe3u8]) + store([0x45u8, 0x60u8, 0xc5u8, 0xf1u8, 0x21u8, 0xa5u8, 0x42u8, 0xf2u8, + 0xc2u8, 0x33u8, 0x62u8, 0x6fu8, 0x4eu8, 0xf6u8, 0xfdu8, 0xd8u8, + 0xf3u8, 0x6eu8, 0xbeu8, 0x97u8, 0xc9u8, 0x48u8, 0xadu8, 0xeau8, + 0xeeu8, 0x28u8, 0x3du8, 0x9eu8, 0xd4u8, 0x57u8, 0x2fu8, 0xdbu8]) } fn nat_dec_eq_addr_dec() -> Addr { - store([0x67u8, 0x6eu8, 0x87u8, 0xddu8, 0xe5u8, 0xcfu8, 0x30u8, 0xc0u8, - 0x01u8, 0x69u8, 0x0bu8, 0xbbu8, 0xe7u8, 0xabu8, 0x74u8, 0xfcu8, - 0xa9u8, 0x2bu8, 0x0au8, 0xa6u8, 0x12u8, 0xedu8, 0x9eu8, 0xf3u8, - 0xcau8, 0xf8u8, 0x9fu8, 0x1du8, 0x9eu8, 0x6au8, 0x24u8, 0x01u8]) + store([0xa3u8, 0xf5u8, 0xa8u8, 0x0du8, 0x1au8, 0x8cu8, 0xc9u8, 0x90u8, + 0x63u8, 0x9du8, 0x06u8, 0xbeu8, 0x98u8, 0xbcu8, 0xc2u8, 0xb2u8, + 0x40u8, 0xf7u8, 0x93u8, 0xa4u8, 0xadu8, 0xbau8, 0x9bu8, 0x00u8, + 0x27u8, 0x12u8, 0xb8u8, 0x04u8, 0xa6u8, 0xfeu8, 0x33u8, 0x76u8]) } fn nat_dec_lt_addr_dec() -> Addr { - store([0xccu8, 0xe1u8, 0x25u8, 0x65u8, 0x0bu8, 0x77u8, 0x5du8, 0x19u8, - 0x10u8, 0xefu8, 0xeau8, 0x91u8, 0x9fu8, 0x5cu8, 0xf2u8, 0x72u8, - 0xf7u8, 0xd9u8, 0xe7u8, 0xb1u8, 0x1du8, 0x62u8, 0x34u8, 0x3du8, - 0x6du8, 0x0au8, 0x58u8, 0x9cu8, 0xdfu8, 0xaeu8, 0xffu8, 0x21u8]) + store([0x2eu8, 0xa3u8, 0x65u8, 0x39u8, 0xacu8, 0x1au8, 0x8eu8, 0x00u8, + 0x22u8, 0xa9u8, 0x0du8, 0x8bu8, 0x70u8, 0xddu8, 0xb6u8, 0xf4u8, + 0xdbu8, 0x46u8, 0xb0u8, 0xceu8, 0x19u8, 0xefu8, 0xe4u8, 0xe1u8, + 0xc4u8, 0x47u8, 0x92u8, 0xfeu8, 0xedu8, 0x9du8, 0x7eu8, 0x8fu8]) } fn decidable_is_true_addr_dec() -> Addr { @@ -448,31 +448,31 @@ def infer := ⟦ } fn nat_le_of_ble_eq_true_addr_dec() -> Addr { - store([0xcbu8, 0x1fu8, 0xa5u8, 0xadu8, 0x3eu8, 0x63u8, 0x2cu8, 0x07u8, - 0xb4u8, 0x88u8, 0x28u8, 0xafu8, 0x60u8, 0x4fu8, 0x73u8, 0xc7u8, - 0x0au8, 0x82u8, 0x0bu8, 0x1du8, 0xe4u8, 0xa1u8, 0x3bu8, 0xabu8, - 0xf3u8, 0x1fu8, 0x2bu8, 0x78u8, 0x96u8, 0xf7u8, 0xf9u8, 0xbau8]) + store([0x04u8, 0x2au8, 0x9au8, 0xd1u8, 0x48u8, 0x9eu8, 0x76u8, 0x9fu8, + 0xd2u8, 0x95u8, 0xd5u8, 0x8cu8, 0xb6u8, 0x4au8, 0x74u8, 0x05u8, + 0xe8u8, 0x6fu8, 0x78u8, 0x81u8, 0xb5u8, 0xe7u8, 0xc2u8, 0x2du8, + 0x77u8, 0xdfu8, 0x48u8, 0x69u8, 0x15u8, 0xd5u8, 0x8eu8, 0xb3u8]) } fn nat_not_le_of_not_ble_eq_true_addr_dec() -> Addr { - store([0xeau8, 0x75u8, 0x61u8, 0xdbu8, 0x25u8, 0xaau8, 0x24u8, 0xceu8, - 0x48u8, 0x1cu8, 0xe3u8, 0xe9u8, 0xeeu8, 0x8du8, 0x70u8, 0x4du8, - 0x48u8, 0x3du8, 0xd9u8, 0x05u8, 0x67u8, 0x57u8, 0xdau8, 0x7eu8, - 0xdau8, 0x24u8, 0xb5u8, 0x11u8, 0x1bu8, 0xe5u8, 0x9bu8, 0xc2u8]) + store([0x7du8, 0xafu8, 0xaau8, 0x15u8, 0x1eu8, 0xd9u8, 0x0bu8, 0x0au8, + 0xb2u8, 0x7fu8, 0x02u8, 0x79u8, 0xb9u8, 0x38u8, 0x3au8, 0xb8u8, + 0xabu8, 0xe8u8, 0x60u8, 0x2cu8, 0x66u8, 0x35u8, 0xcau8, 0x19u8, + 0x1fu8, 0x28u8, 0xcbu8, 0xb7u8, 0xabu8, 0xa6u8, 0xafu8, 0xddu8]) } fn nat_eq_of_beq_eq_true_addr_dec() -> Addr { - store([0xcbu8, 0x0fu8, 0xf0u8, 0x7du8, 0x3fu8, 0x72u8, 0x26u8, 0xa8u8, - 0x98u8, 0x76u8, 0x9du8, 0xa8u8, 0xcau8, 0xacu8, 0x9au8, 0xc1u8, - 0xb4u8, 0x92u8, 0x26u8, 0xd6u8, 0xaeu8, 0x43u8, 0xb2u8, 0xafu8, - 0xfcu8, 0x84u8, 0x9au8, 0x97u8, 0xf9u8, 0xd3u8, 0xe5u8, 0xc7u8]) + store([0xf8u8, 0x31u8, 0x39u8, 0x71u8, 0xbbu8, 0xa5u8, 0xeeu8, 0x8cu8, + 0x81u8, 0x45u8, 0x54u8, 0xb0u8, 0xc0u8, 0x44u8, 0x7au8, 0x10u8, + 0xc1u8, 0x29u8, 0xb4u8, 0x19u8, 0x45u8, 0xacu8, 0x5fu8, 0xb8u8, + 0x17u8, 0xc3u8, 0xfcu8, 0x7bu8, 0x98u8, 0xb2u8, 0x3au8, 0x10u8]) } fn nat_ne_of_beq_eq_false_addr_dec() -> Addr { - store([0x79u8, 0xa5u8, 0x7eu8, 0x7fu8, 0x8du8, 0x10u8, 0x30u8, 0xfbu8, - 0x95u8, 0xffu8, 0x4fu8, 0x19u8, 0xeau8, 0x21u8, 0x2cu8, 0x9au8, - 0xe0u8, 0x11u8, 0x63u8, 0x8fu8, 0xf7u8, 0x34u8, 0x9cu8, 0x4au8, - 0x69u8, 0x2du8, 0xdfu8, 0x5eu8, 0x8eu8, 0x07u8, 0x1au8, 0xd4u8]) + store([0x7au8, 0xecu8, 0xc2u8, 0x06u8, 0x71u8, 0x4du8, 0x64u8, 0xb5u8, + 0x17u8, 0x7au8, 0xcbu8, 0x75u8, 0x3au8, 0x28u8, 0x5eu8, 0x67u8, + 0x0au8, 0x91u8, 0x8au8, 0x1au8, 0xc9u8, 0xfeu8, 0x8fu8, 0x57u8, + 0x46u8, 0x0fu8, 0x77u8, 0x6fu8, 0x17u8, 0xb7u8, 0xadu8, 0xc2u8]) } fn bool_type_addr_dec() -> Addr { @@ -490,24 +490,24 @@ def infer := ⟦ } fn int_dec_eq_addr_dec() -> Addr { - store([0x40u8, 0x2cu8, 0xb0u8, 0x1bu8, 0xfau8, 0x52u8, 0xfeu8, 0x93u8, - 0xaeu8, 0xf3u8, 0xd9u8, 0x6eu8, 0x7du8, 0x28u8, 0xeeu8, 0x03u8, - 0xe0u8, 0xe1u8, 0xf7u8, 0x6fu8, 0x3cu8, 0x87u8, 0x96u8, 0x54u8, - 0xf5u8, 0xe7u8, 0x19u8, 0xa7u8, 0x20u8, 0x15u8, 0x23u8, 0x7fu8]) + store([0x0fu8, 0x53u8, 0xbcu8, 0x57u8, 0x68u8, 0xfdu8, 0x32u8, 0xaau8, + 0x68u8, 0x01u8, 0xdcu8, 0x87u8, 0x62u8, 0x93u8, 0x4bu8, 0x69u8, + 0x04u8, 0x9du8, 0xb3u8, 0xe7u8, 0xe5u8, 0x74u8, 0x12u8, 0xc6u8, + 0x90u8, 0x4du8, 0xd1u8, 0xa8u8, 0xb9u8, 0xcfu8, 0xf4u8, 0xf8u8]) } fn int_dec_le_addr_dec() -> Addr { - store([0xbfu8, 0xfeu8, 0xd7u8, 0xcdu8, 0x49u8, 0x68u8, 0xb8u8, 0xfcu8, - 0x25u8, 0x1eu8, 0xd2u8, 0x4au8, 0x9cu8, 0x25u8, 0x3du8, 0xa0u8, - 0x02u8, 0x15u8, 0x90u8, 0x23u8, 0x54u8, 0xc2u8, 0x94u8, 0x4fu8, - 0x59u8, 0xe8u8, 0x15u8, 0x38u8, 0xdcu8, 0x1au8, 0xe2u8, 0xc7u8]) + store([0x0eu8, 0x5fu8, 0x70u8, 0xefu8, 0xdau8, 0x05u8, 0x98u8, 0x18u8, + 0x28u8, 0x19u8, 0xa1u8, 0x0au8, 0x23u8, 0x87u8, 0x96u8, 0x46u8, + 0x2du8, 0xebu8, 0xc0u8, 0x5fu8, 0x40u8, 0x88u8, 0x81u8, 0x17u8, + 0xd1u8, 0x19u8, 0x69u8, 0x92u8, 0xb9u8, 0x42u8, 0x3fu8, 0xaeu8]) } fn int_dec_lt_addr_dec() -> Addr { - store([0x09u8, 0xb5u8, 0xfbu8, 0x2fu8, 0x2du8, 0x84u8, 0x51u8, 0x68u8, - 0x9fu8, 0x84u8, 0x27u8, 0x11u8, 0x74u8, 0x4au8, 0x27u8, 0xbfu8, - 0xe5u8, 0x5cu8, 0x6fu8, 0xd5u8, 0x01u8, 0x0fu8, 0xd2u8, 0x4au8, - 0x90u8, 0x84u8, 0x53u8, 0x93u8, 0xc7u8, 0x07u8, 0xe0u8, 0xa4u8]) + store([0xceu8, 0x13u8, 0x7cu8, 0xceu8, 0x4cu8, 0x1au8, 0x49u8, 0x32u8, + 0x3au8, 0x78u8, 0x8fu8, 0x16u8, 0x77u8, 0xa9u8, 0xd6u8, 0xa1u8, + 0xd4u8, 0xa9u8, 0x36u8, 0x11u8, 0x15u8, 0x88u8, 0x08u8, 0x35u8, + 0x89u8, 0xbau8, 0xabu8, 0x2bu8, 0xacu8, 0x01u8, 0x10u8, 0x8cu8]) } fn int_of_nat_addr_dec() -> Addr { diff --git a/Ix/IxVM/Kernel/InferOnly.lean b/Ix/IxVM/Kernel/InferOnly.lean index 8ed67c6bb..3e8508043 100644 --- a/Ix/IxVM/Kernel/InferOnly.lean +++ b/Ix/IxVM/Kernel/InferOnly.lean @@ -66,10 +66,10 @@ def inferOnly := ⟦ } fn str_addr_io() -> Addr { - store([0x4au8, 0xc0u8, 0x9eu8, 0xd8u8, 0xffu8, 0x61u8, 0xe4u8, 0x4fu8, - 0x11u8, 0x59u8, 0xbcu8, 0x6fu8, 0xb0u8, 0x0fu8, 0xd7u8, 0xe7u8, - 0x2cu8, 0x15u8, 0xdeu8, 0xefu8, 0xeau8, 0x56u8, 0x9du8, 0x75u8, - 0x5du8, 0x8bu8, 0x1du8, 0x05u8, 0xf5u8, 0xd1u8, 0x91u8, 0xf7u8]) + store([0xfdu8, 0x53u8, 0xe8u8, 0xdcu8, 0xe8u8, 0x2du8, 0x56u8, 0x8bu8, + 0x56u8, 0xe9u8, 0xb1u8, 0x6cu8, 0x39u8, 0x0bu8, 0x56u8, 0x93u8, + 0xc1u8, 0x37u8, 0xb4u8, 0xe5u8, 0x4du8, 0x12u8, 0xacu8, 0x09u8, + 0xaau8, 0x55u8, 0x98u8, 0x63u8, 0x95u8, 0x4bu8, 0x65u8, 0x87u8]) } -- k_infer_only: type-synthesis-only (mirror Rust `with_infer_only`). diff --git a/Ix/IxVM/Kernel/NatPrim.lean b/Ix/IxVM/Kernel/NatPrim.lean index 8d00a3e4b..cabd69189 100644 --- a/Ix/IxVM/Kernel/NatPrim.lean +++ b/Ix/IxVM/Kernel/NatPrim.lean @@ -60,101 +60,101 @@ def natPrim := ⟦ } fn nat_add_addr() -> Addr { - store([0x5eu8, 0xd7u8, 0x8eu8, 0xe0u8, 0x81u8, 0xe1u8, 0x0bu8, 0xc0u8, - 0x99u8, 0x9au8, 0x37u8, 0x2au8, 0x5eu8, 0x54u8, 0xacu8, 0xd3u8, - 0x37u8, 0x3du8, 0x85u8, 0xd4u8, 0x1eu8, 0x9bu8, 0xe3u8, 0xfau8, - 0x75u8, 0xfdu8, 0xdeu8, 0x32u8, 0xdbu8, 0x2du8, 0x65u8, 0x01u8]) + store([0xe1u8, 0xeeu8, 0x4cu8, 0x78u8, 0xa3u8, 0x90u8, 0x64u8, 0x64u8, + 0xfau8, 0x8cu8, 0x17u8, 0xecu8, 0x2eu8, 0xd0u8, 0xc0u8, 0xbfu8, + 0x66u8, 0xdbu8, 0x3bu8, 0x41u8, 0x2du8, 0x9bu8, 0x1cu8, 0x5fu8, + 0x31u8, 0xfbu8, 0xa7u8, 0xbbu8, 0x97u8, 0x4au8, 0x93u8, 0xe5u8]) } fn nat_sub_addr() -> Addr { - store([0x61u8, 0x0fu8, 0xe5u8, 0xa4u8, 0xf5u8, 0xa0u8, 0x3fu8, 0x64u8, - 0xf6u8, 0x0eu8, 0xf5u8, 0xa0u8, 0x69u8, 0xf1u8, 0x64u8, 0x07u8, - 0x58u8, 0xe0u8, 0x00u8, 0xa1u8, 0xb4u8, 0xd5u8, 0x7fu8, 0xd5u8, - 0x94u8, 0x86u8, 0x6eu8, 0x9fu8, 0x6bu8, 0x33u8, 0x81u8, 0xedu8]) + store([0xbfu8, 0x05u8, 0x8eu8, 0xe4u8, 0x46u8, 0x52u8, 0x7au8, 0xf6u8, + 0xecu8, 0x74u8, 0x92u8, 0x23u8, 0x75u8, 0x2du8, 0x07u8, 0xe6u8, + 0xd7u8, 0xc2u8, 0xdfu8, 0x8du8, 0xc0u8, 0xa0u8, 0x77u8, 0x8du8, + 0x93u8, 0x4fu8, 0x88u8, 0x5au8, 0xe8u8, 0x26u8, 0x7du8, 0x57u8]) } fn nat_mul_addr() -> Addr { - store([0xdau8, 0x6fu8, 0xb7u8, 0x25u8, 0x80u8, 0x3du8, 0xb7u8, 0x9fu8, - 0x31u8, 0x8eu8, 0x8au8, 0xefu8, 0x5bu8, 0x19u8, 0xe1u8, 0xd4u8, - 0xc2u8, 0xd1u8, 0xa7u8, 0xc4u8, 0x18u8, 0x31u8, 0xdfu8, 0x48u8, - 0x78u8, 0x7eu8, 0x8au8, 0x31u8, 0x9bu8, 0x8cu8, 0x48u8, 0xd3u8]) + store([0xc2u8, 0xfeu8, 0x5eu8, 0xdau8, 0x1eu8, 0x55u8, 0x92u8, 0x36u8, + 0xbfu8, 0xc2u8, 0xa7u8, 0xa4u8, 0x7du8, 0xb0u8, 0xcau8, 0x6cu8, + 0xf7u8, 0x82u8, 0xf7u8, 0xb6u8, 0x9bu8, 0xddu8, 0x96u8, 0x32u8, + 0x37u8, 0xd0u8, 0x88u8, 0x9fu8, 0xbfu8, 0x9au8, 0x4bu8, 0x07u8]) } fn nat_pow_addr() -> Addr { - store([0xabu8, 0x6fu8, 0x3fu8, 0x1cu8, 0xadu8, 0x63u8, 0x6cu8, 0xeeu8, - 0xb6u8, 0x7du8, 0xf7u8, 0x49u8, 0xcdu8, 0x7cu8, 0xc6u8, 0x34u8, - 0xa2u8, 0xd6u8, 0x8au8, 0xebu8, 0x54u8, 0x25u8, 0x5eu8, 0x08u8, - 0x5cu8, 0xa7u8, 0xefu8, 0x69u8, 0x2bu8, 0x39u8, 0x5eu8, 0x63u8]) + store([0x0au8, 0xecu8, 0x92u8, 0x31u8, 0x3eu8, 0x59u8, 0x8du8, 0x5fu8, + 0xcbu8, 0x5du8, 0xcfu8, 0x0bu8, 0x80u8, 0x39u8, 0x9cu8, 0x69u8, + 0xebu8, 0xf6u8, 0xa4u8, 0x3bu8, 0x9eu8, 0xe9u8, 0x7au8, 0x3eu8, + 0x56u8, 0x14u8, 0x36u8, 0xb9u8, 0xf2u8, 0xb9u8, 0x54u8, 0x80u8]) } fn nat_gcd_addr() -> Addr { - store([0x8cu8, 0xd4u8, 0x19u8, 0x90u8, 0x44u8, 0x49u8, 0xa4u8, 0xd9u8, - 0x1bu8, 0xeau8, 0xb8u8, 0x4du8, 0xc2u8, 0x6bu8, 0x48u8, 0xb2u8, - 0x16u8, 0xdau8, 0xfeu8, 0x16u8, 0x36u8, 0xd7u8, 0x1fu8, 0x48u8, - 0xdcu8, 0xc0u8, 0xd2u8, 0x0cu8, 0x9fu8, 0xedu8, 0x10u8, 0xebu8]) + store([0x59u8, 0xe4u8, 0x7du8, 0x71u8, 0xd7u8, 0x3cu8, 0x54u8, 0x4eu8, + 0xe1u8, 0xa4u8, 0xedu8, 0xf0u8, 0x7eu8, 0x9fu8, 0xffu8, 0xf5u8, + 0x42u8, 0xcbu8, 0x75u8, 0x7eu8, 0x73u8, 0x96u8, 0x51u8, 0xa9u8, + 0xcdu8, 0x45u8, 0x3au8, 0xf0u8, 0x3du8, 0x3du8, 0xceu8, 0x42u8]) } fn nat_mod_addr() -> Addr { - store([0x4fu8, 0xc9u8, 0x15u8, 0x88u8, 0xd0u8, 0xb0u8, 0x4eu8, 0xe9u8, - 0xebu8, 0x22u8, 0x01u8, 0xc8u8, 0x0bu8, 0x72u8, 0xb3u8, 0x9du8, - 0xefu8, 0xa1u8, 0xedu8, 0xf4u8, 0x5cu8, 0x82u8, 0xe5u8, 0xeau8, - 0xe3u8, 0x4eu8, 0x1fu8, 0x71u8, 0x85u8, 0x8du8, 0x76u8, 0xb6u8]) + store([0x2cu8, 0x9du8, 0x2du8, 0x3eu8, 0x7eu8, 0x97u8, 0x4bu8, 0x43u8, + 0xcau8, 0x3du8, 0x21u8, 0x2fu8, 0x32u8, 0x70u8, 0x71u8, 0x87u8, + 0x38u8, 0x21u8, 0x25u8, 0xb1u8, 0x27u8, 0x27u8, 0x58u8, 0xf6u8, + 0x9cu8, 0x4bu8, 0x47u8, 0xe9u8, 0x6du8, 0x9au8, 0xabu8, 0xcfu8]) } fn nat_div_addr() -> Addr { - store([0x83u8, 0xc2u8, 0x70u8, 0x38u8, 0x8eu8, 0x40u8, 0x4au8, 0x2du8, - 0xccu8, 0x99u8, 0x24u8, 0xf2u8, 0x48u8, 0x27u8, 0x82u8, 0xd9u8, - 0xdeu8, 0xbfu8, 0x71u8, 0x66u8, 0xf3u8, 0xd2u8, 0xe0u8, 0x76u8, - 0x3au8, 0x78u8, 0x28u8, 0x17u8, 0x2bu8, 0x8cu8, 0x13u8, 0x1eu8]) + store([0x2fu8, 0x12u8, 0xf3u8, 0x22u8, 0x94u8, 0xb7u8, 0xd1u8, 0x16u8, + 0x8au8, 0xdau8, 0x18u8, 0x09u8, 0xc9u8, 0xb8u8, 0xb2u8, 0x56u8, + 0x38u8, 0x24u8, 0xe9u8, 0xc2u8, 0x87u8, 0x9bu8, 0xf8u8, 0xd3u8, + 0xbbu8, 0x9bu8, 0x5cu8, 0x03u8, 0xd7u8, 0xabu8, 0x71u8, 0x31u8]) } fn nat_land_addr() -> Addr { - store([0x64u8, 0xe1u8, 0x82u8, 0xceu8, 0xf3u8, 0x3cu8, 0xb7u8, 0x17u8, - 0xb7u8, 0x88u8, 0x40u8, 0x4du8, 0x31u8, 0xbau8, 0xd2u8, 0x10u8, - 0x3du8, 0x1au8, 0xfbu8, 0x76u8, 0xdbu8, 0x54u8, 0x47u8, 0xbau8, - 0x34u8, 0x32u8, 0xd8u8, 0x3fu8, 0x72u8, 0xcbu8, 0x9bu8, 0xf4u8]) + store([0x83u8, 0x3cu8, 0x5bu8, 0x2eu8, 0x3cu8, 0x07u8, 0x7eu8, 0xb6u8, + 0xb3u8, 0xc0u8, 0xe4u8, 0xd8u8, 0x48u8, 0xcfu8, 0x54u8, 0x08u8, + 0x24u8, 0x0cu8, 0x7du8, 0x3cu8, 0xffu8, 0x8cu8, 0x40u8, 0x63u8, + 0x5cu8, 0x6eu8, 0x3bu8, 0xf9u8, 0x46u8, 0x63u8, 0x0eu8, 0x34u8]) } fn nat_lor_addr() -> Addr { - store([0xd7u8, 0x5du8, 0xe1u8, 0x2au8, 0x58u8, 0x4bu8, 0xd5u8, 0xfeu8, - 0xbau8, 0xf8u8, 0x9au8, 0x77u8, 0x28u8, 0xdcu8, 0x62u8, 0x70u8, - 0xedu8, 0x38u8, 0xaeu8, 0x17u8, 0x97u8, 0xffu8, 0x5au8, 0x44u8, - 0x68u8, 0x3bu8, 0x8du8, 0xf1u8, 0x59u8, 0x50u8, 0x99u8, 0x94u8]) + store([0x72u8, 0x32u8, 0x09u8, 0x5au8, 0xeau8, 0x9au8, 0x5fu8, 0x79u8, + 0xccu8, 0x0fu8, 0x2bu8, 0x0au8, 0xd8u8, 0x48u8, 0xdbu8, 0xf1u8, + 0x90u8, 0x4au8, 0x63u8, 0x0fu8, 0x1eu8, 0xf8u8, 0x6fu8, 0x24u8, + 0x4fu8, 0x8au8, 0x42u8, 0xb8u8, 0x47u8, 0xafu8, 0xabu8, 0x9au8]) } fn nat_xor_addr() -> Addr { - store([0x0cu8, 0x67u8, 0x88u8, 0xb5u8, 0x8du8, 0x95u8, 0x68u8, 0xccu8, - 0x11u8, 0x8au8, 0x9bu8, 0x0au8, 0x86u8, 0x1eu8, 0x87u8, 0x27u8, - 0x32u8, 0xdbu8, 0xb8u8, 0x45u8, 0x36u8, 0x47u8, 0xeau8, 0x9du8, - 0x60u8, 0x13u8, 0x51u8, 0x52u8, 0x44u8, 0xe6u8, 0x0eu8, 0x38u8]) + store([0xc3u8, 0xb0u8, 0x0bu8, 0x51u8, 0x4bu8, 0x9fu8, 0x26u8, 0xdcu8, + 0x1eu8, 0xdfu8, 0x10u8, 0xc7u8, 0xd6u8, 0xf6u8, 0x9fu8, 0x45u8, + 0x5eu8, 0xf8u8, 0xedu8, 0x0cu8, 0x51u8, 0xb0u8, 0xa6u8, 0x66u8, + 0xe3u8, 0x42u8, 0x7fu8, 0xb4u8, 0x4du8, 0x3au8, 0x04u8, 0xf0u8]) } fn nat_shift_left_addr() -> Addr { - store([0x42u8, 0x4cu8, 0x36u8, 0xeeu8, 0x14u8, 0x36u8, 0x2au8, 0xe7u8, - 0x34u8, 0x2du8, 0x15u8, 0x27u8, 0xd2u8, 0x51u8, 0xd4u8, 0x37u8, - 0x8au8, 0xfdu8, 0x2au8, 0x45u8, 0xa3u8, 0xb5u8, 0x09u8, 0x7du8, - 0x2du8, 0x2au8, 0xe0u8, 0x32u8, 0x1du8, 0x5fu8, 0x9fu8, 0xffu8]) + store([0x6eu8, 0x70u8, 0xcdu8, 0x9du8, 0x17u8, 0x08u8, 0xb8u8, 0xf0u8, + 0x0bu8, 0xe4u8, 0x60u8, 0x65u8, 0x5cu8, 0xa4u8, 0x7au8, 0x41u8, + 0x9du8, 0xc6u8, 0x01u8, 0xf9u8, 0xc0u8, 0x55u8, 0x8eu8, 0x7au8, + 0xc2u8, 0x12u8, 0xb8u8, 0x0eu8, 0xe6u8, 0xffu8, 0x09u8, 0x78u8]) } fn nat_shift_right_addr() -> Addr { - store([0xaau8, 0x9bu8, 0x61u8, 0xbeu8, 0xdcu8, 0x9eu8, 0xe6u8, 0xa9u8, - 0x90u8, 0x8du8, 0x5fu8, 0x0eu8, 0x98u8, 0x95u8, 0x5fu8, 0x18u8, - 0x33u8, 0x0fu8, 0x38u8, 0x58u8, 0x7du8, 0xf7u8, 0x10u8, 0xfdu8, - 0xebu8, 0xe4u8, 0x15u8, 0xceu8, 0xc7u8, 0xdau8, 0x29u8, 0xedu8]) + store([0xd8u8, 0xddu8, 0xecu8, 0x67u8, 0xd3u8, 0x2eu8, 0xebu8, 0x1fu8, + 0x2bu8, 0x0du8, 0x54u8, 0x03u8, 0x72u8, 0xedu8, 0x74u8, 0x52u8, + 0x20u8, 0xfdu8, 0xb1u8, 0xe4u8, 0xe2u8, 0xb2u8, 0xf5u8, 0x4bu8, + 0xadu8, 0xdeu8, 0x60u8, 0xb6u8, 0x67u8, 0x34u8, 0xf9u8, 0xf3u8]) } fn nat_beq_addr() -> Addr { - store([0xfdu8, 0x86u8, 0x25u8, 0xd5u8, 0x16u8, 0x60u8, 0x51u8, 0x03u8, - 0xbfu8, 0x8eu8, 0x01u8, 0x9au8, 0x5du8, 0x86u8, 0xd4u8, 0x7du8, - 0x34u8, 0xddu8, 0x47u8, 0xc1u8, 0xefu8, 0x64u8, 0x9eu8, 0x3du8, - 0xecu8, 0x0fu8, 0xa6u8, 0x97u8, 0xbbu8, 0xfdu8, 0x9eu8, 0x41u8]) + store([0xcau8, 0x30u8, 0x22u8, 0xa3u8, 0xc8u8, 0x35u8, 0x9bu8, 0x0cu8, + 0x43u8, 0x5eu8, 0xb4u8, 0xbbu8, 0x8eu8, 0x8eu8, 0xacu8, 0x0au8, + 0xa0u8, 0x85u8, 0xd1u8, 0xdau8, 0x10u8, 0xf2u8, 0x59u8, 0x28u8, + 0x70u8, 0x25u8, 0x22u8, 0x98u8, 0x61u8, 0x11u8, 0x20u8, 0x70u8]) } fn nat_ble_addr() -> Addr { - store([0xdau8, 0x3fu8, 0x95u8, 0x08u8, 0x77u8, 0x82u8, 0xf4u8, 0x07u8, - 0x43u8, 0x16u8, 0x8bu8, 0xd9u8, 0x17u8, 0x6du8, 0xdcu8, 0xdeu8, - 0x64u8, 0xbfu8, 0x5au8, 0x4du8, 0x50u8, 0x34u8, 0x63u8, 0xc3u8, - 0xd5u8, 0xeeu8, 0xf4u8, 0xcau8, 0x2eu8, 0xfau8, 0xedu8, 0x23u8]) + store([0xcau8, 0x4bu8, 0x39u8, 0x8bu8, 0x20u8, 0x80u8, 0xbeu8, 0xccu8, + 0xccu8, 0xf3u8, 0xa3u8, 0x12u8, 0x1eu8, 0x84u8, 0x8bu8, 0xd1u8, + 0x97u8, 0x78u8, 0x47u8, 0x66u8, 0x8cu8, 0x18u8, 0xa6u8, 0x44u8, + 0x7bu8, 0x0eu8, 0xdcu8, 0x5fu8, 0x56u8, 0x1bu8, 0x1cu8, 0xbcu8]) } fn bool_true_addr() -> Addr { @@ -385,31 +385,31 @@ def natPrim := ⟦ -- BitVec primitives () fn bit_vec_to_nat_addr() -> Addr { - store([0x98u8, 0x6bu8, 0x9cu8, 0x73u8, 0x6cu8, 0xb9u8, 0x30u8, 0xc8u8, - 0x1cu8, 0xaeu8, 0x69u8, 0x7eu8, 0xc4u8, 0x96u8, 0x80u8, 0x4bu8, - 0x6eu8, 0x44u8, 0x15u8, 0xa1u8, 0x78u8, 0xe4u8, 0xf0u8, 0x02u8, - 0x2fu8, 0xb0u8, 0x58u8, 0xf5u8, 0x03u8, 0x4au8, 0xb7u8, 0xbfu8]) + store([0xe3u8, 0x2au8, 0xb4u8, 0xe7u8, 0x72u8, 0x0du8, 0x34u8, 0x42u8, + 0xa2u8, 0x66u8, 0xb3u8, 0x7cu8, 0x97u8, 0xa2u8, 0x72u8, 0x18u8, + 0xe6u8, 0x82u8, 0x39u8, 0x31u8, 0x83u8, 0x11u8, 0xf8u8, 0xe4u8, + 0xb0u8, 0x46u8, 0xa6u8, 0xbdu8, 0xdeu8, 0x52u8, 0x03u8, 0x74u8]) } fn bit_vec_of_nat_addr() -> Addr { - store([0xdau8, 0x08u8, 0x2fu8, 0x15u8, 0x7du8, 0x2au8, 0x7bu8, 0x86u8, - 0xebu8, 0x22u8, 0x6bu8, 0x18u8, 0x81u8, 0xbfu8, 0xacu8, 0xd0u8, - 0xd9u8, 0xddu8, 0x1bu8, 0xe1u8, 0x7au8, 0x27u8, 0xe1u8, 0x3fu8, - 0xa3u8, 0x00u8, 0xc0u8, 0x15u8, 0xc4u8, 0xffu8, 0xbfu8, 0x85u8]) + store([0x3bu8, 0x33u8, 0x4cu8, 0x94u8, 0xddu8, 0x56u8, 0xd8u8, 0x0bu8, + 0xebu8, 0x4eu8, 0xffu8, 0x5du8, 0x82u8, 0x5fu8, 0x67u8, 0xf6u8, + 0xf1u8, 0xacu8, 0x4eu8, 0x14u8, 0x04u8, 0x03u8, 0x69u8, 0x9eu8, + 0x3du8, 0xafu8, 0xf5u8, 0x2au8, 0x00u8, 0xbdu8, 0xbfu8, 0x6eu8]) } fn bit_vec_addr() -> Addr { - store([0xeau8, 0xfdu8, 0x1bu8, 0x2fu8, 0x6bu8, 0x57u8, 0x1au8, 0xbfu8, - 0x76u8, 0xaeu8, 0x96u8, 0xeau8, 0xf9u8, 0xc4u8, 0x85u8, 0x2au8, - 0xa4u8, 0x52u8, 0x0du8, 0x06u8, 0xdfu8, 0x53u8, 0x42u8, 0x91u8, - 0x59u8, 0x0au8, 0x71u8, 0xa2u8, 0x1eu8, 0x6fu8, 0x0bu8, 0x5au8]) + store([0x67u8, 0xf4u8, 0x74u8, 0xb8u8, 0xc3u8, 0x30u8, 0x2bu8, 0x04u8, + 0x41u8, 0x7fu8, 0x72u8, 0x1fu8, 0xf3u8, 0xe8u8, 0x8cu8, 0xe6u8, + 0xf1u8, 0x6au8, 0x7du8, 0xfcu8, 0xb3u8, 0xbau8, 0xe9u8, 0x93u8, + 0x68u8, 0x08u8, 0x5du8, 0x1cu8, 0x5eu8, 0x87u8, 0x2bu8, 0xa4u8]) } fn bit_vec_ult_addr() -> Addr { - store([0xb6u8, 0x68u8, 0xdbu8, 0x7du8, 0x12u8, 0xcau8, 0xbbu8, 0x4du8, - 0x7fu8, 0xe2u8, 0xe1u8, 0xafu8, 0x25u8, 0x98u8, 0x4bu8, 0xaau8, - 0x28u8, 0xbbu8, 0x28u8, 0x52u8, 0xa9u8, 0x82u8, 0xdau8, 0x8du8, - 0x54u8, 0x94u8, 0x2bu8, 0xb3u8, 0x44u8, 0x72u8, 0x6cu8, 0xcfu8]) + store([0x4fu8, 0x9du8, 0x4eu8, 0x0cu8, 0x70u8, 0xe1u8, 0x6cu8, 0x78u8, + 0xe0u8, 0xedu8, 0xa3u8, 0x8eu8, 0x2du8, 0x6du8, 0x94u8, 0xccu8, + 0xd1u8, 0x25u8, 0x98u8, 0x75u8, 0x5eu8, 0x0eu8, 0x72u8, 0x00u8, + 0xa9u8, 0x23u8, 0x9du8, 0xa9u8, 0x2bu8, 0x90u8, 0x57u8, 0xccu8]) } fn decidable_decide_addr() -> Addr { @@ -629,10 +629,10 @@ def natPrim := ⟦ -- String primitives () fn string_utf8_byte_size_addr() -> Addr { - store([0x6au8, 0x14u8, 0x2du8, 0x91u8, 0xe8u8, 0x77u8, 0x95u8, 0x9eu8, - 0x14u8, 0x19u8, 0xc3u8, 0x45u8, 0x80u8, 0x8au8, 0x79u8, 0xa3u8, - 0xe9u8, 0x58u8, 0x18u8, 0x57u8, 0x7au8, 0xfdu8, 0xa6u8, 0x8du8, - 0x28u8, 0x7fu8, 0x4fu8, 0x88u8, 0x15u8, 0x21u8, 0xddu8, 0xe9u8]) + store([0x51u8, 0x86u8, 0xd9u8, 0x1eu8, 0xf8u8, 0x89u8, 0x2eu8, 0x48u8, + 0xebu8, 0x02u8, 0x91u8, 0x8bu8, 0x09u8, 0x26u8, 0xe9u8, 0x76u8, + 0x7cu8, 0x6du8, 0x4bu8, 0x9bu8, 0x08u8, 0x14u8, 0x06u8, 0x4au8, + 0x44u8, 0x9au8, 0x5au8, 0xfeu8, 0x8au8, 0x9eu8, 0x5au8, 0x6eu8]) } -- Native string-value fast paths (mirror crates/kernel/src/primitive.rs @@ -640,24 +640,24 @@ def natPrim := ⟦ -- decidable equality reduce natively in whnf, keeping evaluator-grade -- string values out of the structural ByteArray/UTF-8 model. fn string_append_addr() -> Addr { - store([0x38u8, 0x03u8, 0xadu8, 0xc2u8, 0x1du8, 0x89u8, 0x96u8, 0x93u8, - 0xa1u8, 0x49u8, 0x1du8, 0xb0u8, 0x54u8, 0x10u8, 0x4bu8, 0x20u8, - 0xbdu8, 0x40u8, 0xfcu8, 0x0cu8, 0xa1u8, 0xf6u8, 0xb4u8, 0x37u8, - 0x4bu8, 0x7bu8, 0x15u8, 0x8bu8, 0x42u8, 0x52u8, 0xb3u8, 0x8bu8]) + store([0xffu8, 0x45u8, 0x95u8, 0x54u8, 0xdfu8, 0xdcu8, 0x34u8, 0xd1u8, + 0x59u8, 0x02u8, 0x70u8, 0x38u8, 0x17u8, 0x45u8, 0x71u8, 0xb7u8, + 0x70u8, 0x46u8, 0x4du8, 0x52u8, 0x83u8, 0x4cu8, 0x1du8, 0xbcu8, + 0x64u8, 0x36u8, 0x46u8, 0x7fu8, 0xa8u8, 0x1du8, 0x03u8, 0x9eu8]) } fn string_of_list_addr() -> Addr { - store([0x8eu8, 0x9eu8, 0x6au8, 0xf2u8, 0xd6u8, 0x5au8, 0x17u8, 0x09u8, - 0x4au8, 0x87u8, 0x50u8, 0x0fu8, 0x84u8, 0xf7u8, 0xb2u8, 0x6du8, - 0x82u8, 0xedu8, 0xcau8, 0xd0u8, 0xddu8, 0x69u8, 0x99u8, 0x79u8, - 0x4au8, 0x8bu8, 0x46u8, 0xecu8, 0xb5u8, 0x54u8, 0x24u8, 0x2du8]) + store([0x0fu8, 0x02u8, 0x50u8, 0xd7u8, 0x71u8, 0x37u8, 0x04u8, 0x43u8, + 0x90u8, 0x73u8, 0xbau8, 0xbdu8, 0x51u8, 0x1bu8, 0x77u8, 0xa9u8, + 0xeeu8, 0xeau8, 0xe5u8, 0xadu8, 0xbdu8, 0x50u8, 0xffu8, 0x57u8, + 0x4du8, 0x80u8, 0x1fu8, 0xfbu8, 0x55u8, 0x81u8, 0x28u8, 0xd9u8]) } fn char_of_nat_addr() -> Addr { - store([0x60u8, 0x4bu8, 0x23u8, 0xcdu8, 0x0fu8, 0xacu8, 0xf5u8, 0xb3u8, - 0xe5u8, 0x6du8, 0xefu8, 0x57u8, 0xdau8, 0x91u8, 0xb2u8, 0x68u8, - 0x8fu8, 0xfcu8, 0xa7u8, 0xc5u8, 0x43u8, 0x5bu8, 0xb5u8, 0xdcu8, - 0x2cu8, 0xb1u8, 0x1au8, 0x68u8, 0xa3u8, 0x31u8, 0x86u8, 0x09u8]) + store([0x09u8, 0xeeu8, 0xb4u8, 0x16u8, 0xc8u8, 0x40u8, 0x76u8, 0x66u8, + 0x64u8, 0x57u8, 0x41u8, 0x7fu8, 0x4bu8, 0x7cu8, 0xe3u8, 0xd1u8, + 0xbfu8, 0x34u8, 0x97u8, 0x7du8, 0x3fu8, 0x56u8, 0xddu8, 0x25u8, + 0x62u8, 0xc0u8, 0x01u8, 0x4au8, 0x51u8, 0xcbu8, 0x8du8, 0x34u8]) } fn list_nil_addr() -> Addr { @@ -675,52 +675,52 @@ def natPrim := ⟦ } fn char_type_addr() -> Addr { - store([0x98u8, 0xc9u8, 0x8cu8, 0x0fu8, 0x99u8, 0x6fu8, 0x21u8, 0xf6u8, - 0xe2u8, 0xb6u8, 0x1fu8, 0x1eu8, 0xfcu8, 0xaeu8, 0x99u8, 0xbau8, - 0xa9u8, 0x8bu8, 0xe2u8, 0x6au8, 0x7fu8, 0xf8u8, 0x25u8, 0x15u8, - 0x68u8, 0x4au8, 0x82u8, 0x69u8, 0x54u8, 0xb3u8, 0x5eu8, 0x29u8]) + store([0x20u8, 0x3bu8, 0x76u8, 0xc5u8, 0xb4u8, 0xf5u8, 0xcau8, 0x06u8, + 0x15u8, 0x63u8, 0x31u8, 0x40u8, 0x57u8, 0xa9u8, 0x43u8, 0xbcu8, + 0x43u8, 0x80u8, 0x88u8, 0x5eu8, 0x73u8, 0xd0u8, 0xefu8, 0xafu8, + 0x14u8, 0x64u8, 0x45u8, 0x98u8, 0xc2u8, 0xfau8, 0x6eu8, 0xeeu8]) } fn string_back_addr() -> Addr { - store([0xd0u8, 0x7fu8, 0x81u8, 0x05u8, 0xc5u8, 0x44u8, 0x22u8, 0x7au8, - 0x13u8, 0xecu8, 0x90u8, 0xbeu8, 0xfau8, 0xe2u8, 0x00u8, 0x5eu8, - 0x9cu8, 0x6fu8, 0x64u8, 0x49u8, 0x3fu8, 0x8cu8, 0x7fu8, 0xf6u8, - 0x69u8, 0xbau8, 0x74u8, 0x3eu8, 0x15u8, 0x47u8, 0xc9u8, 0x35u8]) + store([0x54u8, 0x8bu8, 0xbfu8, 0x22u8, 0xbau8, 0x30u8, 0x5fu8, 0x8eu8, + 0x36u8, 0x3eu8, 0xdfu8, 0x99u8, 0x07u8, 0xd0u8, 0xc2u8, 0xc4u8, + 0x54u8, 0xadu8, 0xd4u8, 0x16u8, 0xddu8, 0xbfu8, 0x25u8, 0xb3u8, + 0x8cu8, 0x76u8, 0xd0u8, 0x06u8, 0x3au8, 0xd2u8, 0x1du8, 0x65u8]) } fn string_legacy_back_addr() -> Addr { - store([0xfcu8, 0x49u8, 0x35u8, 0x7au8, 0x5bu8, 0xc6u8, 0x52u8, 0x58u8, - 0x39u8, 0xa7u8, 0xbcu8, 0x11u8, 0xb9u8, 0xdfu8, 0x20u8, 0x78u8, - 0x52u8, 0xa6u8, 0xe9u8, 0xc6u8, 0xafu8, 0xa3u8, 0xecu8, 0x62u8, - 0xbau8, 0xc3u8, 0xc5u8, 0x42u8, 0xacu8, 0x89u8, 0xe0u8, 0xe0u8]) + store([0xefu8, 0x4eu8, 0x74u8, 0xe4u8, 0x4eu8, 0x3bu8, 0xb9u8, 0xfau8, + 0x5eu8, 0x54u8, 0x88u8, 0xa4u8, 0x6cu8, 0x5bu8, 0x4du8, 0x61u8, + 0xfbu8, 0xfdu8, 0x70u8, 0x1eu8, 0x36u8, 0x79u8, 0xc5u8, 0xbfu8, + 0xb4u8, 0x15u8, 0x4cu8, 0x87u8, 0x47u8, 0xceu8, 0xfdu8, 0xc9u8]) } fn string_to_byte_array_addr() -> Addr { - store([0x35u8, 0xd4u8, 0xf3u8, 0x82u8, 0xe2u8, 0x4eu8, 0x00u8, 0x9cu8, - 0xc0u8, 0xe9u8, 0x45u8, 0x79u8, 0x55u8, 0xd3u8, 0xefu8, 0x1eu8, - 0x6fu8, 0x79u8, 0xfau8, 0xe9u8, 0xd8u8, 0xd3u8, 0x1cu8, 0xfdu8, - 0x2eu8, 0x15u8, 0x3fu8, 0xa0u8, 0x3bu8, 0x05u8, 0x4au8, 0x6au8]) + store([0x87u8, 0x09u8, 0xf5u8, 0x70u8, 0xa8u8, 0x19u8, 0x32u8, 0x52u8, + 0x18u8, 0x2au8, 0x9eu8, 0xcdu8, 0x71u8, 0x3fu8, 0x89u8, 0x0eu8, + 0x75u8, 0xd3u8, 0xbfu8, 0xb5u8, 0xa2u8, 0x7fu8, 0x5bu8, 0x91u8, + 0x81u8, 0xccu8, 0xabu8, 0xe0u8, 0x65u8, 0x4au8, 0x0cu8, 0x29u8]) } fn byte_array_empty_addr() -> Addr { - store([0xe2u8, 0x1cu8, 0x24u8, 0xb4u8, 0x2fu8, 0x04u8, 0x92u8, 0x39u8, - 0xc7u8, 0xf7u8, 0x33u8, 0x92u8, 0xfeu8, 0xdcu8, 0x91u8, 0x1fu8, - 0x57u8, 0x4cu8, 0x79u8, 0x83u8, 0x86u8, 0xcbu8, 0xe3u8, 0xe3u8, - 0xe2u8, 0xa2u8, 0x88u8, 0x8eu8, 0x2du8, 0xf3u8, 0xaeu8, 0xf0u8]) + store([0x0du8, 0x23u8, 0x63u8, 0xd6u8, 0x03u8, 0x5cu8, 0xc7u8, 0xc0u8, + 0x33u8, 0x1fu8, 0xffu8, 0x5cu8, 0xa1u8, 0xdeu8, 0x7bu8, 0x40u8, + 0x91u8, 0x25u8, 0x1bu8, 0x50u8, 0x4du8, 0x44u8, 0xeeu8, 0xb2u8, + 0x85u8, 0x09u8, 0x93u8, 0xbdu8, 0x0du8, 0xddu8, 0xe2u8, 0x22u8]) } fn string_dec_eq_addr() -> Addr { - store([0xbau8, 0x51u8, 0xb5u8, 0xd8u8, 0xa3u8, 0xb1u8, 0x42u8, 0x01u8, - 0xd2u8, 0x24u8, 0x02u8, 0xcdu8, 0xa8u8, 0xe7u8, 0x31u8, 0xe4u8, - 0x9fu8, 0xdfu8, 0x78u8, 0xf0u8, 0x8bu8, 0x72u8, 0x64u8, 0x3cu8, - 0x1bu8, 0x08u8, 0xe2u8, 0x50u8, 0x43u8, 0x6au8, 0xafu8, 0xf1u8]) + store([0x14u8, 0xcfu8, 0x51u8, 0x9bu8, 0x05u8, 0xc3u8, 0x03u8, 0x84u8, + 0xfdu8, 0x4cu8, 0xb2u8, 0xe2u8, 0x71u8, 0xb0u8, 0x89u8, 0x6fu8, + 0xe2u8, 0x3eu8, 0x74u8, 0xc9u8, 0x95u8, 0x01u8, 0x0du8, 0x42u8, + 0xebu8, 0x1fu8, 0xfcu8, 0xe1u8, 0x49u8, 0x27u8, 0xe5u8, 0x6bu8]) } fn string_type_addr() -> Addr { - store([0x4au8, 0xc0u8, 0x9eu8, 0xd8u8, 0xffu8, 0x61u8, 0xe4u8, 0x4fu8, - 0x11u8, 0x59u8, 0xbcu8, 0x6fu8, 0xb0u8, 0x0fu8, 0xd7u8, 0xe7u8, - 0x2cu8, 0x15u8, 0xdeu8, 0xefu8, 0xeau8, 0x56u8, 0x9du8, 0x75u8, - 0x5du8, 0x8bu8, 0x1du8, 0x05u8, 0xf5u8, 0xd1u8, 0x91u8, 0xf7u8]) + store([0xfdu8, 0x53u8, 0xe8u8, 0xdcu8, 0xe8u8, 0x2du8, 0x56u8, 0x8bu8, + 0x56u8, 0xe9u8, 0xb1u8, 0x6cu8, 0x39u8, 0x0bu8, 0x56u8, 0x93u8, + 0xc1u8, 0x37u8, 0xb4u8, 0xe5u8, 0x4du8, 0x12u8, 0xacu8, 0x09u8, + 0xaau8, 0x55u8, 0x98u8, 0x63u8, 0x95u8, 0x4bu8, 0x65u8, 0x87u8]) } -- Address is a string primitive. diff --git a/Ix/Tc/Primitive.lean b/Ix/Tc/Primitive.lean index 282172144..8649c4c94 100644 --- a/Ix/Tc/Primitive.lean +++ b/Ix/Tc/Primitive.lean @@ -7,7 +7,7 @@ Mirror: crates/kernel/src/primitive.rs Well-known primitive constant KIds. Content addresses are hardcoded Blake3 hashes matching `PrimAddrs::new()` in Rust (regenerate with -`lake test -- rust-kernel-build-primitives --ignored` and paste into both). +`lake test -- --ignored rust-kernel-build-primitives` and paste into both). `Primitives m` stores `KId m` values resolved from the environment by address so meta-mode names match; in anon mode resolution is trivial (names are @@ -135,33 +135,33 @@ def canonical : PrimAddrs where nat := h "398a7706cf13f223992d173dce07946857240f49afcc743723e839f8f3f2b631" natZero := h "d397370157fb9ae2c6e1eda79feb10bf497401741aba788fab726cfa4c467db6" natSucc := h "def52d1dad5f10cf9893c945e169718d62b15e2dd2c9066e597b9d4570ba056e" - natAdd := h "5ed78ee081e10bc0999a372a5e54acd3373d85d41e9be3fa75fdde32db2d6501" + natAdd := h "e1ee4c78a3906464fa8c17ec2ed0c0bf66db3b412d9b1c5f31fba7bb974a93e5" natPred := h "914f9c01884853652e9224dc511f867d5408517f3beb3192fc4477e0e9594c88" - natSub := h "610fe5a4f5a03f64f60ef5a069f1640758e000a1b4d57fd594866e9f6b3381ed" - natMul := h "da6fb725803db79f318e8aef5b19e1d4c2d1a7c41831df48787e8a319b8c48d3" - natPow := h "ab6f3f1cad636ceeb67df749cd7cc634a2d68aeb54255e085ca7ef692b395e63" - natGcd := h "8cd419904449a4d91beab84dc26b48b216dafe1636d71f48dcc0d20c9fed10eb" - natMod := h "4fc91588d0b04ee9eb2201c80b72b39defa1edf45c82e5eae34e1f71858d76b6" - natDiv := h "83c270388e404a2dcc9924f2482782d9debf7166f3d2e0763a7828172b8c131e" - natBitwise := h "c60b9a8fdc174dbe1647a1f0d3cef13c5df73871d9eabd002c7a76f36e654800" - natBeq := h "fd8625d516605103bf8e019a5d86d47d34dd47c1ef649e3dec0fa697bbfd9e41" - natBle := h "da3f95087782f40743168bd9176ddcde64bf5a4d503463c3d5eef4ca2efaed23" - natLand := h "64e182cef33cb717b788404d31bad2103d1afb76db5447ba3432d83f72cb9bf4" - natLor := h "d75de12a584bd5febaf89a7728dc6270ed38ae1797ff5a44683b8df159509994" - natXor := h "0c6788b58d9568cc118a9b0a861e872732dbb8453647ea9d6013515244e60e38" - natShiftLeft := h "424c36ee14362ae7342d1527d251d4378afd2a45a3b5097d2d2ae0321d5f9fff" - natShiftRight := h "aa9b61bedc9ee6a9908d5f0e98955f18330f38587df710fdebe415cec7da29ed" + natSub := h "bf058ee446527af6ec749223752d07e6d7c2df8dc0a0778d934f885ae8267d57" + natMul := h "c2fe5eda1e559236bfc2a7a47db0ca6cf782f7b69bdd963237d0889fbf9a4b07" + natPow := h "0aec92313e598d5fcb5dcf0b80399c69ebf6a43b9ee97a3e561436b9f2b95480" + natGcd := h "59e47d71d73c544ee1a4edf07e9ffff542cb757e739651a9cd453af03d3dce42" + natMod := h "2c9d2d3e7e974b43ca3d212f32707187382125b1272758f69c4b47e96d9aabcf" + natDiv := h "2f12f32294b7d1168ada1809c9b8b2563824e9c2879bf8d3bb9b5c03d7ab7131" + natBitwise := h "e2a8fae8bf498a31582ac0f816e7902ad7c484ab5cfee0db53776bd24ffc994e" + natBeq := h "ca3022a3c8359b0c435eb4bb8e8eac0aa085d1da10f259287025229861112070" + natBle := h "ca4b398b2080beccccf3a3121e848bd1977847668c18a6447b0edc5f561b1cbc" + natLand := h "833c5b2e3c077eb6b3c0e4d848cf5408240c7d3cff8c40635c6e3bf946630e34" + natLor := h "7232095aea9a5f79cc0f2b0ad848dbf1904a630f1ef86f244f8a42b847afab9a" + natXor := h "c3b00b514b9f26dc1edf10c7d6f69f455ef8ed0c51b0a666e3427fb44d3a04f0" + natShiftLeft := h "6e70cd9d1708b8f00be460655ca47a419dc601f9c0558e7ac212b80ee6ff0978" + natShiftRight := h "d8ddec67d32eeb1f2b0d540372ed745220fdb1e4e2b2f54badde60b66734f9f3" boolType := h "e6eba3c8b4d19f6a1076b39fa89aec61dccbb960f83d9a62e6acf35a69c9a0a4" boolTrue := h "a29a636176cf1135d077eb074798f9007c78e7801383e9cff363bae5edf05762" boolFalse := h "dda12bcb330727f6dfb816bc9752aabd0520e6515b79fc8a5a9e713866f4c63e" - string := h "4ac09ed8ff61e44f1159bc6fb00fd7e72c15deefea569d755d8b1d05f5d191f7" - stringMk := h "8e9e6af2d65a17094a87500f84f7b26d82edcad0dd6999794a8b46ecb554242d" - charType := h "98c98c0f996f21f6e2b61f1efcae99baa98be26a7ff82515684a826954b35e29" - charMk := h "8ef984f787bf09688fd6ef734f7032b3f43c0e667159d2eaf2b030326271d2cc" - charOfNat := h "604b23cd0facf5b3e56def57da91b2688ffca7c5435bb5dc2cb11a68a3318609" - stringOfList := h "8e9e6af2d65a17094a87500f84f7b26d82edcad0dd6999794a8b46ecb554242d" - stringToByteArray := h "35d4f382e24e009cc0e9457955d3ef1e6f79fae9d8d31cfd2e153fa03b054a6a" - byteArrayEmpty := h "e21c24b42f049239c7f73392fedc911f574c798386cbe3e3e2a2888e2df3aef0" + string := h "fd53e8dce82d568b56e9b16c390b5693c137b4e54d12ac09aa559863954b6587" + stringMk := h "0f0250d7713704439073babd511b77a9eeeae5adbd50ff574d801ffb558128d9" + charType := h "203b76c5b4f5ca061563314057a943bc4380885e73d0efaf14644598c2fa6eee" + charMk := h "ef840f0ed608f9fb81cfe0c67bb5a09334a8e77cc087288062e13595a6f65883" + charOfNat := h "09eeb416c84076666457417f4b7ce3d1bf34977d3f56dd2562c0014a51cb8d34" + stringOfList := h "0f0250d7713704439073babd511b77a9eeeae5adbd50ff574d801ffb558128d9" + stringToByteArray := h "8709f570a8193252182a9ecd713f890e75d3bfb5a27f5b9181ccabe0654a0c29" + byteArrayEmpty := h "0d2363d6035cc7c0331fff5ca1de7b4091251b504d44eeb2850993bd0ddde222" list := h "144e207a88d1dfbde22a1b40689033b3a65a652c8f7500b9be3cb7f66366e0fe" listNil := h "258a7364b87c99fe9f83e05e0d05c935609a0dc5df8d77939130efe5e0efca3e" listCons := h "77d519259ec9fa489dbe0e3dc0b9352aef349ccdaa73ea58b08bb0bc683502a0" @@ -177,54 +177,54 @@ def canonical : PrimAddrs where systemPlatformNumBits := h "a91624445393a674fa0f9e9f9a52f41b93b10487018046cbc1265a2455bcfaec" systemPlatformGetNumBits := h "66f29be6e00ac835638a2814988f9cf16547bebb0763527c119bca51d7b0bdd5" subtypeVal := h "0c7072a927b1c46efc9498e749b8320b74d8994ec280601628bfaee1ade36c71" - natDecLe := h "08faad5e92316e17e5f80804982c6f853e32bc43f4dc410619ec13df152377e3" - natDecEq := h "676e87dde5cf30c001690bbbe7ab74fca92b0aa612ed9ef3caf89f1d9e6a2401" - natDecLt := h "cce125650b775d1910efea919f5cf272f7d9e7b11d62343d6d0a589cdfaeff21" + natDecLe := h "4560c5f121a542f2c233626f4ef6fdd8f36ebe97c948adeaee283d9ed4572fdb" + natDecEq := h "a3f5a80d1a8cc990639d06be98bcc2b240f793a4adba9b002712b804a6fe3376" + natDecLt := h "2ea36539ac1a8e0022a90d8b70ddb6f4db46b0ce19efe4e1c44792feed9d7e8f" decidableRec := h "ab3776985743af13a9cb1a7d2f8496997892e17983d14be5270a716570b35719" decidableIsTrue := h "0f9ee8d9033d8f7b852f5b7152fd124f7d411930c992e0f457f8104b60a98381" decidableIsFalse := h "0471e47158b2ae18d3c08dd5c77aae23e62d7bbc1e61116bc2813b1306bc5795" - natLeOfBleEqTrue := h "cb1fa5ad3e632c07b48828af604f73c70a820b1de4a13babf31f2b7896f7f9ba" - natNotLeOfNotBleEqTrue := h "ea7561db25aa24ce481ce3e9ee8d704d483dd9056757da7eda24b5111be59bc2" - natEqOfBeqEqTrue := h "cb0ff07d3f7226a898769da8caac9ac1b49226d6ae43b2affc849a97f9d3e5c7" - natNeOfBeqEqFalse := h "79a57e7f8d1030fb95ff4f19ea212c9ae011638ff7349c4a692ddf5e8e071ad4" + natLeOfBleEqTrue := h "042a9ad1489e769fd295d58cb64a7405e86f7881b5e7c22d77df486915d58eb3" + natNotLeOfNotBleEqTrue := h "7dafaa151ed90b0ab27f0279b9383ab8abe8602c6635ca191f28cbb7aba6afdd" + natEqOfBeqEqTrue := h "f8313971bba5ee8c814554b0c0447a10c129b41945ac5fb817c3fc7b98b23a10" + natNeOfBeqEqFalse := h "7aecc206714d64b5177acb753a285e670a918a1ac9fe8f57460f776f17b7adc2" fin := h "745936fcb9d86c4457f0fd1e537e67077f46f7841108419dac7984008b565b97" boolNoConfusion := h "cd983a826c1e20c4570afca244916c79e20e816f618ffdda38be8a79079274ce" int := h "a5ca2e1d5ceb8d43367bc34d69a50c1650a25dc10780aa0c378cdfa931ff0424" intOfNat := h "09bc253147c36ce22c8e0ccd43c79b2cdae2206e0ddd168fca3609b2a584d3dc" intNegSucc := h "267c0a9c92e75638fc73ed52a9f9c81647eeeceeff2144c1f97e65e2aff149f1" - intAdd := h "2389b32aaff43e1cda02299613f3b1d1308e448cac31678f1f358819f84fec31" - intSub := h "dc3f17411b643dcf55164c6eceb086daf2c788c0becec06c7808714a909979db" - intMul := h "d5b342455210f488f1d6805e7a0bc06aa686ca45d32e05abc407815a600c07bd" + intAdd := h "b6bbac00c8e46f8b8640298f4c9ac894cbcd0101035edd543f7c434e2c9fe926" + intSub := h "bcb09ba43f8bdae65c56a47ff77b50b42ede120fbcdba8469e799a21f12fd389" + intMul := h "74ed1fb9a9bf99d0b02dbefe042464cd715301859a70337a99344be762dcbe10" intNeg := h "f61c7d3fce595430f86f0cd52da5bcb00bf910edd85e14dc0402130fcce34ebd" - intEmod := h "3b5f63733cd0fbdff551b0a006ba88a6f9638db75ee6385576a2c1ad1c93b500" - intEdiv := h "d6d38dfff92a41edd96fb8b935d1725e62202fa7af7c8503e1aa5b6a49ebf172" - intBmod := h "34dbb235a97b1719b2be6d8c7242d58cd3be2d3cfef59d4276eb7d0d6e2dac80" - intBdiv := h "a4b5c5e3a05be0e12faf9412376ff23aa975f8e56669255d5868ddb1c7ad4a90" + intEmod := h "ac9c72319551f5637f7c51c70be6da8fd66a81837c9eb50c3fd50ecf8cbbc070" + intEdiv := h "9f2ca4e3de3a794f67db64849dd577c066e56142206fa6bc724e4b8db6f20f5b" + intBmod := h "197d3c7e9ce0949c52ef98f50b58ddb942db6d367640d6fb6f49ab91f82f4271" + intBdiv := h "0713405a689d2155a84123a0f6395c31c6fa55c1ad905fc55663acf7d7577f57" intNatAbs := h "83e3ce8a747520cc248a0dacf9bd1369467e4907e8aaaa433e1b438e1cad7ca4" - intPow := h "836aeaf2e8c4b240d2e8243f4a9a25679937f2581408e7b3853407bbd18e45fc" - intDecEq := h "402cb01bfa52fe93aef3d96e7d28ee03e0e1f76f3c879654f5e719a72015237f" - intDecLe := h "bffed7cd4968b8fc251ed24a9c253da00215902354c2944f59e81538dc1ae2c7" - intDecLt := h "09b5fb2f2d8451689f842711744a27bfe55c6fd5010fd24a90845393c707e0a4" + intPow := h "875be8d8ae5f332003ec2bade698bb0aa5f2f46e71218da9cdd9d09506e84c10" + intDecEq := h "0f53bc5768fd32aa6801dc8762934b69049db3e7e57412c6904dd1a8b9cff4f8" + intDecLe := h "0e5f70efda0598182819a10a238796462debc05f40888117d1196992b9423fae" + intDecLt := h "ce137cce4c1a49323a788f1677a9d6a1d4a936111588083589baab2bac01108c" punit := h "2dfc16af01b82b3b91c2ff704409d76236a83f956c0c6e6659a64fe21d76695b" pprod := h "c1c9c9a4f2b52a87f6be51476de8fe93d3ed8e7fd5652d5a11617e3255190da5" pprodMk := h "59f659338954244d5574ab1a951c11d7e3a6efe2964a466d460450809732dfb2" natRec := h "b975152f3f0cd9039433c68f5a5e5455f5cb5d917078baed0118b59067a74ea7" natCasesOn := h "1917841d2085796dd7ba346de93a579571b5641c33fc400408ec55b5778a9a51" - bitVec := h "eafd1b2f6b571abf76ae96eaf9c4852aa4520d06df534291590a71a21e6f0b5a" - bitVecToNat := h "986b9c736cb930c81cae697ec496804b6e4415a178e4f0022fb058f5034ab7bf" - bitVecOfNat := h "da082f157d2a7b86eb226b1881bfacd0d9dd1be17a27e13fa300c015c4ffbf85" - bitVecUlt := h "b668db7d12cabb4d7fe2e1af25984baa28bb2852a982da8d54942bb344726ccf" + bitVec := h "67f474b8c3302b04417f721ff3e88ce6f16a7dfcb3bae99368085d1c5e872ba4" + bitVecToNat := h "e32ab4e7720d3442a266b37c97a27218e68239318311f8e4b046a6bdde520374" + bitVecOfNat := h "3b334c94dd56d80beb4eff5d825f67f6f1ac4e140403699e3daff52a00bdbf6e" + bitVecUlt := h "4f9d4e0c70e16c78e0eda38e2d6d94ccd12598755e0e7200a9239da92b9057cc" decidableDecide := h "c5f7b19663e4499e70e1b2645162c5be15fa860f4f8157e331ae546c6f733723" ltLt := h "cacaea97f4cdba0a4a0af71005d0517d1818ab2623bd2ea7fa8c637a0e3d3312" ofNatOfNat := h "5a7292ad756ee1f2df4b92f18a27574a47cbbcf7094f98ab2865f92eb22342d7" unit := h "9232498667f765f437dedaac828e555f6cc67a20e6db28f614fdf3c262710feb" punitSizeOf1 := h "7bd8e19f47f6eae620a5c39f243ce415dd6a77f09590f4c227cef363007f4012" sizeOfSizeOf := h "a343a651bff408c3a29ff27b2b62e34b54b2ab381cf6f3ad87c540c977dc3c4a" - stringBack := h "d07f8105c544227a13ec90befae2005e9c6f64493f8c7ff669ba743e1547c935" - stringLegacyBack := h "fc49357a5bc6525839a7bc11b9df207852a6e9c6afa3ec62bac3c542ac89e0e0" - stringUtf8ByteSize := h "6a142d91e877959e1419c345808a79a3e95818577afda68d287f4f881521dde9" - stringAppend := h "3803adc21d899693a1491db054104b20bd40fc0ca1f6b4374b7b158b4252b38b" - stringDecEq := h "ba51b5d8a3b14201d22402cda8e731e49fdf78f08b72643c1b08e250436aaff1" + stringBack := h "548bbf22ba305f8e363edf9907d0c2c454add416ddbf25b38c76d0063ad21d65" + stringLegacyBack := h "ef4e74e44e3bb9fa5e5488a46c5b4d61fbfd701e3679c5bfb4154c8747cefdc9" + stringUtf8ByteSize := h "5186d91ef8892e48eb02918b0926e9767c6d4b9b0814064a449a5afe8a9e5a6e" + stringAppend := h "ff459554dfdc34d159027038174571b770464d52834c1dbc6436467fa81d039e" + stringDecEq := h "14cf519b05c30384fd4cb2e271b0896fe23e74c995010d42eb1ffce14927e56b" /-- The synthetic kernel-only marker address used by the *original* (LEON-addressed) environment's `PrimAddrs::new_orig()`. Only the marker is diff --git a/Tests/Ix/IxVM.lean b/Tests/Ix/IxVM.lean index 32a98f395..fc89104bc 100644 --- a/Tests/Ix/IxVM.lean +++ b/Tests/Ix/IxVM.lean @@ -347,80 +347,80 @@ private def kernelCheckEntries : List (String × Nat) := [ ("HEq.rec", 133_078_670), ("Eq.rec", 132_487_222), ("Nat", 129_394_264), - ("Nat.add", 163_995_201), - ("Nat.add_comm", 287_575_686), - ("Nat.decEq", 346_055_716), - ("Nat.decLe", 735_974_068), - ("Nat.sub_le_of_le_add", 1_808_729_338), - ("Nat.shiftRight_succ", 1_345_275_400), + ("Nat.add", 165_317_919), + ("Nat.add_comm", 303_189_317), + ("Nat.decEq", 356_804_889), + ("Nat.decLe", 759_924_213), + ("Nat.sub_le_of_le_add", 1_857_622_530), + ("Nat.shiftRight_succ", 1_373_534_790), ("Trans.mk", 135_307_735), - ("Array.append_assoc", 8_937_933_296), - ("Vector.append", 9_138_387_176), - ("IxVMPrim.nat_add_lit", 202_123_107), - ("IxVMPrim.nat_sub_lit", 217_235_012), - ("IxVMPrim.nat_mul_lit", 193_644_150), - ("IxVMPrim.nat_mul_big", 192_198_374), - ("IxVMPrim.nat_div_lit", 1_315_125_838), - ("IxVMPrim.nat_mod_lit", 1_339_384_380), + ("Array.append_assoc", 8_949_803_594), + ("Vector.append", 9_146_059_108), + ("IxVMPrim.nat_add_lit", 203_582_144), + ("IxVMPrim.nat_sub_lit", 218_128_920), + ("IxVMPrim.nat_mul_lit", 195_853_320), + ("IxVMPrim.nat_mul_big", 194_388_669), + ("IxVMPrim.nat_div_lit", 1_342_505_625), + ("IxVMPrim.nat_mod_lit", 1_368_044_088), ("IxVMPrim.nat_succ_lit", 142_774_632), ("IxVMPrim.nat_pred_lit", 162_346_428), - ("IxVMPrim.nat_gcd_lit", 2_071_539_193), - ("IxVMPrim.nat_land_lit", 3_401_317_177), - ("IxVMPrim.nat_lor_lit", 3_403_322_594), - ("IxVMPrim.nat_xor_lit", 3_421_473_548), - ("IxVMPrim.nat_shl_lit", 219_501_106), - ("IxVMPrim.nat_shr_lit", 1_328_726_437), - ("IxVMPrim.nat_pow_big", 378_439_504), - ("IxVMPrim.nat_beq_lit", 192_828_151), - ("IxVMPrim.nat_ble_lit", 187_511_768), + ("IxVMPrim.nat_gcd_lit", 2_110_337_746), + ("IxVMPrim.nat_land_lit", 3_492_302_162), + ("IxVMPrim.nat_lor_lit", 3_494_126_152), + ("IxVMPrim.nat_xor_lit", 3_512_441_946), + ("IxVMPrim.nat_shl_lit", 222_684_846), + ("IxVMPrim.nat_shr_lit", 1_356_504_914), + ("IxVMPrim.nat_pow_big", 382_732_354), + ("IxVMPrim.nat_beq_lit", 194_386_440), + ("IxVMPrim.nat_ble_lit", 188_997_923), ("IxVMPrim.nat_cases_big", 162_177_008), - ("IxVMPrim.nat_dec_le", 752_933_777), - ("IxVMPrim.nat_dec_lt", 763_754_872), - ("IxVMPrim.nat_dec_eq", 382_573_455), - ("IxVMPrim.str_size_lit", 2_358_017_924), - ("IxVMPrim.bv_to_nat_lit", 1_971_333_181), - ("IxVMInd.Even", 196_143_014), - ("IxVMInd.Odd", 196_145_605), - ("IxVMInd.Even.rec", 212_956_051), - ("IxVMInd.Odd.rec", 212_954_206), - ("IxVMInd.IdxTeleN.rec", 156_975_340), - ("IxVMInd.IdxTeleB.rec", 156_974_498), + ("IxVMPrim.nat_dec_le", 776_968_155), + ("IxVMPrim.nat_dec_lt", 787_819_370), + ("IxVMPrim.nat_dec_eq", 393_481_204), + ("IxVMPrim.str_size_lit", 2_416_581_909), + ("IxVMPrim.bv_to_nat_lit", 2_011_530_195), + ("IxVMInd.Even", 197_592_565), + ("IxVMInd.Odd", 197_595_162), + ("IxVMInd.Even.rec", 214_462_853), + ("IxVMInd.Odd.rec", 214_461_004), + ("IxVMInd.IdxTeleN.rec", 156_973_564), + ("IxVMInd.IdxTeleB.rec", 156_972_722), ("IxVMInd.SoloA.rec", 152_570_202), ("IxVMInd.SoloB.rec", 152_570_202), ("IxVMInd.UnsafeSquash", 131_117_457), - ("IxVMInd.Tree", 130_702_353), - ("IxVMInd.Tree.rec", 139_658_547), + ("IxVMInd.Tree", 130_703_546), + ("IxVMInd.Tree.rec", 139_660_099), ("IxVMInd.DedupM", 133_702_359), ("IxVMInd.DedupM.rec", 145_825_072), ("IxVMInd.DepthM", 132_257_976), ("IxVMInd.DepthM.rec", 142_488_980), - ("String.Internal.append", 2_331_764_111), - ("_private.Init.Prelude.0.Lean.extractMainModule._unsafe_rec", 3_461_487_569), - ("Lean.Syntax.rec", 2_385_699_811), - ("IxVMInd.AuxTie", 301_383_750), - ("IxVMInd.AuxTie.rec", 341_303_631), + ("String.Internal.append", 2_388_109_037), + ("_private.Init.Prelude.0.Lean.extractMainModule._unsafe_rec", 3_562_723_089), + ("Lean.Syntax.rec", 2_442_259_617), + ("IxVMInd.AuxTie", 304_969_313), + ("IxVMInd.AuxTie.rec", 344_892_857), ("IxVMInd.HiddenIdx", 129_941_958), ("IxVMInd.HiddenIdx.rec", 132_439_643), - ("IxVMInd.thmMajorUse", 496_208_616), - ("IxVMInd.partialKRec", 148_779_400), - ("IxVMInd.deepRebase", 208_806_873), - ("String.Slice.Pattern.Model.NoPrefixPatternModel.rec", 3_262_061_945), - ("Lean.Widget.TaggedText.rec", 2_358_605_375), - ("Lean.Doc.Part.rec", 2_397_535_586), - ("Lean.Doc.Block.rec", 2_615_255_825), - ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedup1.A", 131_939_009), - ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedup1.A.rec", 134_737_513), - ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedup1.A.rec_1", 134_160_425), - ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedup1.A.rec_2", 134_160_425), - ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedup2.A.rec_1", 134_160_425), - ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedupMixed.M", 132_137_302), - ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedupMixed.M.rec", 142_224_535), - ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedupMixed.M.rec_1", 142_222_962), - ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedupMixed.M.rec_2", 134_160_425), - ("strOfListFoldSize", 2_629_577_595), - ("strOfListFoldSizeAscii", 2_630_378_237), - ("IxVMPrim.lazy_ble_offset", 220_055_084), - ("IxVMPrim.lazy_unit_cast", 509_666_370), + ("IxVMInd.thmMajorUse", 487_912_160), + ("IxVMInd.partialKRec", 147_851_496), + ("IxVMInd.deepRebase", 210_266_459), + ("String.Slice.Pattern.Model.NoPrefixPatternModel.rec", 3_316_322_911), + ("Lean.Widget.TaggedText.rec", 2_415_137_521), + ("Lean.Doc.Part.rec", 2_454_067_124), + ("Lean.Doc.Block.rec", 2_673_626_343), + ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedup1.A", 131_940_408), + ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedup1.A.rec", 134_739_065), + ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedup1.A.rec_1", 134_161_618), + ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedup1.A.rec_2", 134_161_618), + ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedup2.A.rec_1", 134_161_618), + ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedupMixed.M", 132_138_701), + ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedupMixed.M.rec", 142_226_210), + ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedupMixed.M.rec_1", 142_224_636), + ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedupMixed.M.rec_2", 134_161_618), + ("strOfListFoldSize", 2_688_625_609), + ("strOfListFoldSizeAscii", 2_689_396_755), + ("IxVMPrim.lazy_ble_offset", 223_082_369), + ("IxVMPrim.lazy_unit_cast", 523_710_019), ] /-- Variant of `kernelChecks`, pinned to the baseline diff --git a/Tests/Ix/Kernel/BuildPrimOrigs.lean b/Tests/Ix/Kernel/BuildPrimOrigs.lean index adde84856..74eab609d 100644 --- a/Tests/Ix/Kernel/BuildPrimOrigs.lean +++ b/Tests/Ix/Kernel/BuildPrimOrigs.lean @@ -1,10 +1,10 @@ /- Dump ORIGINAL (LEON content-hash) primitive addresses for hardcoding - into the Rust kernel (`src/ix/kernel/primitive.rs::PrimOrigAddrs`). + into the Rust kernel (`crates/common/src/prim_addrs.rs::PrimAddrs::new_orig`). - Run with: `lake test -- rust-kernel-build-prim-origs`. The test prints a + Run with: `lake test -- --ignored rust-kernel-build-prim-origs`. The test prints a `(lean_name, leon_hash_hex)` line for every primitive the Rust kernel - expects to find in `PrimOrigAddrs::new`. Each hex is + expects to find in `PrimAddrs::new_orig`. Each hex is `ConstantInfo::get_hash()` (defined in `src/ix/env.rs`) on the primitive's declaration in the current Lean environment — a Blake3 digest over the serialized original `ConstantInfo` (name + level @@ -16,7 +16,7 @@ so a rogue environment can't silently shadow a primitive just by naming its own declaration `Nat`. - Paste the output lines into `PrimOrigAddrs::new` whenever either: + Paste the output lines into `PrimAddrs::new_orig` whenever either: - a primitive's Lean-side name or content changes upstream, or - the `ConstantInfo::get_hash` byte layout is revised. @@ -31,7 +31,7 @@ upstream). Printed as `// MISSING:` comments so the emitted table is still valid as-is for partial regeneration. - Address change: the LEON hex for a primitive has changed — paste - the new hex into `PrimOrigAddrs::new`. + the new hex into `PrimAddrs::new_orig`. -/ import Ix.Common import Ix.CompileM -- rsLeonHashesFFI @@ -107,6 +107,69 @@ def testBuildPrimOrigs : TestSeq := return (missing.isEmpty, found, missing.size, msg) ) .done +@[extern "rs_prim_addrs_orig"] +opaque rsPrimAddrsOrigFFI : IO (Array (String × String)) + +/-- Every original/LEON primitive address stored in `PrimAddrs::new_orig()` + must match `ConstantInfo::get_hash()` over the live Lean environment. + `eagerReduce` is excluded because its original address is a synthetic + kernel marker rather than the hash of the Lean declaration. -/ +def testPrimOrigsParity : TestSeq := + .individualIO "original primitive address parity (PrimAddrs vs live LEON hashes)" none (do + let leanEnv ← get_env! + let roots := kernelPrimitives.map parseNameToLean + let needed := collectDeps leanEnv roots + let filtered := leanEnv.constants.toList.filter fun (name, _) => + needed.contains name + let pairs : Array (Ix.Name × Address) ← Ix.CompileM.rsLeonHashesFFI filtered + + let live : Std.HashMap Ix.Name Address := + pairs.foldl (init := {}) fun m (name, addr) => m.insert name addr + let hardcoded ← rsPrimAddrsOrigFFI + let lookup : Std.HashMap String String := + hardcoded.foldl (init := {}) fun m (name, hex) => m.insert name hex + + let mut mismatches : Array String := #[] + let mut missing : Array String := #[] + let hardcodedNames := hardcoded.map fun (name, _) => name + if hardcodedNames != kernelPrimitives then + mismatches := mismatches.push + s!"primitive catalog mismatch: expected {kernelPrimitives}, got {hardcodedNames}" + + for primName in kernelPrimitives do + if primName == "eagerReduce" then continue + let ixName := Ix.Name.fromLeanName (parseNameToLean primName) + match live[ixName]? with + | none => missing := missing.push primName + | some liveAddr => + match lookup[primName]? with + | none => + mismatches := mismatches.push + s!"{primName}: missing from PrimAddrs::lean_orig_parity_table" + | some hardcodedHex => + let liveHex := toString liveAddr + if liveHex != hardcodedHex then + mismatches := mismatches.push + s!"{primName}: live={liveHex} PrimAddrs={hardcodedHex}" + + if !missing.isEmpty then + IO.eprintln s!"original primitive parity: {missing.size} primitive(s) missing from Lean env:" + for name in missing do IO.eprintln s!" {name}" + if !mismatches.isEmpty then + IO.eprintln s!"original primitive parity: {mismatches.size} mismatch(es):" + for mismatch in mismatches do IO.eprintln s!" {mismatch}" + IO.eprintln "Regenerate via `lake test -- --ignored rust-kernel-build-prim-origs` and paste into PrimAddrs::new_orig in crates/common/src/prim_addrs.rs." + + let totalProblems := missing.size + mismatches.size + let passed := kernelPrimitives.size - min totalProblems kernelPrimitives.size + let msg : Option String := + if totalProblems == 0 then none + else some s!"{mismatches.size} mismatch(es), {missing.size} missing" + return (totalProblems == 0, passed, totalProblems, msg) + ) .done + +def paritySuite : List TestSeq := [testPrimOrigsParity] + def suite : List TestSeq := [testBuildPrimOrigs] end Tests.Ix.Kernel.BuildPrimOrigs diff --git a/Tests/Ix/Kernel/BuildPrimitives.lean b/Tests/Ix/Kernel/BuildPrimitives.lean index 538088f06..f4de60242 100644 --- a/Tests/Ix/Kernel/BuildPrimitives.lean +++ b/Tests/Ix/Kernel/BuildPrimitives.lean @@ -1,8 +1,8 @@ /- Dump primitive constant names and content-addresses for hardcoding into the - Rust kernel (`src/ix/kernel/primitive.rs`). + Rust kernel (`crates/common/src/prim_addrs.rs`). - Run with: `lake test -- rust-kernel-build-primitives`. The test prints a + Run with: `lake test -- --ignored rust-kernel-build-primitives`. The test prints a `(lean_name, content_address_hex)` line for every primitive the Rust kernel expects to find in `PrimAddrs::new`. Paste the output over the corresponding entries whenever Lean's stdlib changes and tests start @@ -28,7 +28,7 @@ namespace Tests.Ix.Kernel.BuildPrimitives /-- The Lean names of every primitive the Rust kernel resolves in `PrimAddrs::new`. Keep this in sync with the `Primitives` struct in - `src/ix/kernel/primitive.rs`. -/ + `crates/kernel/src/primitive.rs`. -/ def kernelPrimitives : Array String := #[ "Nat", "Nat.zero", "Nat.succ", "Nat.add", "Nat.pred", "Nat.sub", "Nat.mul", "Nat.pow", @@ -200,10 +200,10 @@ opaque rsPrimAddrsCanonicalFFI : IO (Array (String × String)) content hash — Aiur and downstream kernel primitive resolution will silently break if `PrimAddrs::new()` isn't updated. - On failure: re-run `lake test --ignored + On failure: re-run `lake test -- --ignored rust-kernel-build-primitives` to dump the fresh table, then - paste over `PrimAddrs::new` in `src/ix/kernel/primitive.rs` - (plus update `PrimAddrs::lean_parity_table` keeps lock-step). + update `PrimAddrs::new` in `crates/common/src/prim_addrs.rs` and its + Lean/Aiur mirrors. Exception: `eagerReduce` is a synthetic kernel marker whose PrimAddrs value (`0xff…3`) intentionally diverges from its @@ -226,6 +226,10 @@ def testPrimitivesParity : TestSeq := let mut mismatches : Array String := #[] let mut missing : Array String := #[] + let hardcodedNames := hardcoded.map fun (name, _) => name + if hardcodedNames != kernelPrimitives then + mismatches := mismatches.push + s!"primitive catalog mismatch: expected {kernelPrimitives}, got {hardcodedNames}" for primName in kernelPrimitives do -- The synthetic eagerReduce marker is intentionally unequal to -- the compiled `id` hash; skip parity for it. @@ -250,15 +254,18 @@ def testPrimitivesParity : TestSeq := if !mismatches.isEmpty then IO.eprintln s!"primitive parity: {mismatches.size} address mismatch(es):" for m in mismatches do IO.eprintln s!" {m}" - IO.eprintln "Regenerate via `lake test --ignored rust-kernel-build-primitives` and paste into src/ix/kernel/primitive.rs (PrimAddrs::new + lean_parity_table)." + IO.eprintln "Regenerate via `lake test -- --ignored rust-kernel-build-primitives` and paste into crates/common/src/prim_addrs.rs." let total_problems := missing.size + mismatches.size + let passed := kernelPrimitives.size - min total_problems kernelPrimitives.size let msg : Option String := if total_problems == 0 then none else some s!"{mismatches.size} mismatch(es), {missing.size} missing" - return (total_problems == 0, kernelPrimitives.size - total_problems, total_problems, msg) + return (total_problems == 0, passed, total_problems, msg) ) .done -def suite : List TestSeq := [testBuildPrimitives, testPrimitivesParity] +def paritySuite : List TestSeq := [testPrimitivesParity] + +def suite : List TestSeq := [testBuildPrimitives] end Tests.Ix.Kernel.BuildPrimitives diff --git a/Tests/Main.lean b/Tests/Main.lean index d0abd4512..11b5852c2 100644 --- a/Tests/Main.lean +++ b/Tests/Main.lean @@ -81,6 +81,8 @@ def primarySuites : Std.HashMap String (List LSpec.TestSeq) := .ofList [ ("aiur-cross", [AiurTests.Cross.tests]), ("aiur-cost", [AiurTests.Cost.tests]), ("prim-addrs", Tests.Ix.Kernel.PrimAddrs.suite), + ("primitive-address-parity", Tests.Ix.Kernel.BuildPrimitives.paritySuite + ++ Tests.Ix.Kernel.BuildPrimOrigs.paritySuite), ("decompile-unit", Tests.Decompile.unitSuite), ("tc-unit", Tests.Tc.Unit.suite ++ Tests.Tc.Substrate.suite ++ Tests.Tc.Fixtures.suite ++ Tests.Tc.WhnfTests.suite @@ -221,8 +223,8 @@ def ignoredRunners (env : Lean.Environment) : List (String × IO UInt32) := [ let actual := (Aiur.computeStats v2Env.compiled qc v2Env.shapes).totalFftCost.round.toUInt64.toNat pure (LSpec.test - s!"Shard pipeline FFT matches: expected 6_714_093_254, got {actual}" - (actual = 6_714_093_254)) + s!"Shard pipeline FFT matches: expected 6_720_731_750, got {actual}" + (actual = 6_720_731_750)) LSpec.lspecIO (.ofList [("ixvm", [fullSeq, aiurSeq, arenaSeq, exploitSeq, paritySeq, shardSeq])]) []), diff --git a/crates/common/src/prim_addrs.rs b/crates/common/src/prim_addrs.rs index 1e215a024..d51ab39d5 100644 --- a/crates/common/src/prim_addrs.rs +++ b/crates/common/src/prim_addrs.rs @@ -7,7 +7,7 @@ //! FABRICATES during reduction rather than discovers by walking `refs`. //! //! Addresses are blake3 hashes of each primitive's Ixon-compiled form. -//! Regenerate with `lake test -- rust-kernel-build-primitives`, which +//! Regenerate with `lake test -- --ignored rust-kernel-build-primitives`, which //! dumps the current `(name, hex)` pairs — paste the updated lines into //! `PrimAddrs::new`. `lake test -- prim-addrs` pins this table against //! the Lean mirror in `Ix/Tc/Primitive.lean`. @@ -138,7 +138,8 @@ impl PrimAddrs { /// Canonical content-hash addresses, hardcoded from the Ixon-compiled /// form of each primitive. Used by `Primitives::from_env` to resolve /// primitives against a `kctx.kenv` whose KIds live at canonical - /// addresses. Regenerate with `lake test -- rust-kernel-build-primitives`. + /// addresses. Regenerate with + /// `lake test -- --ignored rust-kernel-build-primitives`. pub fn new() -> Self { let h = |hex: &str| -> Address { Address::from_hex(hex).expect("invalid primitive address hex") @@ -154,52 +155,52 @@ impl PrimAddrs { "def52d1dad5f10cf9893c945e169718d62b15e2dd2c9066e597b9d4570ba056e", ), nat_add: h( - "5ed78ee081e10bc0999a372a5e54acd3373d85d41e9be3fa75fdde32db2d6501", + "e1ee4c78a3906464fa8c17ec2ed0c0bf66db3b412d9b1c5f31fba7bb974a93e5", ), nat_pred: h( "914f9c01884853652e9224dc511f867d5408517f3beb3192fc4477e0e9594c88", ), nat_sub: h( - "610fe5a4f5a03f64f60ef5a069f1640758e000a1b4d57fd594866e9f6b3381ed", + "bf058ee446527af6ec749223752d07e6d7c2df8dc0a0778d934f885ae8267d57", ), nat_mul: h( - "da6fb725803db79f318e8aef5b19e1d4c2d1a7c41831df48787e8a319b8c48d3", + "c2fe5eda1e559236bfc2a7a47db0ca6cf782f7b69bdd963237d0889fbf9a4b07", ), nat_pow: h( - "ab6f3f1cad636ceeb67df749cd7cc634a2d68aeb54255e085ca7ef692b395e63", + "0aec92313e598d5fcb5dcf0b80399c69ebf6a43b9ee97a3e561436b9f2b95480", ), nat_gcd: h( - "8cd419904449a4d91beab84dc26b48b216dafe1636d71f48dcc0d20c9fed10eb", + "59e47d71d73c544ee1a4edf07e9ffff542cb757e739651a9cd453af03d3dce42", ), nat_mod: h( - "4fc91588d0b04ee9eb2201c80b72b39defa1edf45c82e5eae34e1f71858d76b6", + "2c9d2d3e7e974b43ca3d212f32707187382125b1272758f69c4b47e96d9aabcf", ), nat_div: h( - "83c270388e404a2dcc9924f2482782d9debf7166f3d2e0763a7828172b8c131e", + "2f12f32294b7d1168ada1809c9b8b2563824e9c2879bf8d3bb9b5c03d7ab7131", ), nat_bitwise: h( - "c60b9a8fdc174dbe1647a1f0d3cef13c5df73871d9eabd002c7a76f36e654800", + "e2a8fae8bf498a31582ac0f816e7902ad7c484ab5cfee0db53776bd24ffc994e", ), nat_beq: h( - "fd8625d516605103bf8e019a5d86d47d34dd47c1ef649e3dec0fa697bbfd9e41", + "ca3022a3c8359b0c435eb4bb8e8eac0aa085d1da10f259287025229861112070", ), nat_ble: h( - "da3f95087782f40743168bd9176ddcde64bf5a4d503463c3d5eef4ca2efaed23", + "ca4b398b2080beccccf3a3121e848bd1977847668c18a6447b0edc5f561b1cbc", ), nat_land: h( - "64e182cef33cb717b788404d31bad2103d1afb76db5447ba3432d83f72cb9bf4", + "833c5b2e3c077eb6b3c0e4d848cf5408240c7d3cff8c40635c6e3bf946630e34", ), nat_lor: h( - "d75de12a584bd5febaf89a7728dc6270ed38ae1797ff5a44683b8df159509994", + "7232095aea9a5f79cc0f2b0ad848dbf1904a630f1ef86f244f8a42b847afab9a", ), nat_xor: h( - "0c6788b58d9568cc118a9b0a861e872732dbb8453647ea9d6013515244e60e38", + "c3b00b514b9f26dc1edf10c7d6f69f455ef8ed0c51b0a666e3427fb44d3a04f0", ), nat_shift_left: h( - "424c36ee14362ae7342d1527d251d4378afd2a45a3b5097d2d2ae0321d5f9fff", + "6e70cd9d1708b8f00be460655ca47a419dc601f9c0558e7ac212b80ee6ff0978", ), nat_shift_right: h( - "aa9b61bedc9ee6a9908d5f0e98955f18330f38587df710fdebe415cec7da29ed", + "d8ddec67d32eeb1f2b0d540372ed745220fdb1e4e2b2f54badde60b66734f9f3", ), bool_type: h( "e6eba3c8b4d19f6a1076b39fa89aec61dccbb960f83d9a62e6acf35a69c9a0a4", @@ -211,32 +212,32 @@ impl PrimAddrs { "dda12bcb330727f6dfb816bc9752aabd0520e6515b79fc8a5a9e713866f4c63e", ), string: h( - "4ac09ed8ff61e44f1159bc6fb00fd7e72c15deefea569d755d8b1d05f5d191f7", + "fd53e8dce82d568b56e9b16c390b5693c137b4e54d12ac09aa559863954b6587", ), string_mk: h( - "8e9e6af2d65a17094a87500f84f7b26d82edcad0dd6999794a8b46ecb554242d", + "0f0250d7713704439073babd511b77a9eeeae5adbd50ff574d801ffb558128d9", ), char_type: h( - "98c98c0f996f21f6e2b61f1efcae99baa98be26a7ff82515684a826954b35e29", + "203b76c5b4f5ca061563314057a943bc4380885e73d0efaf14644598c2fa6eee", ), char_mk: h( - "8ef984f787bf09688fd6ef734f7032b3f43c0e667159d2eaf2b030326271d2cc", + "ef840f0ed608f9fb81cfe0c67bb5a09334a8e77cc087288062e13595a6f65883", ), char_of_nat: h( - "604b23cd0facf5b3e56def57da91b2688ffca7c5435bb5dc2cb11a68a3318609", + "09eeb416c84076666457417f4b7ce3d1bf34977d3f56dd2562c0014a51cb8d34", ), // NOTE: `String.ofList` and `String.mk` share the canonical content-hash // because both compile to the same Ixon form (a one-constructor `String` // built from `List Char`). The Lean-side deprecation of `String.mk` in // favor of `String.ofList` is orthogonal to the compiled representation. string_of_list: h( - "8e9e6af2d65a17094a87500f84f7b26d82edcad0dd6999794a8b46ecb554242d", + "0f0250d7713704439073babd511b77a9eeeae5adbd50ff574d801ffb558128d9", ), string_to_byte_array: h( - "35d4f382e24e009cc0e9457955d3ef1e6f79fae9d8d31cfd2e153fa03b054a6a", + "8709f570a8193252182a9ecd713f890e75d3bfb5a27f5b9181ccabe0654a0c29", ), byte_array_empty: h( - "e21c24b42f049239c7f73392fedc911f574c798386cbe3e3e2a2888e2df3aef0", + "0d2363d6035cc7c0331fff5ca1de7b4091251b504d44eeb2850993bd0ddde222", ), list: h( "144e207a88d1dfbde22a1b40689033b3a65a652c8f7500b9be3cb7f66366e0fe", @@ -286,13 +287,13 @@ impl PrimAddrs { "0c7072a927b1c46efc9498e749b8320b74d8994ec280601628bfaee1ade36c71", ), nat_dec_le: h( - "08faad5e92316e17e5f80804982c6f853e32bc43f4dc410619ec13df152377e3", + "4560c5f121a542f2c233626f4ef6fdd8f36ebe97c948adeaee283d9ed4572fdb", ), nat_dec_eq: h( - "676e87dde5cf30c001690bbbe7ab74fca92b0aa612ed9ef3caf89f1d9e6a2401", + "a3f5a80d1a8cc990639d06be98bcc2b240f793a4adba9b002712b804a6fe3376", ), nat_dec_lt: h( - "cce125650b775d1910efea919f5cf272f7d9e7b11d62343d6d0a589cdfaeff21", + "2ea36539ac1a8e0022a90d8b70ddb6f4db46b0ce19efe4e1c44792feed9d7e8f", ), decidable_rec: h( "ab3776985743af13a9cb1a7d2f8496997892e17983d14be5270a716570b35719", @@ -304,16 +305,16 @@ impl PrimAddrs { "0471e47158b2ae18d3c08dd5c77aae23e62d7bbc1e61116bc2813b1306bc5795", ), nat_le_of_ble_eq_true: h( - "cb1fa5ad3e632c07b48828af604f73c70a820b1de4a13babf31f2b7896f7f9ba", + "042a9ad1489e769fd295d58cb64a7405e86f7881b5e7c22d77df486915d58eb3", ), nat_not_le_of_not_ble_eq_true: h( - "ea7561db25aa24ce481ce3e9ee8d704d483dd9056757da7eda24b5111be59bc2", + "7dafaa151ed90b0ab27f0279b9383ab8abe8602c6635ca191f28cbb7aba6afdd", ), nat_eq_of_beq_eq_true: h( - "cb0ff07d3f7226a898769da8caac9ac1b49226d6ae43b2affc849a97f9d3e5c7", + "f8313971bba5ee8c814554b0c0447a10c129b41945ac5fb817c3fc7b98b23a10", ), nat_ne_of_beq_eq_false: h( - "79a57e7f8d1030fb95ff4f19ea212c9ae011638ff7349c4a692ddf5e8e071ad4", + "7aecc206714d64b5177acb753a285e670a918a1ac9fe8f57460f776f17b7adc2", ), fin: h( "745936fcb9d86c4457f0fd1e537e67077f46f7841108419dac7984008b565b97", @@ -333,43 +334,43 @@ impl PrimAddrs { "267c0a9c92e75638fc73ed52a9f9c81647eeeceeff2144c1f97e65e2aff149f1", ), int_add: h( - "2389b32aaff43e1cda02299613f3b1d1308e448cac31678f1f358819f84fec31", + "b6bbac00c8e46f8b8640298f4c9ac894cbcd0101035edd543f7c434e2c9fe926", ), int_sub: h( - "dc3f17411b643dcf55164c6eceb086daf2c788c0becec06c7808714a909979db", + "bcb09ba43f8bdae65c56a47ff77b50b42ede120fbcdba8469e799a21f12fd389", ), int_mul: h( - "d5b342455210f488f1d6805e7a0bc06aa686ca45d32e05abc407815a600c07bd", + "74ed1fb9a9bf99d0b02dbefe042464cd715301859a70337a99344be762dcbe10", ), int_neg: h( "f61c7d3fce595430f86f0cd52da5bcb00bf910edd85e14dc0402130fcce34ebd", ), int_emod: h( - "3b5f63733cd0fbdff551b0a006ba88a6f9638db75ee6385576a2c1ad1c93b500", + "ac9c72319551f5637f7c51c70be6da8fd66a81837c9eb50c3fd50ecf8cbbc070", ), int_ediv: h( - "d6d38dfff92a41edd96fb8b935d1725e62202fa7af7c8503e1aa5b6a49ebf172", + "9f2ca4e3de3a794f67db64849dd577c066e56142206fa6bc724e4b8db6f20f5b", ), int_bmod: h( - "34dbb235a97b1719b2be6d8c7242d58cd3be2d3cfef59d4276eb7d0d6e2dac80", + "197d3c7e9ce0949c52ef98f50b58ddb942db6d367640d6fb6f49ab91f82f4271", ), int_bdiv: h( - "a4b5c5e3a05be0e12faf9412376ff23aa975f8e56669255d5868ddb1c7ad4a90", + "0713405a689d2155a84123a0f6395c31c6fa55c1ad905fc55663acf7d7577f57", ), int_nat_abs: h( "83e3ce8a747520cc248a0dacf9bd1369467e4907e8aaaa433e1b438e1cad7ca4", ), int_pow: h( - "836aeaf2e8c4b240d2e8243f4a9a25679937f2581408e7b3853407bbd18e45fc", + "875be8d8ae5f332003ec2bade698bb0aa5f2f46e71218da9cdd9d09506e84c10", ), int_dec_eq: h( - "402cb01bfa52fe93aef3d96e7d28ee03e0e1f76f3c879654f5e719a72015237f", + "0f53bc5768fd32aa6801dc8762934b69049db3e7e57412c6904dd1a8b9cff4f8", ), int_dec_le: h( - "bffed7cd4968b8fc251ed24a9c253da00215902354c2944f59e81538dc1ae2c7", + "0e5f70efda0598182819a10a238796462debc05f40888117d1196992b9423fae", ), int_dec_lt: h( - "09b5fb2f2d8451689f842711744a27bfe55c6fd5010fd24a90845393c707e0a4", + "ce137cce4c1a49323a788f1677a9d6a1d4a936111588083589baab2bac01108c", ), punit: h( "2dfc16af01b82b3b91c2ff704409d76236a83f956c0c6e6659a64fe21d76695b", @@ -389,16 +390,16 @@ impl PrimAddrs { "1917841d2085796dd7ba346de93a579571b5641c33fc400408ec55b5778a9a51", ), bit_vec: h( - "eafd1b2f6b571abf76ae96eaf9c4852aa4520d06df534291590a71a21e6f0b5a", + "67f474b8c3302b04417f721ff3e88ce6f16a7dfcb3bae99368085d1c5e872ba4", ), bit_vec_to_nat: h( - "986b9c736cb930c81cae697ec496804b6e4415a178e4f0022fb058f5034ab7bf", + "e32ab4e7720d3442a266b37c97a27218e68239318311f8e4b046a6bdde520374", ), bit_vec_of_nat: h( - "da082f157d2a7b86eb226b1881bfacd0d9dd1be17a27e13fa300c015c4ffbf85", + "3b334c94dd56d80beb4eff5d825f67f6f1ac4e140403699e3daff52a00bdbf6e", ), bit_vec_ult: h( - "b668db7d12cabb4d7fe2e1af25984baa28bb2852a982da8d54942bb344726ccf", + "4f9d4e0c70e16c78e0eda38e2d6d94ccd12598755e0e7200a9239da92b9057cc", ), decidable_decide: h( "c5f7b19663e4499e70e1b2645162c5be15fa860f4f8157e331ae546c6f733723", @@ -419,26 +420,26 @@ impl PrimAddrs { "a343a651bff408c3a29ff27b2b62e34b54b2ab381cf6f3ad87c540c977dc3c4a", ), string_back: h( - "d07f8105c544227a13ec90befae2005e9c6f64493f8c7ff669ba743e1547c935", + "548bbf22ba305f8e363edf9907d0c2c454add416ddbf25b38c76d0063ad21d65", ), string_legacy_back: h( - "fc49357a5bc6525839a7bc11b9df207852a6e9c6afa3ec62bac3c542ac89e0e0", + "ef4e74e44e3bb9fa5e5488a46c5b4d61fbfd701e3679c5bfb4154c8747cefdc9", ), string_utf8_byte_size: h( - "6a142d91e877959e1419c345808a79a3e95818577afda68d287f4f881521dde9", + "5186d91ef8892e48eb02918b0926e9767c6d4b9b0814064a449a5afe8a9e5a6e", ), string_append: h( - "3803adc21d899693a1491db054104b20bd40fc0ca1f6b4374b7b158b4252b38b", + "ff459554dfdc34d159027038174571b770464d52834c1dbc6436467fa81d039e", ), string_dec_eq: h( - "ba51b5d8a3b14201d22402cda8e731e49fdf78f08b72643c1b08e250436aaff1", + "14cf519b05c30384fd4cb2e271b0896fe23e74c995010d42eb1ffce14927e56b", ), } } /// `(lean_name, canonical_address_hex)` table from `Self::new()`, /// in the same order as `Tests/Ix/Kernel/BuildPrimitives.lean`'s - /// `kernelPrimitives` array. Used by the regen-parity test + /// `kernelPrimitives` array. Used by the live-parity test /// (`testPrimitivesParity`) to detect drift between hardcoded /// addresses and freshly-compiled ones: if any future /// compile/serialize change touches a primitive's content hash, @@ -451,7 +452,17 @@ impl PrimAddrs { /// because the real `eagerReduce` canonicalizes to the same /// address as `id`; see the comment on the field in `new()`. pub fn lean_parity_table() -> Vec<(&'static str, String)> { - let p = Self::new(); + Self::parity_table(&Self::new()) + } + + /// `(lean_name, original_address_hex)` table from `Self::new_orig()`. + /// The name order matches [`Self::lean_parity_table`] so the same live + /// primitive catalog can validate both address schemes. + pub fn lean_orig_parity_table() -> Vec<(&'static str, String)> { + Self::parity_table(&Self::new_orig()) + } + + fn parity_table(p: &Self) -> Vec<(&'static str, String)> { vec![ ("Nat", p.nat.hex()), ("Nat.zero", p.nat_zero.hex()), @@ -556,7 +567,8 @@ impl PrimAddrs { /// environment produced by `lean_ingress` where KIds live at LEON /// addresses rather than canonical addresses. /// - /// Regenerate with `lake test -- rust-kernel-build-prim-origs`. The + /// Regenerate with `lake test -- --ignored rust-kernel-build-prim-origs`. + /// The /// failure mode when these drift is a synthetic `@` KId in every /// primitive field of `orig_kenv.prims()`, which cascades into a /// flood of `AppTypeMismatch` errors during original-constant @@ -578,19 +590,19 @@ impl PrimAddrs { "e4f2b35614ae2c6487084cb96e90852643a043296bc682b469ccfd430650cf8d", ), nat_add: h( - "01ec6fdf63bc0de137becade5f420102f35338bef318b9d5fd44e70db82c3f42", + "ed99025afee9212ecf57c260d56d5dce9c901628cb0080421989da4fe979ede7", ), nat_pred: h( "26245a09319bcf9d55a08431bce3b9d8a8d09e3dad25b9a83cc666e3736deeb4", ), nat_sub: h( - "4017cc8c3a02d3eeab73d5cc5af8afe771f60d980f107fd24d3a1d59aaa41d5a", + "858e3184f315fc8f85614d8ccd6f854a71bb8ff1d2e2c0f2819bf411ff25f294", ), nat_mul: h( - "a095de37a0e713551bd237f414ac7317f68b3986ce5734ca0063c504457f24de", + "ea30166fa0b64cf3da2d952ed470d6c3d33de3e85243f95026f3b5262367ec9f", ), nat_pow: h( - "6e9d84492674fb8a36008214b2150c76a83da4af1cadcc303d5d680d0477235a", + "5cf09dd7481dee82376ed65b09a08ea716f3575dd5b0b2d76c04c4fbb2a36a5d", ), nat_gcd: h( "09ae07bc024bfb0317aa228d1274294b40aebb4229dc7014f7b22d56fa46a760", @@ -605,10 +617,10 @@ impl PrimAddrs { "21a51ddc3faeec42c0f3897955d5e24c40ffb1924824bd919da5db0346962a98", ), nat_beq: h( - "8960bdbe7e09dd15582a50de197cb5c28d87b147e3479e417b4c2ad43011f90c", + "6a397f8ed945046604a856b84b14a683b23916d83e794fd8ecc3348be87a8486", ), nat_ble: h( - "7e679407c5e5af964d3d3cb98c9b606218c6f4ac7b19210d375f1d76ddd5f022", + "25bacf590070ada376418c4eae60a90fa529d56951f451166cd6ba15cf0eeb68", ), nat_land: h( "dd73c5c1552ff6ad35537b83f46c9e8c4c2c979eda612fe169e29f3028c63db9", @@ -620,10 +632,10 @@ impl PrimAddrs { "04ffebfee34f36c46f63ef6aa347b0b81db8c1cbf3fb9a282799cac024310e69", ), nat_shift_left: h( - "89705cc0aca476aa6f161f91006980a425536757e2b7ea949d3aec0edcc3df76", + "e09f39bd5d0655d8a7844447e85c5a865bb0d233e7512f21e3de78d15808eb59", ), nat_shift_right: h( - "930ab9e4c2854a0af16c84f89a5aee8e297b65411c499ffae0cf9b27d4ee4b8e", + "6be9556dba2dedb10ea06533ac97de79a1d4973f32f8d0657a1467ea1f746e32", ), bool_type: h( "95fc5d28972d1472a12ddfc2f4a5eefec9a81652fcb63ef06c7f6f6d21a951ab", @@ -721,16 +733,16 @@ impl PrimAddrs { "2c26576bf92a0d9c2d169be19317e587eec54945a5a241c30dd84908d534d5a1", ), nat_le_of_ble_eq_true: h( - "16c9cae0ac27b93644943a84c426db889766476ddb12b0a8b82f76cd2d848561", + "ce908a2c83164cb59df5afba6345e29fa1ae44032e2aed8ac4d7fc0c87951849", ), nat_not_le_of_not_ble_eq_true: h( "adb3eaf42d5f4c368bb929b20cec07fa96f9c9fe70d372ec72b25e6510ae14d4", ), nat_eq_of_beq_eq_true: h( - "2a2e813ddd907721551718bdb3a2f8248231a041a39563d6d68798aa48425ec8", + "06f72598e90d27fd5ba7700a2920781048e9712693b5a2d20df885cb203aa2d3", ), nat_ne_of_beq_eq_false: h( - "a09735868d12586f23121cecf12ea2dd1f197f1d44dadc94b7e056d6cceb1980", + "0bc9d7d2a3d61217967bec2dbdfdbda85e6c41dcb5340d859d0177beeee18437", ), fin: h( "aca8ccd74023a139175db5f1b5b4d037ba1559e25a5d091f2bdc797b23dbb275", diff --git a/crates/ffi/src/kernel.rs b/crates/ffi/src/kernel.rs index 60fd0f453..a71a167d7 100644 --- a/crates/ffi/src/kernel.rs +++ b/crates/ffi/src/kernel.rs @@ -745,6 +745,20 @@ pub extern "C" fn rs_kernel_ixon_names( #[unsafe(no_mangle)] pub extern "C" fn rs_prim_addrs_canonical() -> LeanIOResult { let table = ix_kernel::primitive::PrimAddrs::lean_parity_table(); + build_prim_addrs_table(&table) +} + +/// FFI: expose the original/LEON primitive `(lean_name, hex_address)` +/// table from `PrimAddrs::new_orig()` to the Lean test suite. +#[unsafe(no_mangle)] +pub extern "C" fn rs_prim_addrs_orig() -> LeanIOResult { + let table = ix_kernel::primitive::PrimAddrs::lean_orig_parity_table(); + build_prim_addrs_table(&table) +} + +fn build_prim_addrs_table( + table: &[(&'static str, String)], +) -> LeanIOResult { let arr = LeanArray::alloc(table.len()); for (i, (name, hex)) in table.iter().enumerate() { let name_obj: LeanOwned = LeanString::new(name).into(); diff --git a/crates/ixvm-codegen/src/aiur_ixvm.rs b/crates/ixvm-codegen/src/aiur_ixvm.rs index adbf6d94e..b6c1317cb 100644 --- a/crates/ixvm-codegen/src/aiur_ixvm.rs +++ b/crates/ixvm-codegen/src/aiur_ixvm.rs @@ -16625,38 +16625,38 @@ fn aiur_fn_146( unconstrained: bool, ) -> Result<[G; OUT_146], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(94); - let __v_1: G = G::from_u64(215); - let __v_2: G = G::from_u64(142); - let __v_3: G = G::from_u64(224); - let __v_4: G = G::from_u64(129); - let __v_5: G = G::from_u64(225); - let __v_6: G = G::from_u64(11); - let __v_7: G = G::from_u64(192); - let __v_8: G = G::from_u64(153); - let __v_9: G = G::from_u64(154); - let __v_10: G = G::from_u64(55); - let __v_11: G = G::from_u64(42); - let __v_12: G = G::from_u64(94); - let __v_13: G = G::from_u64(84); - let __v_14: G = G::from_u64(172); - let __v_15: G = G::from_u64(211); - let __v_16: G = G::from_u64(55); - let __v_17: G = G::from_u64(61); - let __v_18: G = G::from_u64(133); - let __v_19: G = G::from_u64(212); - let __v_20: G = G::from_u64(30); + let __v_0: G = G::from_u64(225); + let __v_1: G = G::from_u64(238); + let __v_2: G = G::from_u64(76); + let __v_3: G = G::from_u64(120); + let __v_4: G = G::from_u64(163); + let __v_5: G = G::from_u64(144); + let __v_6: G = G::from_u64(100); + let __v_7: G = G::from_u64(100); + let __v_8: G = G::from_u64(250); + let __v_9: G = G::from_u64(140); + let __v_10: G = G::from_u64(23); + let __v_11: G = G::from_u64(236); + let __v_12: G = G::from_u64(46); + let __v_13: G = G::from_u64(208); + let __v_14: G = G::from_u64(192); + let __v_15: G = G::from_u64(191); + let __v_16: G = G::from_u64(102); + let __v_17: G = G::from_u64(219); + let __v_18: G = G::from_u64(59); + let __v_19: G = G::from_u64(65); + let __v_20: G = G::from_u64(45); let __v_21: G = G::from_u64(155); - let __v_22: G = G::from_u64(227); - let __v_23: G = G::from_u64(250); - let __v_24: G = G::from_u64(117); - let __v_25: G = G::from_u64(253); - let __v_26: G = G::from_u64(222); - let __v_27: G = G::from_u64(50); - let __v_28: G = G::from_u64(219); - let __v_29: G = G::from_u64(45); - let __v_30: G = G::from_u64(101); - let __v_31: G = G::from_u64(1); + let __v_22: G = G::from_u64(28); + let __v_23: G = G::from_u64(95); + let __v_24: G = G::from_u64(49); + let __v_25: G = G::from_u64(251); + let __v_26: G = G::from_u64(167); + let __v_27: G = G::from_u64(187); + let __v_28: G = G::from_u64(151); + let __v_29: G = G::from_u64(74); + let __v_30: G = G::from_u64(147); + let __v_31: G = G::from_u64(229); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_146] = [__v_32]; record.function_queries[146].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -16674,38 +16674,38 @@ fn aiur_fn_147( unconstrained: bool, ) -> Result<[G; OUT_147], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(97); - let __v_1: G = G::from_u64(15); - let __v_2: G = G::from_u64(229); - let __v_3: G = G::from_u64(164); - let __v_4: G = G::from_u64(245); - let __v_5: G = G::from_u64(160); - let __v_6: G = G::from_u64(63); - let __v_7: G = G::from_u64(100); - let __v_8: G = G::from_u64(246); - let __v_9: G = G::from_u64(14); - let __v_10: G = G::from_u64(245); - let __v_11: G = G::from_u64(160); - let __v_12: G = G::from_u64(105); - let __v_13: G = G::from_u64(241); - let __v_14: G = G::from_u64(100); - let __v_15: G = G::from_u64(7); - let __v_16: G = G::from_u64(88); - let __v_17: G = G::from_u64(224); - let __v_18: G = G::from_u64(0); - let __v_19: G = G::from_u64(161); - let __v_20: G = G::from_u64(180); - let __v_21: G = G::from_u64(213); - let __v_22: G = G::from_u64(127); - let __v_23: G = G::from_u64(213); - let __v_24: G = G::from_u64(148); - let __v_25: G = G::from_u64(134); - let __v_26: G = G::from_u64(110); - let __v_27: G = G::from_u64(159); - let __v_28: G = G::from_u64(107); - let __v_29: G = G::from_u64(51); - let __v_30: G = G::from_u64(129); - let __v_31: G = G::from_u64(237); + let __v_0: G = G::from_u64(191); + let __v_1: G = G::from_u64(5); + let __v_2: G = G::from_u64(142); + let __v_3: G = G::from_u64(228); + let __v_4: G = G::from_u64(70); + let __v_5: G = G::from_u64(82); + let __v_6: G = G::from_u64(122); + let __v_7: G = G::from_u64(246); + let __v_8: G = G::from_u64(236); + let __v_9: G = G::from_u64(116); + let __v_10: G = G::from_u64(146); + let __v_11: G = G::from_u64(35); + let __v_12: G = G::from_u64(117); + let __v_13: G = G::from_u64(45); + let __v_14: G = G::from_u64(7); + let __v_15: G = G::from_u64(230); + let __v_16: G = G::from_u64(215); + let __v_17: G = G::from_u64(194); + let __v_18: G = G::from_u64(223); + let __v_19: G = G::from_u64(141); + let __v_20: G = G::from_u64(192); + let __v_21: G = G::from_u64(160); + let __v_22: G = G::from_u64(119); + let __v_23: G = G::from_u64(141); + let __v_24: G = G::from_u64(147); + let __v_25: G = G::from_u64(79); + let __v_26: G = G::from_u64(136); + let __v_27: G = G::from_u64(90); + let __v_28: G = G::from_u64(232); + let __v_29: G = G::from_u64(38); + let __v_30: G = G::from_u64(125); + let __v_31: G = G::from_u64(87); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_147] = [__v_32]; record.function_queries[147].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -16723,38 +16723,38 @@ fn aiur_fn_148( unconstrained: bool, ) -> Result<[G; OUT_148], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(218); - let __v_1: G = G::from_u64(111); - let __v_2: G = G::from_u64(183); - let __v_3: G = G::from_u64(37); - let __v_4: G = G::from_u64(128); - let __v_5: G = G::from_u64(61); - let __v_6: G = G::from_u64(183); - let __v_7: G = G::from_u64(159); - let __v_8: G = G::from_u64(49); - let __v_9: G = G::from_u64(142); - let __v_10: G = G::from_u64(138); - let __v_11: G = G::from_u64(239); - let __v_12: G = G::from_u64(91); - let __v_13: G = G::from_u64(25); - let __v_14: G = G::from_u64(225); - let __v_15: G = G::from_u64(212); - let __v_16: G = G::from_u64(194); - let __v_17: G = G::from_u64(209); - let __v_18: G = G::from_u64(167); - let __v_19: G = G::from_u64(196); - let __v_20: G = G::from_u64(24); - let __v_21: G = G::from_u64(49); - let __v_22: G = G::from_u64(223); - let __v_23: G = G::from_u64(72); - let __v_24: G = G::from_u64(120); - let __v_25: G = G::from_u64(126); - let __v_26: G = G::from_u64(138); - let __v_27: G = G::from_u64(49); - let __v_28: G = G::from_u64(155); - let __v_29: G = G::from_u64(140); - let __v_30: G = G::from_u64(72); - let __v_31: G = G::from_u64(211); + let __v_0: G = G::from_u64(194); + let __v_1: G = G::from_u64(254); + let __v_2: G = G::from_u64(94); + let __v_3: G = G::from_u64(218); + let __v_4: G = G::from_u64(30); + let __v_5: G = G::from_u64(85); + let __v_6: G = G::from_u64(146); + let __v_7: G = G::from_u64(54); + let __v_8: G = G::from_u64(191); + let __v_9: G = G::from_u64(194); + let __v_10: G = G::from_u64(167); + let __v_11: G = G::from_u64(164); + let __v_12: G = G::from_u64(125); + let __v_13: G = G::from_u64(176); + let __v_14: G = G::from_u64(202); + let __v_15: G = G::from_u64(108); + let __v_16: G = G::from_u64(247); + let __v_17: G = G::from_u64(130); + let __v_18: G = G::from_u64(247); + let __v_19: G = G::from_u64(182); + let __v_20: G = G::from_u64(155); + let __v_21: G = G::from_u64(221); + let __v_22: G = G::from_u64(150); + let __v_23: G = G::from_u64(50); + let __v_24: G = G::from_u64(55); + let __v_25: G = G::from_u64(208); + let __v_26: G = G::from_u64(136); + let __v_27: G = G::from_u64(159); + let __v_28: G = G::from_u64(191); + let __v_29: G = G::from_u64(154); + let __v_30: G = G::from_u64(75); + let __v_31: G = G::from_u64(7); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_148] = [__v_32]; record.function_queries[148].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -16772,38 +16772,38 @@ fn aiur_fn_149( unconstrained: bool, ) -> Result<[G; OUT_149], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(171); - let __v_1: G = G::from_u64(111); - let __v_2: G = G::from_u64(63); - let __v_3: G = G::from_u64(28); - let __v_4: G = G::from_u64(173); - let __v_5: G = G::from_u64(99); - let __v_6: G = G::from_u64(108); - let __v_7: G = G::from_u64(238); - let __v_8: G = G::from_u64(182); - let __v_9: G = G::from_u64(125); - let __v_10: G = G::from_u64(247); - let __v_11: G = G::from_u64(73); - let __v_12: G = G::from_u64(205); - let __v_13: G = G::from_u64(124); - let __v_14: G = G::from_u64(198); - let __v_15: G = G::from_u64(52); - let __v_16: G = G::from_u64(162); - let __v_17: G = G::from_u64(214); - let __v_18: G = G::from_u64(138); - let __v_19: G = G::from_u64(235); - let __v_20: G = G::from_u64(84); - let __v_21: G = G::from_u64(37); - let __v_22: G = G::from_u64(94); - let __v_23: G = G::from_u64(8); - let __v_24: G = G::from_u64(92); - let __v_25: G = G::from_u64(167); - let __v_26: G = G::from_u64(239); - let __v_27: G = G::from_u64(105); - let __v_28: G = G::from_u64(43); - let __v_29: G = G::from_u64(57); - let __v_30: G = G::from_u64(94); - let __v_31: G = G::from_u64(99); + let __v_0: G = G::from_u64(10); + let __v_1: G = G::from_u64(236); + let __v_2: G = G::from_u64(146); + let __v_3: G = G::from_u64(49); + let __v_4: G = G::from_u64(62); + let __v_5: G = G::from_u64(89); + let __v_6: G = G::from_u64(141); + let __v_7: G = G::from_u64(95); + let __v_8: G = G::from_u64(203); + let __v_9: G = G::from_u64(93); + let __v_10: G = G::from_u64(207); + let __v_11: G = G::from_u64(11); + let __v_12: G = G::from_u64(128); + let __v_13: G = G::from_u64(57); + let __v_14: G = G::from_u64(156); + let __v_15: G = G::from_u64(105); + let __v_16: G = G::from_u64(235); + let __v_17: G = G::from_u64(246); + let __v_18: G = G::from_u64(164); + let __v_19: G = G::from_u64(59); + let __v_20: G = G::from_u64(158); + let __v_21: G = G::from_u64(233); + let __v_22: G = G::from_u64(122); + let __v_23: G = G::from_u64(62); + let __v_24: G = G::from_u64(86); + let __v_25: G = G::from_u64(20); + let __v_26: G = G::from_u64(54); + let __v_27: G = G::from_u64(185); + let __v_28: G = G::from_u64(242); + let __v_29: G = G::from_u64(185); + let __v_30: G = G::from_u64(84); + let __v_31: G = G::from_u64(128); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_149] = [__v_32]; record.function_queries[149].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -16821,38 +16821,38 @@ fn aiur_fn_150( unconstrained: bool, ) -> Result<[G; OUT_150], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(140); - let __v_1: G = G::from_u64(212); - let __v_2: G = G::from_u64(25); - let __v_3: G = G::from_u64(144); - let __v_4: G = G::from_u64(68); - let __v_5: G = G::from_u64(73); - let __v_6: G = G::from_u64(164); - let __v_7: G = G::from_u64(217); - let __v_8: G = G::from_u64(27); - let __v_9: G = G::from_u64(234); - let __v_10: G = G::from_u64(184); - let __v_11: G = G::from_u64(77); - let __v_12: G = G::from_u64(194); - let __v_13: G = G::from_u64(107); - let __v_14: G = G::from_u64(72); - let __v_15: G = G::from_u64(178); - let __v_16: G = G::from_u64(22); - let __v_17: G = G::from_u64(218); - let __v_18: G = G::from_u64(254); - let __v_19: G = G::from_u64(22); - let __v_20: G = G::from_u64(54); - let __v_21: G = G::from_u64(215); - let __v_22: G = G::from_u64(31); - let __v_23: G = G::from_u64(72); - let __v_24: G = G::from_u64(220); - let __v_25: G = G::from_u64(192); - let __v_26: G = G::from_u64(210); - let __v_27: G = G::from_u64(12); - let __v_28: G = G::from_u64(159); - let __v_29: G = G::from_u64(237); - let __v_30: G = G::from_u64(16); - let __v_31: G = G::from_u64(235); + let __v_0: G = G::from_u64(89); + let __v_1: G = G::from_u64(228); + let __v_2: G = G::from_u64(125); + let __v_3: G = G::from_u64(113); + let __v_4: G = G::from_u64(215); + let __v_5: G = G::from_u64(60); + let __v_6: G = G::from_u64(84); + let __v_7: G = G::from_u64(78); + let __v_8: G = G::from_u64(225); + let __v_9: G = G::from_u64(164); + let __v_10: G = G::from_u64(237); + let __v_11: G = G::from_u64(240); + let __v_12: G = G::from_u64(126); + let __v_13: G = G::from_u64(159); + let __v_14: G = G::from_u64(255); + let __v_15: G = G::from_u64(245); + let __v_16: G = G::from_u64(66); + let __v_17: G = G::from_u64(203); + let __v_18: G = G::from_u64(117); + let __v_19: G = G::from_u64(126); + let __v_20: G = G::from_u64(115); + let __v_21: G = G::from_u64(150); + let __v_22: G = G::from_u64(81); + let __v_23: G = G::from_u64(169); + let __v_24: G = G::from_u64(205); + let __v_25: G = G::from_u64(69); + let __v_26: G = G::from_u64(58); + let __v_27: G = G::from_u64(240); + let __v_28: G = G::from_u64(61); + let __v_29: G = G::from_u64(61); + let __v_30: G = G::from_u64(206); + let __v_31: G = G::from_u64(66); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_150] = [__v_32]; record.function_queries[150].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -16870,38 +16870,38 @@ fn aiur_fn_151( unconstrained: bool, ) -> Result<[G; OUT_151], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(79); - let __v_1: G = G::from_u64(201); - let __v_2: G = G::from_u64(21); - let __v_3: G = G::from_u64(136); - let __v_4: G = G::from_u64(208); - let __v_5: G = G::from_u64(176); - let __v_6: G = G::from_u64(78); - let __v_7: G = G::from_u64(233); - let __v_8: G = G::from_u64(235); - let __v_9: G = G::from_u64(34); - let __v_10: G = G::from_u64(1); - let __v_11: G = G::from_u64(200); - let __v_12: G = G::from_u64(11); - let __v_13: G = G::from_u64(114); - let __v_14: G = G::from_u64(179); - let __v_15: G = G::from_u64(157); - let __v_16: G = G::from_u64(239); - let __v_17: G = G::from_u64(161); - let __v_18: G = G::from_u64(237); - let __v_19: G = G::from_u64(244); - let __v_20: G = G::from_u64(92); - let __v_21: G = G::from_u64(130); - let __v_22: G = G::from_u64(229); - let __v_23: G = G::from_u64(234); - let __v_24: G = G::from_u64(227); - let __v_25: G = G::from_u64(78); - let __v_26: G = G::from_u64(31); - let __v_27: G = G::from_u64(113); - let __v_28: G = G::from_u64(133); - let __v_29: G = G::from_u64(141); - let __v_30: G = G::from_u64(118); - let __v_31: G = G::from_u64(182); + let __v_0: G = G::from_u64(44); + let __v_1: G = G::from_u64(157); + let __v_2: G = G::from_u64(45); + let __v_3: G = G::from_u64(62); + let __v_4: G = G::from_u64(126); + let __v_5: G = G::from_u64(151); + let __v_6: G = G::from_u64(75); + let __v_7: G = G::from_u64(67); + let __v_8: G = G::from_u64(202); + let __v_9: G = G::from_u64(61); + let __v_10: G = G::from_u64(33); + let __v_11: G = G::from_u64(47); + let __v_12: G = G::from_u64(50); + let __v_13: G = G::from_u64(112); + let __v_14: G = G::from_u64(113); + let __v_15: G = G::from_u64(135); + let __v_16: G = G::from_u64(56); + let __v_17: G = G::from_u64(33); + let __v_18: G = G::from_u64(37); + let __v_19: G = G::from_u64(177); + let __v_20: G = G::from_u64(39); + let __v_21: G = G::from_u64(39); + let __v_22: G = G::from_u64(88); + let __v_23: G = G::from_u64(246); + let __v_24: G = G::from_u64(156); + let __v_25: G = G::from_u64(75); + let __v_26: G = G::from_u64(71); + let __v_27: G = G::from_u64(233); + let __v_28: G = G::from_u64(109); + let __v_29: G = G::from_u64(154); + let __v_30: G = G::from_u64(171); + let __v_31: G = G::from_u64(207); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_151] = [__v_32]; record.function_queries[151].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -16919,38 +16919,38 @@ fn aiur_fn_152( unconstrained: bool, ) -> Result<[G; OUT_152], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(131); - let __v_1: G = G::from_u64(194); - let __v_2: G = G::from_u64(112); - let __v_3: G = G::from_u64(56); - let __v_4: G = G::from_u64(142); - let __v_5: G = G::from_u64(64); - let __v_6: G = G::from_u64(74); - let __v_7: G = G::from_u64(45); - let __v_8: G = G::from_u64(204); - let __v_9: G = G::from_u64(153); - let __v_10: G = G::from_u64(36); - let __v_11: G = G::from_u64(242); - let __v_12: G = G::from_u64(72); - let __v_13: G = G::from_u64(39); - let __v_14: G = G::from_u64(130); - let __v_15: G = G::from_u64(217); - let __v_16: G = G::from_u64(222); - let __v_17: G = G::from_u64(191); - let __v_18: G = G::from_u64(113); - let __v_19: G = G::from_u64(102); - let __v_20: G = G::from_u64(243); - let __v_21: G = G::from_u64(210); - let __v_22: G = G::from_u64(224); - let __v_23: G = G::from_u64(118); - let __v_24: G = G::from_u64(58); - let __v_25: G = G::from_u64(120); - let __v_26: G = G::from_u64(40); - let __v_27: G = G::from_u64(23); - let __v_28: G = G::from_u64(43); - let __v_29: G = G::from_u64(140); - let __v_30: G = G::from_u64(19); - let __v_31: G = G::from_u64(30); + let __v_0: G = G::from_u64(47); + let __v_1: G = G::from_u64(18); + let __v_2: G = G::from_u64(243); + let __v_3: G = G::from_u64(34); + let __v_4: G = G::from_u64(148); + let __v_5: G = G::from_u64(183); + let __v_6: G = G::from_u64(209); + let __v_7: G = G::from_u64(22); + let __v_8: G = G::from_u64(138); + let __v_9: G = G::from_u64(218); + let __v_10: G = G::from_u64(24); + let __v_11: G = G::from_u64(9); + let __v_12: G = G::from_u64(201); + let __v_13: G = G::from_u64(184); + let __v_14: G = G::from_u64(178); + let __v_15: G = G::from_u64(86); + let __v_16: G = G::from_u64(56); + let __v_17: G = G::from_u64(36); + let __v_18: G = G::from_u64(233); + let __v_19: G = G::from_u64(194); + let __v_20: G = G::from_u64(135); + let __v_21: G = G::from_u64(155); + let __v_22: G = G::from_u64(248); + let __v_23: G = G::from_u64(211); + let __v_24: G = G::from_u64(187); + let __v_25: G = G::from_u64(155); + let __v_26: G = G::from_u64(92); + let __v_27: G = G::from_u64(3); + let __v_28: G = G::from_u64(215); + let __v_29: G = G::from_u64(171); + let __v_30: G = G::from_u64(113); + let __v_31: G = G::from_u64(49); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_152] = [__v_32]; record.function_queries[152].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -16968,38 +16968,38 @@ fn aiur_fn_153( unconstrained: bool, ) -> Result<[G; OUT_153], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(100); - let __v_1: G = G::from_u64(225); - let __v_2: G = G::from_u64(130); - let __v_3: G = G::from_u64(206); - let __v_4: G = G::from_u64(243); - let __v_5: G = G::from_u64(60); - let __v_6: G = G::from_u64(183); - let __v_7: G = G::from_u64(23); - let __v_8: G = G::from_u64(183); - let __v_9: G = G::from_u64(136); - let __v_10: G = G::from_u64(64); - let __v_11: G = G::from_u64(77); - let __v_12: G = G::from_u64(49); - let __v_13: G = G::from_u64(186); - let __v_14: G = G::from_u64(210); - let __v_15: G = G::from_u64(16); - let __v_16: G = G::from_u64(61); - let __v_17: G = G::from_u64(26); - let __v_18: G = G::from_u64(251); - let __v_19: G = G::from_u64(118); - let __v_20: G = G::from_u64(219); - let __v_21: G = G::from_u64(84); - let __v_22: G = G::from_u64(71); - let __v_23: G = G::from_u64(186); - let __v_24: G = G::from_u64(52); - let __v_25: G = G::from_u64(50); - let __v_26: G = G::from_u64(216); - let __v_27: G = G::from_u64(63); - let __v_28: G = G::from_u64(114); - let __v_29: G = G::from_u64(203); - let __v_30: G = G::from_u64(155); - let __v_31: G = G::from_u64(244); + let __v_0: G = G::from_u64(131); + let __v_1: G = G::from_u64(60); + let __v_2: G = G::from_u64(91); + let __v_3: G = G::from_u64(46); + let __v_4: G = G::from_u64(60); + let __v_5: G = G::from_u64(7); + let __v_6: G = G::from_u64(126); + let __v_7: G = G::from_u64(182); + let __v_8: G = G::from_u64(179); + let __v_9: G = G::from_u64(192); + let __v_10: G = G::from_u64(228); + let __v_11: G = G::from_u64(216); + let __v_12: G = G::from_u64(72); + let __v_13: G = G::from_u64(207); + let __v_14: G = G::from_u64(84); + let __v_15: G = G::from_u64(8); + let __v_16: G = G::from_u64(36); + let __v_17: G = G::from_u64(12); + let __v_18: G = G::from_u64(125); + let __v_19: G = G::from_u64(60); + let __v_20: G = G::from_u64(255); + let __v_21: G = G::from_u64(140); + let __v_22: G = G::from_u64(64); + let __v_23: G = G::from_u64(99); + let __v_24: G = G::from_u64(92); + let __v_25: G = G::from_u64(110); + let __v_26: G = G::from_u64(59); + let __v_27: G = G::from_u64(249); + let __v_28: G = G::from_u64(70); + let __v_29: G = G::from_u64(99); + let __v_30: G = G::from_u64(14); + let __v_31: G = G::from_u64(52); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_153] = [__v_32]; record.function_queries[153].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -17017,38 +17017,38 @@ fn aiur_fn_154( unconstrained: bool, ) -> Result<[G; OUT_154], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(215); - let __v_1: G = G::from_u64(93); - let __v_2: G = G::from_u64(225); - let __v_3: G = G::from_u64(42); - let __v_4: G = G::from_u64(88); - let __v_5: G = G::from_u64(75); - let __v_6: G = G::from_u64(213); - let __v_7: G = G::from_u64(254); - let __v_8: G = G::from_u64(186); - let __v_9: G = G::from_u64(248); - let __v_10: G = G::from_u64(154); - let __v_11: G = G::from_u64(119); - let __v_12: G = G::from_u64(40); - let __v_13: G = G::from_u64(220); - let __v_14: G = G::from_u64(98); - let __v_15: G = G::from_u64(112); - let __v_16: G = G::from_u64(237); - let __v_17: G = G::from_u64(56); - let __v_18: G = G::from_u64(174); - let __v_19: G = G::from_u64(23); - let __v_20: G = G::from_u64(151); - let __v_21: G = G::from_u64(255); - let __v_22: G = G::from_u64(90); - let __v_23: G = G::from_u64(68); - let __v_24: G = G::from_u64(104); - let __v_25: G = G::from_u64(59); - let __v_26: G = G::from_u64(141); - let __v_27: G = G::from_u64(241); - let __v_28: G = G::from_u64(89); - let __v_29: G = G::from_u64(80); - let __v_30: G = G::from_u64(153); - let __v_31: G = G::from_u64(148); + let __v_0: G = G::from_u64(114); + let __v_1: G = G::from_u64(50); + let __v_2: G = G::from_u64(9); + let __v_3: G = G::from_u64(90); + let __v_4: G = G::from_u64(234); + let __v_5: G = G::from_u64(154); + let __v_6: G = G::from_u64(95); + let __v_7: G = G::from_u64(121); + let __v_8: G = G::from_u64(204); + let __v_9: G = G::from_u64(15); + let __v_10: G = G::from_u64(43); + let __v_11: G = G::from_u64(10); + let __v_12: G = G::from_u64(216); + let __v_13: G = G::from_u64(72); + let __v_14: G = G::from_u64(219); + let __v_15: G = G::from_u64(241); + let __v_16: G = G::from_u64(144); + let __v_17: G = G::from_u64(74); + let __v_18: G = G::from_u64(99); + let __v_19: G = G::from_u64(15); + let __v_20: G = G::from_u64(30); + let __v_21: G = G::from_u64(248); + let __v_22: G = G::from_u64(111); + let __v_23: G = G::from_u64(36); + let __v_24: G = G::from_u64(79); + let __v_25: G = G::from_u64(138); + let __v_26: G = G::from_u64(66); + let __v_27: G = G::from_u64(184); + let __v_28: G = G::from_u64(71); + let __v_29: G = G::from_u64(175); + let __v_30: G = G::from_u64(171); + let __v_31: G = G::from_u64(154); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_154] = [__v_32]; record.function_queries[154].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -17066,38 +17066,38 @@ fn aiur_fn_155( unconstrained: bool, ) -> Result<[G; OUT_155], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(12); - let __v_1: G = G::from_u64(103); - let __v_2: G = G::from_u64(136); - let __v_3: G = G::from_u64(181); - let __v_4: G = G::from_u64(141); - let __v_5: G = G::from_u64(149); - let __v_6: G = G::from_u64(104); - let __v_7: G = G::from_u64(204); - let __v_8: G = G::from_u64(17); - let __v_9: G = G::from_u64(138); - let __v_10: G = G::from_u64(155); - let __v_11: G = G::from_u64(10); - let __v_12: G = G::from_u64(134); - let __v_13: G = G::from_u64(30); - let __v_14: G = G::from_u64(135); - let __v_15: G = G::from_u64(39); - let __v_16: G = G::from_u64(50); - let __v_17: G = G::from_u64(219); - let __v_18: G = G::from_u64(184); - let __v_19: G = G::from_u64(69); - let __v_20: G = G::from_u64(54); - let __v_21: G = G::from_u64(71); - let __v_22: G = G::from_u64(234); - let __v_23: G = G::from_u64(157); - let __v_24: G = G::from_u64(96); - let __v_25: G = G::from_u64(19); - let __v_26: G = G::from_u64(81); - let __v_27: G = G::from_u64(82); - let __v_28: G = G::from_u64(68); - let __v_29: G = G::from_u64(230); - let __v_30: G = G::from_u64(14); - let __v_31: G = G::from_u64(56); + let __v_0: G = G::from_u64(195); + let __v_1: G = G::from_u64(176); + let __v_2: G = G::from_u64(11); + let __v_3: G = G::from_u64(81); + let __v_4: G = G::from_u64(75); + let __v_5: G = G::from_u64(159); + let __v_6: G = G::from_u64(38); + let __v_7: G = G::from_u64(220); + let __v_8: G = G::from_u64(30); + let __v_9: G = G::from_u64(223); + let __v_10: G = G::from_u64(16); + let __v_11: G = G::from_u64(199); + let __v_12: G = G::from_u64(214); + let __v_13: G = G::from_u64(246); + let __v_14: G = G::from_u64(159); + let __v_15: G = G::from_u64(69); + let __v_16: G = G::from_u64(94); + let __v_17: G = G::from_u64(248); + let __v_18: G = G::from_u64(237); + let __v_19: G = G::from_u64(12); + let __v_20: G = G::from_u64(81); + let __v_21: G = G::from_u64(176); + let __v_22: G = G::from_u64(166); + let __v_23: G = G::from_u64(102); + let __v_24: G = G::from_u64(227); + let __v_25: G = G::from_u64(66); + let __v_26: G = G::from_u64(127); + let __v_27: G = G::from_u64(180); + let __v_28: G = G::from_u64(77); + let __v_29: G = G::from_u64(58); + let __v_30: G = G::from_u64(4); + let __v_31: G = G::from_u64(240); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_155] = [__v_32]; record.function_queries[155].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -17115,38 +17115,38 @@ fn aiur_fn_156( unconstrained: bool, ) -> Result<[G; OUT_156], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(66); - let __v_1: G = G::from_u64(76); - let __v_2: G = G::from_u64(54); - let __v_3: G = G::from_u64(238); - let __v_4: G = G::from_u64(20); - let __v_5: G = G::from_u64(54); - let __v_6: G = G::from_u64(42); - let __v_7: G = G::from_u64(231); - let __v_8: G = G::from_u64(52); - let __v_9: G = G::from_u64(45); - let __v_10: G = G::from_u64(21); - let __v_11: G = G::from_u64(39); - let __v_12: G = G::from_u64(210); - let __v_13: G = G::from_u64(81); - let __v_14: G = G::from_u64(212); - let __v_15: G = G::from_u64(55); - let __v_16: G = G::from_u64(138); - let __v_17: G = G::from_u64(253); - let __v_18: G = G::from_u64(42); - let __v_19: G = G::from_u64(69); - let __v_20: G = G::from_u64(163); - let __v_21: G = G::from_u64(181); - let __v_22: G = G::from_u64(9); - let __v_23: G = G::from_u64(125); - let __v_24: G = G::from_u64(45); - let __v_25: G = G::from_u64(42); - let __v_26: G = G::from_u64(224); - let __v_27: G = G::from_u64(50); - let __v_28: G = G::from_u64(29); - let __v_29: G = G::from_u64(95); - let __v_30: G = G::from_u64(159); - let __v_31: G = G::from_u64(255); + let __v_0: G = G::from_u64(110); + let __v_1: G = G::from_u64(112); + let __v_2: G = G::from_u64(205); + let __v_3: G = G::from_u64(157); + let __v_4: G = G::from_u64(23); + let __v_5: G = G::from_u64(8); + let __v_6: G = G::from_u64(184); + let __v_7: G = G::from_u64(240); + let __v_8: G = G::from_u64(11); + let __v_9: G = G::from_u64(228); + let __v_10: G = G::from_u64(96); + let __v_11: G = G::from_u64(101); + let __v_12: G = G::from_u64(92); + let __v_13: G = G::from_u64(164); + let __v_14: G = G::from_u64(122); + let __v_15: G = G::from_u64(65); + let __v_16: G = G::from_u64(157); + let __v_17: G = G::from_u64(198); + let __v_18: G = G::from_u64(1); + let __v_19: G = G::from_u64(249); + let __v_20: G = G::from_u64(192); + let __v_21: G = G::from_u64(85); + let __v_22: G = G::from_u64(142); + let __v_23: G = G::from_u64(122); + let __v_24: G = G::from_u64(194); + let __v_25: G = G::from_u64(18); + let __v_26: G = G::from_u64(184); + let __v_27: G = G::from_u64(14); + let __v_28: G = G::from_u64(230); + let __v_29: G = G::from_u64(255); + let __v_30: G = G::from_u64(9); + let __v_31: G = G::from_u64(120); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_156] = [__v_32]; record.function_queries[156].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -17164,38 +17164,38 @@ fn aiur_fn_157( unconstrained: bool, ) -> Result<[G; OUT_157], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(170); - let __v_1: G = G::from_u64(155); - let __v_2: G = G::from_u64(97); - let __v_3: G = G::from_u64(190); - let __v_4: G = G::from_u64(220); - let __v_5: G = G::from_u64(158); - let __v_6: G = G::from_u64(230); - let __v_7: G = G::from_u64(169); - let __v_8: G = G::from_u64(144); - let __v_9: G = G::from_u64(141); - let __v_10: G = G::from_u64(95); - let __v_11: G = G::from_u64(14); - let __v_12: G = G::from_u64(152); - let __v_13: G = G::from_u64(149); - let __v_14: G = G::from_u64(95); - let __v_15: G = G::from_u64(24); - let __v_16: G = G::from_u64(51); - let __v_17: G = G::from_u64(15); - let __v_18: G = G::from_u64(56); - let __v_19: G = G::from_u64(88); - let __v_20: G = G::from_u64(125); - let __v_21: G = G::from_u64(247); - let __v_22: G = G::from_u64(16); - let __v_23: G = G::from_u64(253); - let __v_24: G = G::from_u64(235); - let __v_25: G = G::from_u64(228); - let __v_26: G = G::from_u64(21); - let __v_27: G = G::from_u64(206); - let __v_28: G = G::from_u64(199); - let __v_29: G = G::from_u64(218); - let __v_30: G = G::from_u64(41); - let __v_31: G = G::from_u64(237); + let __v_0: G = G::from_u64(216); + let __v_1: G = G::from_u64(221); + let __v_2: G = G::from_u64(236); + let __v_3: G = G::from_u64(103); + let __v_4: G = G::from_u64(211); + let __v_5: G = G::from_u64(46); + let __v_6: G = G::from_u64(235); + let __v_7: G = G::from_u64(31); + let __v_8: G = G::from_u64(43); + let __v_9: G = G::from_u64(13); + let __v_10: G = G::from_u64(84); + let __v_11: G = G::from_u64(3); + let __v_12: G = G::from_u64(114); + let __v_13: G = G::from_u64(237); + let __v_14: G = G::from_u64(116); + let __v_15: G = G::from_u64(82); + let __v_16: G = G::from_u64(32); + let __v_17: G = G::from_u64(253); + let __v_18: G = G::from_u64(177); + let __v_19: G = G::from_u64(228); + let __v_20: G = G::from_u64(226); + let __v_21: G = G::from_u64(178); + let __v_22: G = G::from_u64(245); + let __v_23: G = G::from_u64(75); + let __v_24: G = G::from_u64(173); + let __v_25: G = G::from_u64(222); + let __v_26: G = G::from_u64(96); + let __v_27: G = G::from_u64(182); + let __v_28: G = G::from_u64(103); + let __v_29: G = G::from_u64(52); + let __v_30: G = G::from_u64(249); + let __v_31: G = G::from_u64(243); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_157] = [__v_32]; record.function_queries[157].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -17213,38 +17213,38 @@ fn aiur_fn_158( unconstrained: bool, ) -> Result<[G; OUT_158], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(253); - let __v_1: G = G::from_u64(134); - let __v_2: G = G::from_u64(37); - let __v_3: G = G::from_u64(213); - let __v_4: G = G::from_u64(22); - let __v_5: G = G::from_u64(96); - let __v_6: G = G::from_u64(81); - let __v_7: G = G::from_u64(3); - let __v_8: G = G::from_u64(191); - let __v_9: G = G::from_u64(142); - let __v_10: G = G::from_u64(1); - let __v_11: G = G::from_u64(154); - let __v_12: G = G::from_u64(93); - let __v_13: G = G::from_u64(134); - let __v_14: G = G::from_u64(212); - let __v_15: G = G::from_u64(125); - let __v_16: G = G::from_u64(52); - let __v_17: G = G::from_u64(221); - let __v_18: G = G::from_u64(71); - let __v_19: G = G::from_u64(193); - let __v_20: G = G::from_u64(239); - let __v_21: G = G::from_u64(100); - let __v_22: G = G::from_u64(158); - let __v_23: G = G::from_u64(61); - let __v_24: G = G::from_u64(236); - let __v_25: G = G::from_u64(15); - let __v_26: G = G::from_u64(166); - let __v_27: G = G::from_u64(151); - let __v_28: G = G::from_u64(187); - let __v_29: G = G::from_u64(253); - let __v_30: G = G::from_u64(158); - let __v_31: G = G::from_u64(65); + let __v_0: G = G::from_u64(202); + let __v_1: G = G::from_u64(48); + let __v_2: G = G::from_u64(34); + let __v_3: G = G::from_u64(163); + let __v_4: G = G::from_u64(200); + let __v_5: G = G::from_u64(53); + let __v_6: G = G::from_u64(155); + let __v_7: G = G::from_u64(12); + let __v_8: G = G::from_u64(67); + let __v_9: G = G::from_u64(94); + let __v_10: G = G::from_u64(180); + let __v_11: G = G::from_u64(187); + let __v_12: G = G::from_u64(142); + let __v_13: G = G::from_u64(142); + let __v_14: G = G::from_u64(172); + let __v_15: G = G::from_u64(10); + let __v_16: G = G::from_u64(160); + let __v_17: G = G::from_u64(133); + let __v_18: G = G::from_u64(209); + let __v_19: G = G::from_u64(218); + let __v_20: G = G::from_u64(16); + let __v_21: G = G::from_u64(242); + let __v_22: G = G::from_u64(89); + let __v_23: G = G::from_u64(40); + let __v_24: G = G::from_u64(112); + let __v_25: G = G::from_u64(37); + let __v_26: G = G::from_u64(34); + let __v_27: G = G::from_u64(152); + let __v_28: G = G::from_u64(97); + let __v_29: G = G::from_u64(17); + let __v_30: G = G::from_u64(32); + let __v_31: G = G::from_u64(112); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_158] = [__v_32]; record.function_queries[158].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -17262,38 +17262,38 @@ fn aiur_fn_159( unconstrained: bool, ) -> Result<[G; OUT_159], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(218); - let __v_1: G = G::from_u64(63); - let __v_2: G = G::from_u64(149); - let __v_3: G = G::from_u64(8); - let __v_4: G = G::from_u64(119); - let __v_5: G = G::from_u64(130); - let __v_6: G = G::from_u64(244); - let __v_7: G = G::from_u64(7); - let __v_8: G = G::from_u64(67); - let __v_9: G = G::from_u64(22); - let __v_10: G = G::from_u64(139); - let __v_11: G = G::from_u64(217); - let __v_12: G = G::from_u64(23); - let __v_13: G = G::from_u64(109); - let __v_14: G = G::from_u64(220); - let __v_15: G = G::from_u64(222); - let __v_16: G = G::from_u64(100); - let __v_17: G = G::from_u64(191); - let __v_18: G = G::from_u64(90); - let __v_19: G = G::from_u64(77); - let __v_20: G = G::from_u64(80); - let __v_21: G = G::from_u64(52); - let __v_22: G = G::from_u64(99); - let __v_23: G = G::from_u64(195); - let __v_24: G = G::from_u64(213); - let __v_25: G = G::from_u64(238); - let __v_26: G = G::from_u64(244); - let __v_27: G = G::from_u64(202); - let __v_28: G = G::from_u64(46); - let __v_29: G = G::from_u64(250); - let __v_30: G = G::from_u64(237); - let __v_31: G = G::from_u64(35); + let __v_0: G = G::from_u64(202); + let __v_1: G = G::from_u64(75); + let __v_2: G = G::from_u64(57); + let __v_3: G = G::from_u64(139); + let __v_4: G = G::from_u64(32); + let __v_5: G = G::from_u64(128); + let __v_6: G = G::from_u64(190); + let __v_7: G = G::from_u64(204); + let __v_8: G = G::from_u64(204); + let __v_9: G = G::from_u64(243); + let __v_10: G = G::from_u64(163); + let __v_11: G = G::from_u64(18); + let __v_12: G = G::from_u64(30); + let __v_13: G = G::from_u64(132); + let __v_14: G = G::from_u64(139); + let __v_15: G = G::from_u64(209); + let __v_16: G = G::from_u64(151); + let __v_17: G = G::from_u64(120); + let __v_18: G = G::from_u64(71); + let __v_19: G = G::from_u64(102); + let __v_20: G = G::from_u64(140); + let __v_21: G = G::from_u64(24); + let __v_22: G = G::from_u64(166); + let __v_23: G = G::from_u64(68); + let __v_24: G = G::from_u64(123); + let __v_25: G = G::from_u64(14); + let __v_26: G = G::from_u64(220); + let __v_27: G = G::from_u64(95); + let __v_28: G = G::from_u64(86); + let __v_29: G = G::from_u64(27); + let __v_30: G = G::from_u64(28); + let __v_31: G = G::from_u64(188); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_159] = [__v_32]; record.function_queries[159].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -18451,38 +18451,38 @@ fn aiur_fn_179( unconstrained: bool, ) -> Result<[G; OUT_179], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(152); - let __v_1: G = G::from_u64(107); - let __v_2: G = G::from_u64(156); - let __v_3: G = G::from_u64(115); - let __v_4: G = G::from_u64(108); - let __v_5: G = G::from_u64(185); - let __v_6: G = G::from_u64(48); - let __v_7: G = G::from_u64(200); - let __v_8: G = G::from_u64(28); - let __v_9: G = G::from_u64(174); - let __v_10: G = G::from_u64(105); - let __v_11: G = G::from_u64(126); - let __v_12: G = G::from_u64(196); - let __v_13: G = G::from_u64(150); - let __v_14: G = G::from_u64(128); - let __v_15: G = G::from_u64(75); - let __v_16: G = G::from_u64(110); - let __v_17: G = G::from_u64(68); - let __v_18: G = G::from_u64(21); - let __v_19: G = G::from_u64(161); - let __v_20: G = G::from_u64(120); - let __v_21: G = G::from_u64(228); - let __v_22: G = G::from_u64(240); - let __v_23: G = G::from_u64(2); - let __v_24: G = G::from_u64(47); - let __v_25: G = G::from_u64(176); - let __v_26: G = G::from_u64(88); - let __v_27: G = G::from_u64(245); - let __v_28: G = G::from_u64(3); - let __v_29: G = G::from_u64(74); - let __v_30: G = G::from_u64(183); - let __v_31: G = G::from_u64(191); + let __v_0: G = G::from_u64(227); + let __v_1: G = G::from_u64(42); + let __v_2: G = G::from_u64(180); + let __v_3: G = G::from_u64(231); + let __v_4: G = G::from_u64(114); + let __v_5: G = G::from_u64(13); + let __v_6: G = G::from_u64(52); + let __v_7: G = G::from_u64(66); + let __v_8: G = G::from_u64(162); + let __v_9: G = G::from_u64(102); + let __v_10: G = G::from_u64(179); + let __v_11: G = G::from_u64(124); + let __v_12: G = G::from_u64(151); + let __v_13: G = G::from_u64(162); + let __v_14: G = G::from_u64(114); + let __v_15: G = G::from_u64(24); + let __v_16: G = G::from_u64(230); + let __v_17: G = G::from_u64(130); + let __v_18: G = G::from_u64(57); + let __v_19: G = G::from_u64(49); + let __v_20: G = G::from_u64(131); + let __v_21: G = G::from_u64(17); + let __v_22: G = G::from_u64(248); + let __v_23: G = G::from_u64(228); + let __v_24: G = G::from_u64(176); + let __v_25: G = G::from_u64(70); + let __v_26: G = G::from_u64(166); + let __v_27: G = G::from_u64(189); + let __v_28: G = G::from_u64(222); + let __v_29: G = G::from_u64(82); + let __v_30: G = G::from_u64(3); + let __v_31: G = G::from_u64(116); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_179] = [__v_32]; record.function_queries[179].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -18500,38 +18500,38 @@ fn aiur_fn_180( unconstrained: bool, ) -> Result<[G; OUT_180], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(218); - let __v_1: G = G::from_u64(8); - let __v_2: G = G::from_u64(47); - let __v_3: G = G::from_u64(21); - let __v_4: G = G::from_u64(125); - let __v_5: G = G::from_u64(42); - let __v_6: G = G::from_u64(123); - let __v_7: G = G::from_u64(134); + let __v_0: G = G::from_u64(59); + let __v_1: G = G::from_u64(51); + let __v_2: G = G::from_u64(76); + let __v_3: G = G::from_u64(148); + let __v_4: G = G::from_u64(221); + let __v_5: G = G::from_u64(86); + let __v_6: G = G::from_u64(216); + let __v_7: G = G::from_u64(11); let __v_8: G = G::from_u64(235); - let __v_9: G = G::from_u64(34); - let __v_10: G = G::from_u64(107); - let __v_11: G = G::from_u64(24); - let __v_12: G = G::from_u64(129); - let __v_13: G = G::from_u64(191); - let __v_14: G = G::from_u64(172); - let __v_15: G = G::from_u64(208); - let __v_16: G = G::from_u64(217); - let __v_17: G = G::from_u64(221); - let __v_18: G = G::from_u64(27); - let __v_19: G = G::from_u64(225); - let __v_20: G = G::from_u64(122); - let __v_21: G = G::from_u64(39); - let __v_22: G = G::from_u64(225); - let __v_23: G = G::from_u64(63); - let __v_24: G = G::from_u64(163); - let __v_25: G = G::from_u64(0); - let __v_26: G = G::from_u64(192); - let __v_27: G = G::from_u64(21); - let __v_28: G = G::from_u64(196); - let __v_29: G = G::from_u64(255); + let __v_9: G = G::from_u64(78); + let __v_10: G = G::from_u64(255); + let __v_11: G = G::from_u64(93); + let __v_12: G = G::from_u64(130); + let __v_13: G = G::from_u64(95); + let __v_14: G = G::from_u64(103); + let __v_15: G = G::from_u64(246); + let __v_16: G = G::from_u64(241); + let __v_17: G = G::from_u64(172); + let __v_18: G = G::from_u64(78); + let __v_19: G = G::from_u64(20); + let __v_20: G = G::from_u64(4); + let __v_21: G = G::from_u64(3); + let __v_22: G = G::from_u64(105); + let __v_23: G = G::from_u64(158); + let __v_24: G = G::from_u64(61); + let __v_25: G = G::from_u64(175); + let __v_26: G = G::from_u64(245); + let __v_27: G = G::from_u64(42); + let __v_28: G = G::from_u64(0); + let __v_29: G = G::from_u64(189); let __v_30: G = G::from_u64(191); - let __v_31: G = G::from_u64(133); + let __v_31: G = G::from_u64(110); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_180] = [__v_32]; record.function_queries[180].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -18549,38 +18549,38 @@ fn aiur_fn_181( unconstrained: bool, ) -> Result<[G; OUT_181], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(234); - let __v_1: G = G::from_u64(253); - let __v_2: G = G::from_u64(27); - let __v_3: G = G::from_u64(47); - let __v_4: G = G::from_u64(107); - let __v_5: G = G::from_u64(87); - let __v_6: G = G::from_u64(26); - let __v_7: G = G::from_u64(191); - let __v_8: G = G::from_u64(118); - let __v_9: G = G::from_u64(174); - let __v_10: G = G::from_u64(150); - let __v_11: G = G::from_u64(234); - let __v_12: G = G::from_u64(249); - let __v_13: G = G::from_u64(196); - let __v_14: G = G::from_u64(133); - let __v_15: G = G::from_u64(42); - let __v_16: G = G::from_u64(164); - let __v_17: G = G::from_u64(82); - let __v_18: G = G::from_u64(13); - let __v_19: G = G::from_u64(6); - let __v_20: G = G::from_u64(223); - let __v_21: G = G::from_u64(83); - let __v_22: G = G::from_u64(66); - let __v_23: G = G::from_u64(145); - let __v_24: G = G::from_u64(89); - let __v_25: G = G::from_u64(10); - let __v_26: G = G::from_u64(113); - let __v_27: G = G::from_u64(162); - let __v_28: G = G::from_u64(30); - let __v_29: G = G::from_u64(111); - let __v_30: G = G::from_u64(11); - let __v_31: G = G::from_u64(90); + let __v_0: G = G::from_u64(103); + let __v_1: G = G::from_u64(244); + let __v_2: G = G::from_u64(116); + let __v_3: G = G::from_u64(184); + let __v_4: G = G::from_u64(195); + let __v_5: G = G::from_u64(48); + let __v_6: G = G::from_u64(43); + let __v_7: G = G::from_u64(4); + let __v_8: G = G::from_u64(65); + let __v_9: G = G::from_u64(127); + let __v_10: G = G::from_u64(114); + let __v_11: G = G::from_u64(31); + let __v_12: G = G::from_u64(243); + let __v_13: G = G::from_u64(232); + let __v_14: G = G::from_u64(140); + let __v_15: G = G::from_u64(230); + let __v_16: G = G::from_u64(241); + let __v_17: G = G::from_u64(106); + let __v_18: G = G::from_u64(125); + let __v_19: G = G::from_u64(252); + let __v_20: G = G::from_u64(179); + let __v_21: G = G::from_u64(186); + let __v_22: G = G::from_u64(233); + let __v_23: G = G::from_u64(147); + let __v_24: G = G::from_u64(104); + let __v_25: G = G::from_u64(8); + let __v_26: G = G::from_u64(93); + let __v_27: G = G::from_u64(28); + let __v_28: G = G::from_u64(94); + let __v_29: G = G::from_u64(135); + let __v_30: G = G::from_u64(43); + let __v_31: G = G::from_u64(164); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_181] = [__v_32]; record.function_queries[181].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -18598,38 +18598,38 @@ fn aiur_fn_182( unconstrained: bool, ) -> Result<[G; OUT_182], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(182); - let __v_1: G = G::from_u64(104); - let __v_2: G = G::from_u64(219); - let __v_3: G = G::from_u64(125); - let __v_4: G = G::from_u64(18); - let __v_5: G = G::from_u64(202); - let __v_6: G = G::from_u64(187); - let __v_7: G = G::from_u64(77); - let __v_8: G = G::from_u64(127); - let __v_9: G = G::from_u64(226); - let __v_10: G = G::from_u64(225); - let __v_11: G = G::from_u64(175); - let __v_12: G = G::from_u64(37); - let __v_13: G = G::from_u64(152); - let __v_14: G = G::from_u64(75); - let __v_15: G = G::from_u64(170); - let __v_16: G = G::from_u64(40); - let __v_17: G = G::from_u64(187); - let __v_18: G = G::from_u64(40); - let __v_19: G = G::from_u64(82); - let __v_20: G = G::from_u64(169); - let __v_21: G = G::from_u64(130); - let __v_22: G = G::from_u64(218); - let __v_23: G = G::from_u64(141); - let __v_24: G = G::from_u64(84); - let __v_25: G = G::from_u64(148); - let __v_26: G = G::from_u64(43); - let __v_27: G = G::from_u64(179); - let __v_28: G = G::from_u64(68); - let __v_29: G = G::from_u64(114); - let __v_30: G = G::from_u64(108); - let __v_31: G = G::from_u64(207); + let __v_0: G = G::from_u64(79); + let __v_1: G = G::from_u64(157); + let __v_2: G = G::from_u64(78); + let __v_3: G = G::from_u64(12); + let __v_4: G = G::from_u64(112); + let __v_5: G = G::from_u64(225); + let __v_6: G = G::from_u64(108); + let __v_7: G = G::from_u64(120); + let __v_8: G = G::from_u64(224); + let __v_9: G = G::from_u64(237); + let __v_10: G = G::from_u64(163); + let __v_11: G = G::from_u64(142); + let __v_12: G = G::from_u64(45); + let __v_13: G = G::from_u64(109); + let __v_14: G = G::from_u64(148); + let __v_15: G = G::from_u64(204); + let __v_16: G = G::from_u64(209); + let __v_17: G = G::from_u64(37); + let __v_18: G = G::from_u64(152); + let __v_19: G = G::from_u64(117); + let __v_20: G = G::from_u64(94); + let __v_21: G = G::from_u64(14); + let __v_22: G = G::from_u64(114); + let __v_23: G = G::from_u64(0); + let __v_24: G = G::from_u64(169); + let __v_25: G = G::from_u64(35); + let __v_26: G = G::from_u64(157); + let __v_27: G = G::from_u64(169); + let __v_28: G = G::from_u64(43); + let __v_29: G = G::from_u64(144); + let __v_30: G = G::from_u64(87); + let __v_31: G = G::from_u64(204); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_182] = [__v_32]; record.function_queries[182].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -19529,38 +19529,38 @@ fn aiur_fn_194( unconstrained: bool, ) -> Result<[G; OUT_194], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(106); - let __v_1: G = G::from_u64(20); - let __v_2: G = G::from_u64(45); - let __v_3: G = G::from_u64(145); - let __v_4: G = G::from_u64(232); - let __v_5: G = G::from_u64(119); - let __v_6: G = G::from_u64(149); - let __v_7: G = G::from_u64(158); - let __v_8: G = G::from_u64(20); - let __v_9: G = G::from_u64(25); - let __v_10: G = G::from_u64(195); - let __v_11: G = G::from_u64(69); - let __v_12: G = G::from_u64(128); - let __v_13: G = G::from_u64(138); - let __v_14: G = G::from_u64(121); - let __v_15: G = G::from_u64(163); - let __v_16: G = G::from_u64(233); - let __v_17: G = G::from_u64(88); - let __v_18: G = G::from_u64(24); - let __v_19: G = G::from_u64(87); - let __v_20: G = G::from_u64(122); - let __v_21: G = G::from_u64(253); - let __v_22: G = G::from_u64(166); - let __v_23: G = G::from_u64(141); - let __v_24: G = G::from_u64(40); - let __v_25: G = G::from_u64(127); - let __v_26: G = G::from_u64(79); - let __v_27: G = G::from_u64(136); - let __v_28: G = G::from_u64(21); - let __v_29: G = G::from_u64(33); - let __v_30: G = G::from_u64(221); - let __v_31: G = G::from_u64(233); + let __v_0: G = G::from_u64(81); + let __v_1: G = G::from_u64(134); + let __v_2: G = G::from_u64(217); + let __v_3: G = G::from_u64(30); + let __v_4: G = G::from_u64(248); + let __v_5: G = G::from_u64(137); + let __v_6: G = G::from_u64(46); + let __v_7: G = G::from_u64(72); + let __v_8: G = G::from_u64(235); + let __v_9: G = G::from_u64(2); + let __v_10: G = G::from_u64(145); + let __v_11: G = G::from_u64(139); + let __v_12: G = G::from_u64(9); + let __v_13: G = G::from_u64(38); + let __v_14: G = G::from_u64(233); + let __v_15: G = G::from_u64(118); + let __v_16: G = G::from_u64(124); + let __v_17: G = G::from_u64(109); + let __v_18: G = G::from_u64(75); + let __v_19: G = G::from_u64(155); + let __v_20: G = G::from_u64(8); + let __v_21: G = G::from_u64(20); + let __v_22: G = G::from_u64(6); + let __v_23: G = G::from_u64(74); + let __v_24: G = G::from_u64(68); + let __v_25: G = G::from_u64(154); + let __v_26: G = G::from_u64(90); + let __v_27: G = G::from_u64(254); + let __v_28: G = G::from_u64(138); + let __v_29: G = G::from_u64(158); + let __v_30: G = G::from_u64(90); + let __v_31: G = G::from_u64(110); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_194] = [__v_32]; record.function_queries[194].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -19578,38 +19578,38 @@ fn aiur_fn_195( unconstrained: bool, ) -> Result<[G; OUT_195], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(56); - let __v_1: G = G::from_u64(3); - let __v_2: G = G::from_u64(173); - let __v_3: G = G::from_u64(194); - let __v_4: G = G::from_u64(29); - let __v_5: G = G::from_u64(137); - let __v_6: G = G::from_u64(150); - let __v_7: G = G::from_u64(147); - let __v_8: G = G::from_u64(161); - let __v_9: G = G::from_u64(73); - let __v_10: G = G::from_u64(29); - let __v_11: G = G::from_u64(176); - let __v_12: G = G::from_u64(84); - let __v_13: G = G::from_u64(16); - let __v_14: G = G::from_u64(75); - let __v_15: G = G::from_u64(32); - let __v_16: G = G::from_u64(189); - let __v_17: G = G::from_u64(64); - let __v_18: G = G::from_u64(252); - let __v_19: G = G::from_u64(12); - let __v_20: G = G::from_u64(161); - let __v_21: G = G::from_u64(246); - let __v_22: G = G::from_u64(180); - let __v_23: G = G::from_u64(55); - let __v_24: G = G::from_u64(75); - let __v_25: G = G::from_u64(123); - let __v_26: G = G::from_u64(21); - let __v_27: G = G::from_u64(139); - let __v_28: G = G::from_u64(66); - let __v_29: G = G::from_u64(82); - let __v_30: G = G::from_u64(179); - let __v_31: G = G::from_u64(139); + let __v_0: G = G::from_u64(255); + let __v_1: G = G::from_u64(69); + let __v_2: G = G::from_u64(149); + let __v_3: G = G::from_u64(84); + let __v_4: G = G::from_u64(223); + let __v_5: G = G::from_u64(220); + let __v_6: G = G::from_u64(52); + let __v_7: G = G::from_u64(209); + let __v_8: G = G::from_u64(89); + let __v_9: G = G::from_u64(2); + let __v_10: G = G::from_u64(112); + let __v_11: G = G::from_u64(56); + let __v_12: G = G::from_u64(23); + let __v_13: G = G::from_u64(69); + let __v_14: G = G::from_u64(113); + let __v_15: G = G::from_u64(183); + let __v_16: G = G::from_u64(112); + let __v_17: G = G::from_u64(70); + let __v_18: G = G::from_u64(77); + let __v_19: G = G::from_u64(82); + let __v_20: G = G::from_u64(131); + let __v_21: G = G::from_u64(76); + let __v_22: G = G::from_u64(29); + let __v_23: G = G::from_u64(188); + let __v_24: G = G::from_u64(100); + let __v_25: G = G::from_u64(54); + let __v_26: G = G::from_u64(70); + let __v_27: G = G::from_u64(127); + let __v_28: G = G::from_u64(168); + let __v_29: G = G::from_u64(29); + let __v_30: G = G::from_u64(3); + let __v_31: G = G::from_u64(158); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_195] = [__v_32]; record.function_queries[195].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -19627,38 +19627,38 @@ fn aiur_fn_196( unconstrained: bool, ) -> Result<[G; OUT_196], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(142); - let __v_1: G = G::from_u64(158); - let __v_2: G = G::from_u64(106); - let __v_3: G = G::from_u64(242); - let __v_4: G = G::from_u64(214); - let __v_5: G = G::from_u64(90); - let __v_6: G = G::from_u64(23); - let __v_7: G = G::from_u64(9); - let __v_8: G = G::from_u64(74); - let __v_9: G = G::from_u64(135); - let __v_10: G = G::from_u64(80); - let __v_11: G = G::from_u64(15); - let __v_12: G = G::from_u64(132); - let __v_13: G = G::from_u64(247); - let __v_14: G = G::from_u64(178); - let __v_15: G = G::from_u64(109); - let __v_16: G = G::from_u64(130); - let __v_17: G = G::from_u64(237); - let __v_18: G = G::from_u64(202); - let __v_19: G = G::from_u64(208); - let __v_20: G = G::from_u64(221); - let __v_21: G = G::from_u64(105); - let __v_22: G = G::from_u64(153); - let __v_23: G = G::from_u64(121); - let __v_24: G = G::from_u64(74); - let __v_25: G = G::from_u64(139); - let __v_26: G = G::from_u64(70); - let __v_27: G = G::from_u64(236); - let __v_28: G = G::from_u64(181); - let __v_29: G = G::from_u64(84); - let __v_30: G = G::from_u64(36); - let __v_31: G = G::from_u64(45); + let __v_0: G = G::from_u64(15); + let __v_1: G = G::from_u64(2); + let __v_2: G = G::from_u64(80); + let __v_3: G = G::from_u64(215); + let __v_4: G = G::from_u64(113); + let __v_5: G = G::from_u64(55); + let __v_6: G = G::from_u64(4); + let __v_7: G = G::from_u64(67); + let __v_8: G = G::from_u64(144); + let __v_9: G = G::from_u64(115); + let __v_10: G = G::from_u64(186); + let __v_11: G = G::from_u64(189); + let __v_12: G = G::from_u64(81); + let __v_13: G = G::from_u64(27); + let __v_14: G = G::from_u64(119); + let __v_15: G = G::from_u64(169); + let __v_16: G = G::from_u64(238); + let __v_17: G = G::from_u64(234); + let __v_18: G = G::from_u64(229); + let __v_19: G = G::from_u64(173); + let __v_20: G = G::from_u64(189); + let __v_21: G = G::from_u64(80); + let __v_22: G = G::from_u64(255); + let __v_23: G = G::from_u64(87); + let __v_24: G = G::from_u64(77); + let __v_25: G = G::from_u64(128); + let __v_26: G = G::from_u64(31); + let __v_27: G = G::from_u64(251); + let __v_28: G = G::from_u64(85); + let __v_29: G = G::from_u64(129); + let __v_30: G = G::from_u64(40); + let __v_31: G = G::from_u64(217); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_196] = [__v_32]; record.function_queries[196].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -19675,39 +19675,39 @@ fn aiur_fn_197( io_buffer: &mut IOBuffer, unconstrained: bool, ) -> Result<[G; OUT_197], ExecError> { - stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(96); - let __v_1: G = G::from_u64(75); - let __v_2: G = G::from_u64(35); - let __v_3: G = G::from_u64(205); - let __v_4: G = G::from_u64(15); - let __v_5: G = G::from_u64(172); - let __v_6: G = G::from_u64(245); - let __v_7: G = G::from_u64(179); - let __v_8: G = G::from_u64(229); - let __v_9: G = G::from_u64(109); - let __v_10: G = G::from_u64(239); - let __v_11: G = G::from_u64(87); - let __v_12: G = G::from_u64(218); - let __v_13: G = G::from_u64(145); - let __v_14: G = G::from_u64(178); - let __v_15: G = G::from_u64(104); - let __v_16: G = G::from_u64(143); - let __v_17: G = G::from_u64(252); - let __v_18: G = G::from_u64(167); - let __v_19: G = G::from_u64(197); - let __v_20: G = G::from_u64(67); - let __v_21: G = G::from_u64(91); - let __v_22: G = G::from_u64(181); - let __v_23: G = G::from_u64(220); - let __v_24: G = G::from_u64(44); - let __v_25: G = G::from_u64(177); - let __v_26: G = G::from_u64(26); - let __v_27: G = G::from_u64(104); - let __v_28: G = G::from_u64(163); - let __v_29: G = G::from_u64(49); - let __v_30: G = G::from_u64(134); - let __v_31: G = G::from_u64(9); + stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { + let __v_0: G = G::from_u64(9); + let __v_1: G = G::from_u64(238); + let __v_2: G = G::from_u64(180); + let __v_3: G = G::from_u64(22); + let __v_4: G = G::from_u64(200); + let __v_5: G = G::from_u64(64); + let __v_6: G = G::from_u64(118); + let __v_7: G = G::from_u64(102); + let __v_8: G = G::from_u64(100); + let __v_9: G = G::from_u64(87); + let __v_10: G = G::from_u64(65); + let __v_11: G = G::from_u64(127); + let __v_12: G = G::from_u64(75); + let __v_13: G = G::from_u64(124); + let __v_14: G = G::from_u64(227); + let __v_15: G = G::from_u64(209); + let __v_16: G = G::from_u64(191); + let __v_17: G = G::from_u64(52); + let __v_18: G = G::from_u64(151); + let __v_19: G = G::from_u64(125); + let __v_20: G = G::from_u64(63); + let __v_21: G = G::from_u64(86); + let __v_22: G = G::from_u64(221); + let __v_23: G = G::from_u64(37); + let __v_24: G = G::from_u64(98); + let __v_25: G = G::from_u64(192); + let __v_26: G = G::from_u64(1); + let __v_27: G = G::from_u64(74); + let __v_28: G = G::from_u64(81); + let __v_29: G = G::from_u64(203); + let __v_30: G = G::from_u64(141); + let __v_31: G = G::from_u64(52); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_197] = [__v_32]; record.function_queries[197].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -19823,38 +19823,38 @@ fn aiur_fn_200( unconstrained: bool, ) -> Result<[G; OUT_200], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(152); - let __v_1: G = G::from_u64(201); - let __v_2: G = G::from_u64(140); - let __v_3: G = G::from_u64(15); - let __v_4: G = G::from_u64(153); - let __v_5: G = G::from_u64(111); - let __v_6: G = G::from_u64(33); - let __v_7: G = G::from_u64(246); - let __v_8: G = G::from_u64(226); - let __v_9: G = G::from_u64(182); - let __v_10: G = G::from_u64(31); - let __v_11: G = G::from_u64(30); - let __v_12: G = G::from_u64(252); - let __v_13: G = G::from_u64(174); - let __v_14: G = G::from_u64(153); - let __v_15: G = G::from_u64(186); - let __v_16: G = G::from_u64(169); - let __v_17: G = G::from_u64(139); - let __v_18: G = G::from_u64(226); - let __v_19: G = G::from_u64(106); - let __v_20: G = G::from_u64(127); - let __v_21: G = G::from_u64(248); - let __v_22: G = G::from_u64(37); - let __v_23: G = G::from_u64(21); - let __v_24: G = G::from_u64(104); - let __v_25: G = G::from_u64(74); - let __v_26: G = G::from_u64(130); - let __v_27: G = G::from_u64(105); - let __v_28: G = G::from_u64(84); - let __v_29: G = G::from_u64(179); - let __v_30: G = G::from_u64(94); - let __v_31: G = G::from_u64(41); + let __v_0: G = G::from_u64(32); + let __v_1: G = G::from_u64(59); + let __v_2: G = G::from_u64(118); + let __v_3: G = G::from_u64(197); + let __v_4: G = G::from_u64(180); + let __v_5: G = G::from_u64(245); + let __v_6: G = G::from_u64(202); + let __v_7: G = G::from_u64(6); + let __v_8: G = G::from_u64(21); + let __v_9: G = G::from_u64(99); + let __v_10: G = G::from_u64(49); + let __v_11: G = G::from_u64(64); + let __v_12: G = G::from_u64(87); + let __v_13: G = G::from_u64(169); + let __v_14: G = G::from_u64(67); + let __v_15: G = G::from_u64(188); + let __v_16: G = G::from_u64(67); + let __v_17: G = G::from_u64(128); + let __v_18: G = G::from_u64(136); + let __v_19: G = G::from_u64(94); + let __v_20: G = G::from_u64(115); + let __v_21: G = G::from_u64(208); + let __v_22: G = G::from_u64(239); + let __v_23: G = G::from_u64(175); + let __v_24: G = G::from_u64(20); + let __v_25: G = G::from_u64(100); + let __v_26: G = G::from_u64(69); + let __v_27: G = G::from_u64(152); + let __v_28: G = G::from_u64(194); + let __v_29: G = G::from_u64(250); + let __v_30: G = G::from_u64(110); + let __v_31: G = G::from_u64(238); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_200] = [__v_32]; record.function_queries[200].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -19872,38 +19872,38 @@ fn aiur_fn_201( unconstrained: bool, ) -> Result<[G; OUT_201], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(208); - let __v_1: G = G::from_u64(127); - let __v_2: G = G::from_u64(129); - let __v_3: G = G::from_u64(5); - let __v_4: G = G::from_u64(197); - let __v_5: G = G::from_u64(68); - let __v_6: G = G::from_u64(34); - let __v_7: G = G::from_u64(122); - let __v_8: G = G::from_u64(19); - let __v_9: G = G::from_u64(236); - let __v_10: G = G::from_u64(144); - let __v_11: G = G::from_u64(190); - let __v_12: G = G::from_u64(250); - let __v_13: G = G::from_u64(226); - let __v_14: G = G::from_u64(0); - let __v_15: G = G::from_u64(94); - let __v_16: G = G::from_u64(156); - let __v_17: G = G::from_u64(111); - let __v_18: G = G::from_u64(100); - let __v_19: G = G::from_u64(73); - let __v_20: G = G::from_u64(63); - let __v_21: G = G::from_u64(140); - let __v_22: G = G::from_u64(127); - let __v_23: G = G::from_u64(246); - let __v_24: G = G::from_u64(105); - let __v_25: G = G::from_u64(186); - let __v_26: G = G::from_u64(116); - let __v_27: G = G::from_u64(62); - let __v_28: G = G::from_u64(21); - let __v_29: G = G::from_u64(71); - let __v_30: G = G::from_u64(201); - let __v_31: G = G::from_u64(53); + let __v_0: G = G::from_u64(84); + let __v_1: G = G::from_u64(139); + let __v_2: G = G::from_u64(191); + let __v_3: G = G::from_u64(34); + let __v_4: G = G::from_u64(186); + let __v_5: G = G::from_u64(48); + let __v_6: G = G::from_u64(95); + let __v_7: G = G::from_u64(142); + let __v_8: G = G::from_u64(54); + let __v_9: G = G::from_u64(62); + let __v_10: G = G::from_u64(223); + let __v_11: G = G::from_u64(153); + let __v_12: G = G::from_u64(7); + let __v_13: G = G::from_u64(208); + let __v_14: G = G::from_u64(194); + let __v_15: G = G::from_u64(196); + let __v_16: G = G::from_u64(84); + let __v_17: G = G::from_u64(173); + let __v_18: G = G::from_u64(212); + let __v_19: G = G::from_u64(22); + let __v_20: G = G::from_u64(221); + let __v_21: G = G::from_u64(191); + let __v_22: G = G::from_u64(37); + let __v_23: G = G::from_u64(179); + let __v_24: G = G::from_u64(140); + let __v_25: G = G::from_u64(118); + let __v_26: G = G::from_u64(208); + let __v_27: G = G::from_u64(6); + let __v_28: G = G::from_u64(58); + let __v_29: G = G::from_u64(210); + let __v_30: G = G::from_u64(29); + let __v_31: G = G::from_u64(101); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_201] = [__v_32]; record.function_queries[201].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -19921,38 +19921,38 @@ fn aiur_fn_202( unconstrained: bool, ) -> Result<[G; OUT_202], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(252); - let __v_1: G = G::from_u64(73); - let __v_2: G = G::from_u64(53); - let __v_3: G = G::from_u64(122); - let __v_4: G = G::from_u64(91); - let __v_5: G = G::from_u64(198); - let __v_6: G = G::from_u64(82); - let __v_7: G = G::from_u64(88); - let __v_8: G = G::from_u64(57); - let __v_9: G = G::from_u64(167); - let __v_10: G = G::from_u64(188); - let __v_11: G = G::from_u64(17); - let __v_12: G = G::from_u64(185); - let __v_13: G = G::from_u64(223); - let __v_14: G = G::from_u64(32); - let __v_15: G = G::from_u64(120); - let __v_16: G = G::from_u64(82); - let __v_17: G = G::from_u64(166); - let __v_18: G = G::from_u64(233); - let __v_19: G = G::from_u64(198); - let __v_20: G = G::from_u64(175); - let __v_21: G = G::from_u64(163); - let __v_22: G = G::from_u64(236); - let __v_23: G = G::from_u64(98); - let __v_24: G = G::from_u64(186); - let __v_25: G = G::from_u64(195); - let __v_26: G = G::from_u64(197); - let __v_27: G = G::from_u64(66); - let __v_28: G = G::from_u64(172); - let __v_29: G = G::from_u64(137); - let __v_30: G = G::from_u64(224); - let __v_31: G = G::from_u64(224); + let __v_0: G = G::from_u64(239); + let __v_1: G = G::from_u64(78); + let __v_2: G = G::from_u64(116); + let __v_3: G = G::from_u64(228); + let __v_4: G = G::from_u64(78); + let __v_5: G = G::from_u64(59); + let __v_6: G = G::from_u64(185); + let __v_7: G = G::from_u64(250); + let __v_8: G = G::from_u64(94); + let __v_9: G = G::from_u64(84); + let __v_10: G = G::from_u64(136); + let __v_11: G = G::from_u64(164); + let __v_12: G = G::from_u64(108); + let __v_13: G = G::from_u64(91); + let __v_14: G = G::from_u64(77); + let __v_15: G = G::from_u64(97); + let __v_16: G = G::from_u64(251); + let __v_17: G = G::from_u64(253); + let __v_18: G = G::from_u64(112); + let __v_19: G = G::from_u64(30); + let __v_20: G = G::from_u64(54); + let __v_21: G = G::from_u64(121); + let __v_22: G = G::from_u64(197); + let __v_23: G = G::from_u64(191); + let __v_24: G = G::from_u64(180); + let __v_25: G = G::from_u64(21); + let __v_26: G = G::from_u64(76); + let __v_27: G = G::from_u64(135); + let __v_28: G = G::from_u64(71); + let __v_29: G = G::from_u64(206); + let __v_30: G = G::from_u64(253); + let __v_31: G = G::from_u64(201); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_202] = [__v_32]; record.function_queries[202].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -19970,38 +19970,38 @@ fn aiur_fn_203( unconstrained: bool, ) -> Result<[G; OUT_203], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(53); - let __v_1: G = G::from_u64(212); - let __v_2: G = G::from_u64(243); - let __v_3: G = G::from_u64(130); - let __v_4: G = G::from_u64(226); - let __v_5: G = G::from_u64(78); - let __v_6: G = G::from_u64(0); - let __v_7: G = G::from_u64(156); - let __v_8: G = G::from_u64(192); - let __v_9: G = G::from_u64(233); - let __v_10: G = G::from_u64(69); - let __v_11: G = G::from_u64(121); - let __v_12: G = G::from_u64(85); - let __v_13: G = G::from_u64(211); - let __v_14: G = G::from_u64(239); - let __v_15: G = G::from_u64(30); - let __v_16: G = G::from_u64(111); - let __v_17: G = G::from_u64(121); - let __v_18: G = G::from_u64(250); - let __v_19: G = G::from_u64(233); - let __v_20: G = G::from_u64(216); - let __v_21: G = G::from_u64(211); - let __v_22: G = G::from_u64(28); - let __v_23: G = G::from_u64(253); - let __v_24: G = G::from_u64(46); - let __v_25: G = G::from_u64(21); - let __v_26: G = G::from_u64(63); - let __v_27: G = G::from_u64(160); - let __v_28: G = G::from_u64(59); - let __v_29: G = G::from_u64(5); - let __v_30: G = G::from_u64(74); - let __v_31: G = G::from_u64(106); + let __v_0: G = G::from_u64(135); + let __v_1: G = G::from_u64(9); + let __v_2: G = G::from_u64(245); + let __v_3: G = G::from_u64(112); + let __v_4: G = G::from_u64(168); + let __v_5: G = G::from_u64(25); + let __v_6: G = G::from_u64(50); + let __v_7: G = G::from_u64(82); + let __v_8: G = G::from_u64(24); + let __v_9: G = G::from_u64(42); + let __v_10: G = G::from_u64(158); + let __v_11: G = G::from_u64(205); + let __v_12: G = G::from_u64(113); + let __v_13: G = G::from_u64(63); + let __v_14: G = G::from_u64(137); + let __v_15: G = G::from_u64(14); + let __v_16: G = G::from_u64(117); + let __v_17: G = G::from_u64(211); + let __v_18: G = G::from_u64(191); + let __v_19: G = G::from_u64(181); + let __v_20: G = G::from_u64(162); + let __v_21: G = G::from_u64(127); + let __v_22: G = G::from_u64(91); + let __v_23: G = G::from_u64(145); + let __v_24: G = G::from_u64(129); + let __v_25: G = G::from_u64(204); + let __v_26: G = G::from_u64(171); + let __v_27: G = G::from_u64(224); + let __v_28: G = G::from_u64(101); + let __v_29: G = G::from_u64(74); + let __v_30: G = G::from_u64(12); + let __v_31: G = G::from_u64(41); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_203] = [__v_32]; record.function_queries[203].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -20019,38 +20019,38 @@ fn aiur_fn_204( unconstrained: bool, ) -> Result<[G; OUT_204], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(226); - let __v_1: G = G::from_u64(28); - let __v_2: G = G::from_u64(36); - let __v_3: G = G::from_u64(180); - let __v_4: G = G::from_u64(47); - let __v_5: G = G::from_u64(4); - let __v_6: G = G::from_u64(146); - let __v_7: G = G::from_u64(57); - let __v_8: G = G::from_u64(199); - let __v_9: G = G::from_u64(247); - let __v_10: G = G::from_u64(51); - let __v_11: G = G::from_u64(146); - let __v_12: G = G::from_u64(254); - let __v_13: G = G::from_u64(220); - let __v_14: G = G::from_u64(145); - let __v_15: G = G::from_u64(31); - let __v_16: G = G::from_u64(87); - let __v_17: G = G::from_u64(76); - let __v_18: G = G::from_u64(121); - let __v_19: G = G::from_u64(131); - let __v_20: G = G::from_u64(134); - let __v_21: G = G::from_u64(203); - let __v_22: G = G::from_u64(227); - let __v_23: G = G::from_u64(227); - let __v_24: G = G::from_u64(226); - let __v_25: G = G::from_u64(162); - let __v_26: G = G::from_u64(136); - let __v_27: G = G::from_u64(142); - let __v_28: G = G::from_u64(45); - let __v_29: G = G::from_u64(243); - let __v_30: G = G::from_u64(174); - let __v_31: G = G::from_u64(240); + let __v_0: G = G::from_u64(13); + let __v_1: G = G::from_u64(35); + let __v_2: G = G::from_u64(99); + let __v_3: G = G::from_u64(214); + let __v_4: G = G::from_u64(3); + let __v_5: G = G::from_u64(92); + let __v_6: G = G::from_u64(199); + let __v_7: G = G::from_u64(192); + let __v_8: G = G::from_u64(51); + let __v_9: G = G::from_u64(31); + let __v_10: G = G::from_u64(255); + let __v_11: G = G::from_u64(92); + let __v_12: G = G::from_u64(161); + let __v_13: G = G::from_u64(222); + let __v_14: G = G::from_u64(123); + let __v_15: G = G::from_u64(64); + let __v_16: G = G::from_u64(145); + let __v_17: G = G::from_u64(37); + let __v_18: G = G::from_u64(27); + let __v_19: G = G::from_u64(80); + let __v_20: G = G::from_u64(77); + let __v_21: G = G::from_u64(68); + let __v_22: G = G::from_u64(238); + let __v_23: G = G::from_u64(178); + let __v_24: G = G::from_u64(133); + let __v_25: G = G::from_u64(9); + let __v_26: G = G::from_u64(147); + let __v_27: G = G::from_u64(189); + let __v_28: G = G::from_u64(13); + let __v_29: G = G::from_u64(221); + let __v_30: G = G::from_u64(226); + let __v_31: G = G::from_u64(34); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_204] = [__v_32]; record.function_queries[204].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -20068,38 +20068,38 @@ fn aiur_fn_205( unconstrained: bool, ) -> Result<[G; OUT_205], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(186); - let __v_1: G = G::from_u64(81); - let __v_2: G = G::from_u64(181); - let __v_3: G = G::from_u64(216); - let __v_4: G = G::from_u64(163); - let __v_5: G = G::from_u64(177); - let __v_6: G = G::from_u64(66); - let __v_7: G = G::from_u64(1); - let __v_8: G = G::from_u64(210); - let __v_9: G = G::from_u64(36); - let __v_10: G = G::from_u64(2); - let __v_11: G = G::from_u64(205); - let __v_12: G = G::from_u64(168); - let __v_13: G = G::from_u64(231); - let __v_14: G = G::from_u64(49); - let __v_15: G = G::from_u64(228); - let __v_16: G = G::from_u64(159); - let __v_17: G = G::from_u64(223); - let __v_18: G = G::from_u64(120); - let __v_19: G = G::from_u64(240); - let __v_20: G = G::from_u64(139); - let __v_21: G = G::from_u64(114); - let __v_22: G = G::from_u64(100); - let __v_23: G = G::from_u64(60); - let __v_24: G = G::from_u64(27); - let __v_25: G = G::from_u64(8); - let __v_26: G = G::from_u64(226); - let __v_27: G = G::from_u64(80); - let __v_28: G = G::from_u64(67); - let __v_29: G = G::from_u64(106); - let __v_30: G = G::from_u64(175); - let __v_31: G = G::from_u64(241); + let __v_0: G = G::from_u64(20); + let __v_1: G = G::from_u64(207); + let __v_2: G = G::from_u64(81); + let __v_3: G = G::from_u64(155); + let __v_4: G = G::from_u64(5); + let __v_5: G = G::from_u64(195); + let __v_6: G = G::from_u64(3); + let __v_7: G = G::from_u64(132); + let __v_8: G = G::from_u64(253); + let __v_9: G = G::from_u64(76); + let __v_10: G = G::from_u64(178); + let __v_11: G = G::from_u64(226); + let __v_12: G = G::from_u64(113); + let __v_13: G = G::from_u64(176); + let __v_14: G = G::from_u64(137); + let __v_15: G = G::from_u64(111); + let __v_16: G = G::from_u64(226); + let __v_17: G = G::from_u64(62); + let __v_18: G = G::from_u64(116); + let __v_19: G = G::from_u64(201); + let __v_20: G = G::from_u64(149); + let __v_21: G = G::from_u64(1); + let __v_22: G = G::from_u64(13); + let __v_23: G = G::from_u64(66); + let __v_24: G = G::from_u64(235); + let __v_25: G = G::from_u64(31); + let __v_26: G = G::from_u64(252); + let __v_27: G = G::from_u64(225); + let __v_28: G = G::from_u64(73); + let __v_29: G = G::from_u64(39); + let __v_30: G = G::from_u64(229); + let __v_31: G = G::from_u64(107); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_205] = [__v_32]; record.function_queries[205].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -20117,38 +20117,38 @@ fn aiur_fn_206( unconstrained: bool, ) -> Result<[G; OUT_206], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(74); - let __v_1: G = G::from_u64(192); - let __v_2: G = G::from_u64(158); - let __v_3: G = G::from_u64(216); - let __v_4: G = G::from_u64(255); - let __v_5: G = G::from_u64(97); - let __v_6: G = G::from_u64(228); - let __v_7: G = G::from_u64(79); - let __v_8: G = G::from_u64(17); - let __v_9: G = G::from_u64(89); - let __v_10: G = G::from_u64(188); - let __v_11: G = G::from_u64(111); - let __v_12: G = G::from_u64(176); - let __v_13: G = G::from_u64(15); - let __v_14: G = G::from_u64(215); - let __v_15: G = G::from_u64(231); - let __v_16: G = G::from_u64(44); - let __v_17: G = G::from_u64(21); - let __v_18: G = G::from_u64(222); - let __v_19: G = G::from_u64(239); - let __v_20: G = G::from_u64(234); - let __v_21: G = G::from_u64(86); - let __v_22: G = G::from_u64(157); - let __v_23: G = G::from_u64(117); - let __v_24: G = G::from_u64(93); - let __v_25: G = G::from_u64(139); - let __v_26: G = G::from_u64(29); - let __v_27: G = G::from_u64(5); - let __v_28: G = G::from_u64(245); - let __v_29: G = G::from_u64(209); - let __v_30: G = G::from_u64(145); - let __v_31: G = G::from_u64(247); + let __v_0: G = G::from_u64(253); + let __v_1: G = G::from_u64(83); + let __v_2: G = G::from_u64(232); + let __v_3: G = G::from_u64(220); + let __v_4: G = G::from_u64(232); + let __v_5: G = G::from_u64(45); + let __v_6: G = G::from_u64(86); + let __v_7: G = G::from_u64(139); + let __v_8: G = G::from_u64(86); + let __v_9: G = G::from_u64(233); + let __v_10: G = G::from_u64(177); + let __v_11: G = G::from_u64(108); + let __v_12: G = G::from_u64(57); + let __v_13: G = G::from_u64(11); + let __v_14: G = G::from_u64(86); + let __v_15: G = G::from_u64(147); + let __v_16: G = G::from_u64(193); + let __v_17: G = G::from_u64(55); + let __v_18: G = G::from_u64(180); + let __v_19: G = G::from_u64(229); + let __v_20: G = G::from_u64(77); + let __v_21: G = G::from_u64(18); + let __v_22: G = G::from_u64(172); + let __v_23: G = G::from_u64(9); + let __v_24: G = G::from_u64(170); + let __v_25: G = G::from_u64(85); + let __v_26: G = G::from_u64(152); + let __v_27: G = G::from_u64(99); + let __v_28: G = G::from_u64(149); + let __v_29: G = G::from_u64(75); + let __v_30: G = G::from_u64(101); + let __v_31: G = G::from_u64(135); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_206] = [__v_32]; record.function_queries[206].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -42118,38 +42118,38 @@ fn aiur_fn_473( unconstrained: bool, ) -> Result<[G; OUT_473], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(8); - let __v_1: G = G::from_u64(250); - let __v_2: G = G::from_u64(173); - let __v_3: G = G::from_u64(94); - let __v_4: G = G::from_u64(146); - let __v_5: G = G::from_u64(49); - let __v_6: G = G::from_u64(110); - let __v_7: G = G::from_u64(23); - let __v_8: G = G::from_u64(229); - let __v_9: G = G::from_u64(248); - let __v_10: G = G::from_u64(8); - let __v_11: G = G::from_u64(4); - let __v_12: G = G::from_u64(152); - let __v_13: G = G::from_u64(44); - let __v_14: G = G::from_u64(111); - let __v_15: G = G::from_u64(133); - let __v_16: G = G::from_u64(62); - let __v_17: G = G::from_u64(50); - let __v_18: G = G::from_u64(188); - let __v_19: G = G::from_u64(67); - let __v_20: G = G::from_u64(244); - let __v_21: G = G::from_u64(220); - let __v_22: G = G::from_u64(65); - let __v_23: G = G::from_u64(6); - let __v_24: G = G::from_u64(25); - let __v_25: G = G::from_u64(236); - let __v_26: G = G::from_u64(19); - let __v_27: G = G::from_u64(223); - let __v_28: G = G::from_u64(21); - let __v_29: G = G::from_u64(35); - let __v_30: G = G::from_u64(119); - let __v_31: G = G::from_u64(227); + let __v_0: G = G::from_u64(69); + let __v_1: G = G::from_u64(96); + let __v_2: G = G::from_u64(197); + let __v_3: G = G::from_u64(241); + let __v_4: G = G::from_u64(33); + let __v_5: G = G::from_u64(165); + let __v_6: G = G::from_u64(66); + let __v_7: G = G::from_u64(242); + let __v_8: G = G::from_u64(194); + let __v_9: G = G::from_u64(51); + let __v_10: G = G::from_u64(98); + let __v_11: G = G::from_u64(111); + let __v_12: G = G::from_u64(78); + let __v_13: G = G::from_u64(246); + let __v_14: G = G::from_u64(253); + let __v_15: G = G::from_u64(216); + let __v_16: G = G::from_u64(243); + let __v_17: G = G::from_u64(110); + let __v_18: G = G::from_u64(190); + let __v_19: G = G::from_u64(151); + let __v_20: G = G::from_u64(201); + let __v_21: G = G::from_u64(72); + let __v_22: G = G::from_u64(173); + let __v_23: G = G::from_u64(234); + let __v_24: G = G::from_u64(238); + let __v_25: G = G::from_u64(40); + let __v_26: G = G::from_u64(61); + let __v_27: G = G::from_u64(158); + let __v_28: G = G::from_u64(212); + let __v_29: G = G::from_u64(87); + let __v_30: G = G::from_u64(47); + let __v_31: G = G::from_u64(219); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_473] = [__v_32]; record.function_queries[473].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -42167,38 +42167,38 @@ fn aiur_fn_474( unconstrained: bool, ) -> Result<[G; OUT_474], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(103); - let __v_1: G = G::from_u64(110); - let __v_2: G = G::from_u64(135); - let __v_3: G = G::from_u64(221); - let __v_4: G = G::from_u64(229); - let __v_5: G = G::from_u64(207); - let __v_6: G = G::from_u64(48); - let __v_7: G = G::from_u64(192); - let __v_8: G = G::from_u64(1); - let __v_9: G = G::from_u64(105); - let __v_10: G = G::from_u64(11); - let __v_11: G = G::from_u64(187); - let __v_12: G = G::from_u64(231); - let __v_13: G = G::from_u64(171); - let __v_14: G = G::from_u64(116); - let __v_15: G = G::from_u64(252); - let __v_16: G = G::from_u64(169); - let __v_17: G = G::from_u64(43); - let __v_18: G = G::from_u64(10); - let __v_19: G = G::from_u64(166); - let __v_20: G = G::from_u64(18); - let __v_21: G = G::from_u64(237); - let __v_22: G = G::from_u64(158); - let __v_23: G = G::from_u64(243); - let __v_24: G = G::from_u64(202); - let __v_25: G = G::from_u64(248); - let __v_26: G = G::from_u64(159); - let __v_27: G = G::from_u64(29); - let __v_28: G = G::from_u64(158); - let __v_29: G = G::from_u64(106); - let __v_30: G = G::from_u64(36); - let __v_31: G = G::from_u64(1); + let __v_0: G = G::from_u64(163); + let __v_1: G = G::from_u64(245); + let __v_2: G = G::from_u64(168); + let __v_3: G = G::from_u64(13); + let __v_4: G = G::from_u64(26); + let __v_5: G = G::from_u64(140); + let __v_6: G = G::from_u64(201); + let __v_7: G = G::from_u64(144); + let __v_8: G = G::from_u64(99); + let __v_9: G = G::from_u64(157); + let __v_10: G = G::from_u64(6); + let __v_11: G = G::from_u64(190); + let __v_12: G = G::from_u64(152); + let __v_13: G = G::from_u64(188); + let __v_14: G = G::from_u64(194); + let __v_15: G = G::from_u64(178); + let __v_16: G = G::from_u64(64); + let __v_17: G = G::from_u64(247); + let __v_18: G = G::from_u64(147); + let __v_19: G = G::from_u64(164); + let __v_20: G = G::from_u64(173); + let __v_21: G = G::from_u64(186); + let __v_22: G = G::from_u64(155); + let __v_23: G = G::from_u64(0); + let __v_24: G = G::from_u64(39); + let __v_25: G = G::from_u64(18); + let __v_26: G = G::from_u64(184); + let __v_27: G = G::from_u64(4); + let __v_28: G = G::from_u64(166); + let __v_29: G = G::from_u64(254); + let __v_30: G = G::from_u64(51); + let __v_31: G = G::from_u64(118); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_474] = [__v_32]; record.function_queries[474].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -42216,38 +42216,38 @@ fn aiur_fn_475( unconstrained: bool, ) -> Result<[G; OUT_475], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(204); - let __v_1: G = G::from_u64(225); - let __v_2: G = G::from_u64(37); - let __v_3: G = G::from_u64(101); - let __v_4: G = G::from_u64(11); - let __v_5: G = G::from_u64(119); - let __v_6: G = G::from_u64(93); - let __v_7: G = G::from_u64(25); - let __v_8: G = G::from_u64(16); - let __v_9: G = G::from_u64(239); - let __v_10: G = G::from_u64(234); - let __v_11: G = G::from_u64(145); - let __v_12: G = G::from_u64(159); - let __v_13: G = G::from_u64(92); - let __v_14: G = G::from_u64(242); - let __v_15: G = G::from_u64(114); - let __v_16: G = G::from_u64(247); - let __v_17: G = G::from_u64(217); - let __v_18: G = G::from_u64(231); - let __v_19: G = G::from_u64(177); - let __v_20: G = G::from_u64(29); - let __v_21: G = G::from_u64(98); - let __v_22: G = G::from_u64(52); - let __v_23: G = G::from_u64(61); - let __v_24: G = G::from_u64(109); - let __v_25: G = G::from_u64(10); - let __v_26: G = G::from_u64(88); - let __v_27: G = G::from_u64(156); - let __v_28: G = G::from_u64(223); - let __v_29: G = G::from_u64(174); - let __v_30: G = G::from_u64(255); - let __v_31: G = G::from_u64(33); + let __v_0: G = G::from_u64(46); + let __v_1: G = G::from_u64(163); + let __v_2: G = G::from_u64(101); + let __v_3: G = G::from_u64(57); + let __v_4: G = G::from_u64(172); + let __v_5: G = G::from_u64(26); + let __v_6: G = G::from_u64(142); + let __v_7: G = G::from_u64(0); + let __v_8: G = G::from_u64(34); + let __v_9: G = G::from_u64(169); + let __v_10: G = G::from_u64(13); + let __v_11: G = G::from_u64(139); + let __v_12: G = G::from_u64(112); + let __v_13: G = G::from_u64(221); + let __v_14: G = G::from_u64(182); + let __v_15: G = G::from_u64(244); + let __v_16: G = G::from_u64(219); + let __v_17: G = G::from_u64(70); + let __v_18: G = G::from_u64(176); + let __v_19: G = G::from_u64(206); + let __v_20: G = G::from_u64(25); + let __v_21: G = G::from_u64(239); + let __v_22: G = G::from_u64(228); + let __v_23: G = G::from_u64(225); + let __v_24: G = G::from_u64(196); + let __v_25: G = G::from_u64(71); + let __v_26: G = G::from_u64(146); + let __v_27: G = G::from_u64(254); + let __v_28: G = G::from_u64(237); + let __v_29: G = G::from_u64(157); + let __v_30: G = G::from_u64(126); + let __v_31: G = G::from_u64(143); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_475] = [__v_32]; record.function_queries[475].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -42363,38 +42363,38 @@ fn aiur_fn_478( unconstrained: bool, ) -> Result<[G; OUT_478], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(203); - let __v_1: G = G::from_u64(31); - let __v_2: G = G::from_u64(165); - let __v_3: G = G::from_u64(173); - let __v_4: G = G::from_u64(62); - let __v_5: G = G::from_u64(99); - let __v_6: G = G::from_u64(44); - let __v_7: G = G::from_u64(7); - let __v_8: G = G::from_u64(180); - let __v_9: G = G::from_u64(136); - let __v_10: G = G::from_u64(40); - let __v_11: G = G::from_u64(175); - let __v_12: G = G::from_u64(96); - let __v_13: G = G::from_u64(79); - let __v_14: G = G::from_u64(115); - let __v_15: G = G::from_u64(199); - let __v_16: G = G::from_u64(10); - let __v_17: G = G::from_u64(130); - let __v_18: G = G::from_u64(11); - let __v_19: G = G::from_u64(29); - let __v_20: G = G::from_u64(228); - let __v_21: G = G::from_u64(161); - let __v_22: G = G::from_u64(59); - let __v_23: G = G::from_u64(171); - let __v_24: G = G::from_u64(243); - let __v_25: G = G::from_u64(31); - let __v_26: G = G::from_u64(43); - let __v_27: G = G::from_u64(120); - let __v_28: G = G::from_u64(150); - let __v_29: G = G::from_u64(247); - let __v_30: G = G::from_u64(249); - let __v_31: G = G::from_u64(186); + let __v_0: G = G::from_u64(4); + let __v_1: G = G::from_u64(42); + let __v_2: G = G::from_u64(154); + let __v_3: G = G::from_u64(209); + let __v_4: G = G::from_u64(72); + let __v_5: G = G::from_u64(158); + let __v_6: G = G::from_u64(118); + let __v_7: G = G::from_u64(159); + let __v_8: G = G::from_u64(210); + let __v_9: G = G::from_u64(149); + let __v_10: G = G::from_u64(213); + let __v_11: G = G::from_u64(140); + let __v_12: G = G::from_u64(182); + let __v_13: G = G::from_u64(74); + let __v_14: G = G::from_u64(116); + let __v_15: G = G::from_u64(5); + let __v_16: G = G::from_u64(232); + let __v_17: G = G::from_u64(111); + let __v_18: G = G::from_u64(120); + let __v_19: G = G::from_u64(129); + let __v_20: G = G::from_u64(181); + let __v_21: G = G::from_u64(231); + let __v_22: G = G::from_u64(194); + let __v_23: G = G::from_u64(45); + let __v_24: G = G::from_u64(119); + let __v_25: G = G::from_u64(223); + let __v_26: G = G::from_u64(72); + let __v_27: G = G::from_u64(105); + let __v_28: G = G::from_u64(21); + let __v_29: G = G::from_u64(213); + let __v_30: G = G::from_u64(142); + let __v_31: G = G::from_u64(179); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_478] = [__v_32]; record.function_queries[478].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -42412,38 +42412,38 @@ fn aiur_fn_479( unconstrained: bool, ) -> Result<[G; OUT_479], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(234); - let __v_1: G = G::from_u64(117); - let __v_2: G = G::from_u64(97); - let __v_3: G = G::from_u64(219); - let __v_4: G = G::from_u64(37); - let __v_5: G = G::from_u64(170); - let __v_6: G = G::from_u64(36); - let __v_7: G = G::from_u64(206); - let __v_8: G = G::from_u64(72); - let __v_9: G = G::from_u64(28); - let __v_10: G = G::from_u64(227); - let __v_11: G = G::from_u64(233); - let __v_12: G = G::from_u64(238); - let __v_13: G = G::from_u64(141); - let __v_14: G = G::from_u64(112); - let __v_15: G = G::from_u64(77); - let __v_16: G = G::from_u64(72); - let __v_17: G = G::from_u64(61); - let __v_18: G = G::from_u64(217); - let __v_19: G = G::from_u64(5); - let __v_20: G = G::from_u64(103); - let __v_21: G = G::from_u64(87); - let __v_22: G = G::from_u64(218); - let __v_23: G = G::from_u64(126); - let __v_24: G = G::from_u64(218); - let __v_25: G = G::from_u64(36); - let __v_26: G = G::from_u64(181); - let __v_27: G = G::from_u64(17); - let __v_28: G = G::from_u64(27); - let __v_29: G = G::from_u64(229); - let __v_30: G = G::from_u64(155); - let __v_31: G = G::from_u64(194); + let __v_0: G = G::from_u64(125); + let __v_1: G = G::from_u64(175); + let __v_2: G = G::from_u64(170); + let __v_3: G = G::from_u64(21); + let __v_4: G = G::from_u64(30); + let __v_5: G = G::from_u64(217); + let __v_6: G = G::from_u64(11); + let __v_7: G = G::from_u64(10); + let __v_8: G = G::from_u64(178); + let __v_9: G = G::from_u64(127); + let __v_10: G = G::from_u64(2); + let __v_11: G = G::from_u64(121); + let __v_12: G = G::from_u64(185); + let __v_13: G = G::from_u64(56); + let __v_14: G = G::from_u64(58); + let __v_15: G = G::from_u64(184); + let __v_16: G = G::from_u64(171); + let __v_17: G = G::from_u64(232); + let __v_18: G = G::from_u64(96); + let __v_19: G = G::from_u64(44); + let __v_20: G = G::from_u64(102); + let __v_21: G = G::from_u64(53); + let __v_22: G = G::from_u64(202); + let __v_23: G = G::from_u64(25); + let __v_24: G = G::from_u64(31); + let __v_25: G = G::from_u64(40); + let __v_26: G = G::from_u64(203); + let __v_27: G = G::from_u64(183); + let __v_28: G = G::from_u64(171); + let __v_29: G = G::from_u64(166); + let __v_30: G = G::from_u64(175); + let __v_31: G = G::from_u64(221); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_479] = [__v_32]; record.function_queries[479].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -42461,38 +42461,38 @@ fn aiur_fn_480( unconstrained: bool, ) -> Result<[G; OUT_480], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(203); - let __v_1: G = G::from_u64(15); - let __v_2: G = G::from_u64(240); - let __v_3: G = G::from_u64(125); - let __v_4: G = G::from_u64(63); - let __v_5: G = G::from_u64(114); - let __v_6: G = G::from_u64(38); - let __v_7: G = G::from_u64(168); - let __v_8: G = G::from_u64(152); - let __v_9: G = G::from_u64(118); - let __v_10: G = G::from_u64(157); - let __v_11: G = G::from_u64(168); - let __v_12: G = G::from_u64(202); - let __v_13: G = G::from_u64(172); - let __v_14: G = G::from_u64(154); - let __v_15: G = G::from_u64(193); - let __v_16: G = G::from_u64(180); - let __v_17: G = G::from_u64(146); - let __v_18: G = G::from_u64(38); - let __v_19: G = G::from_u64(214); - let __v_20: G = G::from_u64(174); - let __v_21: G = G::from_u64(67); - let __v_22: G = G::from_u64(178); - let __v_23: G = G::from_u64(175); - let __v_24: G = G::from_u64(252); - let __v_25: G = G::from_u64(132); - let __v_26: G = G::from_u64(154); - let __v_27: G = G::from_u64(151); - let __v_28: G = G::from_u64(249); - let __v_29: G = G::from_u64(211); - let __v_30: G = G::from_u64(229); - let __v_31: G = G::from_u64(199); + let __v_0: G = G::from_u64(248); + let __v_1: G = G::from_u64(49); + let __v_2: G = G::from_u64(57); + let __v_3: G = G::from_u64(113); + let __v_4: G = G::from_u64(187); + let __v_5: G = G::from_u64(165); + let __v_6: G = G::from_u64(238); + let __v_7: G = G::from_u64(140); + let __v_8: G = G::from_u64(129); + let __v_9: G = G::from_u64(69); + let __v_10: G = G::from_u64(84); + let __v_11: G = G::from_u64(176); + let __v_12: G = G::from_u64(192); + let __v_13: G = G::from_u64(68); + let __v_14: G = G::from_u64(122); + let __v_15: G = G::from_u64(16); + let __v_16: G = G::from_u64(193); + let __v_17: G = G::from_u64(41); + let __v_18: G = G::from_u64(180); + let __v_19: G = G::from_u64(25); + let __v_20: G = G::from_u64(69); + let __v_21: G = G::from_u64(172); + let __v_22: G = G::from_u64(95); + let __v_23: G = G::from_u64(184); + let __v_24: G = G::from_u64(23); + let __v_25: G = G::from_u64(195); + let __v_26: G = G::from_u64(252); + let __v_27: G = G::from_u64(123); + let __v_28: G = G::from_u64(152); + let __v_29: G = G::from_u64(178); + let __v_30: G = G::from_u64(58); + let __v_31: G = G::from_u64(16); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_480] = [__v_32]; record.function_queries[480].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -42510,38 +42510,38 @@ fn aiur_fn_481( unconstrained: bool, ) -> Result<[G; OUT_481], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(121); - let __v_1: G = G::from_u64(165); - let __v_2: G = G::from_u64(126); - let __v_3: G = G::from_u64(127); - let __v_4: G = G::from_u64(141); - let __v_5: G = G::from_u64(16); - let __v_6: G = G::from_u64(48); - let __v_7: G = G::from_u64(251); - let __v_8: G = G::from_u64(149); - let __v_9: G = G::from_u64(255); - let __v_10: G = G::from_u64(79); - let __v_11: G = G::from_u64(25); - let __v_12: G = G::from_u64(234); - let __v_13: G = G::from_u64(33); - let __v_14: G = G::from_u64(44); - let __v_15: G = G::from_u64(154); - let __v_16: G = G::from_u64(224); - let __v_17: G = G::from_u64(17); - let __v_18: G = G::from_u64(99); - let __v_19: G = G::from_u64(143); - let __v_20: G = G::from_u64(247); - let __v_21: G = G::from_u64(52); - let __v_22: G = G::from_u64(156); - let __v_23: G = G::from_u64(74); - let __v_24: G = G::from_u64(105); - let __v_25: G = G::from_u64(45); - let __v_26: G = G::from_u64(223); - let __v_27: G = G::from_u64(94); - let __v_28: G = G::from_u64(142); - let __v_29: G = G::from_u64(7); - let __v_30: G = G::from_u64(26); - let __v_31: G = G::from_u64(212); + let __v_0: G = G::from_u64(122); + let __v_1: G = G::from_u64(236); + let __v_2: G = G::from_u64(194); + let __v_3: G = G::from_u64(6); + let __v_4: G = G::from_u64(113); + let __v_5: G = G::from_u64(77); + let __v_6: G = G::from_u64(100); + let __v_7: G = G::from_u64(181); + let __v_8: G = G::from_u64(23); + let __v_9: G = G::from_u64(122); + let __v_10: G = G::from_u64(203); + let __v_11: G = G::from_u64(117); + let __v_12: G = G::from_u64(58); + let __v_13: G = G::from_u64(40); + let __v_14: G = G::from_u64(94); + let __v_15: G = G::from_u64(103); + let __v_16: G = G::from_u64(10); + let __v_17: G = G::from_u64(145); + let __v_18: G = G::from_u64(138); + let __v_19: G = G::from_u64(26); + let __v_20: G = G::from_u64(201); + let __v_21: G = G::from_u64(254); + let __v_22: G = G::from_u64(143); + let __v_23: G = G::from_u64(87); + let __v_24: G = G::from_u64(70); + let __v_25: G = G::from_u64(15); + let __v_26: G = G::from_u64(119); + let __v_27: G = G::from_u64(111); + let __v_28: G = G::from_u64(23); + let __v_29: G = G::from_u64(183); + let __v_30: G = G::from_u64(173); + let __v_31: G = G::from_u64(194); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_481] = [__v_32]; record.function_queries[481].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -42657,38 +42657,38 @@ fn aiur_fn_484( unconstrained: bool, ) -> Result<[G; OUT_484], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(64); - let __v_1: G = G::from_u64(44); - let __v_2: G = G::from_u64(176); - let __v_3: G = G::from_u64(27); - let __v_4: G = G::from_u64(250); - let __v_5: G = G::from_u64(82); - let __v_6: G = G::from_u64(254); - let __v_7: G = G::from_u64(147); - let __v_8: G = G::from_u64(174); - let __v_9: G = G::from_u64(243); - let __v_10: G = G::from_u64(217); - let __v_11: G = G::from_u64(110); - let __v_12: G = G::from_u64(125); - let __v_13: G = G::from_u64(40); - let __v_14: G = G::from_u64(238); - let __v_15: G = G::from_u64(3); - let __v_16: G = G::from_u64(224); - let __v_17: G = G::from_u64(225); - let __v_18: G = G::from_u64(247); - let __v_19: G = G::from_u64(111); - let __v_20: G = G::from_u64(60); - let __v_21: G = G::from_u64(135); - let __v_22: G = G::from_u64(150); - let __v_23: G = G::from_u64(84); - let __v_24: G = G::from_u64(245); - let __v_25: G = G::from_u64(231); - let __v_26: G = G::from_u64(25); - let __v_27: G = G::from_u64(167); - let __v_28: G = G::from_u64(32); - let __v_29: G = G::from_u64(21); - let __v_30: G = G::from_u64(35); - let __v_31: G = G::from_u64(127); + let __v_0: G = G::from_u64(15); + let __v_1: G = G::from_u64(83); + let __v_2: G = G::from_u64(188); + let __v_3: G = G::from_u64(87); + let __v_4: G = G::from_u64(104); + let __v_5: G = G::from_u64(253); + let __v_6: G = G::from_u64(50); + let __v_7: G = G::from_u64(170); + let __v_8: G = G::from_u64(104); + let __v_9: G = G::from_u64(1); + let __v_10: G = G::from_u64(220); + let __v_11: G = G::from_u64(135); + let __v_12: G = G::from_u64(98); + let __v_13: G = G::from_u64(147); + let __v_14: G = G::from_u64(75); + let __v_15: G = G::from_u64(105); + let __v_16: G = G::from_u64(4); + let __v_17: G = G::from_u64(157); + let __v_18: G = G::from_u64(179); + let __v_19: G = G::from_u64(231); + let __v_20: G = G::from_u64(229); + let __v_21: G = G::from_u64(116); + let __v_22: G = G::from_u64(18); + let __v_23: G = G::from_u64(198); + let __v_24: G = G::from_u64(144); + let __v_25: G = G::from_u64(77); + let __v_26: G = G::from_u64(209); + let __v_27: G = G::from_u64(168); + let __v_28: G = G::from_u64(185); + let __v_29: G = G::from_u64(207); + let __v_30: G = G::from_u64(244); + let __v_31: G = G::from_u64(248); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_484] = [__v_32]; record.function_queries[484].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -42706,38 +42706,38 @@ fn aiur_fn_485( unconstrained: bool, ) -> Result<[G; OUT_485], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(191); - let __v_1: G = G::from_u64(254); - let __v_2: G = G::from_u64(215); - let __v_3: G = G::from_u64(205); - let __v_4: G = G::from_u64(73); - let __v_5: G = G::from_u64(104); - let __v_6: G = G::from_u64(184); - let __v_7: G = G::from_u64(252); - let __v_8: G = G::from_u64(37); - let __v_9: G = G::from_u64(30); - let __v_10: G = G::from_u64(210); - let __v_11: G = G::from_u64(74); - let __v_12: G = G::from_u64(156); - let __v_13: G = G::from_u64(37); - let __v_14: G = G::from_u64(61); - let __v_15: G = G::from_u64(160); - let __v_16: G = G::from_u64(2); - let __v_17: G = G::from_u64(21); - let __v_18: G = G::from_u64(144); - let __v_19: G = G::from_u64(35); - let __v_20: G = G::from_u64(84); - let __v_21: G = G::from_u64(194); - let __v_22: G = G::from_u64(148); - let __v_23: G = G::from_u64(79); - let __v_24: G = G::from_u64(89); - let __v_25: G = G::from_u64(232); - let __v_26: G = G::from_u64(21); - let __v_27: G = G::from_u64(56); - let __v_28: G = G::from_u64(220); - let __v_29: G = G::from_u64(26); - let __v_30: G = G::from_u64(226); - let __v_31: G = G::from_u64(199); + let __v_0: G = G::from_u64(14); + let __v_1: G = G::from_u64(95); + let __v_2: G = G::from_u64(112); + let __v_3: G = G::from_u64(239); + let __v_4: G = G::from_u64(218); + let __v_5: G = G::from_u64(5); + let __v_6: G = G::from_u64(152); + let __v_7: G = G::from_u64(24); + let __v_8: G = G::from_u64(40); + let __v_9: G = G::from_u64(25); + let __v_10: G = G::from_u64(161); + let __v_11: G = G::from_u64(10); + let __v_12: G = G::from_u64(35); + let __v_13: G = G::from_u64(135); + let __v_14: G = G::from_u64(150); + let __v_15: G = G::from_u64(70); + let __v_16: G = G::from_u64(45); + let __v_17: G = G::from_u64(235); + let __v_18: G = G::from_u64(192); + let __v_19: G = G::from_u64(95); + let __v_20: G = G::from_u64(64); + let __v_21: G = G::from_u64(136); + let __v_22: G = G::from_u64(129); + let __v_23: G = G::from_u64(23); + let __v_24: G = G::from_u64(209); + let __v_25: G = G::from_u64(25); + let __v_26: G = G::from_u64(105); + let __v_27: G = G::from_u64(146); + let __v_28: G = G::from_u64(185); + let __v_29: G = G::from_u64(66); + let __v_30: G = G::from_u64(63); + let __v_31: G = G::from_u64(174); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_485] = [__v_32]; record.function_queries[485].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained)); @@ -42755,38 +42755,38 @@ fn aiur_fn_486( unconstrained: bool, ) -> Result<[G; OUT_486], ExecError> { stacker::maybe_grow(64 * 1024, 4 * 1024 * 1024, || { - let __v_0: G = G::from_u64(9); - let __v_1: G = G::from_u64(181); - let __v_2: G = G::from_u64(251); - let __v_3: G = G::from_u64(47); - let __v_4: G = G::from_u64(45); - let __v_5: G = G::from_u64(132); - let __v_6: G = G::from_u64(81); - let __v_7: G = G::from_u64(104); - let __v_8: G = G::from_u64(159); - let __v_9: G = G::from_u64(132); - let __v_10: G = G::from_u64(39); - let __v_11: G = G::from_u64(17); - let __v_12: G = G::from_u64(116); - let __v_13: G = G::from_u64(74); - let __v_14: G = G::from_u64(39); - let __v_15: G = G::from_u64(191); - let __v_16: G = G::from_u64(229); - let __v_17: G = G::from_u64(92); - let __v_18: G = G::from_u64(111); - let __v_19: G = G::from_u64(213); - let __v_20: G = G::from_u64(1); - let __v_21: G = G::from_u64(15); - let __v_22: G = G::from_u64(210); - let __v_23: G = G::from_u64(74); - let __v_24: G = G::from_u64(144); - let __v_25: G = G::from_u64(132); - let __v_26: G = G::from_u64(83); - let __v_27: G = G::from_u64(147); - let __v_28: G = G::from_u64(199); - let __v_29: G = G::from_u64(7); - let __v_30: G = G::from_u64(224); - let __v_31: G = G::from_u64(164); + let __v_0: G = G::from_u64(206); + let __v_1: G = G::from_u64(19); + let __v_2: G = G::from_u64(124); + let __v_3: G = G::from_u64(206); + let __v_4: G = G::from_u64(76); + let __v_5: G = G::from_u64(26); + let __v_6: G = G::from_u64(73); + let __v_7: G = G::from_u64(50); + let __v_8: G = G::from_u64(58); + let __v_9: G = G::from_u64(120); + let __v_10: G = G::from_u64(143); + let __v_11: G = G::from_u64(22); + let __v_12: G = G::from_u64(119); + let __v_13: G = G::from_u64(169); + let __v_14: G = G::from_u64(214); + let __v_15: G = G::from_u64(161); + let __v_16: G = G::from_u64(212); + let __v_17: G = G::from_u64(169); + let __v_18: G = G::from_u64(54); + let __v_19: G = G::from_u64(17); + let __v_20: G = G::from_u64(21); + let __v_21: G = G::from_u64(136); + let __v_22: G = G::from_u64(8); + let __v_23: G = G::from_u64(53); + let __v_24: G = G::from_u64(137); + let __v_25: G = G::from_u64(186); + let __v_26: G = G::from_u64(171); + let __v_27: G = G::from_u64(43); + let __v_28: G = G::from_u64(172); + let __v_29: G = G::from_u64(1); + let __v_30: G = G::from_u64(16); + let __v_31: G = G::from_u64(140); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_mut(&32).ok_or(ExecError::InvalidMemorySize(32))?; if let Some(result) = __mq.get_mut(&__values[..]) { if !unconstrained { *result.multiplicity += G::ONE; } result.output[0] } else { let __ptr = G::from_usize(__mq.len()); __mq.insert(&__values[..], &[__ptr], G::from_bool(!unconstrained)); __ptr } }; let __ret: [G; OUT_486] = [__v_32]; record.function_queries[486].insert(&inp[..], &__ret[..], G::from_bool(!unconstrained));