WokeLang EBNF grammar specification#1
Merged
Conversation
Defines the formal grammar for WokeLang, a human-centered, consent-driven programming language featuring: - Natural language-style syntax with emotionally-aware constructs - Consent blocks (`only if okay`) for user permission handling - Built-in gratitude/attribution system (`thanks to`) - Emotional annotations via emote tags (@Identifier) - Physical unit system with `measured in` syntax - Gentle error handling (`attempt safely` / `or reassure`) - Worker/side quest concurrency model - Pattern matching with `decide based on` - Optional types with Maybe, references, and arrays
hyperpolymath
added a commit
that referenced
this pull request
Mar 22, 2026
All 13 sorry proofs are BLOCKED by incomplete Step relation in the small-step operational semantics. Each sorry is now numbered (#1-#12) with the exact missing Step constructor specified inline, plus a summary table in the file header. No sorry can be resolved without first extending the Step inductive type. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
Jun 14, 2026
…I gate (#79) ## Summary The Lean 4 formal-verification file `docs/proofs/verification/WokeLang.lean` claimed *"all 12 `sorry` eliminated / verified"* — but it had **silently bit-rotted** and did **not compile** under a current Lean toolchain (~100 errors). Root cause: **no CI ever ran the prover** (workflows only covered the OCaml core + e2e), so the headline correctness claim was never machine-enforced. This PR restores **sorry-free compilation under Lean 4.30.0**, adds the missing **CI gate**, and documents a coverage/correspondence audit. ## What changed **Only proof bodies + 2 `deriving` clauses + 1 `abbrev`** — every theorem signature and every inductive is **byte-identical** (verified by diff). No statement was weakened; no `sorry`/`admit`/`axiom` introduced. Root causes fixed: - **`DecidableEq` no longer derives** for `Value`/`WokeType` (`Float` has none — NaN; and nested `List Self` blocks the deriving handler) → reduced to `deriving Repr`; equality decisions use Lean's classical `by_cases` (no instance needed). - **`induction`/`cases` on concrete indices** (`emptyTypeEnv`, `emptyEnv`) + binder-arity drift across Lean versions. `preservation` made **type-polymorphic** via `induction hs generalizing t` (its congruence cases need the IH at the operand type, not the result type). `cases … with | inr ⟨..⟩` anonymous-constructor patterns → `obtain` (no longer supported in `cases`). Type-mismatched reduction siblings discharged with `nomatch`. - **`BEq Permission`**: made `Permission` a reducible `abbrev` so the `String` instance transfers. ## Verification ``` $ lean docs/proofs/verification/WokeLang.lean # exit 0, no output ``` Machine-checked: `progress`, `preservation`, `type_safety` (multi-step), `consent_monotonicity`, `consent_preservation` — for the expression core (incl. the Result/`unwrap`/`error` panic-propagation fragment). ## Added - **`docs/proofs/verification/lean-toolchain`** — pins Lean v4.30.0. - **`docs/proofs/verification/AUDIT.md`** — answers PROOF-NEEDS.md #1 & #2: the proofs cover a **clean expression core** (a strict, honestly-scoped subset), the Lean type system corresponds to the **Rust** typechecker (not the OCaml `core/eval.ml`, which models a different language), and the consent theorems correspond to the spec's Hoare logic. - **`.github/workflows/lean-proofs.yml`** — installs the pinned toolchain and runs the check on every push to the proof dir, so this can't bit-rot again. SHA-pinned action, pure-bash install (matches estate governance). ## Note on scope This repairs and re-verifies the **existing** proofs and makes them durable. It does **not** yet extend coverage (more binops/comparisons, statements, arrays, compiler/VM correctness) — those remain per PROOF-NEEDS.md and are tabulated in AUDIT.md. https://claude.ai/code/session_013wg3Mtq2QFhYi4XVw1Z6z7 --- _Generated by [Claude Code](https://claude.ai/code/session_013wg3Mtq2QFhYi4XVw1Z6z7)_ Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Defines the formal grammar for WokeLang, a human-centered, consent-driven programming language featuring:
only if okay) for user permission handlingthanks to)measured insyntaxattempt safely/or reassure)decide based on