From 423069821b1ef5e57f3898d5a44d0a28c40b3beb Mon Sep 17 00:00:00 2001 From: Alexander Flom Date: Wed, 4 Nov 2026 19:37:22 +0000 Subject: [PATCH] Bind owned research verification to candidate identity and contextual theorem types --- .github/lexlean-revision | 2 +- AGENTS.md | 23 +- README.md | 28 +- Rule30-Core.pdf | Bin 58973 -> 58973 bytes Rule30-Observations.pdf | Bin 273782 -> 273782 bytes Rule30-Paper.pdf | Bin 969094 -> 969094 bytes pdf-manifest.json | 10 +- rule30-api/lexlean.lock | 4 +- rule30-api/lexlean.toml | 4 +- rule30-api/model/dependencies.toml | 2 +- rule30-api/model/standards.toml | 2 +- rule30-api/production/request.json | 30 +- rule30-api/production/research-request.json | 6 +- rule30-api/src/ArtifactIdentity.lex.tex | 113 ++++++ rule30-api/src/ArtifactIdentityTraces.lex.tex | 90 +++++ rule30-api/src/BindingFixture.lex.tex | 30 ++ rule30-api/src/CandidateBinding.lex.tex | 140 ++++++++ rule30-api/src/CandidateBindingTraces.lex.tex | 219 ++++++++++++ rule30-api/src/CoreBinding.lex.tex | 240 +++++++++++++ rule30-api/src/CoreBindingTraces.lex.tex | 273 +++++++++++++++ rule30-api/src/JsonCanonical.lex.tex | 160 +++++++++ rule30-api/src/JsonCanonicalTraces.lex.tex | 331 ++++++++++++++++++ rule30-api/src/R30.lex.tex | 4 +- rule30-api/src/Research.lex.tex | 2 +- rule30-api/src/ResearchCatalog.lex.tex | 11 +- rule30-api/src/ResearchExecution.lex.tex | 4 +- rule30-api/src/ResearchProof.lex.tex | 122 +++++++ rule30-api/src/ResearchProofTraces.lex.tex | 197 +++++++++++ rule30-api/src/ResearchRunner.lex.tex | 107 ++++-- rule30-api/src/ResearchRunnerTraces.lex.tex | 110 +++--- rule30-api/src/ResearchTraces.lex.tex | 2 +- rule30-api/src/ResearchVerification.lex.tex | 4 +- rule30-api/src/Standards.lex.tex | 4 +- rule30-lexlean/Core.pdf | Bin 58973 -> 58973 bytes rule30-lexlean/lexlean.lock | 2 +- rule30-lexlean/pdf/Core.pdf | Bin 58973 -> 58973 bytes rule30-paper/Observations.pdf | Bin 273782 -> 273782 bytes rule30-paper/Paper.pdf | Bin 969094 -> 969094 bytes rule30-paper/lexlean.lock | 2 +- rule30-paper/pdf/Observations.pdf | Bin 273782 -> 273782 bytes rule30-paper/pdf/Paper.pdf | Bin 969094 -> 969094 bytes tools/r30/production.py | 4 +- 42 files changed, 2156 insertions(+), 126 deletions(-) create mode 100644 rule30-api/src/ArtifactIdentity.lex.tex create mode 100644 rule30-api/src/ArtifactIdentityTraces.lex.tex create mode 100644 rule30-api/src/BindingFixture.lex.tex create mode 100644 rule30-api/src/CandidateBinding.lex.tex create mode 100644 rule30-api/src/CandidateBindingTraces.lex.tex create mode 100644 rule30-api/src/CoreBinding.lex.tex create mode 100644 rule30-api/src/CoreBindingTraces.lex.tex create mode 100644 rule30-api/src/JsonCanonical.lex.tex create mode 100644 rule30-api/src/JsonCanonicalTraces.lex.tex create mode 100644 rule30-api/src/ResearchProof.lex.tex create mode 100644 rule30-api/src/ResearchProofTraces.lex.tex diff --git a/.github/lexlean-revision b/.github/lexlean-revision index 7231db5..954a4a8 100644 --- a/.github/lexlean-revision +++ b/.github/lexlean-revision @@ -1 +1 @@ -1cf52d6e92808f1ddc1a1b2eb9f37036fc6c0e6d +2aced32e0f9c1ca0cf160f150a04819dedb4fc04 diff --git a/AGENTS.md b/AGENTS.md index 222ed34..3df1efb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -106,12 +106,14 @@ the registers. Never add a `.py` file or a shell script, and never extend `tools `scripts/*.py` or the shell glue: the pre-commit authoring policy refuses a commit that adds a Python file or grows the Python it touches, with no bypass. -At the pinned compiler (the release/v0.5 development line, revision 1cf52d6) a production root compiles to a Rust library -with no `main` and no effects beyond allocation, overflow and recursion: no files, processes, -arguments or exit codes. An executable entry for a root that reads files and runs `lake`, -`lexlean` and `git` is LexLean issue #271 (the effects boundary). So the logic moves into LexLean -now, as authored modules with certified roots, and the remaining Python and shell glue is deleted -as the effect boundary is implemented on our v0.5-based LexLean branch. The vendored LexLeanStd.Host types are the actual PR #389 interface ported to v0.5 in upstream PR #396; they are imported directly rather than mirrored in Rule30Api.Host. A capability LexLean, PrismPM or +The development compiler pinned in `.github/lexlean-revision` follows `release/v0.5`. +LexLean PR #396 supplies the actual PR #389 `LexLeanStd.Host` interface; PR #439 +adds a generated executable entry for a root with the native Host step signature, +explicit file/process effects, and owned child cleanup. The API imports these +types directly; `Rule30Api.Host` is the application harness. Use this compiler +to complete the native application and remove legacy glue as each replacement +passes the gate. Ordinary pure roots still export as libraries. Issue #271 does +not prevent work on this development branch. A capability LexLean, PrismPM or prism-stdlib cannot yet express is an upstream issue for those projects, never a reason for new Python or shell. The logic already moved: the command surface, the register, the converter (`rule30-api/src/Convert.lex.tex`), the engine's learning rule and schedule @@ -125,10 +127,15 @@ proof receipt. Report review must establish the exact contextual sequent, kernel replay, axiom policy and snapshot before returning a checked answer. `ResearchVerification` owns a fixed LexLean verification job and the ordered command/attestation reads. Its accepted outcome is validated report data; -promotion still requires binding to the generated candidate's exact statement. +`ResearchProof` promotes it only after `CandidateBinding` recomputes the candidate +semantic identity and compares the audited declaration's actual type with the +requested contextual goal. `ResearchRunner.Event.reviewed` refuses checked +answers; submit proof jobs through `Event.proof`. The binding schema encodes the +inspected source type and closed target as core arenas in the sequent; source +inspection must establish their origin and snapshot before dispatch. Maintenance reports have a separate result kind. Cancellation consumes the outstanding host reply before issuing stop; failed cleanup retains ownership -and halts dispatch. The generated driver, strategy planner, report integration and +and halts dispatch. Native application wiring, source inspection, strategy planner and publication path still need completion; these modules do not replace the legacy engine yet. Add every new application or library module and its modeled features to `ResearchCatalog`, and add behavioral evidence for the capability; diff --git a/README.md b/README.md index e40a0dd..f54fd02 100644 --- a/README.md +++ b/README.md @@ -289,18 +289,21 @@ writes to `dist/`; the pre-commit gate publishes those outputs to all tracked PD Pushing any version tag `v*` (e.g. `v0.1`) triggers [`.github/workflows/release.yml`](.github/workflows/release.yml), which builds `rule30-core-lean`, `Rule30PrizeKit/lean`, and `rule30-bridge`, compiles `Rule30-Paper.pdf` and `Rule30-Core.pdf`, packages the verified LexLean bundles, and attaches all PDFs and LexLean artifacts to the GitHub Release. The compiler development pin follows LexLean `release/v0.5` through -[the Host interface contribution](https://github.com/UOR-Foundation/LexLean/pull/396). +[the Host interface contribution](https://github.com/UOR-Foundation/LexLean/pull/396) +and [native command execution](https://github.com/UOR-Foundation/LexLean/pull/439). That source package ports the actual interface from [LexLean #389](https://github.com/UOR-Foundation/LexLean/pull/389) to v0.5, -including fallible startup paths, timed child waits and byte output. +including fallible startup paths, timed child waits and byte output. Native Host +step roots can export a generated executable with explicit file/process effects +and child cleanup; pure roots remain libraries. The API imports `LexLeanStd.Host` from the pinned source package; its local `Host` module contains only the application harness. The attention catalog -covers all 49 application and library modules. `ResearchRunner` connects the +covers all 60 application and library modules. `ResearchRunner` connects the controller to the local-tool supervisor in `ResearchExecution`: it binds each job to the outstanding request, drains cancelled host requests, preserves child ownership on cleanup failure, and requires report review after a successful -process exit. Checked proof reports must name the exact sequent; maintenance -reports must cover the requested sources. Dependency changes invalidate both +process exit. External checked answers are refused: proof jobs use the owned +`ResearchProof` verifier. Maintenance reports must cover the requested sources. Dependency changes invalidate both active work and remembered evidence. The `Json` and `VerificationReport` modules decode tool reports with explicit @@ -309,12 +312,19 @@ kernel-replay records. The decoder recomputes the attestation content identity; `ResearchVerification` owns the fixed local verify job, reads its command output before the matching attestation, and returns a receipt only after decoding it. Cancellation drains pending reads; failed process cleanup retains ownership. -The receipt still needs binding to the generated candidate's exact statement. +`ResearchProof` then binds the receipt to the candidate's actual native declaration. +`ArtifactIdentity` recomputes the semantic identity from canonical linked IR and +lexicon closure; `CandidateBinding` selects the unique audited theorem and +`CoreBinding` compares its type with the selected source premise, closed over +preceding binders only. Refutation negates the premise inside that context. +Binder names may differ; variables, universes, constants and binder visibility +must agree. The runner retains verifier ownership through cancellation and +blocks dispatch after failed cleanup. UTF-8 chunk, parser-state and SHA-256 block facts keep the complete report acceptance proof compositional; lifecycle traces reuse that checked receipt and verify rejection, cancellation, ownership and terminal behavior. -The generated executable driver, strategy candidate construction, runner integration and -durable publication are still required for the new runner to replace the legacy -engine. Its exported functions are currently pure libraries. CI and runtime +Native application wiring, source inspection into the binding schema, +strategy candidate construction and durable publication are still required for +the new runner to replace the legacy engine. CI and runtime use deterministic local tools and no remote models. diff --git a/Rule30-Core.pdf b/Rule30-Core.pdf index 21a5f52f3cd68b4bfd885838ba7f3fc52ac14e5d..3ec8bc1457315135e113d0f140a844f63691320f 100644 GIT binary patch delta 124 zcmcb6hWYLp<_)uNs+brVm{^(^M`?2D`{t*(B$lKqXt-Dz85o%v8X7<)H}Ah$!s%?` t;%aW_;$moQWNBt*?rdOYVPbA!VCrV-Y+&hZVQOTjU_(gB=Ca4nnE?HwBDDYj delta 124 zcmcb6hWYLp<_)uNsu&xZ8yK3HM`?2D`{t*(B$lKqXt-Dz85o%v8X7<)H}Ah$!s+Z} tX=!TeVrXLF>|$=@WNKkx;^^k=Y~tu>;$-4%=ICgrU_(gB=Ca4nnE(%YBUu0d diff --git a/Rule30-Observations.pdf b/Rule30-Observations.pdf index 71fbe00cb1f08f3c712d20e4e6b560ceeaec8bd0..222151ea73ce4adc2d995a3e40862e4563d4c3f0 100644 GIT binary patch delta 118 zcmex%OW@lrfrb{w7N!>FEi6$Y>?TGACYB}^(-TEl#9*B5bs{V~c$}S`42>)tfwCs1 lriNw~j;3Z##%>1Y&aM`Q1}28iCUy!ogp_QrRAl+f4FHP(9%=vp delta 118 zcmex%OW@lrfrb{w7N!>FEi6$Y?8b)X28O1_(-TEl#9*B5bs{V~c$`g*%?*rqoLr5K%}h;Q+$>$4EX|FLU7hR{YzQgYUa83Pmm2_;A0F%g diff --git a/Rule30-Paper.pdf b/Rule30-Paper.pdf index 53c966c3ab5b635210814f320edc65c3305ea83c..fb007df279306a6bb33bf188dd747d0d3698363a 100644 GIT binary patch delta 154 zcmZphY~425x}k-!g{g(Pg{6hHg{_6Xg` 0x | Nat.succ more => (Json::append (bigEndian more (prim quotient value 256 0 : Nat)) (Json::byte (prim remainder value 256 0 : Nat)))), + axioms: [], + recursive_argument: count, + executable: true +} + +definition{ + name: frame, + parameters: [label : Bytes, value : Bytes], + result: Bytes, + body: (Json::append (bigEndian 4 (prim length label : Nat)) (Json::append label (Json::append (bigEndian 8 (prim length value : Nat)) value))), + axioms: [], + executable: true +} + +definition{ + name: hexFrom, + parameters: [source : Bytes, position : Nat, remaining : Nat, output : Bytes], + result: (Option Bytes), + body: (match remaining | Nat.zero => (ctor Option.some [Bytes] output) | Nat.succ more => (match (Json::hexFrom source position 2 0) | Option.none => (ctor Option.none [Bytes]) | Option.some value => (hexFrom source (position + 2) more (Json::append output (Json::byte value))))), + axioms: [], + recursive_argument: remaining, + executable: true +} + +definition{ + name: lowerHex, + parameters: [source : Bytes, position : Nat, remaining : Nat], + result: Bool, + body: (match remaining | Nat.zero => true | Nat.succ more => (match (prim index source position : (Option UInt8)) | Option.none => false | Option.some value => (((Toml::between value (48 : UInt8) (57 : UInt8)) || (Toml::between value (97 : UInt8) (102 : UInt8))) && (lowerHex source (position + 1) more)))), + axioms: [propext], + recursive_argument: remaining, + executable: true +} + +definition{ + name: rawDigest, + parameters: [source : Bytes], + result: (Option Bytes), + body: (if (((prim length source : Nat) =? 64) && (lowerHex source 0 64)) then (hexFrom source 0 32 0x) else (ctor Option.none [Bytes])), + axioms: [propext], + executable: true +} + +definition{ + name: semanticMessage, + parameters: [compiler : Bytes, linked : Bytes, closure : Bytes], + result: Bytes, + body: (Json::append 0x6c65786c65616e2d73656d616e7469632d763100 (Json::append (frame 0x636f6d70696c65722d73656d616e74696373 compiler) (Json::append (frame 0x6c616e6775616765 0x312e32) (Json::append (frame 0x746f6f6c636861696e 0x6c65616e70726f7665722f6c65616e343a76342e33322e31) (Json::append (frame 0x6c696e6b65642d6972 linked) (frame 0x6c657869636f6e2d636c6f73757265 closure)))))), + axioms: [], + executable: true +} + +definition{ + name: semantic, + parameters: [compiler : Bytes, linked : Json::Value, closure : Json::Value, maxBytes : Nat, maxSteps : Nat], + result: (Option Bytes), + body: (match (rawDigest compiler) | Option.none => (ctor Option.none [Bytes]) | Option.some digest => (match (JsonCanonical::encode linked maxBytes maxSteps) | Option.none => (ctor Option.none [Bytes]) | Option.some ir => (match (JsonCanonical::encode closure maxBytes maxSteps) | Option.none => (ctor Option.none [Bytes]) | Option.some lexicon => (ctor Option.some [Bytes] (LexLeanStd.Sha256::sha256Hex (semanticMessage digest ir lexicon)))))), + axioms: [Quot.sound, propext], + executable: true +} + +definition{ + name: buildMessage, + parameters: [source : Bytes, meaning : Bytes], + result: Bytes, + body: (Json::append 0x6c65786c65616e2d6275696c642d763100 (Json::append (frame 0x736f757263652d6964 source) (frame 0x73656d616e7469632d6964 meaning))), + axioms: [], + executable: true +} + +definition{ + name: build, + parameters: [source : Bytes, meaning : Bytes], + result: (Option Bytes), + body: (match (rawDigest source) | Option.none => (ctor Option.none [Bytes]) | Option.some a => (match (rawDigest meaning) | Option.none => (ctor Option.none [Bytes]) | Option.some b => (ctor Option.some [Bytes] (LexLeanStd.Sha256::sha256Hex (buildMessage a b))))), + axioms: [Quot.sound, propext], + executable: true +} + +definition{ + name: features, + parameters: [], + result: (List String), + body: (cons "lexlean-content-framing" (cons "lowercase-raw-digests" (cons "canonical-semantic-identity" (cons "source-semantic-build-identity" (nil String))))), + axioms: [], + executable: true +} +\end{semanticmodule} +\end{lexlean} diff --git a/rule30-api/src/ArtifactIdentityTraces.lex.tex b/rule30-api/src/ArtifactIdentityTraces.lex.tex new file mode 100644 index 0000000..bdfeb83 --- /dev/null +++ b/rule30-api/src/ArtifactIdentityTraces.lex.tex @@ -0,0 +1,90 @@ +\begin{lexlean}{ArtifactIdentityTraces} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\importmodule{Json} +\importmodule{ArtifactIdentity} +\importmodule{Toml} +\title{Boolean} +\begin{semanticmodule} + +definition{ + name: hasBytes, + parameters: [result : (Option Bytes), expectedBytes : Bytes], + result: Bool, + body: (match result | Option.none => false | Option.some actual => (Toml::sameBytes actual expectedBytes)), + axioms: [] +} + +theorem{ + name: frameLengthAndBytes, + parameters: [], + statement: ((Toml::sameBytes (ArtifactIdentity::frame 0x70617468 0xc3a9) 0x00000004706174680000000000000002c3a9) = true), + proof: decide{}, + axioms: [] +} + +theorem{ + name: rawBytes, + parameters: [], + statement: ((hasBytes (ArtifactIdentity::rawDigest 0x31313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131) 0x1111111111111111111111111111111111111111111111111111111111111111) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: uppercase, + parameters: [], + statement: ((ArtifactIdentity::rawDigest 0x41414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: short, + parameters: [], + statement: ((ArtifactIdentity::rawDigest 0x3131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: badDigit, + parameters: [], + statement: ((ArtifactIdentity::rawDigest 0x67676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: buildFraming, + parameters: [], + statement: ((Toml::sameBytes (ArtifactIdentity::buildMessage 0x1111111111111111111111111111111111111111111111111111111111111111 0x2222222222222222222222222222222222222222222222222222222222222222) 0x6c65786c65616e2d6275696c642d76310000000009736f757263652d6964000000000000002011111111111111111111111111111111111111111111111111111111111111110000000b73656d616e7469632d696400000000000000202222222222222222222222222222222222222222222222222222222222222222) = true), + proof: decide{}, + axioms: [] +} + +theorem{ + name: buildHash, + parameters: [], + statement: ((hasBytes (ArtifactIdentity::build 0x31313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131 0x32323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232) 0x62346634333933333037373939396236636337316134343163396364313237353063386162356235623031303164366536663737366231393133303636303733) = true), + proof: decide{}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: semanticFraming, + parameters: [], + statement: ((Toml::sameBytes (ArtifactIdentity::semanticMessage 0x1111111111111111111111111111111111111111111111111111111111111111 0x7b7d 0x5b5d) 0x6c65786c65616e2d73656d616e7469632d76310000000012636f6d70696c65722d73656d616e7469637300000000000000201111111111111111111111111111111111111111111111111111111111111111000000086c616e67756167650000000000000003312e3200000009746f6f6c636861696e00000000000000186c65616e70726f7665722f6c65616e343a76342e33322e31000000096c696e6b65642d697200000000000000027b7d0000000f6c657869636f6e2d636c6f7375726500000000000000025b5d) = true), + proof: decide{}, + axioms: [] +} + +theorem{ + name: semanticHash, + parameters: [], + statement: ((hasBytes (ArtifactIdentity::semantic 0x31313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131 (ctor Json::Value.object (nil (Bytes * Json::Value))) (ctor Json::Value.array (nil Json::Value)) 512 128) 0x37323161396339616232336430333831366437343361356662313731356130323530616432366235306439336636303561623366653333643631646663326265) = true), + proof: decide{}, + axioms: [Quot.sound, propext] +} +\end{semanticmodule} +\end{lexlean} diff --git a/rule30-api/src/BindingFixture.lex.tex b/rule30-api/src/BindingFixture.lex.tex new file mode 100644 index 0000000..93704bb --- /dev/null +++ b/rule30-api/src/BindingFixture.lex.tex @@ -0,0 +1,30 @@ +\begin{lexlean}{BindingFixture} +\useglossary{lexlean.std.nat@1.2.0} +\title{Natural number addition} +\begin{coremodule} +imports [Init] + +theorem Rule30Api.BindingFixture.reflexive : @6 := @10 { + class: false, + generated: false, + policy: none{}, + transparency: semireducible +} +theorem Rule30Api.BindingFixture.context : @14 := @16 { + class: false, + generated: false, + policy: none{}, + transparency: semireducible +} + +@0 := Nat +@1 := #0 +@5 := Eq.{1} @0 @1 @1 +@6 := (n : @0) -> @5 +@10 := fun (n : @0) => Eq.refl.{1} @0 @1 +@11 := True +@12 := True.intro +@14 := (n : @0) -> (h : @5) -> @11 +@16 := fun (n : @0) => fun (h : @5) => @12 +\end{coremodule} +\end{lexlean} diff --git a/rule30-api/src/CandidateBinding.lex.tex b/rule30-api/src/CandidateBinding.lex.tex new file mode 100644 index 0000000..7f16521 --- /dev/null +++ b/rule30-api/src/CandidateBinding.lex.tex @@ -0,0 +1,140 @@ +\begin{lexlean}{CandidateBinding} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\importmodule{Json} +\importmodule{Toml} +\importmodule{JsonCanonical} +\importmodule{ArtifactIdentity} +\importmodule{CoreBinding} +\importmodule{Research} +\importmodule{Hypotheses} +\importmodule{VerificationReport} +\title{Boolean} +\begin{semanticmodule} + +definition{ + name: contract, + parameters: [], + result: String, + body: "Candidate binding consumes the linked IR and lexicon closure of the owned verification job. Their canonical semantic digest must equal the pinned verified digest. The audited module and theorem must select exactly one proof-bearing native declaration; its actual type is compared with the requested contextual goal. In this schema, sequent.telescope is a JSON object with nodes and root for the inspected source type; sequent.target is the same representation of the premise closed over its preceding binders. Inspection must bind these to the source origin and snapshot before dispatch. Proving uses that closure; refuting negates the premise inside its context. This function is not an authority for externally supplied receipts; ResearchProof owns the verify process and report reads before calling it.", + axioms: [], + executable: true +} + +structure{ + name: Input, + type_parameters: [], + parameters: [], + fields: [{name: linked, type: Json::Value}, {name: lexicon, type: Json::Value}] +} + +definition{ + name: array, + parameters: [value : Json::Value], + result: (Option (List Json::Value)), + body: (match value | Json::Value.array items => (ctor Option.some [(List Json::Value)] items) | Json::Value.null => (ctor Option.none [(List Json::Value)]) | Json::Value.boolean b => (ctor Option.none [(List Json::Value)]) | Json::Value.number n => (ctor Option.none [(List Json::Value)]) | Json::Value.string t => (ctor Option.none [(List Json::Value)]) | Json::Value.object o => (ctor Option.none [(List Json::Value)])), + axioms: [], + executable: true +} + +definition{ + name: unique, + parameters: [items : (List Json::Value), key : Bytes, value : Bytes, found : (Option Json::Value)], + result: (Option Json::Value), + body: (match items | List.nil => found | List.cons head tail => (if (Toml::sameBytes (VerificationReport::bytes (CoreBinding::get head key)) value) then (match found | Option.some previous => (ctor Option.none [Json::Value]) | Option.none => (unique tail key value (ctor Option.some [Json::Value] head))) else (unique tail key value found))), + axioms: [], + recursive_argument: items, + executable: true +} + +definition{ + name: named, + parameters: [items : Json::Value, key : Bytes, value : Bytes], + result: (Option Json::Value), + body: (match (array items) | Option.none => (ctor Option.none [Json::Value]) | Option.some entries => (unique entries key value (ctor Option.none [Json::Value]))), + axioms: [], + executable: true +} + +definition{ + name: goal, + parameters: [value : Json::Value], + result: (Option CoreBinding::Goal), + body: (match (array (CoreBinding::get value 0x6e6f646573)) | Option.none => (ctor Option.none [CoreBinding::Goal]) | Option.some nodes => (match (Json::natural (CoreBinding::get value 0x726f6f74) (prim length nodes : Nat)) | Option.none => (ctor Option.none [CoreBinding::Goal]) | Option.some index => (if (index (ctor Option.none [CoreBinding::Goal]) | Result.ok value => (goal value)), + axioms: [propext], + executable: true +} + +definition{ + name: selected, + parameters: [request : Research::Request, maxBytes : Nat, maxDepth : Nat, maxSteps : Nat], + result: (Option CoreBinding::Goal), + body: (let sequent : Research::Sequent := (project (project request task) sequent); (if ((Research::contextual sequent) && (Hypotheses::memberBytes (project sequent origin) (project (project request task) sources))) then (match (parseGoal (project sequent telescope) maxBytes maxDepth) | Option.none => (ctor Option.none [CoreBinding::Goal]) | Option.some source => (match (CoreBinding::premise source (project sequent premise) maxBytes maxSteps) | Option.none => (ctor Option.none [CoreBinding::Goal]) | Option.some expected => (match (parseGoal (project sequent target) maxBytes maxDepth) | Option.none => (ctor Option.none [CoreBinding::Goal]) | Option.some target => (if (CoreBinding::sameType expected target maxBytes maxSteps) then (match (project (project request task) purpose) | Research::Purpose.prove => (ctor Option.some [CoreBinding::Goal] expected) | Research::Purpose.refute => (CoreBinding::refutation source (project sequent premise) maxBytes maxSteps) | Research::Purpose.inspect => (ctor Option.none [CoreBinding::Goal]) | Research::Purpose.maintain => (ctor Option.none [CoreBinding::Goal])) else (ctor Option.none [CoreBinding::Goal]))))) else (ctor Option.none [CoreBinding::Goal]))), + axioms: [propext], + executable: true +} + +definition{ + name: coreGoal, + parameters: [core : Json::Value, theorem : Bytes], + result: (Option CoreBinding::Goal), + body: (if ((Toml::sameBytes (VerificationReport::bytes (CoreBinding::get core 0x73706563)) 0x6c65786c65616e2f636f72652d6d6f64756c652f31) || (Toml::sameBytes (VerificationReport::bytes (CoreBinding::get core 0x73706563)) 0x6c65786c65616e2f636f72652d6d6f64756c652f32)) then (match (named (CoreBinding::get core 0x6465636c61726174696f6e73) 0x6e616d65 theorem) | Option.none => (ctor Option.none [CoreBinding::Goal]) | Option.some declaration => (if (Toml::sameBytes (VerificationReport::bytes (CoreBinding::get declaration 0x6b696e64)) 0x7468656f72656d) then (match (array (CoreBinding::get core 0x6e6f646573)) | Option.none => (ctor Option.none [CoreBinding::Goal]) | Option.some nodes => (match (Json::natural (CoreBinding::get declaration 0x76616c7565) (prim length nodes : Nat)) | Option.none => (ctor Option.none [CoreBinding::Goal]) | Option.some proof => (if (proof (ctor Option.none [CoreBinding::Goal]) | Option.some index => (if (index (ctor Option.none [CoreBinding::Goal]) | Option.some owner => (match (Json::parse (VerificationReport::bytes (CoreBinding::get owner 0x636f7265)) maxBytes maxDepth) | Result.error problem => (ctor Option.none [CoreBinding::Goal]) | Result.ok core => (coreGoal core theorem))) else (ctor Option.none [CoreBinding::Goal]))), + axioms: [propext], + executable: true +} + +definition{ + name: matches, + parameters: [pins : VerificationReport::Pins, input : Input, maxBytes : Nat, maxDepth : Nat, maxSteps : Nat], + result: Bool, + body: ((VerificationReport::validPins pins) && (match (ArtifactIdentity::semantic (project pins compiler) (project input linked) (project input lexicon) maxBytes maxSteps) | Option.none => false | Option.some meaning => ((Toml::sameBytes meaning (project pins semantic)) && (match (selected (project pins request) maxBytes maxDepth maxSteps) | Option.none => false | Option.some expected => (match (candidate input (project pins module) (project pins theorem) maxBytes maxDepth) | Option.none => false | Option.some actual => (CoreBinding::sameType expected actual maxBytes maxSteps)))))), + axioms: [Quot.sound, propext], + executable: true +} + +definition{ + name: receiptMatches, + parameters: [pins : VerificationReport::Pins, receipt : VerificationReport::Receipt], + result: Bool, + body: ((Research::sameRequest (project pins request) (project receipt request)) && ((Toml::sameBytes (project pins source) (project receipt source)) && ((Toml::sameBytes (project pins semantic) (project receipt semantic)) && ((Toml::sameBytes (project pins module) (project receipt module)) && ((Toml::sameBytes (project pins theorem) (project receipt theorem)) && ((Research::axiomsAllowed (project receipt axioms)) && (match (ArtifactIdentity::build (project pins source) (project pins semantic)) | Option.none => false | Option.some identity => (Toml::sameBytes identity (project receipt build))))))))), + axioms: [Quot.sound, propext], + executable: true +} + +definition{ + name: accept, + parameters: [pins : VerificationReport::Pins, input : Input, receipt : VerificationReport::Receipt, maxBytes : Nat, maxDepth : Nat, maxSteps : Nat], + result: (Option Research::Answer), + body: (if ((receiptMatches pins receipt) && (matches pins input maxBytes maxDepth maxSteps)) then (ctor Option.some [Research::Answer] (record Research::Answer {request := (project pins request), result := (ctor Research::ResultKind.checked (project (project (project pins request) task) sequent) (project receipt theorem) (project receipt axioms))})) else (ctor Option.none [Research::Answer])), + axioms: [Quot.sound, propext], + executable: true +} + +definition{ + name: features, + parameters: [], + result: (List String), + body: (cons "candidate-semantic-hash" (cons "unique-audited-declaration" (cons "proof-bearing-native-type" (cons "source-premise-reconstruction" (cons "contextual-refutation-binding" (cons "verified-build-recipe" (nil String))))))), + axioms: [], + executable: true +} +\end{semanticmodule} +\end{lexlean} diff --git a/rule30-api/src/CandidateBindingTraces.lex.tex b/rule30-api/src/CandidateBindingTraces.lex.tex new file mode 100644 index 0000000..c48392e --- /dev/null +++ b/rule30-api/src/CandidateBindingTraces.lex.tex @@ -0,0 +1,219 @@ +\begin{lexlean}{CandidateBindingTraces} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\importmodule{BindingFixture} +\importmodule{Json} +\importmodule{CoreBinding} +\importmodule{CandidateBinding} +\importmodule{Research} +\title{Boolean} +\begin{semanticmodule} + +definition{ + name: core, + parameters: [], + result: Json::Value, + body: (ctor Json::Value.object (cons (0x6465636c61726174696f6e73, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x636c617373, (ctor Json::Value.boolean false)) (cons (0x67656e657261746564, (ctor Json::Value.boolean false)) (cons (0x6b696e64, (ctor Json::Value.string 0x7468656f72656d)) (cons (0x6c6576656c73, (ctor Json::Value.array (nil Json::Value))) (cons (0x6e616d65, (ctor Json::Value.string 0x52756c6533304170692e42696e64696e67466978747572652e7265666c6578697665)) (cons (0x706f6c696379, (ctor Json::Value.object (cons (0x6b696e64, (ctor Json::Value.string 0x6e6f6e65)) (nil (Bytes * Json::Value))))) (cons (0x7472616e73706172656e6379, (ctor Json::Value.string 0x73656d69726564756369626c65)) (cons (0x74797065, (ctor Json::Value.number 0x36)) (cons (0x76616c7565, (ctor Json::Value.number 0x3130)) (nil (Bytes * Json::Value)))))))))))) (cons (ctor Json::Value.object (cons (0x636c617373, (ctor Json::Value.boolean false)) (cons (0x67656e657261746564, (ctor Json::Value.boolean false)) (cons (0x6b696e64, (ctor Json::Value.string 0x7468656f72656d)) (cons (0x6c6576656c73, (ctor Json::Value.array (nil Json::Value))) (cons (0x6e616d65, (ctor Json::Value.string 0x52756c6533304170692e42696e64696e67466978747572652e636f6e74657874)) (cons (0x706f6c696379, (ctor Json::Value.object (cons (0x6b696e64, (ctor Json::Value.string 0x6e6f6e65)) (nil (Bytes * Json::Value))))) (cons (0x7472616e73706172656e6379, (ctor Json::Value.string 0x73656d69726564756369626c65)) (cons (0x74797065, (ctor Json::Value.number 0x3134)) (cons (0x76616c7565, (ctor Json::Value.number 0x3136)) (nil (Bytes * Json::Value)))))))))))) (nil Json::Value))))) (cons (0x696d706f727473, (ctor Json::Value.array (cons (ctor Json::Value.string 0x496e6974) (nil Json::Value)))) (cons (0x6e6f646573, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4e6174)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x69, (ctor Json::Value.number 0x30)) (cons (0x6b, (ctor Json::Value.string 0x62)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4571)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x32)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x33)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x34)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x35)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x45712e7265666c)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x37)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x38)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x39)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x54727565)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x547275652e696e74726f)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x35)) (cons (0x76, (ctor Json::Value.number 0x3131)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x3133)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x35)) (cons (0x76, (ctor Json::Value.number 0x3132)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x3135)) (nil (Bytes * Json::Value)))))))) (nil Json::Value)))))))))))))))))))) (cons (0x70726f6f665f6e6f646573, (ctor Json::Value.array (nil Json::Value))) (cons (0x73706563, (ctor Json::Value.string 0x6c65786c65616e2f636f72652d6d6f64756c652f32)) (nil (Bytes * Json::Value)))))))), + axioms: [] +} + +definition{ + name: nodes, + parameters: [], + result: (List Json::Value), + body: (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4e6174)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x69, (ctor Json::Value.number 0x30)) (cons (0x6b, (ctor Json::Value.string 0x62)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4571)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x32)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x33)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x34)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x35)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x45712e7265666c)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x37)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x38)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x39)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x54727565)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x547275652e696e74726f)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x35)) (cons (0x76, (ctor Json::Value.number 0x3131)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x3133)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x35)) (cons (0x76, (ctor Json::Value.number 0x3132)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x3135)) (nil (Bytes * Json::Value)))))))) (nil Json::Value)))))))))))))))))), + axioms: [] +} + +definition{ + name: reflexive, + parameters: [], + result: CoreBinding::Goal, + body: (record CoreBinding::Goal {nodes := (nodes), root := 6}), + axioms: [] +} + +theorem{ + name: extractReflexive, + parameters: [], + statement: ((match (CandidateBinding::coreGoal (core) 0x52756c6533304170692e42696e64696e67466978747572652e7265666c6578697665) | Option.none => false | Option.some actualGoal => (CoreBinding::sameType actualGoal (reflexive) 4096 256)) = true), + proof: decide{}, + axioms: [propext] +} + +definition{ + name: context, + parameters: [], + result: CoreBinding::Goal, + body: (record CoreBinding::Goal {nodes := (nodes), root := 14}), + axioms: [] +} + +theorem{ + name: extractContext, + parameters: [], + statement: ((match (CandidateBinding::coreGoal (core) 0x52756c6533304170692e42696e64696e67466978747572652e636f6e74657874) | Option.none => false | Option.some actualGoal => (CoreBinding::sameType actualGoal (context) 4096 256)) = true), + proof: decide{}, + axioms: [propext] +} + +definition{ + name: selected, + parameters: [], + result: (Option CoreBinding::Goal), + body: (CoreBinding::premise (context) 1 4096 256), + axioms: [propext] +} + +theorem{ + name: nativeProofHasExactPremiseType, + parameters: [], + statement: ((match (selected) | Option.none => false | Option.some goal => (CoreBinding::sameType goal (reflexive) 4096 256)) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: wholeSourceIsNotItsPremise, + parameters: [], + statement: ((CoreBinding::sameType (context) (reflexive) 4096 256) = false), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: absentDeclaration, + parameters: [], + statement: ((CandidateBinding::coreGoal (core) 0x616273656e74) = (ctor Option.none [CoreBinding::Goal])), + proof: decide{}, + axioms: [] +} + +definition{ + name: definitionCore, + parameters: [], + result: Json::Value, + body: (ctor Json::Value.object (cons (0x6465636c61726174696f6e73, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x636c617373, (ctor Json::Value.boolean false)) (cons (0x67656e657261746564, (ctor Json::Value.boolean false)) (cons (0x6b696e64, (ctor Json::Value.string 0x646566696e6974696f6e)) (cons (0x6c6576656c73, (ctor Json::Value.array (nil Json::Value))) (cons (0x6e616d65, (ctor Json::Value.string 0x52756c6533304170692e42696e64696e67466978747572652e7265666c6578697665)) (cons (0x706f6c696379, (ctor Json::Value.object (cons (0x6b696e64, (ctor Json::Value.string 0x6e6f6e65)) (nil (Bytes * Json::Value))))) (cons (0x7472616e73706172656e6379, (ctor Json::Value.string 0x73656d69726564756369626c65)) (cons (0x74797065, (ctor Json::Value.number 0x36)) (cons (0x76616c7565, (ctor Json::Value.number 0x3130)) (nil (Bytes * Json::Value)))))))))))) (nil Json::Value)))) (cons (0x696d706f727473, (ctor Json::Value.array (cons (ctor Json::Value.string 0x496e6974) (nil Json::Value)))) (cons (0x6e6f646573, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4e6174)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x69, (ctor Json::Value.number 0x30)) (cons (0x6b, (ctor Json::Value.string 0x62)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4571)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x32)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x33)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x34)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x35)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x45712e7265666c)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x37)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x38)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x39)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x54727565)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x547275652e696e74726f)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x35)) (cons (0x76, (ctor Json::Value.number 0x3131)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x3133)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x35)) (cons (0x76, (ctor Json::Value.number 0x3132)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x3135)) (nil (Bytes * Json::Value)))))))) (nil Json::Value)))))))))))))))))))) (cons (0x70726f6f665f6e6f646573, (ctor Json::Value.array (nil Json::Value))) (cons (0x73706563, (ctor Json::Value.string 0x6c65786c65616e2f636f72652d6d6f64756c652f32)) (nil (Bytes * Json::Value)))))))), + axioms: [] +} + +theorem{ + name: definition, + parameters: [], + statement: ((CandidateBinding::coreGoal (definitionCore) 0x52756c6533304170692e42696e64696e67466978747572652e7265666c6578697665) = (ctor Option.none [CoreBinding::Goal])), + proof: decide{}, + axioms: [] +} + +definition{ + name: absentProofCore, + parameters: [], + result: Json::Value, + body: (ctor Json::Value.object (cons (0x6465636c61726174696f6e73, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x636c617373, (ctor Json::Value.boolean false)) (cons (0x67656e657261746564, (ctor Json::Value.boolean false)) (cons (0x6b696e64, (ctor Json::Value.string 0x7468656f72656d)) (cons (0x6c6576656c73, (ctor Json::Value.array (nil Json::Value))) (cons (0x6e616d65, (ctor Json::Value.string 0x52756c6533304170692e42696e64696e67466978747572652e7265666c6578697665)) (cons (0x706f6c696379, (ctor Json::Value.object (cons (0x6b696e64, (ctor Json::Value.string 0x6e6f6e65)) (nil (Bytes * Json::Value))))) (cons (0x7472616e73706172656e6379, (ctor Json::Value.string 0x73656d69726564756369626c65)) (cons (0x74797065, (ctor Json::Value.number 0x36)) (nil (Bytes * Json::Value))))))))))) (nil Json::Value)))) (cons (0x696d706f727473, (ctor Json::Value.array (cons (ctor Json::Value.string 0x496e6974) (nil Json::Value)))) (cons (0x6e6f646573, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4e6174)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x69, (ctor Json::Value.number 0x30)) (cons (0x6b, (ctor Json::Value.string 0x62)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4571)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x32)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x33)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x34)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x35)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x45712e7265666c)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x37)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x38)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x39)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x54727565)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x547275652e696e74726f)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x35)) (cons (0x76, (ctor Json::Value.number 0x3131)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x3133)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x35)) (cons (0x76, (ctor Json::Value.number 0x3132)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x3135)) (nil (Bytes * Json::Value)))))))) (nil Json::Value)))))))))))))))))))) (cons (0x70726f6f665f6e6f646573, (ctor Json::Value.array (nil Json::Value))) (cons (0x73706563, (ctor Json::Value.string 0x6c65786c65616e2f636f72652d6d6f64756c652f32)) (nil (Bytes * Json::Value)))))))), + axioms: [] +} + +theorem{ + name: absentProof, + parameters: [], + statement: ((CandidateBinding::coreGoal (absentProofCore) 0x52756c6533304170692e42696e64696e67466978747572652e7265666c6578697665) = (ctor Option.none [CoreBinding::Goal])), + proof: decide{}, + axioms: [] +} + +definition{ + name: badProofIndexCore, + parameters: [], + result: Json::Value, + body: (ctor Json::Value.object (cons (0x6465636c61726174696f6e73, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x636c617373, (ctor Json::Value.boolean false)) (cons (0x67656e657261746564, (ctor Json::Value.boolean false)) (cons (0x6b696e64, (ctor Json::Value.string 0x7468656f72656d)) (cons (0x6c6576656c73, (ctor Json::Value.array (nil Json::Value))) (cons (0x6e616d65, (ctor Json::Value.string 0x52756c6533304170692e42696e64696e67466978747572652e7265666c6578697665)) (cons (0x706f6c696379, (ctor Json::Value.object (cons (0x6b696e64, (ctor Json::Value.string 0x6e6f6e65)) (nil (Bytes * Json::Value))))) (cons (0x7472616e73706172656e6379, (ctor Json::Value.string 0x73656d69726564756369626c65)) (cons (0x74797065, (ctor Json::Value.number 0x36)) (cons (0x76616c7565, (ctor Json::Value.number 0x3137)) (nil (Bytes * Json::Value)))))))))))) (nil Json::Value)))) (cons (0x696d706f727473, (ctor Json::Value.array (cons (ctor Json::Value.string 0x496e6974) (nil Json::Value)))) (cons (0x6e6f646573, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4e6174)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x69, (ctor Json::Value.number 0x30)) (cons (0x6b, (ctor Json::Value.string 0x62)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4571)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x32)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x33)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x34)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x35)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x45712e7265666c)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x37)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x38)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x39)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x54727565)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x547275652e696e74726f)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x35)) (cons (0x76, (ctor Json::Value.number 0x3131)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x3133)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x35)) (cons (0x76, (ctor Json::Value.number 0x3132)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x3135)) (nil (Bytes * Json::Value)))))))) (nil Json::Value)))))))))))))))))))) (cons (0x70726f6f665f6e6f646573, (ctor Json::Value.array (nil Json::Value))) (cons (0x73706563, (ctor Json::Value.string 0x6c65786c65616e2f636f72652d6d6f64756c652f32)) (nil (Bytes * Json::Value)))))))), + axioms: [] +} + +theorem{ + name: badProofIndex, + parameters: [], + statement: ((CandidateBinding::coreGoal (badProofIndexCore) 0x52756c6533304170692e42696e64696e67466978747572652e7265666c6578697665) = (ctor Option.none [CoreBinding::Goal])), + proof: decide{}, + axioms: [] +} + +definition{ + name: duplicateCore, + parameters: [], + result: Json::Value, + body: (ctor Json::Value.object (cons (0x6465636c61726174696f6e73, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x636c617373, (ctor Json::Value.boolean false)) (cons (0x67656e657261746564, (ctor Json::Value.boolean false)) (cons (0x6b696e64, (ctor Json::Value.string 0x7468656f72656d)) (cons (0x6c6576656c73, (ctor Json::Value.array (nil Json::Value))) (cons (0x6e616d65, (ctor Json::Value.string 0x52756c6533304170692e42696e64696e67466978747572652e7265666c6578697665)) (cons (0x706f6c696379, (ctor Json::Value.object (cons (0x6b696e64, (ctor Json::Value.string 0x6e6f6e65)) (nil (Bytes * Json::Value))))) (cons (0x7472616e73706172656e6379, (ctor Json::Value.string 0x73656d69726564756369626c65)) (cons (0x74797065, (ctor Json::Value.number 0x36)) (cons (0x76616c7565, (ctor Json::Value.number 0x3130)) (nil (Bytes * Json::Value)))))))))))) (cons (ctor Json::Value.object (cons (0x636c617373, (ctor Json::Value.boolean false)) (cons (0x67656e657261746564, (ctor Json::Value.boolean false)) (cons (0x6b696e64, (ctor Json::Value.string 0x7468656f72656d)) (cons (0x6c6576656c73, (ctor Json::Value.array (nil Json::Value))) (cons (0x6e616d65, (ctor Json::Value.string 0x52756c6533304170692e42696e64696e67466978747572652e7265666c6578697665)) (cons (0x706f6c696379, (ctor Json::Value.object (cons (0x6b696e64, (ctor Json::Value.string 0x6e6f6e65)) (nil (Bytes * Json::Value))))) (cons (0x7472616e73706172656e6379, (ctor Json::Value.string 0x73656d69726564756369626c65)) (cons (0x74797065, (ctor Json::Value.number 0x36)) (cons (0x76616c7565, (ctor Json::Value.number 0x3130)) (nil (Bytes * Json::Value)))))))))))) (nil Json::Value))))) (cons (0x696d706f727473, (ctor Json::Value.array (cons (ctor Json::Value.string 0x496e6974) (nil Json::Value)))) (cons (0x6e6f646573, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4e6174)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x69, (ctor Json::Value.number 0x30)) (cons (0x6b, (ctor Json::Value.string 0x62)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4571)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x32)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x33)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x34)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x35)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x45712e7265666c)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x37)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x38)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x39)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x54727565)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x547275652e696e74726f)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x35)) (cons (0x76, (ctor Json::Value.number 0x3131)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x3133)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x35)) (cons (0x76, (ctor Json::Value.number 0x3132)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x6c)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x3135)) (nil (Bytes * Json::Value)))))))) (nil Json::Value)))))))))))))))))))) (cons (0x70726f6f665f6e6f646573, (ctor Json::Value.array (nil Json::Value))) (cons (0x73706563, (ctor Json::Value.string 0x6c65786c65616e2f636f72652d6d6f64756c652f32)) (nil (Bytes * Json::Value)))))))), + axioms: [] +} + +theorem{ + name: duplicateTheorem, + parameters: [], + statement: ((CandidateBinding::coreGoal (duplicateCore) 0x52756c6533304170692e42696e64696e67466978747572652e7265666c6578697665) = (ctor Option.none [CoreBinding::Goal])), + proof: decide{}, + axioms: [] +} + +theorem{ + name: refutationIsNotPositiveEvidence, + parameters: [], + statement: ((match (CoreBinding::refutation (context) 1 4096 256) | Option.none => true | Option.some goal => (CoreBinding::sameType goal (reflexive) 4096 256)) = false), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: refutationKeepsContextOutsideNegation, + parameters: [], + statement: ((match (CoreBinding::refutation (context) 1 4096 256) | Option.none => true | Option.some goal => (CoreBinding::sameType goal (CoreBinding::negated (reflexive)) 4096 256)) = false), + proof: decide{}, + axioms: [propext] +} +definition{ + name: sourceRequest, + parameters: [originName : Bytes, sourceNames : (List Bytes), goalBytes : Bytes, purpose : Research::Purpose], + result: Research::Request, + body: (record Research::Request {serial := 1, snapshot := (record Research::Snapshot {library := 0x6c, compiler := 0x63, model := 0x6d}), task := (record Research::Task {id := 0x74, purpose := purpose, intent := purpose, status := (ctor Research::Status.waiting), component := "deduction", sources := sourceNames, schema := 0x73, sequent := (record Research::Sequent {origin := originName, theorem := 0x52756c653330554f522e496e74657266616365732e736f75726365, premise := 0, telescope := 0x7b226e6f646573223a5b7b226b223a2263222c226e223a2254727565222c2275223a5b5d7d2c7b226b223a2270222c226e223a2268222c2262223a2265222c2274223a302c2276223a307d5d2c22726f6f74223a317d, target := goalBytes}), age := 0, weight := 1})}), + axioms: [] +} + +definition{ + name: namedSourceRequest, + parameters: [purpose : Research::Purpose], + result: Research::Request, + body: (sourceRequest 0x52756c653330554f522e496e74657266616365732e736f75726365 (cons 0x52756c653330554f522e496e74657266616365732e736f75726365 (nil Bytes)) 0x7b226e6f646573223a5b7b226b223a2263222c226e223a2254727565222c2275223a5b5d7d5d2c22726f6f74223a307d purpose), + axioms: [] +} + +theorem{ + name: namedSourceSelectsItsExactPremise, + parameters: [], + statement: ((match (CandidateBinding::selected (namedSourceRequest (ctor Research::Purpose.prove)) 512 16 128) | Option.none => false | Option.some goal => (match (CandidateBinding::parseGoal 0x7b226e6f646573223a5b7b226b223a2263222c226e223a2254727565222c2275223a5b5d7d5d2c22726f6f74223a307d 512 16) | Option.none => false | Option.some expected => (CoreBinding::sameType goal expected 512 128))) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: unlistedOriginCannotSelectPremise, + parameters: [], + statement: ((CandidateBinding::selected (sourceRequest 0x6f74686572 (cons 0x52756c653330554f522e496e74657266616365732e736f75726365 (nil Bytes)) 0x7b226e6f646573223a5b7b226b223a2263222c226e223a2254727565222c2275223a5b5d7d5d2c22726f6f74223a307d (ctor Research::Purpose.prove)) 512 16 128) = (ctor Option.none [CoreBinding::Goal])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: namedSourceRejectsSubstitutedTarget, + parameters: [], + statement: ((CandidateBinding::selected (sourceRequest 0x52756c653330554f522e496e74657266616365732e736f75726365 (cons 0x52756c653330554f522e496e74657266616365732e736f75726365 (nil Bytes)) 0x7b226e6f646573223a5b7b226b223a2263222c226e223a2246616c7365222c2275223a5b5d7d5d2c22726f6f74223a307d (ctor Research::Purpose.prove)) 512 16 128) = (ctor Option.none [CoreBinding::Goal])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: namedRefutationSelectsNegatedPremise, + parameters: [], + statement: ((match (CandidateBinding::selected (namedSourceRequest (ctor Research::Purpose.refute)) 512 16 128) | Option.none => false | Option.some goal => (match (CandidateBinding::parseGoal 0x7b226e6f646573223a5b7b226b223a2263222c226e223a2254727565222c2275223a5b5d7d5d2c22726f6f74223a307d 512 16) | Option.none => false | Option.some expected => (CoreBinding::sameType goal (CoreBinding::negated expected) 512 128))) = true), + proof: decide{}, + axioms: [propext] +} +\end{semanticmodule} +\end{lexlean} diff --git a/rule30-api/src/CoreBinding.lex.tex b/rule30-api/src/CoreBinding.lex.tex new file mode 100644 index 0000000..7a68f7e --- /dev/null +++ b/rule30-api/src/CoreBinding.lex.tex @@ -0,0 +1,240 @@ +\begin{lexlean}{CoreBinding} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\importmodule{Json} +\importmodule{JsonCanonical} +\importmodule{Toml} +\importmodule{Hypotheses} +\title{Boolean} +\begin{semanticmodule} + +definition{ + name: contract, + parameters: [], + result: String, + body: "This boundary compares the types of kernel-checked native core declarations. It retains de Bruijn indices, universe levels, constants, binder visibility and every semantic node field, ignoring only binder display names. It refuses unknown constructors, duplicate or missing fields, forward references and exhausted bounds. A selected source premise is closed over preceding binders only; the premise itself and later binders never become assumptions. Arena data must be tied to the current verified source and candidate identities by the owning verifier. Comparison establishes exact applicability; it does not verify a proof or grant authority to arbitrary JSON.", + axioms: [], + executable: true +} + +structure{ + name: Goal, + type_parameters: [], + parameters: [], + fields: [{name: nodes, type: (List Json::Value)}, {name: root, type: Nat}] +} + +structure{ + name: Node, + type_parameters: [], + parameters: [], + fields: [{name: shape, type: Bytes}, {name: children, type: (List Nat)}] +} + +definition{ + name: get, + parameters: [value : Json::Value, key : Bytes], + result: Json::Value, + body: (match (Json::field value key) | Option.none => (ctor Json::Value.null) | Option.some found => found), + axioms: [], + executable: true +} + +definition{ + name: kind, + parameters: [node : Json::Value], + result: Bytes, + body: (match (get node 0x6b) | Json::Value.string text => text | Json::Value.null => 0x | Json::Value.boolean b => 0x | Json::Value.number n => 0x | Json::Value.array a => 0x | Json::Value.object o => 0x), + axioms: [], + executable: true +} + +definition{ + name: nodeKeys, + parameters: [tag : Bytes], + result: (Option (List Bytes)), + body: (if (Toml::sameBytes tag 0x62) then (ctor Option.some [(List Bytes)] (cons 0x6b (cons 0x69 (nil Bytes)))) else (if (Toml::sameBytes tag 0x73) then (ctor Option.some [(List Bytes)] (cons 0x6b (cons 0x6c (nil Bytes)))) else (if (Toml::sameBytes tag 0x63) then (ctor Option.some [(List Bytes)] (cons 0x6b (cons 0x6e (cons 0x75 (nil Bytes))))) else (if (Toml::sameBytes tag 0x61) then (ctor Option.some [(List Bytes)] (cons 0x6b (cons 0x66 (cons 0x78 (nil Bytes))))) else (if (Toml::sameBytes tag 0x6c) then (ctor Option.some [(List Bytes)] (cons 0x6b (cons 0x6e (cons 0x62 (cons 0x74 (cons 0x76 (nil Bytes))))))) else (if (Toml::sameBytes tag 0x70) then (ctor Option.some [(List Bytes)] (cons 0x6b (cons 0x6e (cons 0x62 (cons 0x74 (cons 0x76 (nil Bytes))))))) else (if (Toml::sameBytes tag 0x65) then (ctor Option.some [(List Bytes)] (cons 0x6b (cons 0x6e (cons 0x74 (cons 0x76 (cons 0x626f6479 (cons 0x64 (nil Bytes)))))))) else (if (Toml::sameBytes tag 0x6e) then (ctor Option.some [(List Bytes)] (cons 0x6b (cons 0x76 (nil Bytes)))) else (if (Toml::sameBytes tag 0x74) then (ctor Option.some [(List Bytes)] (cons 0x6b (cons 0x76 (nil Bytes)))) else (if (Toml::sameBytes tag 0x6a) then (ctor Option.some [(List Bytes)] (cons 0x6b (cons 0x6e (cons 0x73 (cons 0x69 (cons 0x78 (nil Bytes))))))) else (if (Toml::sameBytes tag 0x64) then (ctor Option.some [(List Bytes)] (cons 0x6b (cons 0x6d (cons 0x78 (nil Bytes))))) else (ctor Option.none [(List Bytes)])))))))))))), + axioms: [], + executable: true +} + +definition{ + name: childKeys, + parameters: [tag : Bytes], + result: (List Bytes), + body: (if (Toml::sameBytes tag 0x61) then (cons 0x66 (cons 0x78 (nil Bytes))) else (if (Toml::sameBytes tag 0x6c) then (cons 0x74 (cons 0x76 (nil Bytes))) else (if (Toml::sameBytes tag 0x70) then (cons 0x74 (cons 0x76 (nil Bytes))) else (if (Toml::sameBytes tag 0x65) then (cons 0x74 (cons 0x76 (cons 0x626f6479 (nil Bytes)))) else (if (Toml::sameBytes tag 0x6a) then (cons 0x78 (nil Bytes)) else (if (Toml::sameBytes tag 0x64) then (cons 0x78 (nil Bytes)) else (nil Bytes))))))), + axioms: [], + executable: true +} + +definition{ + name: contains, + parameters: [key : Bytes, keys : (List Bytes)], + result: Bool, + body: (match keys | List.nil => false | List.cons head tail => ((Toml::sameBytes key head) || (contains key tail))), + axioms: [], + recursive_argument: keys, + executable: true +} + +definition{ + name: fieldsKnown, + parameters: [entries : (List (Bytes * Json::Value)), keys : (List Bytes)], + result: Bool, + body: (match entries | List.nil => true | List.cons head tail => ((contains (first head) keys) && (fieldsKnown tail keys))), + axioms: [], + recursive_argument: entries, + executable: true +} + +definition{ + name: removeFields, + parameters: [entries : (List (Bytes * Json::Value)), keys : (List Bytes)], + result: (List (Bytes * Json::Value)), + body: (match entries | List.nil => (nil (Bytes * Json::Value)) | List.cons head tail => (if (contains (first head) keys) then (removeFields tail keys) else (cons head (removeFields tail keys)))), + axioms: [], + recursive_argument: entries, + executable: true +} + +definition{ + name: references, + parameters: [node : Json::Value, keys : (List Bytes), before : Nat], + result: (Option (List Nat)), + body: (match keys | List.nil => (ctor Option.some [(List Nat)] (nil Nat)) | List.cons head tail => (match (Json::natural (get node head) before) | Option.none => (ctor Option.none [(List Nat)]) | Option.some index => (if (index (ctor Option.none [(List Nat)]) | Option.some rest => (ctor Option.some [(List Nat)] (cons index rest))) else (ctor Option.none [(List Nat)])))), + axioms: [], + recursive_argument: keys, + executable: true +} + +definition{ + name: describe, + parameters: [node : Json::Value, before : Nat, maxBytes : Nat, maxSteps : Nat], + result: (Option Node), + body: (match node | Json::Value.object entries => (let tag : Bytes := (kind node); (match (nodeKeys tag) | Option.none => (ctor Option.none [Node]) | Option.some expected => (if (((prim length entries : Nat) =? (prim length expected : Nat)) && (fieldsKnown entries expected)) then (match (JsonCanonical::encode node maxBytes maxSteps) | Option.none => (ctor Option.none [Node]) | Option.some full => (let children : (List Bytes) := (childKeys tag); (let removed : (List Bytes) := (if ((Toml::sameBytes tag 0x6c) || ((Toml::sameBytes tag 0x70) || (Toml::sameBytes tag 0x65))) then (cons 0x6e children) else children); (match (references node children before) | Option.none => (ctor Option.none [Node]) | Option.some refs => (match (JsonCanonical::encode (ctor Json::Value.object (removeFields entries removed)) maxBytes maxSteps) | Option.none => (ctor Option.none [Node]) | Option.some shape => (ctor Option.some [Node] (record Node {shape := shape, children := refs}))))))) else (ctor Option.none [Node])))) | Json::Value.null => (ctor Option.none [Node]) | Json::Value.boolean b => (ctor Option.none [Node]) | Json::Value.number n => (ctor Option.none [Node]) | Json::Value.string t => (ctor Option.none [Node]) | Json::Value.array a => (ctor Option.none [Node])), + axioms: [propext], + executable: true +} + +definition{ + name: nodeAt, + parameters: [nodes : (List Json::Value), index : Nat, maxBytes : Nat, maxSteps : Nat], + result: (Option Node), + body: (match (prim index nodes index : (Option Json::Value)) | Option.none => (ctor Option.none [Node]) | Option.some value => (describe value index maxBytes maxSteps)), + axioms: [propext], + executable: true +} + +definition{ + name: zipOnto, + parameters: [left : (List Nat), right : (List Nat), tail : (List (Nat * Nat))], + result: (Option (List (Nat * Nat))), + body: (match left | List.nil => (match right | List.nil => (ctor Option.some [(List (Nat * Nat))] tail) | List.cons head rest => (ctor Option.none [(List (Nat * Nat))])) | List.cons head rest => (match right | List.nil => (ctor Option.none [(List (Nat * Nat))]) | List.cons other others => (zipOnto rest others (cons (head, other) tail)))), + axioms: [], + recursive_argument: left, + executable: true +} + +definition{ + name: compare, + parameters: [left : (List Json::Value), right : (List Json::Value), pending : (List (Nat * Nat)), maxBytes : Nat, maxSteps : Nat, fuel : Nat], + result: Bool, + body: (match fuel | Nat.zero => (match pending | List.nil => true | List.cons head tail => false) | Nat.succ more => (match pending | List.nil => true | List.cons head tail => (match (nodeAt left (first head) maxBytes maxSteps) | Option.none => false | Option.some a => (match (nodeAt right (second head) maxBytes maxSteps) | Option.none => false | Option.some b => (if (Toml::sameBytes (project a shape) (project b shape)) then (match (zipOnto (project a children) (project b children) tail) | Option.none => false | Option.some next => (compare left right next maxBytes maxSteps more)) else false))))), + axioms: [propext], + recursive_argument: fuel, + executable: true +} + +definition{ + name: sameType, + parameters: [left : Goal, right : Goal, maxBytes : Nat, maxSteps : Nat], + result: Bool, + body: (compare (project left nodes) (project right nodes) (cons ((project left root), (project right root)) (nil (Nat * Nat))) maxBytes maxSteps maxSteps), + axioms: [propext], + executable: true +} + +definition{ + name: number, + parameters: [value : Nat], + result: Json::Value, + body: (ctor Json::Value.number (Hypotheses::decimal value)), + axioms: [], + executable: true +} + +definition{ + name: binderNode, + parameters: [binder : Json::Value, root : Nat], + result: Json::Value, + body: (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (get binder 0x6e)) (cons (0x62, (get binder 0x62)) (cons (0x74, (get binder 0x74)) (cons (0x76, (number root)) (nil (Bytes * Json::Value)))))))), + axioms: [], + executable: true +} + +definition{ + name: close, + parameters: [binders : (List Json::Value), goal : Goal], + result: Goal, + body: (match binders | List.nil => goal | List.cons head tail => (close tail (record Goal {nodes := (prim append (project goal nodes) (cons (binderNode head (project goal root)) (nil Json::Value)) : (List Json::Value)), root := (prim length (project goal nodes) : Nat)}))), + axioms: [], + recursive_argument: binders, + executable: true +} + +definition{ + name: pi, + parameters: [nodes : (List Json::Value), index : Nat, maxBytes : Nat, maxSteps : Nat], + result: (Option (Nat * Nat)), + body: (match (prim index nodes index : (Option Json::Value)) | Option.none => (ctor Option.none [(Nat * Nat)]) | Option.some node => (if (Toml::sameBytes (kind node) 0x70) then (match (describe node index maxBytes maxSteps) | Option.none => (ctor Option.none [(Nat * Nat)]) | Option.some found => (match (project found children) | List.nil => (ctor Option.none [(Nat * Nat)]) | List.cons domain rest => (match rest | List.nil => (ctor Option.none [(Nat * Nat)]) | List.cons body others => (ctor Option.some [(Nat * Nat)] (domain, body))))) else (ctor Option.none [(Nat * Nat)]))), + axioms: [propext], + executable: true +} + +definition{ + name: negated, + parameters: [goal : Goal], + result: Goal, + body: (let index : Nat := (prim length (project goal nodes) : Nat); (let falseNode : Json::Value := (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x46616c7365)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))); (let binder : Json::Value := (ctor Json::Value.object (cons (0x6e, (ctor Json::Value.string 0x6e656761746564)) (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x74, (number (project goal root))) (nil (Bytes * Json::Value)))))); (record Goal {nodes := (prim append (project goal nodes) (cons falseNode (cons (binderNode binder index) (nil Json::Value))) : (List Json::Value)), root := (index + 1)})))), + axioms: [], + executable: true +} + +definition{ + name: premiseFrom, + parameters: [nodes : (List Json::Value), index : Nat, preceding : (List Json::Value), position : Nat, negative : Bool, maxBytes : Nat, maxSteps : Nat], + result: (Option Goal), + body: (match position | Nat.zero => (match (pi nodes index maxBytes maxSteps) | Option.none => (ctor Option.none [Goal]) | Option.some pair => (ctor Option.some [Goal] (close preceding (if negative then (negated (record Goal {nodes := nodes, root := (first pair)})) else (record Goal {nodes := nodes, root := (first pair)}))))) | Nat.succ more => (match (pi nodes index maxBytes maxSteps) | Option.none => (ctor Option.none [Goal]) | Option.some pair => (match (prim index nodes index : (Option Json::Value)) | Option.none => (ctor Option.none [Goal]) | Option.some binder => (premiseFrom nodes (second pair) (cons binder preceding) more negative maxBytes maxSteps)))), + axioms: [propext], + recursive_argument: position, + executable: true +} + +definition{ + name: premise, + parameters: [source : Goal, position : Nat, maxBytes : Nat, maxSteps : Nat], + result: (Option Goal), + body: (if (position <=? maxSteps) then (premiseFrom (project source nodes) (project source root) (nil Json::Value) position false maxBytes maxSteps) else (ctor Option.none [Goal])), + axioms: [propext], + executable: true +} + +definition{ + name: refutation, + parameters: [source : Goal, position : Nat, maxBytes : Nat, maxSteps : Nat], + result: (Option Goal), + body: (if (position <=? maxSteps) then (premiseFrom (project source nodes) (project source root) (nil Json::Value) position true maxBytes maxSteps) else (ctor Option.none [Goal])), + axioms: [propext], + executable: true +} + +definition{ + name: features, + parameters: [], + result: (List String), + body: (cons "exact-core-type-comparison" (cons "de-bruijn-context-preservation" (cons "binder-alpha-renaming" (cons "selected-premise-closure" (cons "exclude-target-assumption" (cons "reject-forward-edges" (cons "comparison-resource-bounds" (cons "contextual-refutation" (nil String))))))))), + axioms: [], + executable: true +} +\end{semanticmodule} +\end{lexlean} diff --git a/rule30-api/src/CoreBindingTraces.lex.tex b/rule30-api/src/CoreBindingTraces.lex.tex new file mode 100644 index 0000000..52d5c86 --- /dev/null +++ b/rule30-api/src/CoreBindingTraces.lex.tex @@ -0,0 +1,273 @@ +\begin{lexlean}{CoreBindingTraces} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\importmodule{Json} +\importmodule{CoreBinding} +\title{Boolean} +\begin{semanticmodule} + +definition{ + name: source, + parameters: [], + result: CoreBinding::Goal, + body: (record CoreBinding::Goal {nodes := (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4e6174)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x69, (ctor Json::Value.number 0x30)) (cons (0x6b, (ctor Json::Value.string 0x62)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x6e)) (cons (0x76, (ctor Json::Value.string 0x30)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4571)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x33)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x34)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x35)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x32)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x54727565)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x36)) (cons (0x76, (ctor Json::Value.number 0x37)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x38)) (nil (Bytes * Json::Value)))))))) (nil Json::Value))))))))))), root := 9}), + axioms: [] +} + +definition{ + name: expected, + parameters: [], + result: CoreBinding::Goal, + body: (record CoreBinding::Goal {nodes := (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4e6174)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x69, (ctor Json::Value.number 0x30)) (cons (0x6b, (ctor Json::Value.string 0x62)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x6e)) (cons (0x76, (ctor Json::Value.string 0x30)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4571)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x33)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x34)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x35)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x32)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x54727565)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x36)) (cons (0x76, (ctor Json::Value.number 0x37)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x38)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x36)) (nil (Bytes * Json::Value)))))))) (nil Json::Value)))))))))))), root := 10}), + axioms: [] +} + +definition{ + name: renamed, + parameters: [], + result: CoreBinding::Goal, + body: (record CoreBinding::Goal {nodes := (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4e6174)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x69, (ctor Json::Value.number 0x30)) (cons (0x6b, (ctor Json::Value.string 0x62)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x6e)) (cons (0x76, (ctor Json::Value.string 0x30)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4571)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x33)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x34)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x35)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x32)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x54727565)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x36)) (cons (0x76, (ctor Json::Value.number 0x37)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x38)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x72656e616d6564)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x36)) (nil (Bytes * Json::Value)))))))) (nil Json::Value)))))))))))), root := 10}), + axioms: [] +} + +definition{ + name: wrongVariable, + parameters: [], + result: CoreBinding::Goal, + body: (record CoreBinding::Goal {nodes := (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4e6174)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x69, (ctor Json::Value.number 0x31)) (cons (0x6b, (ctor Json::Value.string 0x62)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x6e)) (cons (0x76, (ctor Json::Value.string 0x30)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4571)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x33)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x34)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x35)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x32)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x54727565)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x36)) (cons (0x76, (ctor Json::Value.number 0x37)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x38)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x36)) (nil (Bytes * Json::Value)))))))) (nil Json::Value)))))))))))), root := 10}), + axioms: [] +} + +definition{ + name: wrongUniverse, + parameters: [], + result: CoreBinding::Goal, + body: (record CoreBinding::Goal {nodes := (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4e6174)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x69, (ctor Json::Value.number 0x30)) (cons (0x6b, (ctor Json::Value.string 0x62)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x6e)) (cons (0x76, (ctor Json::Value.string 0x30)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4571)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x33)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x34)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x35)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x32)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x54727565)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x36)) (cons (0x76, (ctor Json::Value.number 0x37)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x38)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x36)) (nil (Bytes * Json::Value)))))))) (nil Json::Value)))))))))))), root := 10}), + axioms: [] +} + +definition{ + name: wrongConstant, + parameters: [], + result: CoreBinding::Goal, + body: (record CoreBinding::Goal {nodes := (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x46616c7365)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x69, (ctor Json::Value.number 0x30)) (cons (0x6b, (ctor Json::Value.string 0x62)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x6e)) (cons (0x76, (ctor Json::Value.string 0x30)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4571)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x33)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x34)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x35)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x32)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x54727565)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x36)) (cons (0x76, (ctor Json::Value.number 0x37)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x38)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x36)) (nil (Bytes * Json::Value)))))))) (nil Json::Value)))))))))))), root := 10}), + axioms: [] +} + +definition{ + name: implicit, + parameters: [], + result: CoreBinding::Goal, + body: (record CoreBinding::Goal {nodes := (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4e6174)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x69, (ctor Json::Value.number 0x30)) (cons (0x6b, (ctor Json::Value.string 0x62)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x6e)) (cons (0x76, (ctor Json::Value.string 0x30)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4571)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x33)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x34)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x35)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x32)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x54727565)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x36)) (cons (0x76, (ctor Json::Value.number 0x37)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x38)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x69)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x36)) (nil (Bytes * Json::Value)))))))) (nil Json::Value)))))))))))), root := 10}), + axioms: [] +} + +definition{ + name: forward, + parameters: [], + result: CoreBinding::Goal, + body: (record CoreBinding::Goal {nodes := (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x30)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (nil Json::Value)), root := 0}), + axioms: [] +} + +definition{ + name: missingField, + parameters: [], + result: CoreBinding::Goal, + body: (record CoreBinding::Goal {nodes := (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4e6174)) (nil (Bytes * Json::Value))))) (nil Json::Value)), root := 0}), + axioms: [] +} + +definition{ + name: unknown, + parameters: [], + result: CoreBinding::Goal, + body: (record CoreBinding::Goal {nodes := (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x667574757265)) (nil (Bytes * Json::Value)))) (nil Json::Value)), root := 0}), + axioms: [] +} + +definition{ + name: targetWithoutContext, + parameters: [], + result: CoreBinding::Goal, + body: (record CoreBinding::Goal {nodes := (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4e6174)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x69, (ctor Json::Value.number 0x30)) (cons (0x6b, (ctor Json::Value.string 0x62)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x6e)) (cons (0x76, (ctor Json::Value.string 0x30)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4571)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x33)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x34)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x35)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x32)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x54727565)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x36)) (cons (0x76, (ctor Json::Value.number 0x37)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x38)) (nil (Bytes * Json::Value)))))))) (nil Json::Value))))))))))), root := 6}), + axioms: [] +} + +definition{ + name: conclusion, + parameters: [], + result: CoreBinding::Goal, + body: (record CoreBinding::Goal {nodes := (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4e6174)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x69, (ctor Json::Value.number 0x30)) (cons (0x6b, (ctor Json::Value.string 0x62)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x6e)) (cons (0x76, (ctor Json::Value.string 0x30)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4571)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x33)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x34)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x35)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x32)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x54727565)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x36)) (cons (0x76, (ctor Json::Value.number 0x37)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x38)) (nil (Bytes * Json::Value)))))))) (nil Json::Value))))))))))), root := 7}), + axioms: [] +} + +theorem{ + name: closesSelectedPremise, + parameters: [], + statement: ((match (CoreBinding::premise (source) 1 512 128) | Option.none => false | Option.some actualGoal => (CoreBinding::sameType actualGoal (expected) 4096 256)) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: firstBinderHasNoAssumptions, + parameters: [], + statement: ((match (CoreBinding::premise (source) 0 512 128) | Option.none => false | Option.some actualGoal => (CoreBinding::sameType actualGoal (record CoreBinding::Goal {nodes := (project (source) nodes), root := 0}) 4096 256)) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: pastTheTelescope, + parameters: [], + statement: ((CoreBinding::premise (source) 2 512 128) = (ctor Option.none [CoreBinding::Goal])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: premiseBudget, + parameters: [], + statement: ((CoreBinding::premise (source) 1 512 0) = (ctor Option.none [CoreBinding::Goal])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: compareExpected, + parameters: [], + statement: ((CoreBinding::sameType (expected) (expected) 512 128) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: compareRenamed, + parameters: [], + statement: ((CoreBinding::sameType (expected) (renamed) 512 128) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: compareSource, + parameters: [], + statement: ((CoreBinding::sameType (expected) (source) 512 128) = false), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: compareWrongvariable, + parameters: [], + statement: ((CoreBinding::sameType (expected) (wrongVariable) 512 128) = false), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: compareWronguniverse, + parameters: [], + statement: ((CoreBinding::sameType (expected) (wrongUniverse) 512 128) = false), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: compareWrongconstant, + parameters: [], + statement: ((CoreBinding::sameType (expected) (wrongConstant) 512 128) = false), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: compareImplicit, + parameters: [], + statement: ((CoreBinding::sameType (expected) (implicit) 512 128) = false), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: compareTargetwithoutcontext, + parameters: [], + statement: ((CoreBinding::sameType (expected) (targetWithoutContext) 512 128) = false), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: compareConclusion, + parameters: [], + statement: ((CoreBinding::sameType (expected) (conclusion) 512 128) = false), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: rejectForward, + parameters: [], + statement: ((CoreBinding::sameType (forward) (forward) 512 128) = false), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: rejectMissingfield, + parameters: [], + statement: ((CoreBinding::sameType (missingField) (missingField) 512 128) = false), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: rejectUnknown, + parameters: [], + statement: ((CoreBinding::sameType (unknown) (unknown) 512 128) = false), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: comparisonBudget, + parameters: [], + statement: ((CoreBinding::sameType (expected) (expected) 512 0) = false), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: shapeBudget, + parameters: [], + statement: ((CoreBinding::sameType (expected) (expected) 0 128) = false), + proof: decide{}, + axioms: [propext] +} + +definition{ + name: shiftedNat, + parameters: [], + result: CoreBinding::Goal, + body: (record CoreBinding::Goal {nodes := (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x54727565)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4e6174)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (nil Json::Value))), root := 1}), + axioms: [] +} + +definition{ + name: nat, + parameters: [], + result: CoreBinding::Goal, + body: (record CoreBinding::Goal {nodes := (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4e6174)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x69, (ctor Json::Value.number 0x30)) (cons (0x6b, (ctor Json::Value.string 0x62)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x6e)) (cons (0x76, (ctor Json::Value.string 0x30)) (nil (Bytes * Json::Value))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x4571)) (cons (0x75, (ctor Json::Value.array (cons (ctor Json::Value.object (cons (0x61, (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x7a)) (nil (Bytes * Json::Value))))) (cons (0x6b, (ctor Json::Value.string 0x73)) (nil (Bytes * Json::Value))))) (nil Json::Value)))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x33)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x30)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x34)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x31)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x66, (ctor Json::Value.number 0x35)) (cons (0x6b, (ctor Json::Value.string 0x61)) (cons (0x78, (ctor Json::Value.number 0x32)) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x6b, (ctor Json::Value.string 0x63)) (cons (0x6e, (ctor Json::Value.string 0x54727565)) (cons (0x75, (ctor Json::Value.array (nil Json::Value))) (nil (Bytes * Json::Value)))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x68)) (cons (0x74, (ctor Json::Value.number 0x36)) (cons (0x76, (ctor Json::Value.number 0x37)) (nil (Bytes * Json::Value)))))))) (cons (ctor Json::Value.object (cons (0x62, (ctor Json::Value.string 0x65)) (cons (0x6b, (ctor Json::Value.string 0x70)) (cons (0x6e, (ctor Json::Value.string 0x6e)) (cons (0x74, (ctor Json::Value.number 0x30)) (cons (0x76, (ctor Json::Value.number 0x38)) (nil (Bytes * Json::Value)))))))) (nil Json::Value))))))))))), root := 0}), + axioms: [] +} + +theorem{ + name: arenaOrderIndependent, + parameters: [], + statement: ((CoreBinding::sameType (nat) (shiftedNat) 512 128) = true), + proof: decide{}, + axioms: [propext] +} +\end{semanticmodule} +\end{lexlean} diff --git a/rule30-api/src/JsonCanonical.lex.tex b/rule30-api/src/JsonCanonical.lex.tex new file mode 100644 index 0000000..c58ba81 --- /dev/null +++ b/rule30-api/src/JsonCanonical.lex.tex @@ -0,0 +1,160 @@ +\begin{lexlean}{JsonCanonical} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\importmodule{Json} +\importmodule{Toml} +\importmodule{Hypotheses} +\importmodule{LexLeanStd.Buffer} +\title{Boolean} +\begin{semanticmodule} + +definition{ + name: contract, + parameters: [], + result: String, + body: "Canonical JSON follows LexLean section 21.7: signed 64-bit integers, no null or floating point, byte-sorted distinct UTF-8 object keys, minimal escapes, no whitespace and no trailing newline. Encoding validates manually constructed values too. The byte and work limits reject incomplete encodings, including sorting and container traversal. Output uses the standard library chunk buffer. File output adds exactly one newline. Canonical bytes establish identity, never proof authority.", + axioms: [], + executable: true +} + +definition{ + name: integer, + parameters: [source : Bytes], + result: (Option Bytes), + body: (let negative : Bool := (Toml::byteIs source 0 (45 : UInt8)); (let digits : Bytes := (if negative then (Toml::sliceOr source 1 (prim subtract (prim length source : Nat) 1 : Nat)) else source); (match (Json::natural (ctor Json::Value.number digits) (if negative then 9223372036854775808 else 9223372036854775807)) | Option.none => (ctor Option.none [Bytes]) | Option.some value => (ctor Option.some [Bytes] (if (value =? 0) then 0x30 else source))))), + axioms: [], + executable: true +} + +definition{ + name: escapedByte, + parameters: [source : Bytes, position : Nat], + result: Bytes, + body: (if (Toml::byteIs source position (34 : UInt8)) then 0x5c22 else (if (Toml::byteIs source position (92 : UInt8)) then 0x5c5c else (if (Toml::byteIs source position (0 : UInt8)) then 0x5c7530303030 else (if (Toml::byteIs source position (1 : UInt8)) then 0x5c7530303031 else (if (Toml::byteIs source position (2 : UInt8)) then 0x5c7530303032 else (if (Toml::byteIs source position (3 : UInt8)) then 0x5c7530303033 else (if (Toml::byteIs source position (4 : UInt8)) then 0x5c7530303034 else (if (Toml::byteIs source position (5 : UInt8)) then 0x5c7530303035 else (if (Toml::byteIs source position (6 : UInt8)) then 0x5c7530303036 else (if (Toml::byteIs source position (7 : UInt8)) then 0x5c7530303037 else (if (Toml::byteIs source position (8 : UInt8)) then 0x5c62 else (if (Toml::byteIs source position (9 : UInt8)) then 0x5c74 else (if (Toml::byteIs source position (10 : UInt8)) then 0x5c6e else (if (Toml::byteIs source position (11 : UInt8)) then 0x5c7530303062 else (if (Toml::byteIs source position (12 : UInt8)) then 0x5c66 else (if (Toml::byteIs source position (13 : UInt8)) then 0x5c72 else (if (Toml::byteIs source position (14 : UInt8)) then 0x5c7530303065 else (if (Toml::byteIs source position (15 : UInt8)) then 0x5c7530303066 else (if (Toml::byteIs source position (16 : UInt8)) then 0x5c7530303130 else (if (Toml::byteIs source position (17 : UInt8)) then 0x5c7530303131 else (if (Toml::byteIs source position (18 : UInt8)) then 0x5c7530303132 else (if (Toml::byteIs source position (19 : UInt8)) then 0x5c7530303133 else (if (Toml::byteIs source position (20 : UInt8)) then 0x5c7530303134 else (if (Toml::byteIs source position (21 : UInt8)) then 0x5c7530303135 else (if (Toml::byteIs source position (22 : UInt8)) then 0x5c7530303136 else (if (Toml::byteIs source position (23 : UInt8)) then 0x5c7530303137 else (if (Toml::byteIs source position (24 : UInt8)) then 0x5c7530303138 else (if (Toml::byteIs source position (25 : UInt8)) then 0x5c7530303139 else (if (Toml::byteIs source position (26 : UInt8)) then 0x5c7530303161 else (if (Toml::byteIs source position (27 : UInt8)) then 0x5c7530303162 else (if (Toml::byteIs source position (28 : UInt8)) then 0x5c7530303163 else (if (Toml::byteIs source position (29 : UInt8)) then 0x5c7530303164 else (if (Toml::byteIs source position (30 : UInt8)) then 0x5c7530303165 else (if (Toml::byteIs source position (31 : UInt8)) then 0x5c7530303166 else (Toml::sliceOr source position 1))))))))))))))))))))))))))))))))))), + axioms: [], + executable: true +} + +definition{ + name: escapeFrom, + parameters: [source : Bytes, position : Nat, remaining : Nat, output : LexLeanStd.Buffer::Buffer], + result: (Option Bytes), + body: (match remaining | Nat.zero => (match (LexLeanStd.Buffer::finish (LexLeanStd.Buffer::writeBytes output 0x22)) | Result.error problem => (ctor Option.none [Bytes]) | Result.ok bytes => (ctor Option.some [Bytes] bytes)) | Nat.succ more => (let next : LexLeanStd.Buffer::Buffer := (LexLeanStd.Buffer::writeBytes output (escapedByte source position)); (if (LexLeanStd.Buffer::exceeded next) then (ctor Option.none [Bytes]) else (escapeFrom source (position + 1) more next)))), + axioms: [], + recursive_argument: remaining, + executable: true +} + +definition{ + name: quote, + parameters: [source : Bytes, maximum : Nat], + result: (Option Bytes), + body: (if ((2 <=? maximum) && (((prim length source : Nat) <=? (prim subtract maximum 2 : Nat)) && (Toml::validFrom source 0 (prim length source : Nat)))) then (escapeFrom source 0 (prim length source : Nat) (LexLeanStd.Buffer::writeBytes (LexLeanStd.Buffer::new maximum) 0x22)) else (ctor Option.none [Bytes])), + axioms: [propext], + executable: true +} + + + +inductive{ + name: Work, + type_parameters: [], + parameters: [], + constructors: [ + {name: value, fields: [Json::Value]}, + {name: raw, fields: [Bytes]}, + {name: arrayTail, fields: [(List Json::Value)]}, + {name: objectTail, fields: [(List (Bytes * Json::Value))]}, + {name: sortEntries, fields: [(List (Bytes * Json::Value)), (List (Bytes * Json::Value))]}, + {name: insertEntry, fields: [(Bytes * Json::Value), (List (Bytes * Json::Value)), (List (Bytes * Json::Value)), (List (Bytes * Json::Value))]}, + {name: restoreEntries, fields: [(List (Bytes * Json::Value)), (List (Bytes * Json::Value)), (List (Bytes * Json::Value))]} + ] +} + + + +definition{ + name: expand, + parameters: [value : Json::Value, tail : (List Work), maximum : Nat], + result: (Option (List Work)), + body: (match value + | Json::Value.null => (ctor Option.none [(List Work)]) + | Json::Value.boolean b => (ctor Option.some [(List Work)] (cons (ctor Work.raw (if b then 0x74727565 else 0x66616c7365)) tail)) + | Json::Value.number n => (if ((prim length n : Nat) <=? 20) then (match (integer n) | Option.none => (ctor Option.none [(List Work)]) | Option.some text => (ctor Option.some [(List Work)] (cons (ctor Work.raw text) tail))) else (ctor Option.none [(List Work)])) + | Json::Value.string text => (match (quote text maximum) | Option.none => (ctor Option.none [(List Work)]) | Option.some quoted => (ctor Option.some [(List Work)] (cons (ctor Work.raw quoted) tail))) + | Json::Value.array items => (ctor Option.some [(List Work)] (cons (ctor Work.raw 0x5b) (cons (ctor Work.arrayTail items) (cons (ctor Work.raw 0x5d) tail)))) + | Json::Value.object entries => (ctor Option.some [(List Work)] (cons (ctor Work.sortEntries entries (nil (Bytes * Json::Value))) tail))), + axioms: [propext], + executable: true +} + +definition{ + name: keyFits, + parameters: [key : Bytes, maximum : Nat], + result: Bool, + body: ((2 <=? maximum) && ((prim length key : Nat) <=? (prim subtract maximum 2 : Nat))), + axioms: [], + executable: true +} + +definition{ + name: render, + parameters: [pending : (List Work), output : LexLeanStd.Buffer::Buffer, maximum : Nat, fuel : Nat], + result: (Option Bytes), + body: (match fuel + | Nat.zero => (match pending | List.nil => (match (LexLeanStd.Buffer::finish output) | Result.error problem => (ctor Option.none [Bytes]) | Result.ok bytes => (ctor Option.some [Bytes] bytes)) | List.cons head tail => (ctor Option.none [Bytes])) + | Nat.succ more => (match pending | List.nil => (match (LexLeanStd.Buffer::finish output) | Result.error problem => (ctor Option.none [Bytes]) | Result.ok bytes => (ctor Option.some [Bytes] bytes)) | List.cons head tail => (match head + | Work.raw text => (let next : LexLeanStd.Buffer::Buffer := (LexLeanStd.Buffer::writeBytes output text); (if (LexLeanStd.Buffer::exceeded next) then (ctor Option.none [Bytes]) else (render tail next maximum more))) + | Work.value value => (match (expand value tail (prim subtract maximum (LexLeanStd.Buffer::length output) : Nat)) | Option.none => (ctor Option.none [Bytes]) | Option.some next => (render next output maximum more)) + | Work.arrayTail items => (match items | List.nil => (render tail output maximum more) | List.cons item rest => (render (cons (ctor Work.value item) (match rest | List.nil => tail | List.cons another others => (cons (ctor Work.raw 0x2c) (cons (ctor Work.arrayTail rest) tail)))) output maximum more)) + | Work.objectTail entries => (match entries | List.nil => (render tail output maximum more) | List.cons entry rest => (render (cons (ctor Work.value (ctor Json::Value.string (first entry))) (cons (ctor Work.raw 0x3a) (cons (ctor Work.value (second entry)) (match rest | List.nil => tail | List.cons another others => (cons (ctor Work.raw 0x2c) (cons (ctor Work.objectTail rest) tail)))))) output maximum more)) + | Work.sortEntries entries sorted => (match entries | List.nil => (render (cons (ctor Work.raw 0x7b) (cons (ctor Work.objectTail sorted) (cons (ctor Work.raw 0x7d) tail))) output maximum more) | List.cons entry rest => (render (cons (ctor Work.insertEntry entry sorted (nil (Bytes * Json::Value)) rest) tail) output maximum more)) + | Work.insertEntry entry sorted prefix remaining => (if (keyFits (first entry) maximum) then (match sorted + | List.nil => (render (cons (ctor Work.restoreEntries prefix (cons entry (nil (Bytes * Json::Value))) remaining) tail) output maximum more) + | List.cons firstEntry rest => (if (keyFits (first firstEntry) maximum) then (if (Toml::sameBytes (first entry) (first firstEntry)) then (ctor Option.none [Bytes]) else (if (Hypotheses::lessBytes (first entry) (first firstEntry)) then (render (cons (ctor Work.restoreEntries prefix (cons entry sorted) remaining) tail) output maximum more) else (render (cons (ctor Work.insertEntry entry rest (cons firstEntry prefix) remaining) tail) output maximum more))) else (ctor Option.none [Bytes]))) else (ctor Option.none [Bytes])) + | Work.restoreEntries prefix sorted remaining => (match prefix + | List.nil => (render (cons (ctor Work.sortEntries remaining sorted) tail) output maximum more) + | List.cons entry rest => (render (cons (ctor Work.restoreEntries rest (cons entry sorted) remaining) tail) output maximum more))))), + axioms: [propext], + recursive_argument: fuel, + executable: true +} + +definition{ + name: encode, + parameters: [value : Json::Value, maxBytes : Nat, maxSteps : Nat], + result: (Option Bytes), + body: (render (cons (ctor Work.value value) (nil Work)) (LexLeanStd.Buffer::new maxBytes) maxBytes maxSteps), + axioms: [propext], + executable: true +} + +definition{ + name: canonicalize, + parameters: [source : Bytes, maxBytes : Nat, maxDepth : Nat, maxSteps : Nat], + result: (Option Bytes), + body: (match (Json::parse source maxBytes maxDepth) | Result.error problem => (ctor Option.none [Bytes]) | Result.ok value => (encode value maxBytes maxSteps)), + axioms: [propext], + executable: true +} + +definition{ + name: file, + parameters: [value : Json::Value, maxBytes : Nat, maxSteps : Nat], + result: (Option Bytes), + body: (if (0 (ctor Option.none [Bytes]) | Option.some bytes => (ctor Option.some [Bytes] (Json::append bytes 0x0a))) else (ctor Option.none [Bytes])), + axioms: [propext], + executable: true +} + +definition{ + name: features, + parameters: [], + result: (List String), + body: (cons "signed-integer-domain" (cons "utf8-byte-key-order" (cons "duplicate-key-rejection" (cons "minimal-string-escaping" (cons "bounded-canonical-encoding" (cons "newline-free-identity" (cons "canonical-file-newline" (nil String)))))))), + axioms: [], + executable: true +} + +\end{semanticmodule} +\end{lexlean} diff --git a/rule30-api/src/JsonCanonicalTraces.lex.tex b/rule30-api/src/JsonCanonicalTraces.lex.tex new file mode 100644 index 0000000..8fa8512 --- /dev/null +++ b/rule30-api/src/JsonCanonicalTraces.lex.tex @@ -0,0 +1,331 @@ +\begin{lexlean}{JsonCanonicalTraces} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\importmodule{Json} +\importmodule{JsonCanonical} +\importmodule{LexLeanStd.Buffer} +\importmodule{Toml} +\title{Boolean} +\begin{semanticmodule} + +definition{ + name: hasBytes, + parameters: [result : (Option Bytes), expectedBytes : Bytes], + result: Bool, + body: (match result | Option.none => false | Option.some actual => (Toml::sameBytes actual expectedBytes)), + axioms: [] +} + +theorem{ + name: sorted, + parameters: [], + statement: ((hasBytes (JsonCanonical::canonicalize 0x207b20227a223a205b747275652c202d305d2c202261223a2022612f6222207d 512 16 128) 0x7b2261223a22612f62222c227a223a5b747275652c305d7d) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: nested, + parameters: [], + statement: ((hasBytes (JsonCanonical::canonicalize 0x7b2278223a7b2262223a322c2261223a317d7d 512 16 128) 0x7b2278223a7b2261223a312c2262223a327d7d) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: unicode, + parameters: [], + statement: ((hasBytes (JsonCanonical::canonicalize 0x7b22f09f9880223a312c22c3a9223a322c2261223a337d 512 16 128) 0x7b2261223a332c22c3a9223a322c22f09f9880223a317d) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: escaped, + parameters: [], + statement: ((hasBytes (JsonCanonical::canonicalize 0x225c75303030305c625c665c6e5c725c745c75303031665c225c5c5c2f22 512 16 128) 0x225c75303030305c625c665c6e5c725c745c75303031665c225c5c2f22) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: surrogate, + parameters: [], + statement: ((hasBytes (JsonCanonical::canonicalize 0x225c75643833645c756465303022 512 16 128) 0x22f09f988022) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: minimum, + parameters: [], + statement: ((hasBytes (JsonCanonical::canonicalize 0x2d39323233333732303336383534373735383038 512 16 128) 0x2d39323233333732303336383534373735383038) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: maximum, + parameters: [], + statement: ((hasBytes (JsonCanonical::canonicalize 0x39323233333732303336383534373735383037 512 16 128) 0x39323233333732303336383534373735383037) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: zero, + parameters: [], + statement: ((hasBytes (JsonCanonical::canonicalize 0x2d30 512 16 128) 0x30) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: null, + parameters: [], + statement: ((JsonCanonical::canonicalize 0x6e756c6c 512 16 128) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: nestedNull, + parameters: [], + statement: ((JsonCanonical::canonicalize 0x5b312c6e756c6c5d 512 16 128) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: positiveOverflow, + parameters: [], + statement: ((JsonCanonical::canonicalize 0x39323233333732303336383534373735383038 512 16 128) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: negativeOverflow, + parameters: [], + statement: ((JsonCanonical::canonicalize 0x2d39323233333732303336383534373735383039 512 16 128) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: fraction, + parameters: [], + statement: ((JsonCanonical::canonicalize 0x312e30 512 16 128) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: exponent, + parameters: [], + statement: ((JsonCanonical::canonicalize 0x316530 512 16 128) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: duplicate, + parameters: [], + statement: ((JsonCanonical::canonicalize 0x7b2261223a312c225c7530303631223a327d 512 16 128) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: leadingZero, + parameters: [], + statement: ((JsonCanonical::canonicalize 0x3031 512 16 128) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: emptyNumber, + parameters: [], + statement: ((JsonCanonical::canonicalize 0x 512 16 128) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: plus, + parameters: [], + statement: ((JsonCanonical::canonicalize 0x2b31 512 16 128) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: rawDuplicate, + parameters: [], + statement: ((JsonCanonical::encode (ctor Json::Value.object (cons (0x61, (ctor Json::Value.boolean true)) (cons (0x61, (ctor Json::Value.boolean false)) (nil (Bytes * Json::Value))))) 512 128) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: invalidUtf8, + parameters: [], + statement: ((JsonCanonical::encode (ctor Json::Value.string 0xc080) 512 128) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: invalidKey, + parameters: [], + statement: ((JsonCanonical::encode (ctor Json::Value.object (cons (0xff, (ctor Json::Value.boolean true)) (nil (Bytes * Json::Value)))) 512 128) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: rawFraction, + parameters: [], + statement: ((JsonCanonical::encode (ctor Json::Value.number 0x312e30) 512 128) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: rawLeadingZero, + parameters: [], + statement: ((JsonCanonical::encode (ctor Json::Value.number 0x3031) 512 128) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: exactLimit, + parameters: [], + statement: ((hasBytes (JsonCanonical::canonicalize 0x226122 3 16 2) 0x226122) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: shortLimit, + parameters: [], + statement: ((JsonCanonical::canonicalize 0x226122 2 16 2) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: escapeLimit, + parameters: [], + statement: ((hasBytes (JsonCanonical::canonicalize 0x225c6e22 4 16 2) 0x225c6e22) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: shortEscape, + parameters: [], + statement: ((JsonCanonical::canonicalize 0x225c6e22 3 16 2) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: workExhausted, + parameters: [], + statement: ((JsonCanonical::canonicalize 0x74727565 4 16 1) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: zeroWork, + parameters: [], + statement: ((JsonCanonical::canonicalize 0x5b5d 2 16 0) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: emptyArray, + parameters: [], + statement: ((hasBytes (JsonCanonical::canonicalize 0x5b5d 2 16 4) 0x5b5d) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: emptyString, + parameters: [], + statement: ((hasBytes (JsonCanonical::canonicalize 0x2222 2 16 2) 0x2222) = true), + proof: decide{}, + axioms: [propext] +} +theorem{ + name: exhaustedWorkDoesNotTraverseContainers, + parameters: [head : JsonCanonical::Work, tail : (List JsonCanonical::Work), output : LexLeanStd.Buffer::Buffer, byteLimit : Nat], + statement: ((JsonCanonical::render (cons head tail) output byteLimit 0) = (ctor Option.none [Bytes])), + proof: reflexivity{}, + axioms: [propext] +} + +theorem{ + name: objectExpansionSchedulesSorting, + parameters: [entries : (List (Bytes * Json::Value)), tail : (List JsonCanonical::Work), byteLimit : Nat], + statement: ((JsonCanonical::expand (ctor Json::Value.object entries) tail byteLimit) = (ctor Option.some [(List JsonCanonical::Work)] (cons (ctor JsonCanonical::Work.sortEntries entries (nil (Bytes * Json::Value))) tail))), + proof: reflexivity{}, + axioms: [propext] +} + +theorem{ + name: oversizedKeyStopsBeforeSorting, + parameters: [value : Json::Value, sortedItems : (List (Bytes * Json::Value)), prefix : (List (Bytes * Json::Value)), remaining : (List (Bytes * Json::Value)), tail : (List JsonCanonical::Work), output : LexLeanStd.Buffer::Buffer, fuel : Nat], + statement: ((JsonCanonical::render (cons (ctor JsonCanonical::Work.insertEntry (0x616263, value) sortedItems prefix remaining) tail) output 4 (ctor Nat.succ fuel)) = (ctor Option.none [Bytes])), + proof: reflexivity{}, + axioms: [propext] +} + +theorem{ + name: oversizedStoredKeyStopsBeforeComparison, + parameters: [value : Json::Value, stored : Json::Value, rest : (List (Bytes * Json::Value)), prefix : (List (Bytes * Json::Value)), remaining : (List (Bytes * Json::Value)), tail : (List JsonCanonical::Work), output : LexLeanStd.Buffer::Buffer, fuel : Nat], + statement: ((JsonCanonical::render (cons (ctor JsonCanonical::Work.insertEntry (0x61, value) (cons (0x616263, stored) rest) prefix remaining) tail) output 4 (ctor Nat.succ fuel)) = (ctor Option.none [Bytes])), + proof: reflexivity{}, + axioms: [propext] +} + +theorem{ + name: oversizedNumberStopsBeforeParsing, + parameters: [tail : (List JsonCanonical::Work), byteLimit : Nat], + statement: ((JsonCanonical::expand (ctor Json::Value.number 0x2d393232333337323033363835343737353830383030) tail byteLimit) = (ctor Option.none [(List JsonCanonical::Work)])), + proof: reflexivity{}, + axioms: [propext] +} + +theorem{ + name: negativeZeroFitsCanonicalBudget, + parameters: [], + statement: ((hasBytes (JsonCanonical::encode (ctor Json::Value.number 0x2d30) 1 2) 0x30) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: canonicalFileHasOneNewline, + parameters: [], + statement: ((hasBytes (JsonCanonical::file (ctor Json::Value.boolean true) 5 2) 0x747275650a) = true), + proof: decide{}, + axioms: [propext] +} + +theorem{ + name: fileLimitIncludesNewline, + parameters: [], + statement: ((JsonCanonical::file (ctor Json::Value.boolean true) 4 2) = (ctor Option.none [Bytes])), + proof: decide{}, + axioms: [propext] +} + +\end{semanticmodule} +\end{lexlean} diff --git a/rule30-api/src/R30.lex.tex b/rule30-api/src/R30.lex.tex index 6ed1a61..0acfd95 100644 --- a/rule30-api/src/R30.lex.tex +++ b/rule30-api/src/R30.lex.tex @@ -10,7 +10,7 @@ name: rootKind, parameters: [], result: String, - body: "step consumes LexLeanStd.Host.Event and returns a session and LexLeanStd.Host.Request. These are imported source-package types from the v0.5 development branch; Rule30Api.Host supplies application adapters, not duplicate protocol types. The root is certified for rust-std with allocation, overflow and recursion, and production exports a pure Rust library function when a request names it. Its closure constructs read, stat and exit through Host::realize. Constructing a request does not execute an effect: the compiler's generated command driver, files and process effect checking, and connection to the research executor remain implementation work on our v0.5-based LexLean branch. rule30-api/production/request.json and model/runtime-roots.toml still describe the deprecated runtime's roots, so bin/r30 api production does not export step. plan carries paths and output as pieces; step realizes paths as text and output as exact bytes. step realizes plan by definition, and the kernel decides traces of plan.", + body: "step consumes LexLeanStd.Host.Event and returns a session and LexLeanStd.Host.Request. These are imported source-package types from the v0.5 development branch; Rule30Api.Host supplies application adapters. The root declares allocation, files, overflow and recursion for rust-std. Its closure constructs read, stat and exit through Host::realize; a production request naming step can export the native executable driver that executes these requests. Connection to the research executor remains application work. rule30-api/production/request.json and model/runtime-roots.toml describe the legacy runtime's roots, so bin/r30 api production does not export step. plan carries paths and output as pieces; step realizes paths as text and output as exact bytes. step realizes plan by definition, and the kernel decides traces of plan.", executable: true } @@ -877,7 +877,7 @@ body: (let drafted : (Session * Host::Draft) := (plan state event); ((first drafted), (Host::realize (second drafted)))), axioms: [Quot.sound, propext], executable: true, - production: {effects: [allocation, overflow, recursion], targets: [rust-std]} + production: {effects: [allocation, files, overflow, recursion], targets: [rust-std]} } theorem{ diff --git a/rule30-api/src/Research.lex.tex b/rule30-api/src/Research.lex.tex index efcbb0a..1418e1f 100644 --- a/rule30-api/src/Research.lex.tex +++ b/rule30-api/src/Research.lex.tex @@ -11,7 +11,7 @@ name: boundary, parameters: [], result: String, - body: "Research is the pure research controller. A schema minted by Hypotheses is a retrieval key, never a universally quantified goal to prove. Inspecting it must return the source theorem's exact telescope and premise position before deduction can begin. A kernel answer is an outcome of the controller's outstanding request, supplied by the execution boundary after elaboration, axiom checking and replay; a row read from a register is not a kernel answer. Matching a receipt establishes custody and applicability, not the truth of a proposition. Only the kernel establishes the latter. The controller never turns a strategy failure, a budget cut or a shared head symbol into a refutation. Actions carry their complete snapshot, task and sequent so an executor cannot substitute a different instance. The pinned compiler exports this step as a pure Rust library; its host driver remains the upstream LexLean issue 271 boundary.", + body: "Research is the pure research controller. A schema minted by Hypotheses is a retrieval key, never a universally quantified goal to prove. Inspecting it must return the source theorem's exact telescope and premise position before deduction can begin. A kernel answer is an outcome of the controller's outstanding request, supplied by the execution boundary after elaboration, axiom checking and replay; a row read from a register is not a kernel answer. Matching a receipt establishes custody and applicability, not the truth of a proposition. Only the kernel establishes the latter. The controller never turns a strategy failure, a budget cut or a shared head symbol into a refutation. Actions carry their complete snapshot, task and sequent so an executor cannot substitute a different instance. The pinned compiler exports this controller step as a pure Rust library. ResearchRunner owns its verification lifecycle; the native Host command entry must supply application wiring.", executable: true } diff --git a/rule30-api/src/ResearchCatalog.lex.tex b/rule30-api/src/ResearchCatalog.lex.tex index 90aaec3..a0bbd5f 100644 --- a/rule30-api/src/ResearchCatalog.lex.tex +++ b/rule30-api/src/ResearchCatalog.lex.tex @@ -13,6 +13,11 @@ \importmodule{Standards} \importmodule{Toml} \importmodule{Json} +\importmodule{JsonCanonical} +\importmodule{CoreBinding} +\importmodule{ArtifactIdentity} +\importmodule{ResearchProof} +\importmodule{CandidateBinding} \importmodule{VerificationReport} \importmodule{ResearchVerification} \title{Boolean} @@ -35,7 +40,7 @@ name: moduleScopes, parameters: [], result: (List Scope), - body: (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e557466384669787475726573 "VerificationUtf8Fixtures") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e436f6d6d616e644669787475726573 "VerificationCommandFixtures") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e4a736f6e44617461 "VerificationJsonData") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e4a736f6e537465707330 "VerificationJsonSteps0") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e4a736f6e537465707331 "VerificationJsonSteps1") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e4a736f6e537465707332 "VerificationJsonSteps2") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e4a736f6e537465707333 "VerificationJsonSteps3") (cons (unitScope 0x6d6f64756c652f417069 "Api") (cons (unitScope 0x6d6f64756c652f4170706c69636174696f6e "Application") (cons (unitScope 0x6d6f64756c652f417263686974656374757265 "Architecture") (cons (unitScope 0x6d6f64756c652f4175646974 "Audit") (cons (unitScope 0x6d6f64756c652f436f6e76657274 "Convert") (cons (unitScope 0x6d6f64756c652f446973636f76657279 "Discovery") (cons (unitScope 0x6d6f64756c652f456e67696e65 "Engine") (cons (unitScope 0x6d6f64756c652f486f7374 "Host") (cons (unitScope 0x6d6f64756c652f4879706f746865736573 "Hypotheses") (cons (unitScope 0x6d6f64756c652f4f62736572766572 "Observer") (cons (unitScope 0x6d6f64756c652f50726573656e746174696f6e "Presentation") (cons (unitScope 0x6d6f64756c652f523330 "R30") (cons (unitScope 0x6d6f64756c652f523330547261636573 "R30Traces") (cons (unitScope 0x6d6f64756c652f523330547261636573436c61696d73 "R30TracesClaims") (cons (unitScope 0x6d6f64756c652f523330547261636573466f726d73 "R30TracesForms") (cons (unitScope 0x6d6f64756c652f5233305472616365735265676973746572 "R30TracesRegister") (cons (unitScope 0x6d6f64756c652f5265676973746572 "Register") (cons (unitScope 0x6d6f64756c652f5265736561726368 "Research") (cons (unitScope 0x6d6f64756c652f5265736561726368436174616c6f67 "ResearchCatalog") (cons (unitScope 0x6d6f64756c652f5265736561726368547261636573 "ResearchTraces") (cons (unitScope 0x6d6f64756c652f52756c653330436f7265 "Rule30Core") (cons (unitScope 0x6d6f64756c652f53657175656e636573 "Sequences") (cons (unitScope 0x6d6f64756c652f5374616e6461726473 "Standards") (cons (unitScope 0x6d6f64756c652f546f6d6c "Toml") (cons (unitScope 0x6d6f64756c652f466f756e646174696f6e2e41726368 "Foundation.Arch") (cons (unitScope 0x6d6f64756c652f466f756e646174696f6e2e5175616c "Foundation.Qual") (cons (unitScope 0x6d6f64756c652f4c65784c65616e5374642e427566666572 "LexLeanStd.Buffer") (cons (unitScope 0x6d6f64756c652f4c65784c65616e5374642e54657874 "LexLeanStd.Text") (cons (unitScope 0x6d6f64756c652f4c65784c65616e5374642e536861323536 "LexLeanStd.Sha256") (cons (unitScope 0x6d6f64756c652f4c65784c65616e5374642e486f7374 "LexLeanStd.Host") (cons (unitScope 0x6d6f64756c652f5265736561726368457865637574696f6e "ResearchExecution") (cons (unitScope 0x6d6f64756c652f5265736561726368457865637574696f6e547261636573 "ResearchExecutionTraces") (cons (unitScope 0x6d6f64756c652f526573656172636852756e6e6572 "ResearchRunner") (cons (unitScope 0x6d6f64756c652f526573656172636852756e6e6572547261636573 "ResearchRunnerTraces") (cons (unitScope 0x6d6f64756c652f4a736f6e "Json") (cons (unitScope 0x6d6f64756c652f4a736f6e547261636573 "JsonTraces") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e5265706f7274 "VerificationReport") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e5265706f7274547261636573 "VerificationReportTraces") (cons (unitScope 0x6d6f64756c652f5265736561726368566572696669636174696f6e "ResearchVerification") (cons (unitScope 0x6d6f64756c652f5265736561726368566572696669636174696f6e547261636573 "ResearchVerificationTraces") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e4a736f6e4669787475726573 "VerificationJsonFixtures") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e486173684669787475726573 "VerificationHashFixtures") (nil Scope)))))))))))))))))))))))))))))))))))))))))))))))))), + body: (cons (unitScope 0x6d6f64756c652f526573656172636850726f6f66547261636573 "ResearchProofTraces") (cons (unitScope 0x6d6f64756c652f43616e64696461746542696e64696e67547261636573 "CandidateBindingTraces") (cons (unitScope 0x6d6f64756c652f42696e64696e6746697874757265 "BindingFixture") (cons (unitScope 0x6d6f64756c652f526573656172636850726f6f66 "ResearchProof") (cons (unitScope 0x6d6f64756c652f43616e64696461746542696e64696e67 "CandidateBinding") (cons (unitScope 0x6d6f64756c652f41727469666163744964656e74697479547261636573 "ArtifactIdentityTraces") (cons (unitScope 0x6d6f64756c652f41727469666163744964656e74697479 "ArtifactIdentity") (cons (unitScope 0x6d6f64756c652f436f726542696e64696e67547261636573 "CoreBindingTraces") (cons (unitScope 0x6d6f64756c652f436f726542696e64696e67 "CoreBinding") (cons (unitScope 0x6d6f64756c652f4a736f6e43616e6f6e6963616c547261636573 "JsonCanonicalTraces") (cons (unitScope 0x6d6f64756c652f4a736f6e43616e6f6e6963616c "JsonCanonical") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e557466384669787475726573 "VerificationUtf8Fixtures") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e436f6d6d616e644669787475726573 "VerificationCommandFixtures") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e4a736f6e44617461 "VerificationJsonData") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e4a736f6e537465707330 "VerificationJsonSteps0") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e4a736f6e537465707331 "VerificationJsonSteps1") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e4a736f6e537465707332 "VerificationJsonSteps2") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e4a736f6e537465707333 "VerificationJsonSteps3") (cons (unitScope 0x6d6f64756c652f417069 "Api") (cons (unitScope 0x6d6f64756c652f4170706c69636174696f6e "Application") (cons (unitScope 0x6d6f64756c652f417263686974656374757265 "Architecture") (cons (unitScope 0x6d6f64756c652f4175646974 "Audit") (cons (unitScope 0x6d6f64756c652f436f6e76657274 "Convert") (cons (unitScope 0x6d6f64756c652f446973636f76657279 "Discovery") (cons (unitScope 0x6d6f64756c652f456e67696e65 "Engine") (cons (unitScope 0x6d6f64756c652f486f7374 "Host") (cons (unitScope 0x6d6f64756c652f4879706f746865736573 "Hypotheses") (cons (unitScope 0x6d6f64756c652f4f62736572766572 "Observer") (cons (unitScope 0x6d6f64756c652f50726573656e746174696f6e "Presentation") (cons (unitScope 0x6d6f64756c652f523330 "R30") (cons (unitScope 0x6d6f64756c652f523330547261636573 "R30Traces") (cons (unitScope 0x6d6f64756c652f523330547261636573436c61696d73 "R30TracesClaims") (cons (unitScope 0x6d6f64756c652f523330547261636573466f726d73 "R30TracesForms") (cons (unitScope 0x6d6f64756c652f5233305472616365735265676973746572 "R30TracesRegister") (cons (unitScope 0x6d6f64756c652f5265676973746572 "Register") (cons (unitScope 0x6d6f64756c652f5265736561726368 "Research") (cons (unitScope 0x6d6f64756c652f5265736561726368436174616c6f67 "ResearchCatalog") (cons (unitScope 0x6d6f64756c652f5265736561726368547261636573 "ResearchTraces") (cons (unitScope 0x6d6f64756c652f52756c653330436f7265 "Rule30Core") (cons (unitScope 0x6d6f64756c652f53657175656e636573 "Sequences") (cons (unitScope 0x6d6f64756c652f5374616e6461726473 "Standards") (cons (unitScope 0x6d6f64756c652f546f6d6c "Toml") (cons (unitScope 0x6d6f64756c652f466f756e646174696f6e2e41726368 "Foundation.Arch") (cons (unitScope 0x6d6f64756c652f466f756e646174696f6e2e5175616c "Foundation.Qual") (cons (unitScope 0x6d6f64756c652f4c65784c65616e5374642e427566666572 "LexLeanStd.Buffer") (cons (unitScope 0x6d6f64756c652f4c65784c65616e5374642e54657874 "LexLeanStd.Text") (cons (unitScope 0x6d6f64756c652f4c65784c65616e5374642e536861323536 "LexLeanStd.Sha256") (cons (unitScope 0x6d6f64756c652f4c65784c65616e5374642e486f7374 "LexLeanStd.Host") (cons (unitScope 0x6d6f64756c652f5265736561726368457865637574696f6e "ResearchExecution") (cons (unitScope 0x6d6f64756c652f5265736561726368457865637574696f6e547261636573 "ResearchExecutionTraces") (cons (unitScope 0x6d6f64756c652f526573656172636852756e6e6572 "ResearchRunner") (cons (unitScope 0x6d6f64756c652f526573656172636852756e6e6572547261636573 "ResearchRunnerTraces") (cons (unitScope 0x6d6f64756c652f4a736f6e "Json") (cons (unitScope 0x6d6f64756c652f4a736f6e547261636573 "JsonTraces") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e5265706f7274 "VerificationReport") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e5265706f7274547261636573 "VerificationReportTraces") (cons (unitScope 0x6d6f64756c652f5265736561726368566572696669636174696f6e "ResearchVerification") (cons (unitScope 0x6d6f64756c652f5265736561726368566572696669636174696f6e547261636573 "ResearchVerificationTraces") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e4a736f6e4669787475726573 "VerificationJsonFixtures") (cons (unitScope 0x6d6f64756c652f566572696669636174696f6e486173684669787475726573 "VerificationHashFixtures") (nil Scope))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), axioms: [] } @@ -43,7 +48,7 @@ name: facetScopes, parameters: [], result: (List Scope), - body: (cons (record Scope {id := 0x617069, module := "Api", features := (Architecture::commandNames (Api::commands))}) + body: (cons (record Scope {id := 0x70726f6f662d766572696669636174696f6e, module := "ResearchProof", features := (ResearchProof::features)}) (cons (record Scope {id := 0x63616e6469646174652d62696e64696e67, module := "CandidateBinding", features := (CandidateBinding::features)}) (cons (record Scope {id := 0x61727469666163742d6964656e74697479, module := "ArtifactIdentity", features := (ArtifactIdentity::features)}) (cons (record Scope {id := 0x636f72652d62696e64696e67, module := "CoreBinding", features := (CoreBinding::features)}) (cons (record Scope {id := 0x63616e6f6e6963616c2d6a736f6e, module := "JsonCanonical", features := (JsonCanonical::features)}) (cons (record Scope {id := 0x617069, module := "Api", features := (Architecture::commandNames (Api::commands))}) (cons (record Scope {id := 0x636c61696d73, module := "Register", features := (Register::idsOf (Register::claims))}) (cons (record Scope {id := 0x7374616b65686f6c64657273, module := "Architecture", features := (Architecture::stakeholderIds (Architecture::stakeholders))}) (cons (record Scope {id := 0x636f6e6365726e73, module := "Architecture", features := (Architecture::concernIds (Architecture::concerns))}) @@ -62,7 +67,7 @@ (cons (record Scope {id := 0x706f7274666f6c696f, module := "Engine", features := (Engine::strategyIdsOf (Engine::portfolio))}) (cons (record Scope {id := 0x7265616c697a657273, module := "Standards", features := (Standards::declaredIds)}) (cons (record Scope {id := 0x7374646c6962, module := "Research", features := (cons "Foundation.Arch" (cons "Foundation.Qual" (cons "LexLeanStd.Buffer" (cons "LexLeanStd.Text" (cons "LexLeanStd.Sha256" (cons "LexLeanStd.Host" (nil String)))))))}) - (cons (record Scope {id := 0x6a736f6e, module := "Json", features := (Json::features)}) (cons (record Scope {id := 0x766572696669636174696f6e2d7265706f727473, module := "VerificationReport", features := (VerificationReport::features)}) (cons (record Scope {id := 0x766572696669636174696f6e2d657865637574696f6e, module := "ResearchVerification", features := (ResearchVerification::features)}) (nil Scope))))))))))))))))))))))), + (cons (record Scope {id := 0x6a736f6e, module := "Json", features := (Json::features)}) (cons (record Scope {id := 0x766572696669636174696f6e2d7265706f727473, module := "VerificationReport", features := (VerificationReport::features)}) (cons (record Scope {id := 0x766572696669636174696f6e2d657865637574696f6e, module := "ResearchVerification", features := (ResearchVerification::features)}) (nil Scope)))))))))))))))))))))))))))), axioms: [] } diff --git a/rule30-api/src/ResearchExecution.lex.tex b/rule30-api/src/ResearchExecution.lex.tex index 254cee0..faaf55a 100644 --- a/rule30-api/src/ResearchExecution.lex.tex +++ b/rule30-api/src/ResearchExecution.lex.tex @@ -93,7 +93,7 @@ body: (if (validJob job) then ((record State {job := job, phase := (ctor Phase.spawning), owner := (ctor Option.none [Nat])}), (ctor Emission.host (ctor LexLeanStd.Host::Request.spawn (record LexLeanStd.Host::Child {program := (program (project job tool)), arguments := (project job arguments), directory := (project job directory), environment := (project job environment), output := (project job output), errors := (project job errors)})))) else (finish job (ctor EndKind.refused) (ctor Option.none [Int32]) 0 0x696e76616c6964206a6f62)), axioms: [], executable: true, - production: {effects: [allocation, overflow, recursion], targets: [rust-std]} + production: {effects: [allocation, overflow, process, recursion], targets: [rust-std]} } definition{ @@ -265,7 +265,7 @@ body: (let result : (State * Emission) := (advance state event); ((record State {job := (project (first result) job), phase := (project (first result) phase), owner := (match (project (first result) owner) | Option.some child => (ctor Option.some [Nat] child) | Option.none => (project state owner))}), (second result))), axioms: [], executable: true, - production: {effects: [allocation, overflow, recursion], targets: [rust-std]} + production: {effects: [allocation, overflow, process, recursion], targets: [rust-std]} } definition{ diff --git a/rule30-api/src/ResearchProof.lex.tex b/rule30-api/src/ResearchProof.lex.tex new file mode 100644 index 0000000..22e1d86 --- /dev/null +++ b/rule30-api/src/ResearchProof.lex.tex @@ -0,0 +1,122 @@ +\begin{lexlean}{ResearchProof} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\importmodule{LexLeanStd.Host} +\importmodule{Research} +\importmodule{ResearchExecution} +\importmodule{ResearchVerification} +\importmodule{VerificationReport} +\importmodule{CandidateBinding} +\title{Boolean} +\begin{semanticmodule} + +definition{ + name: contract, + parameters: [], + result: String, + body: "One owned local verification lifecycle promotes a proof only after its accepted report is bound to the candidate linked IR and exact contextual sequent. Host events and cancellation are the only runtime inputs after begin; an external Answer or Receipt is not an event. A rejected type or identity produces failed evidence. Cancellation, stale snapshots and failed process cleanup preserve the verifier lifecycle; cleanup failure blocks dispatch with the owned state retained. Candidate source construction, source inspection and durable publication are caller responsibilities.", + axioms: [], + executable: true +} + +structure{ + name: State, + type_parameters: [], + parameters: [], + fields: [{name: verification, type: ResearchVerification::State}, {name: binding, type: CandidateBinding::Input}, {name: maxDepth, type: Nat}, {name: maxSteps, type: Nat}] +} +inductive{ + name: Emission, + type_parameters: [], + parameters: [], + constructors: [{name: host, fields: [LexLeanStd.Host::Request]}, {name: awaiting, fields: []}, {name: complete, fields: [Research::Answer]}, {name: blocked, fields: [ResearchExecution::Completion]}] +} + +definition{ + name: answer, + parameters: [state : State, result : Research::ResultKind], + result: Emission, + body: (ctor Emission.complete (record Research::Answer {request := (project (project (project state verification) pins) request), result := result})), + axioms: [], + executable: true +} + +definition{ + name: terminated, + parameters: [state : State, completion : ResearchExecution::Completion], + result: Emission, + body: (if (ResearchExecution::resumeAllowed completion) then (match (project completion kind) + | ResearchExecution::EndKind.cut => (answer state (ctor Research::ResultKind.cut)) + | ResearchExecution::EndKind.unavailable => (answer state (ctor Research::ResultKind.unavailable)) + | ResearchExecution::EndKind.failed => (answer state (ctor Research::ResultKind.failed 0x766572696669636174696f6e206661696c6564)) + | ResearchExecution::EndKind.succeeded => (answer state (ctor Research::ResultKind.failed 0x766572696669636174696f6e20686173206e6f207265706f7274)) + | ResearchExecution::EndKind.protocol => (ctor Emission.blocked completion) + | ResearchExecution::EndKind.cleanupFailed => (ctor Emission.blocked completion) + | ResearchExecution::EndKind.refused => (ctor Emission.blocked completion)) else (ctor Emission.blocked completion)), + axioms: [], + executable: true +} + +definition{ + name: accepted, + parameters: [state : State, receipt : VerificationReport::Receipt], + result: Emission, + body: (match (CandidateBinding::accept (project (project state verification) pins) (project state binding) receipt (project (project (project state verification) config) maxBytes) (project state maxDepth) (project state maxSteps)) | Option.none => (answer state (ctor Research::ResultKind.failed 0x63616e6469646174652073746174656d656e74206f72206964656e7469747920646f6573206e6f74206d61746368)) | Option.some result => (ctor Emission.complete result)), + axioms: [Quot.sound, propext], + executable: true +} + +definition{ + name: outcome, + parameters: [state : State, result : ResearchVerification::Outcome], + result: Emission, + body: (match result | ResearchVerification::Outcome.accepted receipt => (accepted state receipt) | ResearchVerification::Outcome.terminated completion => (terminated state completion) | ResearchVerification::Outcome.rejected reason => (answer state (ctor Research::ResultKind.failed (prim utf8_encode reason : Bytes))) | ResearchVerification::Outcome.cancelled => (answer state (ctor Research::ResultKind.cut))), + axioms: [Quot.sound, propext], + executable: true +} + +definition{ + name: forward, + parameters: [binding : CandidateBinding::Input, maxDepth : Nat, maxSteps : Nat, result : (ResearchVerification::State * ResearchVerification::Emission)], + result: (State * Emission), + body: (let state : State := (record State {verification := (first result), binding := binding, maxDepth := maxDepth, maxSteps := maxSteps}); (state, (match (second result) | ResearchVerification::Emission.host request => (ctor Emission.host request) | ResearchVerification::Emission.awaiting => (ctor Emission.awaiting) | ResearchVerification::Emission.complete finished => (outcome state finished)))), + axioms: [Quot.sound, propext], + executable: true +} + +definition{ + name: begin, + parameters: [pins : VerificationReport::Pins, config : ResearchVerification::Config, binding : CandidateBinding::Input, maxDepth : Nat, maxSteps : Nat], + result: (State * Emission), + body: (forward binding maxDepth maxSteps (ResearchVerification::begin pins config)), + axioms: [Quot.sound, propext], + executable: true +} + +definition{ + name: step, + parameters: [state : State, event : ResearchVerification::Event], + result: (State * Emission), + body: (forward (project state binding) (project state maxDepth) (project state maxSteps) (ResearchVerification::step (project state verification) event)), + axioms: [Quot.sound, propext], + executable: true +} + +theorem{ + name: completedProofIsSilent, + parameters: [verification : ResearchVerification::State, result : ResearchVerification::Outcome, binding : CandidateBinding::Input, maxDepth : Nat, maxSteps : Nat, event : ResearchVerification::Event], + statement: ((step (record State {verification := (first (ResearchVerification::finish verification result)), binding := binding, maxDepth := maxDepth, maxSteps := maxSteps}) event) = ((record State {verification := (first (ResearchVerification::finish verification result)), binding := binding, maxDepth := maxDepth, maxSteps := maxSteps}), (ctor Emission.awaiting))), + proof: reflexivity{}, + axioms: [Quot.sound, propext] +} + +definition{ + name: features, + parameters: [], + result: (List String), + body: (cons "owned-proof-verification" (cons "semantic-and-statement-promotion" (cons "no-external-receipt-event" (cons "cancel-before-promotion" (cons "cleanup-blocks-dispatch" (cons "single-proof-outcome" (nil String))))))), + axioms: [], + executable: true +} +\end{semanticmodule} +\end{lexlean} diff --git a/rule30-api/src/ResearchProofTraces.lex.tex b/rule30-api/src/ResearchProofTraces.lex.tex new file mode 100644 index 0000000..d633b55 --- /dev/null +++ b/rule30-api/src/ResearchProofTraces.lex.tex @@ -0,0 +1,197 @@ +\begin{lexlean}{ResearchProofTraces} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\importmodule{LexLeanStd.Host} +\importmodule{Json} +\importmodule{Research} +\importmodule{ResearchTraces} +\importmodule{ResearchExecution} +\importmodule{ResearchExecutionTraces} +\importmodule{ResearchVerification} +\importmodule{ResearchVerificationTraces} +\importmodule{VerificationReport} +\importmodule{VerificationReportTraces} +\importmodule{CandidateBinding} +\importmodule{ResearchProof} +\importmodule{ResearchRunner} +\importmodule{ResearchRunnerTraces} +\title{Boolean} +\begin{semanticmodule} + +definition{ + name: input, + parameters: [], + result: CandidateBinding::Input, + body: (record CandidateBinding::Input {linked := (ctor Json::Value.null), lexicon := (ctor Json::Value.null)}), + axioms: [] +} + +definition{ + name: research, + parameters: [], + result: Research::State, + body: (record Research::State {snapshot := (project (VerificationReportTraces::request) snapshot), components := (ResearchTraces::components), tasks := (cons (project (VerificationReportTraces::request) task) (nil Research::Task)), pending := (ctor Option.none [Research::Request]), next := 1, history := (nil Research::Answer)}), + axioms: [] +} + +definition{ + name: initial, + parameters: [], + result: (ResearchRunner::State * ResearchRunner::Action), + body: (ResearchRunner::begin (research)), + axioms: [] +} + +definition{ + name: started, + parameters: [], + result: (ResearchRunner::State * ResearchRunner::Action), + body: (ResearchRunner::step (first (initial)) (ctor ResearchRunner::Event.proof (VerificationReportTraces::pins) (ResearchVerificationTraces::settings) (input) 32 1024)), + axioms: [Quot.sound, propext] +} + +definition{ + name: cancelled, + parameters: [], + result: (ResearchRunner::State * ResearchRunner::Action), + body: (ResearchRunner::step (first (started)) (ctor ResearchRunner::Event.cancel)), + axioms: [Quot.sound, propext] +} + +definition{ + name: stopping, + parameters: [], + result: (ResearchRunner::State * ResearchRunner::Action), + body: (ResearchRunner::step (first (cancelled)) (ctor ResearchRunner::Event.host (ResearchVerificationTraces::spawned))), + axioms: [Quot.sound, propext] +} + +definition{ + name: failedStop, + parameters: [], + result: (ResearchRunner::State * ResearchRunner::Action), + body: (ResearchRunner::step (first (stopping)) (ctor ResearchRunner::Event.host (ctor LexLeanStd.Host::Event.finished (ctor Result.error [Unit, LexLeanStd.Host::Failure] (ResearchExecutionTraces::failedHost))))), + axioms: [Quot.sound, propext] +} + +theorem{ + name: verificationStartsLocalJob, + parameters: [], + statement: ((ResearchRunnerTraces::kindOf (started)) = 1), + proof: decide{}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: proofOwnerIsRetained, + parameters: [], + statement: ((match (project (first (started)) proof) | Option.none => false | Option.some owner => true) = true), + proof: decide{}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: aSecondProcessCannotLaunch, + parameters: [], + statement: ((ResearchRunnerTraces::kindOf (ResearchRunner::step (first (started)) (ctor ResearchRunner::Event.job (ResearchExecutionTraces::job 10 4 3)))) = 6), + proof: decide{}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: aSecondVerifierCannotLaunch, + parameters: [], + statement: ((ResearchRunnerTraces::kindOf (ResearchRunner::step (first (started)) (ctor ResearchRunner::Event.proof (VerificationReportTraces::pins) (ResearchVerificationTraces::settings) (input) 32 1024))) = 6), + proof: decide{}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: externalAnswerDuringVerificationIsRefused, + parameters: [], + statement: ((ResearchRunnerTraces::kindOf (ResearchRunner::step (first (started)) (ctor ResearchRunner::Event.reviewed (ResearchRunnerTraces::checkedAnswer 0x4861)))) = 6), + proof: decide{}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: cancelDrainsSpawnFirst, + parameters: [], + statement: ((ResearchRunnerTraces::kindOf (cancelled)) = 3), + proof: decide{}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: cancelStopsTheOwnedChild, + parameters: [], + statement: ((ResearchRunnerTraces::stopTarget (stopping)) = 7), + proof: decide{}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: failedCleanupHaltsResearch, + parameters: [], + statement: ((project (first (failedStop)) halted) = true), + proof: decide{}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: failedCleanupRetainsProofChild, + parameters: [], + statement: ((match (project (first (failedStop)) proof) | Option.none => (ctor Option.none [Nat]) | Option.some owner => (project (project (project owner verification) execution) owner)) = (ctor Option.some [Nat] 7)), + proof: decide{}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: failedCleanupCannotDispatch, + parameters: [], + statement: ((ResearchRunnerTraces::kindOf (ResearchRunner::step (first (failedStop)) (ctor ResearchRunner::Event.tick))) = 5), + proof: decide{}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: failedCleanupCreatesNoProofEvidence, + parameters: [], + statement: ((ResearchRunnerTraces::historySize (failedStop)) = 0), + proof: decide{}, + axioms: [Quot.sound, propext] +} + +definition{ + name: changed, + parameters: [], + result: (ResearchRunner::State * ResearchRunner::Action), + body: (ResearchRunner::step (first (started)) (ctor ResearchRunner::Event.changed (ResearchTraces::otherSnapshot) (ResearchTraces::components) (cons "stdlib" (nil String)))), + axioms: [Quot.sound, propext] +} + +theorem{ + name: changedSnapshotDrainsSpawn, + parameters: [], + statement: ((ResearchRunnerTraces::kindOf (changed)) = 3), + proof: decide{}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: changedSnapshotStopsChild, + parameters: [], + statement: ((ResearchRunnerTraces::stopTarget (ResearchRunner::step (first (changed)) (ctor ResearchRunner::Event.host (ResearchVerificationTraces::spawned)))) = 7), + proof: decide{}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: wrongSnapshotCannotStartVerification, + parameters: [], + statement: ((ResearchRunnerTraces::kindOf (ResearchRunner::step (first (ResearchRunnerTraces::initial)) (ctor ResearchRunner::Event.proof (VerificationReportTraces::pins) (ResearchVerificationTraces::settings) (input) 32 1024))) = 6), + proof: decide{}, + axioms: [Quot.sound, propext] +} +\end{semanticmodule} +\end{lexlean} diff --git a/rule30-api/src/ResearchRunner.lex.tex b/rule30-api/src/ResearchRunner.lex.tex index e0bbcb5..020cb9c 100644 --- a/rule30-api/src/ResearchRunner.lex.tex +++ b/rule30-api/src/ResearchRunner.lex.tex @@ -4,6 +4,10 @@ \importmodule{LexLeanStd.Host} \importmodule{Research} \importmodule{ResearchExecution} +\importmodule{ResearchProof} +\importmodule{ResearchVerification} +\importmodule{VerificationReport} +\importmodule{CandidateBinding} \importmodule{Hypotheses} \title{Boolean} \begin{semanticmodule} @@ -11,7 +15,7 @@ name: boundary, parameters: [], result: String, - body: "The runner composes research attention with local process supervision. A work action requests a concrete strategy job; a review action requires the verified report of a successful process. Only that report may supply an inspected sequent or checked proof answer. Successful exit alone cannot establish a task. Changed dependencies cancel the active job and discard stale review evidence. A host protocol or cleanup failure halts the runner while preserving its outstanding request for recovery. The generated driver, strategy job construction, report decoding and durable publication remain separate execution-boundary responsibilities.", + body: "The runner composes research attention with local process supervision. A work action requests a concrete strategy job; a review action requires the verified report of a successful process. Inspection and maintenance reports remain distinct from proof verification. A checked proof answer is produced only by the owned ResearchProof verifier after its report is bound to the exact candidate type; the reviewed event refuses externally supplied checked answers. Successful exit alone cannot establish a task. Changed dependencies cancel the active job and discard stale review evidence. A host protocol or cleanup failure halts the runner while preserving its outstanding request for recovery. The generated driver, strategy job construction, source inspection and durable publication remain separate execution-boundary responsibilities.", executable: true } @@ -19,7 +23,7 @@ name: State, type_parameters: [], parameters: [], - fields: [{name: research, type: Research::State}, {name: execution, type: (Option ResearchExecution::State)}, {name: review, type: (Option ResearchExecution::Completion)}, {name: halted, type: Bool}] + fields: [{name: research, type: Research::State}, {name: execution, type: (Option ResearchExecution::State)}, {name: review, type: (Option ResearchExecution::Completion)}, {name: proof, type: (Option ResearchProof::State)}, {name: halted, type: Bool}] } inductive{ @@ -33,7 +37,7 @@ name: Event, type_parameters: [], parameters: [], - constructors: [{name: tick, fields: []}, {name: ingest, fields: [(List Hypotheses::Hypothesis)]}, {name: job, fields: [ResearchExecution::Job]}, {name: host, fields: [LexLeanStd.Host::Event]}, {name: reviewed, fields: [Research::Answer]}, {name: changed, fields: [Research::Snapshot, (List Research::Component), (List String)]}, {name: cancel, fields: []}] + constructors: [{name: tick, fields: []}, {name: ingest, fields: [(List Hypotheses::Hypothesis)]}, {name: job, fields: [ResearchExecution::Job]}, {name: proof, fields: [VerificationReport::Pins, ResearchVerification::Config, CandidateBinding::Input, Nat, Nat]}, {name: host, fields: [LexLeanStd.Host::Event]}, {name: reviewed, fields: [Research::Answer]}, {name: changed, fields: [Research::Snapshot, (List Research::Component), (List String)]}, {name: cancel, fields: []}] } definition{ @@ -48,7 +52,7 @@ name: forward, parameters: [state : State, result : (Research::State * Research::Action)], result: (State * Action), - body: ((record State {research := (first result), execution := (project state execution), review := (project state review), halted := (project state halted)}), (match (second result) + body: ((record State {research := (first result), execution := (project state execution), review := (project state review), proof := (project state proof), halted := (project state halted)}), (match (second result) | Research::Action.run request => (ctor Action.work request) | Research::Action.wait => (ctor Action.wait) | Research::Action.idle => (ctor Action.idle) @@ -61,7 +65,7 @@ name: clear, parameters: [research : Research::State, halted : Bool], result: State, - body: (record State {research := research, execution := (ctor Option.none [ResearchExecution::State]), review := (ctor Option.none [ResearchExecution::Completion]), halted := halted}), + body: (record State {research := research, execution := (ctor Option.none [ResearchExecution::State]), review := (ctor Option.none [ResearchExecution::Completion]), proof := (ctor Option.none [ResearchProof::State]), halted := halted}), executable: true } @@ -77,14 +81,14 @@ name: completed, parameters: [research : Research::State, execution : ResearchExecution::State, completion : ResearchExecution::Completion], result: (State * Action), - body: (let request : Research::Request := (project completion request); (if (not (ResearchExecution::resumeAllowed completion)) then ((record State {research := research, execution := (ctor Option.some [ResearchExecution::State] execution), review := (ctor Option.none [ResearchExecution::Completion]), halted := true}), (ctor Action.blocked)) else (if (not (current research request)) then (answer research request (ctor Research::ResultKind.unavailable)) else (match (project completion kind) - | ResearchExecution::EndKind.succeeded => ((record State {research := research, execution := (ctor Option.none [ResearchExecution::State]), review := (ctor Option.some [ResearchExecution::Completion] completion), halted := false}), (ctor Action.review completion)) + body: (let request : Research::Request := (project completion request); (if (not (ResearchExecution::resumeAllowed completion)) then ((record State {research := research, execution := (ctor Option.some [ResearchExecution::State] execution), review := (ctor Option.none [ResearchExecution::Completion]), proof := (ctor Option.none [ResearchProof::State]), halted := true}), (ctor Action.blocked)) else (if (not (current research request)) then (answer research request (ctor Research::ResultKind.unavailable)) else (match (project completion kind) + | ResearchExecution::EndKind.succeeded => ((record State {research := research, execution := (ctor Option.none [ResearchExecution::State]), review := (ctor Option.some [ResearchExecution::Completion] completion), proof := (ctor Option.none [ResearchProof::State]), halted := false}), (ctor Action.review completion)) | ResearchExecution::EndKind.failed => (answer research request (ctor Research::ResultKind.failed (prim utf8_encode (project completion errors) : Bytes))) | ResearchExecution::EndKind.cut => (answer research request (ctor Research::ResultKind.cut)) | ResearchExecution::EndKind.unavailable => (answer research request (ctor Research::ResultKind.unavailable)) - | ResearchExecution::EndKind.protocol => ((record State {research := research, execution := (ctor Option.some [ResearchExecution::State] execution), review := (ctor Option.none [ResearchExecution::Completion]), halted := true}), (ctor Action.blocked)) - | ResearchExecution::EndKind.cleanupFailed => ((record State {research := research, execution := (ctor Option.some [ResearchExecution::State] execution), review := (ctor Option.none [ResearchExecution::Completion]), halted := true}), (ctor Action.blocked)) - | ResearchExecution::EndKind.refused => ((record State {research := research, execution := (ctor Option.some [ResearchExecution::State] execution), review := (ctor Option.none [ResearchExecution::Completion]), halted := true}), (ctor Action.blocked)))))), + | ResearchExecution::EndKind.protocol => ((record State {research := research, execution := (ctor Option.some [ResearchExecution::State] execution), review := (ctor Option.none [ResearchExecution::Completion]), proof := (ctor Option.none [ResearchProof::State]), halted := true}), (ctor Action.blocked)) + | ResearchExecution::EndKind.cleanupFailed => ((record State {research := research, execution := (ctor Option.some [ResearchExecution::State] execution), review := (ctor Option.none [ResearchExecution::Completion]), proof := (ctor Option.none [ResearchProof::State]), halted := true}), (ctor Action.blocked)) + | ResearchExecution::EndKind.refused => ((record State {research := research, execution := (ctor Option.some [ResearchExecution::State] execution), review := (ctor Option.none [ResearchExecution::Completion]), proof := (ctor Option.none [ResearchProof::State]), halted := true}), (ctor Action.blocked)))))), executable: true } @@ -94,8 +98,8 @@ result: (State * Action), body: (match (second result) | ResearchExecution::Emission.complete completion => (completed research (first result) completion) - | ResearchExecution::Emission.awaiting => ((record State {research := research, execution := (ctor Option.some [ResearchExecution::State] (first result)), review := (ctor Option.none [ResearchExecution::Completion]), halted := false}), (ctor Action.wait)) - | ResearchExecution::Emission.host request => ((record State {research := research, execution := (ctor Option.some [ResearchExecution::State] (first result)), review := (ctor Option.none [ResearchExecution::Completion]), halted := false}), (ctor Action.host request))), + | ResearchExecution::Emission.awaiting => ((record State {research := research, execution := (ctor Option.some [ResearchExecution::State] (first result)), review := (ctor Option.none [ResearchExecution::Completion]), proof := (ctor Option.none [ResearchProof::State]), halted := false}), (ctor Action.wait)) + | ResearchExecution::Emission.host request => ((record State {research := research, execution := (ctor Option.some [ResearchExecution::State] (first result)), review := (ctor Option.none [ResearchExecution::Completion]), proof := (ctor Option.none [ResearchProof::State]), halted := false}), (ctor Action.host request))), executable: true } @@ -124,7 +128,7 @@ } definition{ - name: reviewed, + name: reviewedNonProof, parameters: [state : State, receipt : Research::Answer], result: (State * Action), body: (match (project state review) @@ -134,22 +138,78 @@ } definition{ - name: reconcile, + name: reviewed, + parameters: [state : State, receipt : Research::Answer], + result: (State * Action), + body: (match (project receipt result) | Research::ResultKind.checked goal theorem axioms => (state, (ctor Action.refused)) | Research::ResultKind.inspected goal => (reviewedNonProof state receipt) | Research::ResultKind.maintained sources evidence => (reviewedNonProof state receipt) | Research::ResultKind.failed reason => (reviewedNonProof state receipt) | Research::ResultKind.cut => (reviewedNonProof state receipt) | Research::ResultKind.unavailable => (reviewedNonProof state receipt)), + executable: true +} + +definition{ + name: reconcileOther, parameters: [state : State, result : (Research::State * Research::Action)], result: (State * Action), body: (let research : Research::State := (first result); (match (project state execution) - | Option.some execution => (if (current research (project (project execution job) request)) then ((record State {research := research, execution := (project state execution), review := (project state review), halted := false}), (ctor Action.wait)) else (executionResult research (ResearchExecution::cancel execution))) + | Option.some execution => (if (current research (project (project execution job) request)) then ((record State {research := research, execution := (project state execution), review := (project state review), proof := (project state proof), halted := false}), (ctor Action.wait)) else (executionResult research (ResearchExecution::cancel execution))) | Option.none => (match (project state review) - | Option.some completion => (if (current research (project completion request)) then ((record State {research := research, execution := (project state execution), review := (project state review), halted := false}), (ctor Action.review completion)) else (answer research (project completion request) (ctor Research::ResultKind.unavailable))) + | Option.some completion => (if (current research (project completion request)) then ((record State {research := research, execution := (project state execution), review := (project state review), proof := (project state proof), halted := false}), (ctor Action.review completion)) else (answer research (project completion request) (ctor Research::ResultKind.unavailable))) | Option.none => (forward state result)))), executable: true } +definition{ + name: proofResult, + parameters: [research : Research::State, result : (ResearchProof::State * ResearchProof::Emission)], + result: (State * Action), + body: (let active : State := (record State {research := research, execution := (ctor Option.none [ResearchExecution::State]), review := (ctor Option.none [ResearchExecution::Completion]), proof := (ctor Option.some [ResearchProof::State] (first result)), halted := false}); (match (second result) + | ResearchProof::Emission.host request => (active, (ctor Action.host request)) + | ResearchProof::Emission.awaiting => (active, (ctor Action.wait)) + | ResearchProof::Emission.complete receipt => (if (current research (project receipt request)) then (forward (clear research false) (Research::receive research receipt)) else (answer research (project receipt request) (ctor Research::ResultKind.unavailable))) + | ResearchProof::Emission.blocked completion => ((record State {research := research, execution := (ctor Option.none [ResearchExecution::State]), review := (ctor Option.none [ResearchExecution::Completion]), proof := (ctor Option.some [ResearchProof::State] (first result)), halted := true}), (ctor Action.blocked)))), + axioms: [], + executable: true +} + +definition{ + name: startProof, + parameters: [state : State, pins : VerificationReport::Pins, config : ResearchVerification::Config, binding : CandidateBinding::Input, maxDepth : Nat, maxSteps : Nat], + result: (State * Action), + body: (match (project state proof) + | Option.some active => (state, (ctor Action.refused)) + | Option.none => (match (project state execution) + | Option.some active => (state, (ctor Action.refused)) + | Option.none => (if ((current (project state research) (project pins request)) && (match (project state review) | Option.none => true | Option.some completion => (Research::sameRequest (project completion request) (project pins request)))) then (proofResult (project state research) (ResearchProof::begin pins config binding maxDepth maxSteps)) else (state, (ctor Action.refused))))), + axioms: [Quot.sound, propext], + executable: true +} + +definition{ + name: reconcile, + parameters: [state : State, result : (Research::State * Research::Action)], + result: (State * Action), + body: (match (project state proof) + | Option.none => (reconcileOther state result) + | Option.some proof => (if (current (first result) (project (project (project proof verification) pins) request)) then ((record State {research := (first result), execution := (project state execution), review := (project state review), proof := (project state proof), halted := false}), (ctor Action.wait)) else (proofResult (first result) (ResearchProof::step proof (ctor ResearchVerification::Event.cancel))))), + axioms: [Quot.sound, propext], + executable: true +} + definition{ name: step, parameters: [state : State, event : Event], result: (State * Action), - body: (if (project state halted) then (state, (ctor Action.blocked)) else (match event + body: (if (project state halted) then (state, (ctor Action.blocked)) else (match (project state proof) + | Option.some proof => (match event + | Event.host response => (proofResult (project state research) (ResearchProof::step proof (ctor ResearchVerification::Event.host response))) + | Event.cancel => (proofResult (project state research) (ResearchProof::step proof (ctor ResearchVerification::Event.cancel))) + | Event.changed snapshot components affected => (reconcile state (Research::step (project state research) (ctor Research::Event.changed snapshot components affected))) + | Event.ingest hypotheses => (reconcile state (Research::step (project state research) (ctor Research::Event.ingest hypotheses))) + | Event.tick => (state, (ctor Action.wait)) + | Event.job job => (state, (ctor Action.refused)) + | Event.proof pins config binding maxDepth maxSteps => (state, (ctor Action.refused)) + | Event.reviewed receipt => (state, (ctor Action.refused))) + | Option.none => (match event + | Event.proof pins config binding maxDepth maxSteps => (startProof state pins config binding maxDepth maxSteps) | Event.job job => (startJob state job) | Event.reviewed receipt => (reviewed state receipt) | Event.changed snapshot components affected => (reconcile state (Research::step (project state research) (ctor Research::Event.changed snapshot components affected))) @@ -166,17 +226,18 @@ | Option.some execution => (executionResult (project state research) (ResearchExecution::cancel execution)) | Option.none => (match (project state review) | Option.some completion => (answer (project state research) (project completion request) (ctor Research::ResultKind.cut)) - | Option.none => (state, (ctor Action.refused)))))), - axioms: [], + | Option.none => (state, (ctor Action.refused))))))), + axioms: [Quot.sound, propext], executable: true, - production: {effects: [allocation, overflow, recursion], targets: [rust-std]} + production: {effects: [allocation, files, overflow, process, recursion], targets: [rust-std]} } theorem{ name: haltedRunnerNeverDispatches, - parameters: [research : Research::State, execution : (Option ResearchExecution::State), review : (Option ResearchExecution::Completion), event : Event], - statement: ((step (record State {research := research, execution := execution, review := review, halted := true}) event) = ((record State {research := research, execution := execution, review := review, halted := true}), (ctor Action.blocked))), - proof: reflexivity{} + parameters: [research : Research::State, execution : (Option ResearchExecution::State), review : (Option ResearchExecution::Completion), proof : (Option ResearchProof::State), event : Event], + statement: ((step (record State {research := research, execution := execution, review := review, proof := proof, halted := true}) event) = ((record State {research := research, execution := execution, review := review, proof := proof, halted := true}), (ctor Action.blocked))), + proof: reflexivity{}, + axioms: [Quot.sound, propext] } \end{semanticmodule} \end{lexlean} diff --git a/rule30-api/src/ResearchRunnerTraces.lex.tex b/rule30-api/src/ResearchRunnerTraces.lex.tex index dcec8e6..fa9ad01 100644 --- a/rule30-api/src/ResearchRunnerTraces.lex.tex +++ b/rule30-api/src/ResearchRunnerTraces.lex.tex @@ -22,21 +22,24 @@ name: launch, parameters: [], result: (ResearchRunner::State * ResearchRunner::Action), - body: (ResearchRunner::step (first (initial)) (ctor ResearchRunner::Event.job (ResearchExecutionTraces::job 10 4 3))) + body: (ResearchRunner::step (first (initial)) (ctor ResearchRunner::Event.job (ResearchExecutionTraces::job 10 4 3))), + axioms: [Quot.sound, propext] } definition{ name: running, parameters: [], result: (ResearchRunner::State * ResearchRunner::Action), - body: (ResearchRunner::step (first (launch)) (ctor ResearchRunner::Event.host (ctor LexLeanStd.Host::Event.spawned (ctor Result.ok [(Nat * Nat), LexLeanStd.Host::Failure] (7, 100))))) + body: (ResearchRunner::step (first (launch)) (ctor ResearchRunner::Event.host (ctor LexLeanStd.Host::Event.spawned (ctor Result.ok [(Nat * Nat), LexLeanStd.Host::Failure] (7, 100))))), + axioms: [Quot.sound, propext] } definition{ name: success, parameters: [], result: (ResearchRunner::State * ResearchRunner::Action), - body: (ResearchRunner::step (first (running)) (ctor ResearchRunner::Event.host (ResearchExecutionTraces::exitEvent 7 (ctor Option.some [Int32] (0 : Int32)) 105))) + body: (ResearchRunner::step (first (running)) (ctor ResearchRunner::Event.host (ResearchExecutionTraces::exitEvent 7 (ctor Option.some [Int32] (0 : Int32)) 105))), + axioms: [Quot.sound, propext] } definition{ @@ -92,196 +95,224 @@ name: matchingJobLaunches, parameters: [], statement: ((kindOf (launch)) = 1), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ name: aSecondJobCannotLaunchWhileRunning, parameters: [], statement: ((kindOf (ResearchRunner::step (first (running)) (ctor ResearchRunner::Event.job (ResearchExecutionTraces::job 10 4 3)))) = 6), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ name: unsolicitedHostReplyIsRefused, parameters: [], statement: ((kindOf (ResearchRunner::step (first (initial)) (ctor ResearchRunner::Event.host (ctor LexLeanStd.Host::Event.spawned (ctor Result.ok [(Nat * Nat), LexLeanStd.Host::Failure] (7, 100)))))) = 6), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ name: receiptBeforeExecutionIsRefused, parameters: [], statement: ((kindOf (ResearchRunner::step (first (initial)) (ctor ResearchRunner::Event.reviewed (checkedAnswer 0x4861)))) = 6), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ name: zeroExitRequiresReportReview, parameters: [], statement: ((kindOf (success)) = 2), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ name: zeroExitDoesNotEstablishTheTask, parameters: [], statement: ((taskStatus (success)) = 1), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ name: zeroExitAddsNoKernelEvidence, parameters: [], statement: ((historySize (success)) = 0), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ - name: matchingCheckedReportEstablishesTheTask, + name: externalCheckedAnswerCannotEstablishTheTask, parameters: [], - statement: ((taskStatus (ResearchRunner::step (first (success)) (ctor ResearchRunner::Event.reviewed (checkedAnswer 0x4861)))) = 3), - proof: decide{} + statement: ((taskStatus (ResearchRunner::step (first (success)) (ctor ResearchRunner::Event.reviewed (checkedAnswer 0x4861)))) = 1), + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ - name: matchingCheckedReportSettlesTheController, + name: externalCheckedAnswerIsRefused, parameters: [], - statement: ((kindOf (ResearchRunner::step (first (success)) (ctor ResearchRunner::Event.reviewed (checkedAnswer 0x4861)))) = 4), - proof: decide{} + statement: ((kindOf (ResearchRunner::step (first (success)) (ctor ResearchRunner::Event.reviewed (checkedAnswer 0x4861)))) = 6), + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ - name: acceptedReportIsRecordedOnce, + name: externalCheckedAnswerAddsNoEvidence, parameters: [], - statement: ((historySize (ResearchRunner::step (first (success)) (ctor ResearchRunner::Event.reviewed (checkedAnswer 0x4861)))) = 1), - proof: decide{} + statement: ((historySize (ResearchRunner::step (first (success)) (ctor ResearchRunner::Event.reviewed (checkedAnswer 0x4861)))) = 0), + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ name: replayedReportIsRefused, parameters: [], statement: ((kindOf (ResearchRunner::step (first (ResearchRunner::step (first (success)) (ctor ResearchRunner::Event.reviewed (checkedAnswer 0x4861)))) (ctor ResearchRunner::Event.reviewed (checkedAnswer 0x4861)))) = 6), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ name: anotherTargetCannotEstablishTheTask, parameters: [], - statement: ((taskStatus (ResearchRunner::step (first (success)) (ctor ResearchRunner::Event.reviewed (checkedAnswer 0x4862)))) = 2), - proof: decide{} + statement: ((taskStatus (ResearchRunner::step (first (success)) (ctor ResearchRunner::Event.reviewed (checkedAnswer 0x4862)))) = 1), + proof: decide{}, + axioms: [Quot.sound, propext] } definition{ name: invalidated, parameters: [], result: (ResearchRunner::State * ResearchRunner::Action), - body: (ResearchRunner::step (first (running)) (ctor ResearchRunner::Event.changed (ResearchTraces::snapshot) (ResearchTraces::components) (cons "stdlib" (nil String)))) + body: (ResearchRunner::step (first (running)) (ctor ResearchRunner::Event.changed (ResearchTraces::snapshot) (ResearchTraces::components) (cons "stdlib" (nil String)))), + axioms: [Quot.sound, propext] } theorem{ name: changeDrainsTheOutstandingWait, parameters: [], statement: ((kindOf (invalidated)) = 3), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } definition{ name: stopping, parameters: [], result: (ResearchRunner::State * ResearchRunner::Action), - body: (ResearchRunner::step (first (invalidated)) (ctor ResearchRunner::Event.host (ResearchExecutionTraces::waitEvent 105 (nil (Nat * (Option Int32)))))) + body: (ResearchRunner::step (first (invalidated)) (ctor ResearchRunner::Event.host (ResearchExecutionTraces::waitEvent 105 (nil (Nat * (Option Int32)))))), + axioms: [Quot.sound, propext] } theorem{ name: changedDependencyStopsTheOwnedChild, parameters: [], statement: ((stopTarget (stopping)) = 7), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } definition{ name: cancelled, parameters: [], result: (ResearchRunner::State * ResearchRunner::Action), - body: (ResearchRunner::step (first (stopping)) (ctor ResearchRunner::Event.host (ResearchExecutionTraces::stopOk))) + body: (ResearchRunner::step (first (stopping)) (ctor ResearchRunner::Event.host (ResearchExecutionTraces::stopOk))), + axioms: [Quot.sound, propext] } theorem{ name: cancelledEvidenceIsNotRecorded, parameters: [], statement: ((historySize (cancelled)) = 0), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ name: invalidatedTaskIsRescheduledForInspection, parameters: [], statement: ((kindOf (cancelled)) = 0), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ name: staleReportAfterCancellationIsRefused, parameters: [], statement: ((kindOf (ResearchRunner::step (first (cancelled)) (ctor ResearchRunner::Event.reviewed (checkedAnswer 0x4861)))) = 6), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } definition{ name: failedStop, parameters: [], result: (ResearchRunner::State * ResearchRunner::Action), - body: (ResearchRunner::step (first (stopping)) (ctor ResearchRunner::Event.host (ctor LexLeanStd.Host::Event.finished (ctor Result.error [Unit, LexLeanStd.Host::Failure] (ResearchExecutionTraces::failedHost))))) + body: (ResearchRunner::step (first (stopping)) (ctor ResearchRunner::Event.host (ctor LexLeanStd.Host::Event.finished (ctor Result.error [Unit, LexLeanStd.Host::Failure] (ResearchExecutionTraces::failedHost))))), + axioms: [Quot.sound, propext] } theorem{ name: failedStopHaltsTheRunner, parameters: [], statement: ((project (first (failedStop)) halted) = true), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ name: failedStopPreservesChildOwnership, parameters: [], statement: ((ownedChild (failedStop)) = 7), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ name: haltedRunnerCannotLaunchAnotherJob, parameters: [], statement: ((kindOf (ResearchRunner::step (first (failedStop)) (ctor ResearchRunner::Event.job (ResearchExecutionTraces::job 10 4 3)))) = 5), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ name: unrelatedFeatureChangeDoesNotCancelWork, parameters: [], statement: ((kindOf (ResearchRunner::step (first (ResearchRunner::step (first (running)) (ctor ResearchRunner::Event.changed (ResearchTraces::snapshot) (ResearchTraces::components) (cons "presentation" (nil String))))) (ctor ResearchRunner::Event.host (ResearchExecutionTraces::exitEvent 7 (ctor Option.some [Int32] (0 : Int32)) 105)))) = 2), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ name: newHypothesesDoNotCancelIndependentWork, parameters: [], statement: ((kindOf (ResearchRunner::step (first (ResearchRunner::step (first (running)) (ctor ResearchRunner::Event.ingest (cons (ResearchTraces::hypothesis) (nil Hypotheses::Hypothesis))))) (ctor ResearchRunner::Event.host (ResearchExecutionTraces::exitEvent 7 (ctor Option.some [Int32] (0 : Int32)) 105)))) = 2), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ name: modelChangeDiscardsPendingReview, parameters: [], statement: ((kindOf (ResearchRunner::step (first (success)) (ctor ResearchRunner::Event.changed (ResearchTraces::snapshot) (ResearchTraces::components) (cons "stdlib" (nil String))))) = 0), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } theorem{ name: discardedReviewAddsNoEvidence, parameters: [], statement: ((historySize (ResearchRunner::step (first (success)) (ctor ResearchRunner::Event.changed (ResearchTraces::snapshot) (ResearchTraces::components) (cons "stdlib" (nil String))))) = 0), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } definition{ @@ -295,7 +326,8 @@ name: availabilityChangesAreDetectedWithoutAHint, parameters: [], statement: ((stopTarget (ResearchRunner::step (first (ResearchRunner::step (first (running)) (ctor ResearchRunner::Event.changed (ResearchTraces::snapshot) (lostDependency) (nil String)))) (ctor ResearchRunner::Event.host (ResearchExecutionTraces::waitEvent 105 (nil (Nat * (Option Int32))))))) = 7), - proof: decide{} + proof: decide{}, + axioms: [Quot.sound, propext] } \end{semanticmodule} diff --git a/rule30-api/src/ResearchTraces.lex.tex b/rule30-api/src/ResearchTraces.lex.tex index 781b7e6..2f8bd0a 100644 --- a/rule30-api/src/ResearchTraces.lex.tex +++ b/rule30-api/src/ResearchTraces.lex.tex @@ -345,7 +345,7 @@ theorem{ name: everyApplicationAndLibraryModuleGetsOneMaintenanceTask, parameters: [], - statement: ((prim length (ResearchCatalog::maintenanceTasks (ResearchCatalog::registeredScopes)) : Nat) = 49), + statement: ((prim length (ResearchCatalog::maintenanceTasks (ResearchCatalog::registeredScopes)) : Nat) = 60), proof: decide{} } definition{ diff --git a/rule30-api/src/ResearchVerification.lex.tex b/rule30-api/src/ResearchVerification.lex.tex index aca2a2c..b6e75b0 100644 --- a/rule30-api/src/ResearchVerification.lex.tex +++ b/rule30-api/src/ResearchVerification.lex.tex @@ -177,7 +177,7 @@ body: (let initial : ResearchExecution::State := (record ResearchExecution::State {job := (job pins config), phase := (ctor ResearchExecution::Phase.spawning), owner := (ctor Option.none [Nat])}); (let state : State := (record State {pins := pins, config := config, execution := initial, phase := (ctor Phase.running), cancelled := false, outcome := (ctor Option.none [Outcome])}); (if (validConfig pins config) then (executionResult state (ResearchExecution::begin (job pins config))) else (finish state (ctor Outcome.rejected "invalid verification plan"))))), axioms: [propext], executable: true, - production: {effects: [allocation, overflow, recursion], targets: [rust-std]} + production: {effects: [allocation, files, overflow, process, recursion], targets: [rust-std]} } definition{ @@ -317,7 +317,7 @@ | Event.host response => (reading state response))), axioms: [Quot.sound, propext], executable: true, - production: {effects: [allocation, overflow, recursion], targets: [rust-std]} + production: {effects: [allocation, files, overflow, process, recursion], targets: [rust-std]} } theorem{ diff --git a/rule30-api/src/Standards.lex.tex b/rule30-api/src/Standards.lex.tex index 619e581..02e6654 100644 --- a/rule30-api/src/Standards.lex.tex +++ b/rule30-api/src/Standards.lex.tex @@ -26,7 +26,7 @@ name: standards, parameters: [], result: (List Standard), - body: (cons (record Standard {id := "iso-42010", name := "ISO/IEC/IEEE 42010:2022, Architecture description", authority := "https://www.iso.org/standard/74393.html", version := "2022", scope := "Stakeholders, concerns, viewpoints and views of the proof effort on Foundation.Arch; every panel of the site is governed by a viewpoint.", realizedBy := (cons "Architecture" (cons "architecture-module" (cons "Presentation" (nil String)))), conformance := "bin/r30 verify api: everyConcernFramed, viewpointsFrameHeldConcerns, everyViewpointGovernsAView (Architecture), panelsGovernedByViewpoints (Presentation)", coverage := "implemented"}) (cons (record Standard {id := "iso-25010", name := "ISO/IEC 25010:2023, Product quality model", authority := "https://www.iso.org/standard/78176.html", version := "2023", scope := "What an optimal implementation is here: characteristics, subcharacteristics, requirements and measures with thresholds on Foundation.Qual, each measure naming the command that reports it.", realizedBy := (cons "Architecture" (cons "quality" (cons "architecture-module" (cons "api_check" (cons "check" (cons "choice_audit" (cons "frontier_check" (cons "gate" (cons "verify" (cons "view_render" (nil String))))))))))), conformance := "bin/r30 verify api: everyRequirementMeasured, everyMeasureCommandExists (Architecture), publicationWithinBudget (Application)", coverage := "implemented"}) (cons (record Standard {id := "wcag-2.2", name := "W3C WCAG 2.2, Web Content Accessibility Guidelines", authority := "https://www.w3.org/TR/WCAG22/", version := "2.2 (Recommendation, 2023-10-05)", scope := "The site at level AA: 4.5:1 text contrast in both themes, one visible focus ring, a skip link, reduced motion honoured, keyboard operation of every control and step.", realizedBy := (cons "site" (cons "picture" (cons "explainer" (cons "reduction-tree" (cons "register" (cons "open-leaves" (cons "paper" (cons "obligation" (cons "refutations" (cons "interface-sheets" (cons "modules" (cons "quality" (cons "sitemap" (cons "verify" (cons "standards" (cons "model" (cons "design" (cons "viz-triangle" (cons "viz-tower" (cons "viz-ledger" (cons "viz-rays" (cons "viz-defects" (cons "viz-dyadic" (cons "nav-primary" (cons "nav-breadcrumb" (cons "nav-stepper" (nil String))))))))))))))))))))))))))), conformance := "python3 -m unittest scripts.tests.test_r30.AccessibilityTests (contrast measured from the stylesheet, landmarks, focus, motion, keyboard)", coverage := "implemented"}) (cons (record Standard {id := "wai-aria-1.2", name := "W3C WAI-ARIA 1.2 and the ARIA Authoring Practices Guide", authority := "https://www.w3.org/TR/wai-aria-1.2/", version := "1.2 (Recommendation, 2023-06-06); APG patterns", scope := "The navigation of the site: the primary navigation, the breadcrumb and the stepper follow the APG patterns (roles, aria-current, arrow keys), the status region is live.", realizedBy := (cons "site" (cons "nav-primary" (cons "nav-breadcrumb" (cons "nav-stepper" (nil String))))), conformance := "python3 -m unittest scripts.tests.test_r30.AccessibilityTests (role, aria-current, aria-pressed, role=status, arrow keys)", coverage := "implemented"}) (cons (record Standard {id := "html-living-standard", name := "WHATWG HTML Living Standard", authority := "https://html.spec.whatwg.org/multipage/", version := "living standard", scope := "The page's landmarks (header, nav, main, footer), the one-document site with its data in a JSON script element and its metadata in the head.", realizedBy := (cons "site" (cons "nav-primary" (cons "nav-breadcrumb" (cons "nav-stepper" (nil String))))), conformance := "python3 -m unittest scripts.tests.test_r30.AccessibilityTests.test_landmarks_focus_motion_and_keyboard", coverage := "implemented"}) (cons (record Standard {id := "svg-2", name := "W3C SVG 2", authority := "https://www.w3.org/TR/SVG2/", version := "2 (Candidate Recommendation, 2018-10-04)", scope := "The Rule 30 picture, the logo and the visualizations are SVG documents with a title and a description, crisp cells, colours from the page's tokens.", realizedBy := (cons "picture" (cons "logo" (cons "viz-triangle" (cons "viz-tower" (cons "viz-ledger" (cons "viz-rays" (cons "viz-defects" (cons "viz-dyadic" (nil String))))))))), conformance := "python3 -m unittest scripts.tests.test_r30.SiteTests.test_rule30_rows_and_logo (parsed as SVG, no script)", coverage := "implemented"}) (cons (record Standard {id := "wai-aria-graphics-1.0", name := "W3C WAI-ARIA Graphics Module 1.0", authority := "https://www.w3.org/TR/graphics-aria-1.0/", version := "1.0 (Recommendation, 2018-10-02)", scope := "Every drawing carries role=img with aria-labelledby pointing at its title and description; the interactive visualizations use graphics-document and graphics-symbol.", realizedBy := (cons "picture" (cons "logo" (cons "viz-triangle" (cons "viz-tower" (cons "viz-ledger" (cons "viz-rays" (cons "viz-defects" (cons "viz-dyadic" (nil String))))))))), conformance := "python3 -m unittest scripts.tests.test_r30.SiteTests.test_statements_picture_and_explainer_artifacts (role=img, aria-labelledby)", coverage := "implemented"}) (cons (record Standard {id := "schema-org", name := "schema.org vocabulary (JSON-LD)", authority := "https://schema.org/", version := "current release (https://schema.org/docs/releases.html)", scope := "A LearningResource for every pedagogical step of every journey, the paper as ScholarlyArticle, the repository as SoftwareSourceCode, the register as Dataset, embedded in the page and published as schema.json.", realizedBy := (cons "jsonld" (cons "site" (cons "paper-pdf" (cons "register-json" (cons "readme" (cons "prize-review" (cons "research-session" (cons "reading" (cons "stdlib-feedback" (cons "mathematics" (cons "first-visit" (nil String)))))))))))), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests.test_schema_org_describes_every_step_the_paper_the_repository_and_the_register", coverage := "implemented"}) (cons (record Standard {id := "json-ld-1.1", name := "W3C JSON-LD 1.1", authority := "https://www.w3.org/TR/json-ld11/", version := "1.1 (Recommendation, 2020-07-16)", scope := "The serialization of the schema.org and PROV-O graphs: a @context, a @graph, ids under the published URL.", realizedBy := (cons "jsonld" (cons "provenance" (nil String))), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests (both documents parse and carry @context and @graph)", coverage := "implemented"}) (cons (record Standard {id := "prov-o", name := "W3C PROV-O, the PROV Ontology", authority := "https://www.w3.org/TR/prov-o/", version := "Recommendation, 2013-04-30", scope := "Provenance of every claim: a proved claim prov:wasDerivedFrom its Lean theorem and prov:wasAttributedTo the Lean kernel, attested by the paper's LexLean attestation and the module's kappa-label; the view prov:wasGeneratedBy the render of this commit under the view workflow.", realizedBy := (cons "provenance" (cons "view-workflow" (cons "view_render" (cons "frontier_check" (cons "kappa" (cons "verify" (nil String))))))), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests.test_provenance_derives_every_proved_claim_from_its_theorem", coverage := "implemented"}) (cons (record Standard {id := "json-schema-2020-12", name := "JSON Schema 2020-12", authority := "https://json-schema.org/draft/2020-12/schema", version := "2020-12", scope := "The closed schemas of register.json, the interface sheets, standards.json and the --json reports (rule30-api/schemas), validated by the tests and referenced from openapi.json.", realizedBy := (cons "register-json" (cons "standards" (cons "openapi" (cons "api_check" (cons "api_production" (cons "brief" (cons "chain" (cons "claim" (cons "deduce" (cons "discover" (cons "engine_prune" (cons "engine_status" (cons "engine_tick" (cons "frontier_list" (cons "interface" (cons "kappa" (cons "sequences" (cons "status" (nil String))))))))))))))))))), conformance := "python3 -m unittest scripts.tests.test_r30.ResultSchemaTests; bin/r30 api check", coverage := "implemented"}) (cons (record Standard {id := "openapi-3.1", name := "OpenAPI Specification 3.1", authority := "https://spec.openapis.org/oas/v3.1.1", version := "3.1.1 (2024-10-24)", scope := "The r30 command surface as an API description: one path per command of the parser, its arguments as parameters, its responses from the result schemas, the same leaves as Api.lex.tex and the MCP tools.", realizedBy := (prim append (cons "openapi" (cons "status" (cons "brief" (cons "chain" (cons "api_sync" (cons "api_check" (cons "api_production" (cons "view_render" (cons "interface" (cons "claim" (cons "audit" (cons "gate" (cons "lexicon_search" (cons "lexicon_show" (cons "lexicon_packages" (cons "sig" (cons "mentions" (cons "theorem_preview" (cons "theorem_add" (cons "theorem_remove" (cons "define" (cons "check" (cons "unpublished" (cons "selfcheck" (cons "verify" (cons "probe" (cons "axioms" (cons "choice_audit" (cons "frontier_list" (cons "frontier_add" (cons "frontier_set" (cons "frontier_check" (cons "frontier_render" (cons "commit" (cons "module_list" (cons "module_add" (cons "module_build" (cons "consolidate" (cons "kappa" (cons "sequences" (nil String))))))))))))))))))))))))))))))))))))))))) (cons "discover" (cons "deduce" (cons "engine_tick" (cons "engine_status" (cons "engine_hypotheses" (cons "engine_prune" (cons "experiment_list" (cons "experiment_run" (nil String))))))))) : (List String)), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests.test_openapi_describes_the_command_surface; bin/r30 api check (Api.lex.tex)", coverage := "implemented"}) (cons (record Standard {id := "gherkin", name := "Gherkin (Cucumber reference)", authority := "https://cucumber.io/docs/gherkin/reference/", version := "Gherkin reference (current)", scope := "One scenario per conformance id in features/suites, tagged with the id and its honesty level, generated with the registers.", realizedBy := (cons "api_sync" (cons "api_check" (nil String))), conformance := "python3 -m unittest scripts.tests.test_r30.ConformanceTests; bin/r30 api check", coverage := "implemented"}) (cons (record Standard {id := "citation-cff", name := "Citation File Format 1.2.0", authority := "https://citation-file-format.github.io/", version := "1.2.0", scope := "CITATION.cff at the repository root (and copied into the view): the author, the title of the paper, the repository and the published view.", realizedBy := (cons "citation" (cons "readme" (nil String))), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests.test_citation_file_names_the_author_the_title_and_the_repository", coverage := "implemented"}) (cons (record Standard {id := "spdx", name := "SPDX License Expressions (SPDX 2.3, ISO/IEC 5962:2021)", authority := "https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/", version := "2.3", scope := "License identifiers of the vendored sources: the repository is MIT (LICENSE at the root, `license: MIT` in CITATION.cff); the prism-stdlib register carries the SPDX expression of its vendored license files.", realizedBy := (cons "stdlib-package" (cons "citation" (nil String))), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests.test_spdx_expressions_are_well_formed", coverage := "implemented"}) (cons (record Standard {id := "sitemap-protocol", name := "Sitemaps XML protocol 0.9", authority := "https://www.sitemaps.org/protocol.html", version := "0.9", scope := "sitemap.xml: the page and the deep link of every step of every journey; robots.txt names the sitemap.", realizedBy := (cons "sitemap" (cons "robots" (cons "site" (cons "prize-review" (cons "research-session" (cons "reading" (cons "stdlib-feedback" (cons "mathematics" (cons "first-visit" (nil String)))))))))), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests.test_sitemap_lists_every_step_deep_link", coverage := "implemented"}) (cons (record Standard {id := "open-graph", name := "The Open Graph protocol", authority := "https://ogp.me/", version := "ogp.me (2014-10)", scope := "og:title, og:type, og:url, og:description and og:image in the page's head, injected with the JSON-LD at render.", realizedBy := (cons "site" (cons "logo" (nil String))), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests.test_site_head_carries_json_ld_and_open_graph", coverage := "implemented"}) (cons (record Standard {id := "rfc-8785", name := "RFC 8785, JSON Canonicalization Scheme (JCS)", authority := "https://www.rfc-editor.org/rfc/rfc8785", version := "2020-06", scope := "The identity of the published JSON contracts (sha256-canonical-json in contracts.toml) and the canonical JSON of the LexLean attestations; uor-addr labels JSON under JCS.", realizedBy := (cons "register-json" (cons "statements" (cons "kappa" (nil String)))), conformance := "python3 -m unittest scripts.tests.test_kappa (the no-prefix rule on the JCS vector)", coverage := "implemented"}) (cons (record Standard {id := "rivest-csexp", name := "Rivest, S-Expressions (canonical form, section 4.3)", authority := "https://people.csail.mit.edu/rivest/Sexp.txt", version := "draft-rivest-sexp-00, 1997-05-04", scope := "The kappa-label of a research module: the SHA-256 of the canonical S-expression of the declarations the kernel replays, as UOR-Foundation/uor-addr mints labels; the key of the replay receipts. The same canonical form labels the sequences of the basis, (sequence ), their transforms and the relations the discovery engines find, (relation ).", realizedBy := (cons "kappa" (cons "provenance" (cons "sequences" (cons "discover" (cons "Sequences" (cons "Discovery" (nil String))))))), conformance := "python3 -m unittest scripts.tests.test_kappa; bin/r30 kappa ; bin/r30 api check (sequences)", coverage := "implemented"}) (cons (record Standard {id := "in-toto-statement-v1", name := "in-toto Attestation Framework, Statement v1", authority := "https://github.com/in-toto/attestation/blob/main/spec/v1/statement.md", version := "v1", scope := "attestations.intoto.json: a Statement whose subjects are the attested PDFs and the paper's sources with their SHA-256 digests and whose predicate is the paper's LexLean attestation.", realizedBy := (cons "attestations" (cons "pdf-manifest" (cons "verify" (cons "paper-pdf" (cons "observations-pdf" (cons "core-pdf" (nil String))))))), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests.test_in_toto_statement_subjects_are_the_attested_documents", coverage := "implemented"}) (cons (record Standard {id := "oci-distribution", name := "OCI Distribution Specification", authority := "https://github.com/opencontainers/distribution-spec/blob/main/spec.md", version := "1.1.0 (2024-02)", scope := "Planned: a kappa-registry serving the replay receipts and certified bundles by content address; today only the kappa-labels that would address them exist.", realizedBy := (cons "kappa" (nil String)), conformance := "bin/r30 kappa (the labels); no registry runs yet", coverage := "planned"}) (cons (record Standard {id := "iana-media-types", name := "IANA Media Types (RFC 6838)", authority := "https://www.iana.org/assignments/media-types/", version := "RFC 6838 (2013-01)", scope := "Every published artifact declares its media type in Presentation.lex.tex; the contracts register declares the vendor types of the JSON reports.", realizedBy := (prim append (cons "chain" (cons "register-json" (cons "register-text" (cons "frontier" (cons "interfaces" (cons "statements" (cons "explainer" (cons "picture" (cons "paper-pdf" (cons "observations-pdf" (cons "core-pdf" (cons "pdf-manifest" (cons "api-module" (cons "register-module" (cons "architecture-module" (cons "presentation-module" (cons "application-module" (cons "core-vectors" (cons "frontier-module" (cons "agents" (cons "round-workflow" (cons "strategy" (cons "readme" (cons "logo" (cons "standards" (cons "standards-module" (cons "openapi" (cons "sitemap" (cons "robots" (cons "provenance" (cons "jsonld" (cons "attestations" (cons "citation" (cons "observer-module" (cons "tokens" (cons "site" (cons "viz-core-js" (cons "viz-triangle-js" (cons "viz-tower-js" (cons "viz-ledger-js" (nil String))))))))))))))))))))))))))))))))))))))))) (cons "viz-rays-js" (cons "viz-defects-js" (cons "viz-dyadic-js" (nil String)))) : (List String)), conformance := "bin/r30 verify api: artifactPathsDistinct, panelsReadArtifacts (Presentation); python3 -m unittest scripts.tests.test_r30.StandardsTests", coverage := "implemented"}) (cons (record Standard {id := "lean-4", name := "Lean 4 (the kernel)", authority := "https://github.com/leanprover/lean4", version := "leanprover/lean4:v4.32.1", scope := "Every proved claim names a theorem the Lean kernel checked under propext and Quot.sound; the research modules are kernel-replayed with leanchecker.", realizedBy := (cons "Register" (cons "axioms" (cons "choice_audit" (cons "frontier_check" (cons "kappa" (cons "module_build" (nil String))))))), conformance := "bin/r30 frontier check; bin/r30 axioms ; bin/r30 choice-audit", coverage := "implemented"}) (cons (record Standard {id := "lexlean", name := "UOR-Foundation/LexLean (closed-lexicon LaTeX to Lean 4)", authority := "https://github.com/UOR-Foundation/LexLean", version := "0.4.0, language 1.2, compiler semantics 0b48547157a4", scope := "The authoring surface: the paper, the register and these API modules are LexLean modules verified by lexlean; the production roots export to certified Rust.", realizedBy := (cons "Api" (cons "Register" (cons "Architecture" (cons "Presentation" (cons "Application" (cons "Observer" (cons "Convert" (cons "Standards" (cons "Rule30Core" (cons "Sequences" (cons "Discovery" (cons "verify" (cons "check" (cons "api_sync" (cons "api_check" (cons "api_production" (nil String))))))))))))))))), conformance := "bin/r30 verify api; bin/r30 check api; bin/r30 api check", coverage := "implemented"}) (nil Standard))))))))))))))))))))))))), + body: (cons (record Standard {id := "iso-42010", name := "ISO/IEC/IEEE 42010:2022, Architecture description", authority := "https://www.iso.org/standard/74393.html", version := "2022", scope := "Stakeholders, concerns, viewpoints and views of the proof effort on Foundation.Arch; every panel of the site is governed by a viewpoint.", realizedBy := (cons "Architecture" (cons "architecture-module" (cons "Presentation" (nil String)))), conformance := "bin/r30 verify api: everyConcernFramed, viewpointsFrameHeldConcerns, everyViewpointGovernsAView (Architecture), panelsGovernedByViewpoints (Presentation)", coverage := "implemented"}) (cons (record Standard {id := "iso-25010", name := "ISO/IEC 25010:2023, Product quality model", authority := "https://www.iso.org/standard/78176.html", version := "2023", scope := "What an optimal implementation is here: characteristics, subcharacteristics, requirements and measures with thresholds on Foundation.Qual, each measure naming the command that reports it.", realizedBy := (cons "Architecture" (cons "quality" (cons "architecture-module" (cons "api_check" (cons "check" (cons "choice_audit" (cons "frontier_check" (cons "gate" (cons "verify" (cons "view_render" (nil String))))))))))), conformance := "bin/r30 verify api: everyRequirementMeasured, everyMeasureCommandExists (Architecture), publicationWithinBudget (Application)", coverage := "implemented"}) (cons (record Standard {id := "wcag-2.2", name := "W3C WCAG 2.2, Web Content Accessibility Guidelines", authority := "https://www.w3.org/TR/WCAG22/", version := "2.2 (Recommendation, 2023-10-05)", scope := "The site at level AA: 4.5:1 text contrast in both themes, one visible focus ring, a skip link, reduced motion honoured, keyboard operation of every control and step.", realizedBy := (cons "site" (cons "picture" (cons "explainer" (cons "reduction-tree" (cons "register" (cons "open-leaves" (cons "paper" (cons "obligation" (cons "refutations" (cons "interface-sheets" (cons "modules" (cons "quality" (cons "sitemap" (cons "verify" (cons "standards" (cons "model" (cons "design" (cons "viz-triangle" (cons "viz-tower" (cons "viz-ledger" (cons "viz-rays" (cons "viz-defects" (cons "viz-dyadic" (cons "nav-primary" (cons "nav-breadcrumb" (cons "nav-stepper" (nil String))))))))))))))))))))))))))), conformance := "python3 -m unittest scripts.tests.test_r30.AccessibilityTests (contrast measured from the stylesheet, landmarks, focus, motion, keyboard)", coverage := "implemented"}) (cons (record Standard {id := "wai-aria-1.2", name := "W3C WAI-ARIA 1.2 and the ARIA Authoring Practices Guide", authority := "https://www.w3.org/TR/wai-aria-1.2/", version := "1.2 (Recommendation, 2023-06-06); APG patterns", scope := "The navigation of the site: the primary navigation, the breadcrumb and the stepper follow the APG patterns (roles, aria-current, arrow keys), the status region is live.", realizedBy := (cons "site" (cons "nav-primary" (cons "nav-breadcrumb" (cons "nav-stepper" (nil String))))), conformance := "python3 -m unittest scripts.tests.test_r30.AccessibilityTests (role, aria-current, aria-pressed, role=status, arrow keys)", coverage := "implemented"}) (cons (record Standard {id := "html-living-standard", name := "WHATWG HTML Living Standard", authority := "https://html.spec.whatwg.org/multipage/", version := "living standard", scope := "The page's landmarks (header, nav, main, footer), the one-document site with its data in a JSON script element and its metadata in the head.", realizedBy := (cons "site" (cons "nav-primary" (cons "nav-breadcrumb" (cons "nav-stepper" (nil String))))), conformance := "python3 -m unittest scripts.tests.test_r30.AccessibilityTests.test_landmarks_focus_motion_and_keyboard", coverage := "implemented"}) (cons (record Standard {id := "svg-2", name := "W3C SVG 2", authority := "https://www.w3.org/TR/SVG2/", version := "2 (Candidate Recommendation, 2018-10-04)", scope := "The Rule 30 picture, the logo and the visualizations are SVG documents with a title and a description, crisp cells, colours from the page's tokens.", realizedBy := (cons "picture" (cons "logo" (cons "viz-triangle" (cons "viz-tower" (cons "viz-ledger" (cons "viz-rays" (cons "viz-defects" (cons "viz-dyadic" (nil String))))))))), conformance := "python3 -m unittest scripts.tests.test_r30.SiteTests.test_rule30_rows_and_logo (parsed as SVG, no script)", coverage := "implemented"}) (cons (record Standard {id := "wai-aria-graphics-1.0", name := "W3C WAI-ARIA Graphics Module 1.0", authority := "https://www.w3.org/TR/graphics-aria-1.0/", version := "1.0 (Recommendation, 2018-10-02)", scope := "Every drawing carries role=img with aria-labelledby pointing at its title and description; the interactive visualizations use graphics-document and graphics-symbol.", realizedBy := (cons "picture" (cons "logo" (cons "viz-triangle" (cons "viz-tower" (cons "viz-ledger" (cons "viz-rays" (cons "viz-defects" (cons "viz-dyadic" (nil String))))))))), conformance := "python3 -m unittest scripts.tests.test_r30.SiteTests.test_statements_picture_and_explainer_artifacts (role=img, aria-labelledby)", coverage := "implemented"}) (cons (record Standard {id := "schema-org", name := "schema.org vocabulary (JSON-LD)", authority := "https://schema.org/", version := "current release (https://schema.org/docs/releases.html)", scope := "A LearningResource for every pedagogical step of every journey, the paper as ScholarlyArticle, the repository as SoftwareSourceCode, the register as Dataset, embedded in the page and published as schema.json.", realizedBy := (cons "jsonld" (cons "site" (cons "paper-pdf" (cons "register-json" (cons "readme" (cons "prize-review" (cons "research-session" (cons "reading" (cons "stdlib-feedback" (cons "mathematics" (cons "first-visit" (nil String)))))))))))), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests.test_schema_org_describes_every_step_the_paper_the_repository_and_the_register", coverage := "implemented"}) (cons (record Standard {id := "json-ld-1.1", name := "W3C JSON-LD 1.1", authority := "https://www.w3.org/TR/json-ld11/", version := "1.1 (Recommendation, 2020-07-16)", scope := "The serialization of the schema.org and PROV-O graphs: a @context, a @graph, ids under the published URL.", realizedBy := (cons "jsonld" (cons "provenance" (nil String))), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests (both documents parse and carry @context and @graph)", coverage := "implemented"}) (cons (record Standard {id := "prov-o", name := "W3C PROV-O, the PROV Ontology", authority := "https://www.w3.org/TR/prov-o/", version := "Recommendation, 2013-04-30", scope := "Provenance of every claim: a proved claim prov:wasDerivedFrom its Lean theorem and prov:wasAttributedTo the Lean kernel, attested by the paper's LexLean attestation and the module's kappa-label; the view prov:wasGeneratedBy the render of this commit under the view workflow.", realizedBy := (cons "provenance" (cons "view-workflow" (cons "view_render" (cons "frontier_check" (cons "kappa" (cons "verify" (nil String))))))), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests.test_provenance_derives_every_proved_claim_from_its_theorem", coverage := "implemented"}) (cons (record Standard {id := "json-schema-2020-12", name := "JSON Schema 2020-12", authority := "https://json-schema.org/draft/2020-12/schema", version := "2020-12", scope := "The closed schemas of register.json, the interface sheets, standards.json and the --json reports (rule30-api/schemas), validated by the tests and referenced from openapi.json.", realizedBy := (cons "register-json" (cons "standards" (cons "openapi" (cons "api_check" (cons "api_production" (cons "brief" (cons "chain" (cons "claim" (cons "deduce" (cons "discover" (cons "engine_prune" (cons "engine_status" (cons "engine_tick" (cons "frontier_list" (cons "interface" (cons "kappa" (cons "sequences" (cons "status" (nil String))))))))))))))))))), conformance := "python3 -m unittest scripts.tests.test_r30.ResultSchemaTests; bin/r30 api check", coverage := "implemented"}) (cons (record Standard {id := "openapi-3.1", name := "OpenAPI Specification 3.1", authority := "https://spec.openapis.org/oas/v3.1.1", version := "3.1.1 (2024-10-24)", scope := "The r30 command surface as an API description: one path per command of the parser, its arguments as parameters, its responses from the result schemas, the same leaves as Api.lex.tex and the MCP tools.", realizedBy := (prim append (cons "openapi" (cons "status" (cons "brief" (cons "chain" (cons "api_sync" (cons "api_check" (cons "api_production" (cons "view_render" (cons "interface" (cons "claim" (cons "audit" (cons "gate" (cons "lexicon_search" (cons "lexicon_show" (cons "lexicon_packages" (cons "sig" (cons "mentions" (cons "theorem_preview" (cons "theorem_add" (cons "theorem_remove" (cons "define" (cons "check" (cons "unpublished" (cons "selfcheck" (cons "verify" (cons "probe" (cons "axioms" (cons "choice_audit" (cons "frontier_list" (cons "frontier_add" (cons "frontier_set" (cons "frontier_check" (cons "frontier_render" (cons "commit" (cons "module_list" (cons "module_add" (cons "module_build" (cons "consolidate" (cons "kappa" (cons "sequences" (nil String))))))))))))))))))))))))))))))))))))))))) (cons "discover" (cons "deduce" (cons "engine_tick" (cons "engine_status" (cons "engine_hypotheses" (cons "engine_prune" (cons "experiment_list" (cons "experiment_run" (nil String))))))))) : (List String)), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests.test_openapi_describes_the_command_surface; bin/r30 api check (Api.lex.tex)", coverage := "implemented"}) (cons (record Standard {id := "gherkin", name := "Gherkin (Cucumber reference)", authority := "https://cucumber.io/docs/gherkin/reference/", version := "Gherkin reference (current)", scope := "One scenario per conformance id in features/suites, tagged with the id and its honesty level, generated with the registers.", realizedBy := (cons "api_sync" (cons "api_check" (nil String))), conformance := "python3 -m unittest scripts.tests.test_r30.ConformanceTests; bin/r30 api check", coverage := "implemented"}) (cons (record Standard {id := "citation-cff", name := "Citation File Format 1.2.0", authority := "https://citation-file-format.github.io/", version := "1.2.0", scope := "CITATION.cff at the repository root (and copied into the view): the author, the title of the paper, the repository and the published view.", realizedBy := (cons "citation" (cons "readme" (nil String))), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests.test_citation_file_names_the_author_the_title_and_the_repository", coverage := "implemented"}) (cons (record Standard {id := "spdx", name := "SPDX License Expressions (SPDX 2.3, ISO/IEC 5962:2021)", authority := "https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/", version := "2.3", scope := "License identifiers of the vendored sources: the repository is MIT (LICENSE at the root, `license: MIT` in CITATION.cff); the prism-stdlib register carries the SPDX expression of its vendored license files.", realizedBy := (cons "stdlib-package" (cons "citation" (nil String))), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests.test_spdx_expressions_are_well_formed", coverage := "implemented"}) (cons (record Standard {id := "sitemap-protocol", name := "Sitemaps XML protocol 0.9", authority := "https://www.sitemaps.org/protocol.html", version := "0.9", scope := "sitemap.xml: the page and the deep link of every step of every journey; robots.txt names the sitemap.", realizedBy := (cons "sitemap" (cons "robots" (cons "site" (cons "prize-review" (cons "research-session" (cons "reading" (cons "stdlib-feedback" (cons "mathematics" (cons "first-visit" (nil String)))))))))), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests.test_sitemap_lists_every_step_deep_link", coverage := "implemented"}) (cons (record Standard {id := "open-graph", name := "The Open Graph protocol", authority := "https://ogp.me/", version := "ogp.me (2014-10)", scope := "og:title, og:type, og:url, og:description and og:image in the page's head, injected with the JSON-LD at render.", realizedBy := (cons "site" (cons "logo" (nil String))), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests.test_site_head_carries_json_ld_and_open_graph", coverage := "implemented"}) (cons (record Standard {id := "rfc-8785", name := "RFC 8785, JSON Canonicalization Scheme (JCS)", authority := "https://www.rfc-editor.org/rfc/rfc8785", version := "2020-06", scope := "The identity of the published JSON contracts (sha256-canonical-json in contracts.toml) and the canonical JSON of the LexLean attestations; uor-addr labels JSON under JCS.", realizedBy := (cons "register-json" (cons "statements" (cons "kappa" (nil String)))), conformance := "python3 -m unittest scripts.tests.test_kappa (the no-prefix rule on the JCS vector)", coverage := "implemented"}) (cons (record Standard {id := "rivest-csexp", name := "Rivest, S-Expressions (canonical form, section 4.3)", authority := "https://people.csail.mit.edu/rivest/Sexp.txt", version := "draft-rivest-sexp-00, 1997-05-04", scope := "The kappa-label of a research module: the SHA-256 of the canonical S-expression of the declarations the kernel replays, as UOR-Foundation/uor-addr mints labels; the key of the replay receipts. The same canonical form labels the sequences of the basis, (sequence ), their transforms and the relations the discovery engines find, (relation ).", realizedBy := (cons "kappa" (cons "provenance" (cons "sequences" (cons "discover" (cons "Sequences" (cons "Discovery" (nil String))))))), conformance := "python3 -m unittest scripts.tests.test_kappa; bin/r30 kappa ; bin/r30 api check (sequences)", coverage := "implemented"}) (cons (record Standard {id := "in-toto-statement-v1", name := "in-toto Attestation Framework, Statement v1", authority := "https://github.com/in-toto/attestation/blob/main/spec/v1/statement.md", version := "v1", scope := "attestations.intoto.json: a Statement whose subjects are the attested PDFs and the paper's sources with their SHA-256 digests and whose predicate is the paper's LexLean attestation.", realizedBy := (cons "attestations" (cons "pdf-manifest" (cons "verify" (cons "paper-pdf" (cons "observations-pdf" (cons "core-pdf" (nil String))))))), conformance := "python3 -m unittest scripts.tests.test_r30.StandardsTests.test_in_toto_statement_subjects_are_the_attested_documents", coverage := "implemented"}) (cons (record Standard {id := "oci-distribution", name := "OCI Distribution Specification", authority := "https://github.com/opencontainers/distribution-spec/blob/main/spec.md", version := "1.1.0 (2024-02)", scope := "Planned: a kappa-registry serving the replay receipts and certified bundles by content address; today only the kappa-labels that would address them exist.", realizedBy := (cons "kappa" (nil String)), conformance := "bin/r30 kappa (the labels); no registry runs yet", coverage := "planned"}) (cons (record Standard {id := "iana-media-types", name := "IANA Media Types (RFC 6838)", authority := "https://www.iana.org/assignments/media-types/", version := "RFC 6838 (2013-01)", scope := "Every published artifact declares its media type in Presentation.lex.tex; the contracts register declares the vendor types of the JSON reports.", realizedBy := (prim append (cons "chain" (cons "register-json" (cons "register-text" (cons "frontier" (cons "interfaces" (cons "statements" (cons "explainer" (cons "picture" (cons "paper-pdf" (cons "observations-pdf" (cons "core-pdf" (cons "pdf-manifest" (cons "api-module" (cons "register-module" (cons "architecture-module" (cons "presentation-module" (cons "application-module" (cons "core-vectors" (cons "frontier-module" (cons "agents" (cons "round-workflow" (cons "strategy" (cons "readme" (cons "logo" (cons "standards" (cons "standards-module" (cons "openapi" (cons "sitemap" (cons "robots" (cons "provenance" (cons "jsonld" (cons "attestations" (cons "citation" (cons "observer-module" (cons "tokens" (cons "site" (cons "viz-core-js" (cons "viz-triangle-js" (cons "viz-tower-js" (cons "viz-ledger-js" (nil String))))))))))))))))))))))))))))))))))))))))) (cons "viz-rays-js" (cons "viz-defects-js" (cons "viz-dyadic-js" (nil String)))) : (List String)), conformance := "bin/r30 verify api: artifactPathsDistinct, panelsReadArtifacts (Presentation); python3 -m unittest scripts.tests.test_r30.StandardsTests", coverage := "implemented"}) (cons (record Standard {id := "lean-4", name := "Lean 4 (the kernel)", authority := "https://github.com/leanprover/lean4", version := "leanprover/lean4:v4.32.1", scope := "Every proved claim names a theorem the Lean kernel checked under propext and Quot.sound; the research modules are kernel-replayed with leanchecker.", realizedBy := (cons "Register" (cons "axioms" (cons "choice_audit" (cons "frontier_check" (cons "kappa" (cons "module_build" (nil String))))))), conformance := "bin/r30 frontier check; bin/r30 axioms ; bin/r30 choice-audit", coverage := "implemented"}) (cons (record Standard {id := "lexlean", name := "UOR-Foundation/LexLean (closed-lexicon LaTeX to Lean 4)", authority := "https://github.com/UOR-Foundation/LexLean", version := "0.4.0, language 1.2, compiler semantics b9816b388a3e", scope := "The authoring surface: the paper, the register and these API modules are LexLean modules verified by lexlean; the production roots export to certified Rust.", realizedBy := (cons "Api" (cons "Register" (cons "Architecture" (cons "Presentation" (cons "Application" (cons "Observer" (cons "Convert" (cons "Standards" (cons "Rule30Core" (cons "Sequences" (cons "Discovery" (cons "verify" (cons "check" (cons "api_sync" (cons "api_check" (cons "api_production" (nil String))))))))))))))))), conformance := "bin/r30 verify api; bin/r30 check api; bin/r30 api check", coverage := "implemented"}) (nil Standard))))))))))))))))))))))))), axioms: [] } @@ -281,7 +281,7 @@ theorem{ name: lexleanPinned, parameters: [], - statement: ((prim equal (standardVersion "lexlean" (standards)) "0.4.0, language 1.2, compiler semantics 0b48547157a4" : Bool) = true), + statement: ((prim equal (standardVersion "lexlean" (standards)) "0.4.0, language 1.2, compiler semantics b9816b388a3e" : Bool) = true), proof: decide{}, axioms: [] } diff --git a/rule30-lexlean/Core.pdf b/rule30-lexlean/Core.pdf index 21a5f52f3cd68b4bfd885838ba7f3fc52ac14e5d..3ec8bc1457315135e113d0f140a844f63691320f 100644 GIT binary patch delta 124 zcmcb6hWYLp<_)uNs+brVm{^(^M`?2D`{t*(B$lKqXt-Dz85o%v8X7<)H}Ah$!s%?` t;%aW_;$moQWNBt*?rdOYVPbA!VCrV-Y+&hZVQOTjU_(gB=Ca4nnE?HwBDDYj delta 124 zcmcb6hWYLp<_)uNsu&xZ8yK3HM`?2D`{t*(B$lKqXt-Dz85o%v8X7<)H}Ah$!s+Z} tX=!TeVrXLF>|$=@WNKkx;^^k=Y~tu>;$-4%=ICgrU_(gB=Ca4nnE(%YBUu0d diff --git a/rule30-lexlean/lexlean.lock b/rule30-lexlean/lexlean.lock index 9b89f7a..366e112 100644 --- a/rule30-lexlean/lexlean.lock +++ b/rule30-lexlean/lexlean.lock @@ -1,6 +1,6 @@ spec = "lexlean/lock/2" language = "1.2" -compiler_semantics = "0b48547157a44c7dafdc0c59cfd270f185a6a172b83bb42e5af79323d4fb84eb" +compiler_semantics = "b9816b388a3eb1800179f96aa9bc789620a46d7a7132f1b52ee9fa404c2092f7" project_config_sha256 = "19b484b35998550fc91a00820ee56382eaf79bbb39852dfb7d54e82018f0cd7b" lean_toolchain = "leanprover/lean4:v4.32.1" diff --git a/rule30-lexlean/pdf/Core.pdf b/rule30-lexlean/pdf/Core.pdf index 21a5f52f3cd68b4bfd885838ba7f3fc52ac14e5d..3ec8bc1457315135e113d0f140a844f63691320f 100644 GIT binary patch delta 124 zcmcb6hWYLp<_)uNs+brVm{^(^M`?2D`{t*(B$lKqXt-Dz85o%v8X7<)H}Ah$!s%?` t;%aW_;$moQWNBt*?rdOYVPbA!VCrV-Y+&hZVQOTjU_(gB=Ca4nnE?HwBDDYj delta 124 zcmcb6hWYLp<_)uNsu&xZ8yK3HM`?2D`{t*(B$lKqXt-Dz85o%v8X7<)H}Ah$!s+Z} tX=!TeVrXLF>|$=@WNKkx;^^k=Y~tu>;$-4%=ICgrU_(gB=Ca4nnE(%YBUu0d diff --git a/rule30-paper/Observations.pdf b/rule30-paper/Observations.pdf index 71fbe00cb1f08f3c712d20e4e6b560ceeaec8bd0..222151ea73ce4adc2d995a3e40862e4563d4c3f0 100644 GIT binary patch delta 118 zcmex%OW@lrfrb{w7N!>FEi6$Y>?TGACYB}^(-TEl#9*B5bs{V~c$}S`42>)tfwCs1 lriNw~j;3Z##%>1Y&aM`Q1}28iCUy!ogp_QrRAl+f4FHP(9%=vp delta 118 zcmex%OW@lrfrb{w7N!>FEi6$Y?8b)X28O1_(-TEl#9*B5bs{V~c$`g*%?*rqoLr5K%}h;Q+$>$4EX|FLU7hR{YzQgYUa83Pmm2_;A0F%g diff --git a/rule30-paper/Paper.pdf b/rule30-paper/Paper.pdf index 53c966c3ab5b635210814f320edc65c3305ea83c..fb007df279306a6bb33bf188dd747d0d3698363a 100644 GIT binary patch delta 154 zcmZphY~425x}k-!g{g(Pg{6hHg{_6Xg`FEi6$Y>?TGACYB}^(-TEl#9*B5bs{V~c$}S`42>)tfwCs1 lriNw~j;3Z##%>1Y&aM`Q1}28iCUy!ogp_QrRAl+f4FHP(9%=vp delta 118 zcmex%OW@lrfrb{w7N!>FEi6$Y?8b)X28O1_(-TEl#9*B5bs{V~c$`g*%?*rqoLr5K%}h;Q+$>$4EX|FLU7hR{YzQgYUa83Pmm2_;A0F%g diff --git a/rule30-paper/pdf/Paper.pdf b/rule30-paper/pdf/Paper.pdf index 53c966c3ab5b635210814f320edc65c3305ea83c..fb007df279306a6bb33bf188dd747d0d3698363a 100644 GIT binary patch delta 154 zcmZphY~425x}k-!g{g(Pg{6hHg{_6Xg`