Skip to content

WokeLang EBNF grammar specification#1

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/wokelang-ebnf-grammar-QoeVv
Dec 16, 2025
Merged

WokeLang EBNF grammar specification#1
hyperpolymath merged 1 commit into
mainfrom
claude/wokelang-ebnf-grammar-QoeVv

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

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

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
hyperpolymath merged commit 78f67fc into main Dec 16, 2025
1 check failed
@hyperpolymath
hyperpolymath deleted the claude/wokelang-ebnf-grammar-QoeVv branch December 16, 2025 03:34
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants