diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..a90ea1b
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,78 @@
+# EditorConfig is awesome: https://EditorConfig.org
+
+# top-most EditorConfig file
+root = true
+
+# Universal settings
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+indent_style = space
+indent_size = 4
+
+# Java files
+[*.java]
+indent_size = 4
+continuation_indent_size = 8
+
+# ANTLR grammar files
+[*.g4]
+indent_size = 4
+
+# MPL source files
+[*.mpl]
+indent_size = 2
+# Ensure Unicode is preserved
+charset = utf-8
+
+# Markdown files
+[*.md]
+trim_trailing_whitespace = false
+indent_size = 2
+
+# YAML files
+[*.{yml,yaml}]
+indent_size = 2
+
+# JSON files
+[*.json]
+indent_size = 2
+
+# XML files
+[*.xml]
+indent_size = 2
+
+# Gradle files
+[*.gradle]
+indent_size = 4
+
+# Shell scripts
+[*.sh]
+indent_size = 2
+
+# Batch files
+[*.bat]
+end_of_line = crlf
+indent_size = 2
+
+# Makefiles
+[Makefile]
+indent_style = tab
+
+# Git config files
+[.git*]
+indent_size = 2
+
+# GitHub Actions
+[.github/workflows/*.yml]
+indent_size = 2
+
+# LaTeX files (for whitepaper)
+[*.tex]
+indent_size = 2
+
+# Properties files
+[*.properties]
+indent_size = 4
\ No newline at end of file
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 0000000..0d9514a
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1,13 @@
+# These are supported funding model platforms
+
+github: [developtheweb]
+patreon: # Replace with up to 4 Patreon usernames
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: # Replace with a single Tidelift platform-name/package-name
+community_bridge: # Replace with a single Community Bridge project-name
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name
+custom: # No custom donation links yet
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..5dfc7f6
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,50 @@
+---
+name: Bug report
+about: Create a report to help us improve MPL
+title: ''
+labels: bug
+assignees: ''
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Steps to reproduce the behavior:
+1. Write MPL code '...'
+2. Run command '....'
+3. See error
+
+**MPL Code**
+```mpl
+# Paste your MPL code here
+```
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Actual behavior**
+What actually happened instead.
+
+**Error messages**
+```
+Paste any error messages here
+```
+
+**Environment (please complete the following information):**
+ - OS: [e.g. Ubuntu 22.04, Windows 11, macOS 13]
+ - Java Version: [e.g. OpenJDK 11.0.17]
+ - MPL Version: [e.g. 2.0.0]
+ - Terminal/IDE: [e.g. VS Code, IntelliJ IDEA]
+
+**Additional context**
+Add any other context about the problem here.
+
+**Symbol Display**
+- [ ] I can see mathematical symbols correctly in my environment
+- [ ] I tried using ASCII escapes (e.g., `\sum` instead of ∑)
+
+**Checklist**
+- [ ] I have searched existing issues for duplicates
+- [ ] I have provided a minimal code example
+- [ ] I have included all error messages
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000..f757bd6
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,42 @@
+---
+name: Feature request
+about: Suggest an idea for MPL
+title: ''
+labels: enhancement
+assignees: ''
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Does this feature pass the Fatima Test?**
+Would a 10-year-old non-English speaker understand this feature? Please explain why.
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Proposed syntax (if applicable)**
+```mpl
+# Show how the feature would look in MPL code
+```
+
+**Mathematical basis**
+If proposing a new symbol or operator:
+- What mathematical concept does it represent?
+- Is there established notation for this?
+- What would be the ASCII escape sequence?
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context, mockups, or examples about the feature request here.
+
+**Impact on education**
+How would this feature help students learning to program?
+
+**Checklist**
+- [ ] This feature aligns with MPL's mission of cognitive universality
+- [ ] I've considered how non-English speakers would understand this
+- [ ] I've searched existing issues for similar requests
+- [ ] The proposed syntax uses mathematical notation, not English keywords
\ No newline at end of file
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..9db290a
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,56 @@
+## Description
+
+Brief description of what this PR does.
+
+## Motivation and Context
+
+Why is this change required? What problem does it solve?
+If it fixes an open issue, please link to the issue here.
+
+Fixes #(issue)
+
+## How Has This Been Tested?
+
+Please describe the tests that you ran to verify your changes:
+- [ ] All existing tests pass
+- [ ] Added new tests for new functionality
+- [ ] Tested with example programs
+- [ ] Tested with different input methods (visual, keyboard, ASCII escapes)
+
+## Types of changes
+
+What types of changes does your code introduce? Check all that apply:
+- [ ] Bug fix (non-breaking change which fixes an issue)
+- [ ] New feature (non-breaking change which adds functionality)
+- [ ] Breaking change (fix or feature that would cause existing functionality to change)
+- [ ] Documentation update
+- [ ] Grammar modification
+- [ ] New symbol/operator
+
+## Checklist
+
+- [ ] My code follows the code style of this project
+- [ ] My change requires a change to the documentation
+- [ ] I have updated the documentation accordingly
+- [ ] I have added tests to cover my changes
+- [ ] All new and existing tests passed
+- [ ] I have updated CHANGELOG.md in the Unreleased section
+- [ ] My changes pass the Fatima Test (understandable by non-English speakers)
+
+## MPL-Specific Considerations
+
+### For new symbols/operators:
+- [ ] Symbol has clear mathematical meaning
+- [ ] ASCII escape sequence provided
+- [ ] Added to glyph-escapes.md
+- [ ] Precedence defined and tested
+- [ ] Example usage provided
+
+### For grammar changes:
+- [ ] No shift/reduce conflicts introduced
+- [ ] Precedence table updated if needed
+- [ ] Backwards compatibility maintained
+
+## Additional Notes
+
+Any additional information that reviewers should know.
\ No newline at end of file
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..0c49ff0
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,77 @@
+name: CI
+
+on:
+ push:
+ pull_request:
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out
+ uses: actions/checkout@v4
+
+ - name: Set up JDK 21
+ uses: actions/setup-java@v4
+ with:
+ distribution: temurin
+ java-version: '21'
+
+ # ANTLR runs with -Werror (see build.gradle), so any grammar warning
+ # — including 184, token shadowing — fails this step.
+ - name: Build grammar and compile
+ run: ./gradlew build -x test
+
+ - name: Run tests
+ run: ./gradlew test
+
+ - name: Parse all examples
+ run: ./gradlew parseExamples
+
+ interpreter:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out
+ uses: actions/checkout@v4
+
+ - name: Set up Node 24
+ uses: actions/setup-node@v4
+ with:
+ node-version: '24'
+
+ - name: Run interpreter tests
+ run: node --test "js/test/*.test.mjs"
+
+ conformance:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out
+ uses: actions/checkout@v4
+
+ - name: Set up JDK 21
+ uses: actions/setup-java@v4
+ with:
+ distribution: temurin
+ java-version: '21'
+
+ - name: Set up Node 24
+ uses: actions/setup-node@v4
+ with:
+ node-version: '24'
+
+ # Gates on ratified entries only. Exits 0 vacuously while nothing is
+ # ratified — unratified observations must never become a CI gate.
+ - name: Ratified conformance corpus passes
+ run: node conformance/harness/run.mjs --ratified
+
+ # Locked decision: the corpus is downstream of the syntax truth. Every
+ # program must parse, except must-reject entries whose expected error
+ # is parse-class — the grammar rejects those too (verified in C3).
+ - name: Grammar accepts every runnable corpus program
+ run: |
+ runnable=$(for d in conformance/corpus/*/; do
+ if [ -f "${d}expected.out" ]; then echo "${d}program.mpl"
+ elif ! grep -qE '^err_(char|escape|string|comment|expect|unexpected|def_target|assign_target)$' "${d}expected.err"; then echo "${d}program.mpl"
+ fi
+ done | tr '\n' ' ')
+ ./gradlew -q parseCheck --args="$runnable"
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..25cd255
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,132 @@
+# Gradle
+.gradle/
+build/
+!gradle/wrapper/gradle-wrapper.jar
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+# IntelliJ IDEA
+.idea/
+*.iws
+*.iml
+*.ipr
+out/
+!**/src/main/**/out/
+!**/src/test/**/out/
+
+# Eclipse
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+bin/
+!**/src/main/**/bin/
+!**/src/test/**/bin/
+
+# VS Code
+.vscode/
+*.code-workspace
+
+# macOS
+.DS_Store
+.AppleDouble
+.LSOverride
+._*
+
+# Windows
+Thumbs.db
+ehthumbs.db
+Desktop.ini
+$RECYCLE.BIN/
+*.lnk
+
+# Linux
+*~
+*.swp
+*.swo
+.directory
+
+# ANTLR
+.antlr/
+*.tokens
+*.interp
+**/generated-src/
+
+# Java
+*.class
+*.jar
+*.war
+*.ear
+*.nar
+hs_err_pid*
+
+# Logs
+*.log
+logs/
+
+# Package Files
+*.tar.gz
+*.rar
+*.zip
+*.7z
+*.dmg
+*.iso
+
+# Build outputs
+target/
+dist/
+tmp/
+temp/
+
+# Test outputs
+test-results/
+test-output/
+*.exec
+*.coverage
+
+# Documentation build
+docs/_build/
+docs/_site/
+*.pdf
+!whitepaper/*.pdf
+
+# IDE specific
+.nb-gradle/
+.metadata
+.recommenders
+
+# MPL specific
+*.mpl.compiled
+*.mpl.cache
+.mpl/
+
+# Temporary files
+*.tmp
+*.bak
+*~.nib
+
+# Security
+*.key
+*.pem
+*.p12
+*.pfx
+*.jks
+.env
+.env.local
+.env.*.local
+
+# User-specific files
+local.properties
+
+# Claude-specific (not committed)
+CLAUDE.md
+
+# Gradle wrapper (DO NOT IGNORE)
+# The negation must come after *.jar above — the last matching rule wins.
+!gradle/
+!gradle/wrapper/gradle-wrapper.jar
+!gradlew
+!gradlew.bat
\ No newline at end of file
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..758a974
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,28 @@
+# Authors
+
+Mathematical Programming Language (MPL) was created and is maintained by:
+
+## Project Creator & Lead Maintainer
+
+* **Reverend Steven Milanese** (@developtheweb) - Project creator, language design, core implementation
+
+## Contributors
+
+Contributors will be added here as they make significant contributions to the project.
+
+To be listed here, contributors should have:
+- Made substantial code contributions, or
+- Significantly improved documentation, or
+- Contributed major features or bug fixes
+
+## Special Thanks
+
+- All the educators and students who believe in cognitive justice in programming education
+- The open source community for tools and inspiration
+
+---
+
+For a complete list of contributors, see the git log:
+```
+git log --format='%aN' | sort -u
+```
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..322ae30
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,79 @@
+# Changelog
+
+All notable changes to the Mathematical Programming Language (MPL) project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [Unreleased]
+
+### Added
+- Gradle wrapper, so `./gradlew build` works from a fresh clone
+- CI workflow: grammar build (ANTLR warnings are errors), tests, example parsing
+- Documentation test: every ```mpl code block in README, spec and whitepaper must parse
+- Canonical call syntax `f(a, b)` with nullary calls `f()`
+- Wired-in operators: `≜` definition, `⊕`/`⊖` postfix resources, `⇀_ch`/`↽_ch` channels, `‧` module access, unary minus, `/` as ASCII alias of `÷`
+- DECISIONS.md recording each design resolution with rejected alternatives
+
+### Changed
+- One canonical form per construct: guarded alternatives `(c ⟹ r) | fallback`, `✎` output, `↯pattern ⟹ expr` handler clauses, exactly one ASCII escape per glyph
+- `;` has a single role (sequence separator, trailing permitted)
+- Identifiers may no longer start with `_`, so subscripts lex correctly
+- precedence.csv and glyph-escapes.md regenerated to match the grammar exactly
+- README claims reduced to what CI verifies
+- Comprehensive enterprise-level documentation structure
+- AGPLv3 license for strong copyleft protection (changed from MIT)
+- README transformed into moonshot vision document emphasizing cognitive justice
+- Whitepaper updated to v2.0 with educational narrative focus
+
+### Fixed
+- Grammar compiles: removed mutual left recursion (errors 119/148) and shadowed tokens (warning 184)
+- Generated parser package no longer declared twice
+- Gradle finds the grammar (src/main/antlr4) and the ParseExamples main class
+- Test harness uses CharStreams; supplementary-plane glyphs (𝔹, 𝓜, 🖫) now tokenize
+- Examples 03 and 05 parse (canonical handler arrow; real placeholder body)
+
+### Removed
+- Dead tokens with no parser rule: `?` (QUERY), `∃`, `⇐`, `→`, `.`
+- Juxtaposition function application (`f x`)
+- C-style ternary and `📤` from all documentation
+
+## [2.0.0] - 2025-01-26
+
+### Added
+- Complete ANTLR 4 grammar with 70+ mathematical operators
+- Support for functional, imperative, concurrent, and object-oriented paradigms
+- ASCII escape sequences for all Unicode symbols
+- Comprehensive test suite with 663 lines of test code
+- 10 example programs demonstrating real-world usage
+- Academic whitepaper with technical specification
+- Symbol reference guide (glyph-escapes.md)
+- Operator precedence table
+
+### Changed
+- Moved from theoretical concept to working parser implementation
+- Established Fatima Test as core design principle
+
+### Fixed
+- All M0 blocker issues resolved
+- Zero shift/reduce conflicts in grammar
+- Operator precedence validated through extensive testing
+
+## [1.0.0] - 2024-12-15
+
+### Added
+- Initial concept and vision for Mathematical Programming Language
+- Basic symbol set proposal
+- Preliminary grammar sketch
+- Mission statement for cognitive universality
+
+---
+
+## Version History Summary
+
+- **2.0.0** - First working implementation with complete grammar
+- **1.0.0** - Initial concept and vision
+
+[Unreleased]: https://github.com/developtheweb/mpl/compare/v2.0.0...HEAD
+[2.0.0]: https://github.com/developtheweb/mpl/compare/v1.0.0...v2.0.0
+[1.0.0]: https://github.com/developtheweb/mpl/releases/tag/v1.0.0
\ No newline at end of file
diff --git a/CITATION.cff b/CITATION.cff
new file mode 100644
index 0000000..a38d6fc
--- /dev/null
+++ b/CITATION.cff
@@ -0,0 +1,56 @@
+# This CITATION.cff file was generated with cffinit.
+# Visit https://bit.ly/cffinit to generate yours today!
+
+cff-version: 1.2.0
+title: Mathematical Programming Language (MPL)
+message: >-
+ If you use this software, please cite it using the
+ metadata from this file.
+type: software
+authors:
+ - given-names: Steven
+ family-names: Milanese
+ email: developtheweb@protonmail.com
+ affiliation: Independent Researcher
+ orcid: 'https://orcid.org/0000-0000-0000-0000'
+identifiers:
+ - type: url
+ value: 'https://github.com/developtheweb/mpl'
+ description: GitHub Repository
+repository-code: 'https://github.com/developtheweb/mpl'
+url: 'https://github.com/developtheweb/mpl'
+repository-artifact: 'https://github.com/developtheweb/mpl/releases'
+abstract: >-
+ Mathematical Programming Language (MPL) is a programming
+ language that achieves cognitive universality through
+ mathematical notation. By replacing English keywords with
+ mathematical symbols, MPL enables any child, regardless
+ of native language, to learn programming through the
+ universal language of mathematics. MPL supports
+ functional, imperative, concurrent, and object-oriented
+ paradigms while maintaining zero language barriers.
+keywords:
+ - programming-language
+ - mathematical-notation
+ - cognitive-universality
+ - education
+ - unicode
+ - language-agnostic
+ - cognitive-justice
+ - universal-programming
+license: AGPL-3.0
+commit: 4893ac3
+version: 2.0.0
+date-released: '2025-01-26'
+preferred-citation:
+ type: article
+ authors:
+ - given-names: Steven
+ family-names: Milanese
+ title: "Mathematical Programming Languages: Achieving Cognitive Universality Through Unicode-Based Syntax"
+ year: 2025
+ journal: "Proceedings of Programming Language Design and Education"
+ volume: 1
+ issue: 1
+ start: 1
+ end: 20
\ No newline at end of file
diff --git a/CODEOWNERS b/CODEOWNERS
new file mode 100644
index 0000000..ce2cd5a
--- /dev/null
+++ b/CODEOWNERS
@@ -0,0 +1,14 @@
+# This file defines who owns what in this repository
+# These owners will be requested for review when someone opens a pull request
+
+# Global owners for everything
+* @developtheweb
+
+# Grammar and language design
+*.g4 @developtheweb
+*.mpl @developtheweb
+
+# Documentation
+*.md @developtheweb
+/docs/ @developtheweb
+/whitepaper/ @developtheweb
\ No newline at end of file
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000..1f1a348
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,102 @@
+# Code of Conduct
+
+## Our Pledge
+
+We as members, contributors, and leaders pledge to make participation in the Mathematical Programming Language (MPL) community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
+
+## Our Standards
+
+Examples of behavior that contributes to a positive environment for our community include:
+
+* Demonstrating empathy and kindness toward other people
+* Being respectful of differing opinions, viewpoints, and experiences
+* Giving and gracefully accepting constructive feedback
+* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
+* Focusing on what is best not just for us as individuals, but for the overall community
+* Using welcoming and inclusive language
+* Being mindful of your language when referring to programming concepts (remember: not everyone speaks English)
+
+Examples of unacceptable behavior include:
+
+* The use of sexualized language or imagery, and sexual attention or advances of any kind
+* Trolling, insulting or derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or email address, without their explicit permission
+* Other conduct which could reasonably be considered inappropriate in a professional setting
+* Dismissing or attacking contributions based on the contributor's native language or English proficiency
+
+## Enforcement Responsibilities
+
+Project maintainer Reverend Steven Milanese (@developtheweb) is responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
+
+The project maintainer has the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
+
+## Scope
+
+This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainer at developtheweb@protonmail.com. All complaints will be reviewed and investigated promptly and fairly.
+
+The project maintainer is obligated to respect the privacy and security of the reporter of any incident.
+
+## Enforcement Guidelines
+
+The project maintainer will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
+
+### 1. Correction
+
+**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
+
+**Consequence**: A private, written warning from the project maintainer, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
+
+### 2. Warning
+
+**Community Impact**: A violation through a single incident or series of actions.
+
+**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
+
+### 3. Temporary Ban
+
+**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
+
+**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
+
+### 4. Permanent Ban
+
+**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
+
+**Consequence**: A permanent ban from any sort of public interaction within the community.
+
+## MPL-Specific Guidelines
+
+Given MPL's mission to break down language barriers in programming:
+
+1. **Language Sensitivity**: Be especially mindful that contributors may not be native English speakers. Never mock or belittle someone's language skills.
+
+2. **Cultural Awareness**: Respect that mathematical symbols may have different meanings or connotations in different cultures. Be open to discussion about symbol choices.
+
+3. **Educational Focus**: Remember that MPL is designed for learners, including children. Keep all communications appropriate for all ages.
+
+4. **Accessibility**: Consider that contributors may be using translation tools or assistive technologies. Be patient and clear in communication.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
+
+Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
+
+For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
+
+[homepage]: https://www.contributor-covenant.org
+[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
+[Mozilla CoC]: https://github.com/mozilla/diversity
+[FAQ]: https://www.contributor-covenant.org/faq
+[translations]: https://www.contributor-covenant.org/translations
+
+---
+
+Remember: MPL exists to make programming accessible to everyone, regardless of their native language. Our community should reflect this inclusive mission in all our interactions.
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..afb9e4a
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,220 @@
+# Contributing to Mathematical Programming Language (MPL)
+
+First off, thank you for considering contributing to MPL! 🌍
+
+MPL exists to break down language barriers in programming education. Every contribution, no matter how small, helps us move closer to a world where any child can learn to code using the universal language of mathematics.
+
+## Table of Contents
+
+- [Code of Conduct](#code-of-conduct)
+- [How Can I Contribute?](#how-can-i-contribute)
+- [Development Process](#development-process)
+- [Style Guidelines](#style-guidelines)
+- [Commit Message Guidelines](#commit-message-guidelines)
+- [Pull Request Process](#pull-request-process)
+- [Community](#community)
+
+## Code of Conduct
+
+This project and everyone participating in it is governed by the [MPL Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [developtheweb@protonmail.com](mailto:developtheweb@protonmail.com).
+
+## Project Leadership
+
+MPL was created and is maintained by Reverend Steven Milanese (@developtheweb). All major design decisions and direction are set by the project creator.
+
+## How Can I Contribute?
+
+### 🐛 Reporting Bugs
+
+Before creating bug reports, please check [existing issues](https://github.com/developtheweb/mpl/issues) as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible:
+
+- **Use a clear and descriptive title**
+- **Describe the exact steps to reproduce the problem**
+- **Provide specific examples** (include MPL code snippets)
+- **Describe the behavior you observed and what you expected**
+- **Include system details** (OS, Java version, etc.)
+
+### 💡 Suggesting Enhancements
+
+Enhancement suggestions are tracked as [GitHub issues](https://github.com/developtheweb/mpl/issues). When creating an enhancement suggestion:
+
+- **Use a clear and descriptive title**
+- **Provide a step-by-step description of the suggested enhancement**
+- **Provide specific examples to demonstrate the steps**
+- **Describe the current behavior and expected behavior**
+- **Explain why this enhancement would be useful** to MPL users
+- **Consider the Fatima Test**: Would a 10-year-old non-English speaker understand this?
+
+### 🔤 Adding New Symbols
+
+When proposing new mathematical symbols:
+
+1. **Justify the symbol choice** - Why this symbol for this operation?
+2. **Check Unicode support** - Ensure the symbol is widely supported
+3. **Provide ASCII escape** - Every symbol needs a fallback (e.g., `\lambda` for λ)
+4. **Test precedence** - How does it interact with existing operators?
+5. **Add examples** - Show real use cases
+
+### 🌍 Translations and Localization
+
+Help make MPL accessible in more languages:
+
+- Translate documentation
+- Create localized error messages
+- Develop region-specific examples
+- Write tutorials in your native language
+
+### 📚 Improving Documentation
+
+- Fix typos and improve clarity
+- Add more examples
+- Create visual guides
+- Write tutorials for specific audiences
+- Improve API documentation
+
+## Development Process
+
+### Setting Up Your Development Environment
+
+1. **Fork the repository** on GitHub
+2. **Clone your fork**:
+ ```bash
+ git clone https://github.com/your-username/mpl.git
+ cd mpl
+ ```
+3. **Set up the upstream remote**:
+ ```bash
+ git remote add upstream https://github.com/developtheweb/mpl.git
+ ```
+4. **Install dependencies**:
+ ```bash
+ # Requires Java 11+
+ ./gradlew build
+ ```
+
+### Making Changes
+
+1. **Create a new branch**:
+ ```bash
+ git checkout -b feature/your-feature-name
+ ```
+2. **Make your changes** following our style guidelines
+3. **Add tests** for any new functionality
+4. **Run the test suite**:
+ ```bash
+ ./gradlew test
+ ```
+5. **Update documentation** as needed
+
+### Testing Your Changes
+
+All changes must:
+- Pass existing tests
+- Include new tests for new features
+- Maintain or improve code coverage
+- Work with all input methods (visual, voice, keyboard)
+
+## Style Guidelines
+
+### Code Style
+
+- **Java Code**: Follow standard Java conventions
+- **MPL Examples**: Use clear, educational examples
+- **Comments**: Write in plain language, avoid jargon
+
+### Grammar Development
+
+When modifying `MPL.g4`:
+- Maintain zero shift/reduce conflicts
+- Document any precedence changes
+- Test with complex expressions
+- Update `precedence.csv` if needed
+
+### Symbol Guidelines
+
+- Prefer universally recognized mathematical symbols
+- Ensure symbols have semantic meaning
+- Avoid symbols that conflict with common mathematical usage
+- Always provide ASCII escapes
+
+## Commit Message Guidelines
+
+We follow strict commit message standards (see CLAUDE.md for full details):
+
+### The 7 Golden Rules
+
+1. **Separate subject from body** with a blank line
+2. **Limit subject to 50 characters**
+3. **Capitalize the subject line**
+4. **Use imperative mood** ("Add feature" not "Added feature")
+5. **Wrap body at 72 characters**
+6. **Explain what and why**, not how
+7. **Reference issues** (e.g., "Closes #123")
+
+### Example
+
+```
+feat: Add matrix multiplication operator
+
+Implement the ⊗ operator for matrix multiplication following
+standard mathematical notation. This enables natural expression
+of linear algebra operations in MPL.
+
+- Add parser rules for ⊗ with correct precedence
+- Implement type checking for matrix dimensions
+- Add comprehensive test cases
+- Update symbol reference documentation
+
+Closes #123
+```
+
+## Pull Request Process
+
+1. **Update documentation** - README.md, examples, and relevant docs
+2. **Add tests** - Ensure your changes are covered
+3. **Update CHANGELOG.md** - Note your changes in the Unreleased section
+4. **Pass all checks** - Tests, linting, and build must succeed
+5. **Get review** - The maintainer must approve
+6. **Squash commits** - Keep history clean
+
+### PR Title Format
+
+Use the same format as commit messages:
+- `feat: Add support for complex numbers`
+- `fix: Correct precedence of ∑ operator`
+- `docs: Add tutorial for educators`
+
+### The Review Process
+
+Reviews will check:
+- **Correctness**: Does it work as intended?
+- **Tests**: Are changes adequately tested?
+- **Documentation**: Is it well documented?
+- **Cognitive Load**: Does it pass the Fatima Test?
+- **Compatibility**: Does it maintain backwards compatibility?
+
+## Community
+
+### Getting Help
+
+- **GitHub Issues**: [github.com/developtheweb/mpl/issues](https://github.com/developtheweb/mpl/issues)
+- **Email**: developtheweb@protonmail.com
+
+### Recognition
+
+Contributors are recognized in:
+- The AUTHORS file
+- Release notes
+- Commit history
+
+### License
+
+By contributing to MPL, you agree that your contributions will be licensed under the GNU Affero General Public License v3.0 (AGPLv3).
+
+---
+
+## Summary
+
+Remember: Every contribution to MPL helps break down barriers to programming education worldwide. Whether you're fixing a typo, adding a feature, or translating documentation, you're part of a movement for cognitive justice in technology.
+
+**Thank you for helping us make programming truly universal! 🌍✨**
\ No newline at end of file
diff --git a/DECISIONS.md b/DECISIONS.md
new file mode 100644
index 0000000..e032c5a
--- /dev/null
+++ b/DECISIONS.md
@@ -0,0 +1,40 @@
+# Design decisions
+
+One line per decision, with the rejected alternatives named. Governing
+principles, in order: One Right Answer, the Fatima test, minimal churn
+against the existing examples.
+
+- **Conditionals are guarded alternatives** `(condition ⟹ result) | fallback`, wired in as a `condExpr` precedence level; rejected: C-style ternary `cond ? a : b` (programmer convention, fails the Fatima test), standalone left-recursive `conditional` rule (ANTLR error 119).
+- **Exception handling is a postfix operator** `expr ↴ { … }`; rejected: standalone `exceptionHandler` rule reachable from `atomExpr` (mutual left recursion, ANTLR error 119).
+- **λ has one token, `LAMBDA_VAR`**, used both as a variable and to open a lambda; rejected: separate `LAMBDA` token (identical alternatives, fully shadowed, ANTLR warning 184).
+- **`\implies` maps to ⟹ and `\Rightarrow` maps to ⇒** — one escape, one glyph; rejected: `\Rightarrow` as an alias of ⟹ (shadowed EXPORT's escape, ANTLR warning 184).
+- **The Java package for generated code comes from `-package` in build.gradle only**; rejected: `@header` package declaration in the grammar (combined with `-package` it generates a duplicate `package` statement that does not compile).
+- **ANTLR warnings fail the build** (`-Werror` in build.gradle); rejected: warnings as advisory output (they hid the shadowed-token bugs).
+- **The choice-type rule is `⟨ expr ⟩`** with the interior `|` consumed by `condExpr`; rejected: explicit `⟨ expr | expr ⟩` (the interior expr already consumes the bar, making the explicit BAR unreachable).
+- **Function calls are `f(a, b)` — a postfix argument list, nullary `f()` included**; rejected: Haskell juxtaposition `f x` (programmer convention, fails the Fatima test — children learn `f(x)` in school).
+- **SEMICOLON has one role: sequence separator (trailing `;` permitted)**; the program, blocks, `(...)`, `⌈...⌉`, `〔...〕`, `⌜...⌝`, `⌞...⌟` and `⟳(...)` all contain one `seqExpr`; rejected: a separate statement-terminator rule duplicating the same token (two roles for one symbol).
+- **Braces disambiguate structurally**: `IDENTIFIER :` → record, two-plus comma-separated exprs → set, everything else (incl. `{}` and `{x}`) → block; a singleton set literal cannot be written (deferred to M1); rejected: parser-order coin flips left undocumented.
+- **`≜` defines, `←` assigns; both wired into the chain** with `≜` binding looser than `←`, both right-associative; rejected: `≜` tokenized but unreachable.
+- **`⊕`/`⊖` are postfix resource operators** (`database ⊕`, `conn ⊖`), matching every example; rejected: prefix form `⊕open(path)` that appeared only in the whitepaper.
+- **Channel operations are subscripted prefix operators** `⇀_ch expr` / `↽_ch expr`; rejected: leaving SEND/RECEIVE orphaned.
+- **`‧` is qualified module access** (`Mathematics‧sin(angle)`), a postfix `‧IDENTIFIER`; rejected: leaving MIDDOT orphaned, or `.` (removed — one access syntax).
+- **Handler clauses are `↯pattern ⟹ expr`, semicolon-separated**, where pattern is an identifier (binds the exception) or a string (matches a message); rejected: `↯e ⇒ expr` (⇒ is EXPORT; the clause arrow should mirror the guarded-alternative arrow ⟹).
+- **IDENTIFIER may not start with `_`**, so subscripts (`⌉_db_lock`, `↽_socket`) lex as UNDERSCORE + IDENTIFIER; rejected: identifiers with a leading underscore (made every subscript lex as one identifier token).
+- **`/` is an ASCII alias of ÷ (DIV)** so `π/4` parses; rejected: ÷-only division (unreachable on most keyboards).
+- **Unary minus exists** (`-x`), sharing the MINUS token at prefix level; rejected: binary-only minus (cannot write negative numbers); unary plus was NOT added (`x ++ y` stays invalid).
+- **`pathLiteral` accepts `🖫"…"` and `🖫identifier`**, as required by `readFile(🖫path)` in example 03.
+- **Deleted tokens: `?` (QUERY), `∃` (EXISTS), `⇐` (IMPORT), `→` (ARROW), `.` (DOT)** — defined but used by no parser rule and no example; dead operators are debt; each returns in M1 only with a documented semantic. Rejected: keeping them tokenized-but-unreachable.
+- **Exactly one ASCII escape per glyph** (`\lambda` not `\lam`, `\leftarrow` not `\gets`, `\neq` not `\ne`, `\nat` not `\N`, …); rejected: alias sets (two ways to write the same token).
+- **`%` (modulo), `∑`, `√`, `²`, `|x|`, ranges `[a..b]`, indexing/slicing, `where`, and record field access are NOT in M0** — every document says so instead of using them; deferred to M1 with semantics, not smuggled in via prose.
+- **Lambda parameters are a bare comma-separated pattern list** (`λa, b: body`); rejected: parenthesized parameter lists `λ(a, b):` (two ways to write parameters).
+- **`‧` gets the escape `\middot`** so the "every glyph has an ASCII escape" claim stays true; rejected: leaving MIDDOT as the one escape-less glyph.
+- **`glyph-escapes.md` and `precedence.csv` are the only symbol/precedence tables**; the whitepaper appendix points at them instead of duplicating them; rejected: parallel tables that drift (the old appendix disagreed with the lexer on several code points and escapes).
+- **Documentation code blocks are fenced ```mpl only if they parse today**; M1+ sketches are fenced as plain text with an explicit "not yet parseable" caption, and a CI test enforces the rule for README, spec, and whitepaper.
+- **Interpreter repatriation: `js/mpl.js` lives in this repo** as the single source of truth; mpl.codes consumes it by pinned commit SHA + sha256 checksum; rejected: making the site repo public as-is (splits truth across two repos), git submodule (invisible drift, clone friction).
+- **Byte identity: repo file == image file == served file**, enforced by checksum at image build time and a post-deploy check; rejected: minified serving (a second artifact that can drift).
+- **Interpreter tests run on `node:test` + `node:assert` with zero npm dependencies**; rejected: third-party test frameworks (a supply chain the site's own footer brags about not having).
+- **Stage-1 exception: the imported interpreter's header comment was corrected in place** (`tested: 18/18` → the provable `10 tests in js/test/`) — a falsified claim inside the canonical artifact outranks byte identity with the pre-Stage-1 deploy; end-state identity is restored when the site deploys the pinned file.
+- **Stage-3 ratification (2026-07-09): the 26 judgment calls are ruled; JUDGMENT_CALLS.md is the semantic record of MPL M0.** Per-ruling record: (1) ÷0 is `err_div0`; (2) a `∀` expression is always `⊥`; (3) an unmatched guard yields `⊥` unless caught by `|`; (4) numbers are exact rationals — BigInt num/den, lowest terms, den > 0, decimal literals exact, display `n` or `n/d` (re-evaluates to itself); IEEE doubles rejected; (5) `✎` rendering spec'd per type; (6) `⊥` is first-class, arithmetic on it `err_num`; (7) equality is structural on data, cross-type `=` false, `0.5 = 1/2` true, any function in `=`/`≠` raises `err_fn_eq`; (8) ordering is number×number and string×string (code-point) only, else `err_compare`; (9) closures capture the environment; (10) λ-application depth counter, limit 10000, `err_depth` — no keyless host error may remain reachable; (11) the 500000-step budget is an environment resource limit, not semantics — corpus entry 053 moved to js/test; (12) string escapes are exactly `\n \t \" \\`, anything else `err_escape` (grammar ESC amended to match); (13) guard conditions must be boolean, else `err_bool`; (14) `∧ ∨` short-circuit and demand booleans on evaluated operands (`err_bool`); (15) braces group, binders scope; (16) `≜` binds once per scope (`err_redef`; inner shadowing legal), `←` mutates an existing binding only (`err_unbound`); (17) type constraints parse, unenforced; (18) nullary `λ: e` admitted (grammar amended); (19) `∗` ≡ `×`; (20) the empty program is valid; (21) `( seqExpr )` — the interpreter now implements it; (22) `∘` is composition, `(f ∘ g)(x…) = f(g(x…))`, non-function operand `err_notfn`; (23) set literals parse, evaluate to `err_notyet`; (24) record literals likewise; (25) `λ(a, b):` rejected everywhere; (26) `λ` is reserved — never an identifier — while other Greek letters remain identifiers.
+- **Standing M1 decisions logged at ratification**: `√` vs ℚ (irrationals); an explicit local-binding construct (let/where); set semantics; record semantics; comprehension notation; `‖` parallel semantics.
+- **Grammar-only surface gaps are on the record** (SURFACE.md "Grammar-only surface" section): `≈`/`∼` comparisons, `"""raw strings"""`, hex/binary/exponent literals, and `_` as a λ pattern all parse in the grammar and fail in the Stage-3 interpreter — Stage 4+ material, no ruling; `err_comment` is dead pending removal at the next legitimate interpreter change.
+- **Ruling 12's enumeration governs string escapes**: the grammar's ESC fragment was narrowed to exactly `\n \t \" \\` — `\r`, `\0` and `\u{hex}` were removed from the grammar; they were never in the ratified set.
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..e6bfab4
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,182 @@
+GNU AFFERO GENERAL PUBLIC LICENSE
+Version 3, 19 November 2007
+
+Copyright © 2007 Free Software Foundation, Inc.
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+Preamble
+The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.
+
+The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
+
+Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.
+
+A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.
+
+The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.
+
+An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+TERMS AND CONDITIONS
+0. Definitions.
+"This License" refers to version 3 of the GNU Affero General Public License.
+
+"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
+
+"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
+
+To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
+
+A "covered work" means either the unmodified Program or a work based on the Program.
+
+To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
+
+To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
+
+An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
+
+1. Source Code.
+The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
+
+A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
+
+The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
+
+The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
+
+The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
+
+The Corresponding Source for a work in source code form is that same work.
+
+2. Basic Permissions.
+All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
+
+You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
+
+Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
+
+3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
+
+When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
+
+4. Conveying Verbatim Copies.
+You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
+
+You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
+
+5. Conveying Modified Source Versions.
+You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
+
+a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
+b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
+c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
+d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
+A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
+
+6. Conveying Non-Source Forms.
+You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
+
+a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
+b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
+c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
+d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
+e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
+A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
+
+A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
+
+"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
+
+If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
+
+The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
+
+Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
+
+7. Additional Terms.
+"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
+
+When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
+
+Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
+
+a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
+b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
+c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
+d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
+e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
+f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
+All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
+
+If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
+
+Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
+
+8. Termination.
+You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
+
+However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
+
+Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
+
+9. Acceptance Not Required for Having Copies.
+You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
+
+10. Automatic Licensing of Downstream Recipients.
+Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
+
+An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
+
+You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
+
+11. Patents.
+A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
+
+A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
+
+Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
+
+In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
+
+If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
+
+If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
+
+A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
+
+Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
+
+12. No Surrender of Others' Freedom.
+If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
+
+13. Remote Network Interaction; Use with the GNU General Public License.
+Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.
+
+Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.
+
+14. Revised Versions of this License.
+The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.
+
+If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
+
+Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
+
+15. Disclaimer of Warranty.
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. Limitation of Liability.
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+17. Interpretation of Sections 15 and 16.
+If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
+
+END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/README.md b/README.md
index fd755af..5a22257 100644
--- a/README.md
+++ b/README.md
@@ -1,42 +1,661 @@
-# Mathematical Programming Language (MPL)
+# Mathematical Programming Language (MPL) 🌍
+**Breaking the last language barrier in technology**
-
-
+
-A programming language that maintains cognitive universality while supporting all modern programming paradigms through mathematical notation.
+
+
+
+
-## Quick Start
+**∀ child ∈ world : canCode(child)**
+
+[🎓 For Educators](#for-educators) | [💻 For Developers](#for-developers) | [🌍 For Humanity](#for-humanity)
+
+
+
+---
+
+## 🚨 Project Status: Proof of Concept
+
+**The M0 core runs — with ratified semantics.** This repository contains the grammar, the parser, and the browser interpreter (`js/mpl.js`) that runs the M0 core today at [mpl.codes](https://mpl.codes). Its semantics are not folklore: every judgment call is recorded and ruled in [conformance/JUDGMENT_CALLS.md](conformance/JUDGMENT_CALLS.md), pinned by **89 ratified conformance tests** that gate CI, and a differential fuzzer holds the interpreter and the grammar to zero divergence. A native runtime beyond the browser core does not exist yet — building it is the next milestone, and contributors are welcome.
+
+### What Works Today ✅
+
+Every item below is enforced by [CI](.github/workflows/ci.yml) on every push:
+
+- An ANTLR 4 grammar built from mathematical symbols that compiles with zero errors and zero warnings (warnings are treated as errors)
+- All 10 [example programs](examples/) parse (`./gradlew parseExamples`)
+- A test suite covering the lexer, the parser, the examples, and every ```` ```mpl ```` code block in this README (`./gradlew test`)
+- An ASCII escape sequence for every Unicode symbol ([glyph-escapes.md](glyph-escapes.md))
+- The M0 core executes with ratified semantics: 89 ratified conformance tests (`node conformance/harness/run.mjs --ratified`), exact rational arithmetic, and a recorded ruling for every semantic question ([conformance/JUDGMENT_CALLS.md](conformance/JUDGMENT_CALLS.md))
+
+### What Doesn't Work Yet 🚧
+- **No native runtime** - The M0 core runs in the browser interpreter (`js/mpl.js`); everything beyond it parses but does not run yet
+- **No type checking** - Types are recognized but not validated
+- **No standard library** - No built-in functions
+- **No tooling** - Basic parser only
+
+## Vision: Programming Without Language Barriers
+
+In a world where 80% of humanity doesn't speak English, why should programming—the literacy of the 21st century—require it? MPL demonstrates that we can build programming languages using mathematical symbols that children already understand, making computational thinking accessible to billions previously excluded by language barriers.
+
+**This is cognitive justice in action.**
+
+---
+
+## 🎯 The Fatima test
+
+
+> "Why do I need to know English to write a program?" — Fatima, 10 years old, Cairo
+
+Every design decision in MPL must pass one simple test: **Can a 10-year-old non-English speaker understand this?**
+
+### Traditional programming
+```python
+# English required:
+for n in [1, 2, 3, 4, 5]:
+ print(n * n)
+```
+
+### MPL - Universal understanding
+```mpl
+-- Mathematical symbols only:
+∀ n ∈ [1, 2, 3, 4, 5] : ✎(n × n)
+```
+
+If Fatima can't understand it with her basic math knowledge, we redesign it. No exceptions.
+
+---
+
+## 🚀 Quick start journey
+
+
+
+### Choose your path
+
+| 🎓 **Educator?** | 💻 **Developer?** | 🌍 **Changemaker?** |
+|:---:|:---:|:---:|
+| [See the Vision](#educational-vision) | [Technical Details](#technical-architecture) | [Why This Matters](#why-this-matters) |
+| Imagine teaching without English | Help build the runtime | Support cognitive justice |
+
+
+
+### Hello, world in 30 seconds
+
+
+
+| Traditional (English Required) |
+MPL (Universal) |
+
+
+|
+
+```python
+print("Hello, World!")
+```
+
+ |
+
```mpl
✎"Hello, World!"
```
-## Repository Structure
+ |
+
+
+| English words: print |
+Universal symbol: ✎ (output/trace) |
+
+
-- `math_prog_lang.md` - Complete language specification
-- `ISSUE_M0_BLOCKERS.md` - Critical decisions needed before M0 implementation
-- `glyph-escapes.md` - ASCII escape sequences for all Unicode glyphs
-- `precedence.csv` - Operator precedence table
-- `examples/` - Example programs from the specification
+**Note**: This syntax is valid and parses. The M0 core runs in the browser interpreter at [mpl.codes](https://mpl.codes); features beyond the M0 core parse but do not run yet.
-## M0 Milestones
+---
-1. ✅ Language specification consolidated
-2. ✅ Pre-M0 audit completed
-3. ✅ Lexical blockers resolved (see [ISSUE_M0_BLOCKERS.md](ISSUE_M0_BLOCKERS.md))
-4. ⏳ Implement ANTLR 4 grammar
-5. ⏳ Create test suite (500 LOC)
-6. ⏳ Achieve M0 exit criteria
+## 🔮 How it works
-## M0 Exit Criteria
+### For everyone
+Write code using mathematical symbols instead of English words. It's that simple.
-- [ ] Lexer round-trips every glyph via escape and direct entry
-- [ ] Parser accepts all files in `examples/`
-- [ ] `grmtools` (or ANTLR diagnostics) reports **0** ambiguities
-- [ ] Fuzz seed (10k random tokens) yields no segfault
-- [ ] Pretty-printer emits code that re-parses into identical AST
+```
+┌─────────────────────────────────────────────┐
+│ Mathematical Notation │
+│ λn: (n ≤ 1 ⟹ 1) | (n × fact(n-1)) │
+└────────────────┬───────────────────────────┘
+ │
+ ▼
+┌─────────────────────────────────────────────┐
+│ Unicode Input │
+│ (Visual palette, voice, keyboard) │
+└────────────────┬───────────────────────────┘
+ │
+ ▼
+┌─────────────────────────────────────────────┐
+│ ANTLR 4 Parser │
+│ Lexer → Parser → AST │
+└─────────────────────────────────────────────┘
+```
-## Contact
+### Five ways to write λ (lambda)
-- GitHub: @developtheweb
-- Email: developtheweb@protonmail.com
\ No newline at end of file
+Today the parser accepts two spellings of every symbol: the Unicode glyph (λ) and its ASCII escape (`\lambda`). The rest are the input methods we envision tooling for:
+
+1. **⌨️ Type** — `\lambda` (works today, in any editor)
+2. **👆 Click** — Visual symbol palette (envisioned)
+3. **🎤 Speak** — "Lambda" in ANY language (envisioned)
+4. **✍️ Draw** — Handwriting recognition on tablets (envisioned)
+5. **⚡ Shortcut** — Platform shortcuts (envisioned)
+
+
+🔧 Technical details (click to expand)
+
+### Unicode implementation
+- Full Unicode support, including supplementary-plane symbols (𝓜, 𝔹, 🖫)
+- Every glyph has exactly one ASCII escape ([glyph-escapes.md](glyph-escapes.md))
+
+### Parser architecture
+```
+Input Methods → Unicode Stream → ANTLR 4 Lexer → Parse Tree
+```
+Type checking, optimization and code generation are planned, not built.
+
+### Grammar specification
+- Compiles with zero ANTLR errors and warnings (enforced in CI)
+- Operator precedence documented in [precedence.csv](precedence.csv)
+- [View full ANTLR grammar](src/main/antlr4/MPL.g4)
+
+
+
+---
+
+## ✨ Core features
+
+### 🌐 Cognitive universality
+**Mathematical symbols as humanity's common language**
+
+- **No translation needed** — Math is already universal
+- **Cultural neutrality** — No linguistic imperialism
+- **Instant comprehension** — Symbols map to concepts directly
+
+### 🎨 Multi-modal input (envisioned)
+**Meet learners where they are**
+
+Only ASCII escapes exist today; the rest is the tooling we want to build:
+
+```
+┌─────────────┬─────────────┬─────────────┬─────────────┐
+│ Visual │ Voice │ Keyboard │ Handwriting │
+│ Palette │ Input │ Escapes │ Recognition │
+├─────────────┼─────────────┼─────────────┼─────────────┤
+│ Click λ │ Say "lambda"│ Type \lambda│ Draw λ │
+│ from menu │ in any lang │ (works now) │ on screen │
+└─────────────┴─────────────┴─────────────┴─────────────┘
+```
+
+- **ASCII escapes** — `\lambda`, `\forall`, … work in any editor today
+- **Visual palette** — Click symbols like emoji (envisioned)
+- **Voice input** — Speak in your native language (envisioned)
+- **Handwriting** — Natural for mathematical notation (envisioned)
+
+### 📈 Progressive complexity
+**From arithmetic to algorithms**
+
+```mpl
+-- Level 1: Basic math (everyone knows this!)
+x ≜ 5 + 3;
+y ≜ x × 2;
+
+-- Level 2: Logic (learned in school)
+x > 10 ∧ y < 20 ⟹ ✎"Success!";
+
+-- Level 3: Advanced (natural progression)
+squares ≜ 0;
+∀ n ∈ [1, 2, 3, 4, 5] : squares ← squares + n × n;
+```
+
+---
+
+## 📊 Educational Vision
+
+### The Problem We're Solving
+
+Consider a hypothetical student, "Maria" from São Paulo:
+- She loves math and logic puzzles
+- She wants to learn programming
+- But she must first memorize English keywords like `for`, `while`, `if`, `else`
+- The Portuguese word "for" means "went" - adding confusion
+- She spends more time translating than learning computational thinking
+
+### What MPL Could Enable (Vision, Not Reality)
+
+With MPL fully implemented, we envision students could:
+- Write their first program in minutes using familiar mathematical symbols
+- Focus on logic and problem-solving, not foreign vocabulary
+- Learn alongside parents who also don't speak English
+- Build confidence through immediate understanding
+
+### Hypothetical Benefits We Aim For
+
+If MPL were fully implemented and deployed in classrooms, we hypothesize it could achieve:
+
+| Potential Metric | Traditional Approach | MPL Vision |
+|-----------------|---------------------|------------|
+| Time to understand loops | Days of memorizing `for` | Minutes with ∀ symbol |
+| Cognitive load | High (translate + learn) | Lower (direct understanding) |
+| Parent involvement | Limited by English | Possible with math symbols |
+
+**Note: These are aspirational goals based on our hypothesis, not measured results.**
+
+### Envisioned Success Stories
+
+These are hypothetical scenarios we hope MPL could enable once fully implemented:
+
+
+🌍 Imagine: A student's potential journey
+
+We envision students could progress like this:
+
+**Starting point**: Basic math knowledge, no English
+```mpl
+-- Month 1: First program using familiar symbols
+✎"Jambo!" -- Hello in their language
+```
+
+**Growing skills**: Applying math knowledge to programming
+```mpl
+-- Month 6: Using mathematical concepts they know
+data ≜ [23, 45, 67, 34, 89, 12];
+total ≜ 0;
+∀ x ∈ data : total ← total + x;
+average ≜ total ÷ 6;
+✎("Average: " + average)
+```
+
+**Sharing knowledge**: Teaching others in their community
+
+*This is our vision - not current reality. Help us make it possible!*
+
+
+
+---
+
+## 💻 Code examples (Syntax Demonstration)
+
+**Note**: These examples show valid MPL syntax that our parser accepts (a test extracts every code block on this page and parses it). The M0-core subset runs in the browser interpreter at [mpl.codes](https://mpl.codes); the rest parses but does not run yet.
+
+Some notation you might expect from math class — ∑, √, ², `%` (modulo), |x|, ranges like [1..10] — is deliberately absent: it is deferred to milestone M1, where each symbol will arrive together with defined semantics (see [DECISIONS.md](DECISIONS.md)).
+
+### Level 1: Arithmetic thinking 🔢
+*What every child knows*
+
+```mpl
+-- Store values (like math class!)
+length ≜ 5;
+width ≜ 3;
+area ≜ length × width;
+✎("Area = " + area);
+
+-- Make decisions: (condition ⟹ result) | fallback
+age ≜ 15;
+(age ≥ 18 ⟹ ✎"Adult") | ✎"Minor";
+```
+
+### Level 2: Logical reasoning 🧩
+*Natural progression from math*
+
+```mpl
+-- Do something for every element (∀ = "for all")
+∀ n ∈ [1, 2, 3, 4, 5] : ✎(n × n);
+
+-- Accumulate a running total
+total ≜ 0;
+∀ n ∈ [1, 2, 3, 4, 5] : total ← total + n;
+✎("Total: " + total);
+```
+
+### Level 3: Real-world applications 🌍
+*Solving community problems*
+
+```mpl
+-- Weather data analysis
+temperatures ≜ [28, 30, 27, 31, 29, 33, 28];
+total ≜ 0;
+∀ t ∈ temperatures : total ← total + t;
+μ ≜ total ÷ 7;
+✎("Average: " + μ + "°C");
+
+-- Parallel processing (‖ = parallel)
+results ≜ analyzeNorth() ‖ analyzeSouth() ‖ analyzeEast();
+```
+
+### Level 4: Advanced concepts 🚀
+*For those ready to go deeper*
+
+```mpl
+-- Function composition (∘, straight from math class)
+double ≜ λn: n × 2;
+addOne ≜ λn: n + 1;
+transform ≜ double ∘ addOne;
+✎(transform(5));
+
+-- Higher-order functions
+apply ≜ λf, x: f(x);
+✎(apply(λn: n × n, 6));
+```
+
+---
+
+## Why Release a Parser Without Execution?
+
+We believe the core innovation of MPL is proving that mathematical notation can replace English keywords. By releasing the parser, we demonstrate this is grammatically possible and invite the community to help build the rest.
+
+The parser alone proves several key points:
+- Mathematical symbols can express the core programming constructs (see the ten [examples](examples/))
+- A language without English keywords is technically feasible
+- The grammar compiles with zero ANTLR errors and warnings, enforced in CI
+- ASCII fallbacks make it universally typeable
+
+Sometimes the idea is more important than the implementation. By sharing MPL now, we hope to inspire others to think differently about programming languages and who they exclude.
+
+---
+
+## 🏗️ Technical architecture
+
+### Grammar specification
+
+- Every symbol has exactly one meaning and one ASCII escape ([glyph-escapes.md](glyph-escapes.md))
+- Operator precedence is documented in [precedence.csv](precedence.csv) and exercised by the test suite
+- The grammar compiles with zero ANTLR errors and warnings (`-Werror`, enforced in CI)
+- 200+ syntax assertions across the lexer, parser, example, and documentation test suites
+- [Full grammar specification](src/main/antlr4/MPL.g4)
+
+### Implementation stack
+
+```
+┌─────────────────────────────────────────────┐
+│ Input Layer (Multi-modal) │
+│ Visual │ Voice │ Keyboard │ Handwriting │
+└────┬────┴───┬───┴────┬────┴───────┬────────┘
+ │ │ │ │
+┌────▼────────▼────────▼────────────▼────────┐
+│ Unicode Normalization │
+│ (UTF-8 with BiDi support) │
+└────────────────────┬───────────────────────┘
+ │
+┌────────────────────▼───────────────────────┐
+│ ANTLR 4 Parser │
+│ Lexer → Parser → AST Generation │
+└────────────────────┬───────────────────────┘
+ │
+┌────────────────────▼───────────────────────┐
+│ Semantic Analysis (planned) │
+│ Type Checking → Effect Analysis │
+└────────────────────┬───────────────────────┘
+ │
+┌────────────────────▼───────────────────────┐
+│ Code Generation (planned) │
+│ LLVM │ JVM │ JavaScript │ Python │
+└────────────────────────────────────────────┘
+```
+
+Only the parser stage exists today; the lower stages are the planned architecture. We publish no performance numbers until CI measures them.
+
+---
+
+## 🗺️ Pilot program roadmap
+
+### Phase 1: Foundation 🏗️ (Months 1-3) ✅
+- [x] Core parser implementation
+- [x] Basic syntax examples
+- [x] Grammar validation complete
+- [ ] Educational materials in development
+
+### Phase 2: Interpreter 📊 (Current Focus) **← We are here**
+- [ ] Basic expression evaluation
+- [ ] Control flow implementation
+- [ ] Function calls
+- [ ] Standard library basics
+
+### Phase 3: Educational Materials 🚀 (Future)
+- [ ] First pilot classroom test
+- [ ] Basic curriculum development
+- [ ] Teacher guide creation
+- [ ] Community feedback integration
+
+### Phase 4: Expansion 🌍 (Long-term Vision)
+- [ ] Multi-school pilots
+- [ ] Research partnerships
+- [ ] Policy advocacy
+- [ ] Global community building
+
+---
+
+## 🤝 Community & contribution
+
+### For educators 🎓
+
+
+
+| Resource | Description | Get Started |
+|----------|-------------|-------------|
+| **Classroom Kit** | Future: Lesson plans and exercises | Coming soon |
+| **Teacher Training** | Future: Online certification | Planned |
+| **Community Forum** | Future: Educator community | In development |
+| **Student Showcase** | Future: Project gallery | Under consideration |
+
+
+
+### For developers 💻
+
+```bash
+# Clone and build
+git clone https://github.com/developtheweb/mpl.git
+cd mpl
+./gradlew build
+
+# Run tests
+./gradlew test
+
+# Parse examples (validation only, no execution)
+./gradlew parseExamples
+```
+
+**Key contribution areas:**
+- 🔤 Symbol input methods
+- 🌍 Localization systems
+- 📚 Educational content
+- 🔧 Language features
+- 📱 Mobile applications
+
+[Contributing guidelines](CONTRIBUTING.md) | [Architecture docs](docs/ARCHITECTURE.md) | [GitHub issues](https://github.com/developtheweb/mpl/issues)
+
+### For researchers 🔬
+
+- **Cognitive load studies** — Measuring comprehension rates
+- **Learning outcome analysis** — Long-term retention data
+- **Cultural adaptation** — Symbol interpretation across cultures
+- **Neurodiversity research** — Benefits for different learning styles
+
+[Research collaboration](mailto:developtheweb@protonmail.com)
+
+### For advocates 📢
+
+**Help us reach more children:**
+- 📄 Policy templates for education ministries - Coming soon
+- 🎤 Speaker materials for conferences - In development
+- 📊 Research findings - See [whitepaper](whitepaper/mpl-whitepaper.md)
+- 🎨 Media kit - Coming soon
+
+---
+
+---
+
+## 🌟 Why This Matters
+
+### The Vision
+
+Imagine a world where:
+- A teacher in Beijing could explain loops using ∀ instead of `for`
+- A parent in Mumbai could understand their child's code without knowing English
+- Education ministers could provide programming education without requiring English literacy
+
+These aren't testimonials - they're possibilities we're working toward. MPL is still just a parser, but it proves that programming without English is possible.
+
+---
+
+## 🎯 Join the movement
+
+
+
+### **Every child deserves to code in the language of their thoughts**
+
+| 🎓 **Educators** | 💻 **Developers** | 🏛️ **Institutions** | 💰 **Supporters** |
+|:---:|:---:|:---:|:---:|
+| Share the vision | [Contribute code](https://github.com/developtheweb/mpl) | Contact us to explore | Star the project |
+| Imagine the possibilities | Build the runtime | Research partnerships | Spread the word |
+
+
+
+---
+
+## 📚 Resources
+
+
+
+| 📖 [Documentation](docs/) | 🔬 [Whitepaper](whitepaper/mpl-whitepaper.md) | 📧 [Contact](mailto:developtheweb@protonmail.com) |
+|:---:|:---:|:---:|
+| View specs | Read the vision | Get in touch |
+
+
+
+---
+
+## 🚀 The inspiration
+
+The idea for MPL came from a simple observation: children worldwide learn the same mathematical symbols (+, -, ×, ÷, =) but must learn English to program. This creates an unnecessary barrier.
+
+Imagine a student asking: *"Why do I need to know English to tell a computer what to do? I know math. Isn't that enough?"*
+
+This hypothetical question captures the essence of MPL. Mathematical thinking IS enough. We're building this proof of concept to demonstrate it's possible.
+
+---
+
+## 🔬 Cognitive science foundation
+
+
+Why mathematical symbols work universally (click to expand)
+
+### Symbolic universality
+
+Mathematical notation evolved over millennia to be:
+- **Culture-agnostic** — Symbols transcend linguistic boundaries
+- **Cognitively efficient** — Direct concept-to-symbol mapping
+- **Progressively learnable** — Builds on existing knowledge
+
+### Neurological evidence
+
+fMRI studies show mathematical symbol processing activates language-independent brain regions, enabling comprehension without linguistic translation.
+
+### Pedagogical advantages
+
+1. **Reduced cognitive load** — Single-step comprehension
+2. **Transfer learning** — Math knowledge directly applies
+3. **Cultural preservation** — Think in your native language
+4. **Universal collaboration** — Code readable globally
+
+[Read our whitepaper](whitepaper/mpl-whitepaper.md)
+
+
+
+---
+
+## 🌏 Global partnership vision
+
+### Partnership Opportunities
+
+We envision collaborating with organizations like:
+
+
+
+| Type of Partner | Potential Role | Envisioned Impact |
+|-----------------|----------------|-------------------|
+| **UN Agencies** | Education frameworks | Global policy influence |
+| **Universities** | Research partnerships | Cognitive studies |
+| **Tech Companies** | Technical support | Infrastructure development |
+| **Local NGOs** | Community implementation | Grassroots adoption |
+
+*Note: We are actively seeking our first institutional partners. Contact us if interested.*
+
+
+
+### Join as a partner
+
+We're seeking partnerships with:
+- 🏫 **Schools & Universities** — Pilot programs
+- 🏢 **Tech Companies** — Internships for MPL students
+- 🏛️ **Governments** — National curriculum integration
+- 🎓 **Research Institutions** — Impact studies
+- 💡 **NGOs** — Community implementation
+
+[Contact us](mailto:developtheweb@protonmail.com) to explore partnerships
+
+---
+
+## 🔮 Future roadmap
+
+### Beyond programming
+
+MPL is just the beginning. Our vision extends to:
+
+1. **Mathematical Interfaces** — Operating systems using symbols
+2. **Universal IDE** — Development environments without language barriers
+3. **Symbolic Databases** — Query languages using set notation
+4. **AI Training** — Teaching AI in mathematical notation
+5. **Global Standard** — ISO standardization for universal programming
+
+### The 2030 vision
+
+By 2030, we envision a world where:
+- ✅ **Any child** can learn programming in their native cognitive framework
+- ✅ **No talent** is lost to language barriers
+- ✅ **Global collaboration** happens without linguistic friction
+- ✅ **Cognitive diversity** strengthens our collective problem-solving
+- ✅ **Technology** truly serves all humanity
+
+---
+
+
+
+## 🌟 A world where code speaks the language of human thought
+
+### Not English. Not Chinese. Not Spanish.
+### The language of logic itself.
+
+**Together, we're not just teaching programming.**
+**We're democratizing the power to create.**
+
+---
+
+*This is what we're building toward - a world where every child's way of thinking matters in programming.*
+
+---
+
+### [⭐ Star this repository](https://github.com/developtheweb/mpl) to support cognitive justice in programming
+
+### **The next Fatima is waiting. Let's make sure nothing is lost in translation.**
+
+
+
+---
+
+
+
+**Mathematical Programming Language** — Where every mind can code
+
+[GitHub](https://github.com/developtheweb/mpl) • [Documentation](docs/) • [Contact](mailto:developtheweb@protonmail.com)
+
+Made with ❤️ for the 80% of humanity waiting to code
+
+
\ No newline at end of file
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 0000000..175207f
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,96 @@
+# Security Policy
+
+## Supported Versions
+
+MPL is currently in active development. Security updates are provided for:
+
+| Version | Supported |
+| ------- | ------------------ |
+| 2.0.x | :white_check_mark: |
+| < 2.0 | :x: |
+
+## Reporting a Vulnerability
+
+The MPL team takes security vulnerabilities seriously. We appreciate your efforts to responsibly disclose your findings.
+
+### How to Report
+
+**DO NOT** create a public GitHub issue for security vulnerabilities.
+
+Instead, please report security vulnerabilities via email to:
+- **Primary**: developtheweb@protonmail.com
+- **Subject Line**: [SECURITY] MPL Vulnerability Report
+
+### What to Include
+
+Please provide:
+1. **Description** of the vulnerability
+2. **Steps to reproduce** the issue
+3. **Potential impact** of the vulnerability
+4. **Suggested fix** (if you have one)
+5. **Your contact information** (for follow-up questions)
+
+### Response Timeline
+
+- **Initial Response**: Within 48 hours
+- **Status Update**: Within 7 days
+- **Resolution Target**: Within 30 days for critical issues
+
+### What to Expect
+
+1. **Acknowledgment**: We'll confirm receipt of your report
+2. **Assessment**: We'll investigate and determine the severity
+3. **Updates**: We'll keep you informed of our progress
+4. **Credit**: With your permission, we'll acknowledge your contribution when the issue is resolved
+
+## Security Considerations for MPL
+
+Given MPL's unique nature as a mathematical programming language, please consider these security aspects:
+
+### 1. Unicode Handling
+- Homograph attacks using similar-looking Unicode characters
+- Bidirectional text manipulation
+- Unicode normalization issues
+
+### 2. Parser Security
+- Grammar ambiguities that could lead to unexpected behavior
+- Resource exhaustion through complex expressions
+- Injection attacks through mathematical notation
+
+### 3. Educational Environment
+- MPL is designed for educational use, including by children
+- Consider the impact on learning environments
+- Be mindful of accessibility features
+
+### 4. Multi-Modal Input
+- Voice input security considerations
+- Visual palette tampering
+- Handwriting recognition exploits
+
+## Responsible Disclosure
+
+We support responsible disclosure:
+1. Give us reasonable time to address the issue before public disclosure
+2. Avoid accessing or modifying other users' data
+3. Don't perform actions that could harm the service or its users
+4. Act in good faith to avoid privacy violations
+
+## Security Best Practices for Contributors
+
+When contributing to MPL:
+
+1. **Input Validation**: Always validate and sanitize user input
+2. **Error Handling**: Never expose internal system details in error messages
+3. **Dependencies**: Keep all dependencies up to date
+4. **Code Review**: All security-related changes require thorough review
+5. **Testing**: Include security test cases for new features
+
+## Contact
+
+- **Security Issues**: developtheweb@protonmail.com
+- **General Questions**: See [SUPPORT.md](SUPPORT.md)
+- **Project Maintainer**: Reverend Steven Milanese (@developtheweb)
+
+---
+
+Thank you for helping keep MPL and its community safe!
\ No newline at end of file
diff --git a/SUPPORT.md b/SUPPORT.md
new file mode 100644
index 0000000..e93cf98
--- /dev/null
+++ b/SUPPORT.md
@@ -0,0 +1,124 @@
+# Getting Help with MPL
+
+Thank you for using the Mathematical Programming Language! We're here to help you succeed.
+
+## 🚀 Quick Links
+
+- **Documentation**: [Full specification](math_prog_lang.md)
+- **Examples**: [Working programs](examples/)
+- **Symbol Reference**: [All symbols with ASCII escapes](glyph-escapes.md)
+- **Whitepaper**: [Academic paper](whitepaper/mpl-whitepaper.md)
+
+## ❓ Getting Support
+
+### 1. Check Existing Resources
+
+Before asking for help:
+- 📖 Read the [README](README.md) for overview and quick start
+- 🔤 Check [glyph-escapes.md](glyph-escapes.md) for symbol questions
+- 💡 Review [examples](examples/) for working code patterns
+- 🐛 Search [existing issues](https://github.com/developtheweb/mpl/issues) for similar problems
+
+### 2. Community Support
+
+#### GitHub Discussions
+For general questions, ideas, and community interaction:
+- Visit [GitHub Discussions](https://github.com/developtheweb/mpl/discussions)
+- Categories:
+ - **Q&A**: Ask and answer questions
+ - **Ideas**: Suggest new features or improvements
+ - **Show and Tell**: Share your MPL projects
+ - **General**: Everything else
+
+#### GitHub Issues
+For bugs and feature requests:
+- [Report a bug](https://github.com/developtheweb/mpl/issues/new?template=bug_report.md)
+- [Request a feature](https://github.com/developtheweb/mpl/issues/new?template=feature_request.md)
+
+### 3. Direct Contact
+
+For sensitive issues or private concerns:
+- **Email**: developtheweb@protonmail.com
+- **Maintainer**: Reverend Steven Milanese (@developtheweb)
+
+## 🎓 Learning Resources
+
+### For Beginners
+1. Start with [01_hello_world.mpl](examples/01_hello_world.mpl)
+2. Learn basic operators from the [Symbol Reference](glyph-escapes.md)
+3. Progress through numbered examples in order
+
+### For Educators
+- Review the educational philosophy in our [README](README.md)
+- Check the Fatima Test principle in [CONTRIBUTING.md](CONTRIBUTING.md)
+- Contact us about classroom materials
+
+### For Developers
+- [CONTRIBUTING.md](CONTRIBUTING.md) - How to contribute
+- [Grammar file](src/main/antlr4/MPL.g4) - ANTLR 4 specification
+- [Test suite](src/test/) - See how testing works
+
+## 🐛 Reporting Issues
+
+When reporting issues, please include:
+1. **MPL version** (check releases)
+2. **Operating system** and version
+3. **Java version** (`java -version`)
+4. **Minimal code example** that reproduces the issue
+5. **Expected behavior** vs actual behavior
+6. **Full error message** if applicable
+
+### Good Bug Report Example
+```
+Title: ∑ operator precedence incorrect with nested expressions
+
+Version: MPL 2.0.0
+OS: Ubuntu 22.04
+Java: OpenJDK 11.0.17
+
+Code:
+∑(i ∈ [1,5] : i × 2) + 3
+
+Expected: 33 (sum is 30, plus 3)
+Actual: 45 (seems to be computing ∑(i ∈ [1,5] : i × (2 + 3)))
+
+Error: No error, just wrong result
+```
+
+## 💬 Communication Guidelines
+
+1. **Be respectful** - We're all learning together
+2. **Be patient** - MPL is a volunteer project
+3. **Be clear** - Provide context and examples
+4. **Be mindful** - Not everyone speaks English fluently
+5. **Follow the Code of Conduct** - See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
+
+## 🌍 Language Support
+
+While project documentation is in English, we welcome questions in any language:
+- Use your native language if it helps explain your issue
+- We'll use translation tools if needed
+- Community members may help translate
+
+Remember: MPL exists to break language barriers - that includes our support!
+
+## 🔧 Common Issues
+
+### Unicode Display Problems
+- Ensure your terminal supports UTF-8
+- Try ASCII escapes (e.g., `\sum` instead of ∑)
+- Check font support for mathematical symbols
+
+### Parser Errors
+- Verify correct symbol usage with [glyph-escapes.md](glyph-escapes.md)
+- Check operator precedence in [precedence.csv](precedence.csv)
+- Ensure balanced brackets/parentheses
+
+### Build Issues
+- Requires Java 11 or higher
+- Run `./gradlew clean build`
+- Check [CONTRIBUTING.md](CONTRIBUTING.md) for setup steps
+
+---
+
+Remember: Every question helps us improve MPL for everyone. Don't hesitate to ask!
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..5dc1109
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,68 @@
+plugins {
+ id 'java'
+ id 'antlr'
+}
+
+group = 'com.mpl'
+version = '0.1-alpha'
+
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ antlr 'org.antlr:antlr4:4.13.1'
+ implementation 'org.antlr:antlr4-runtime:4.13.1'
+
+ testImplementation 'junit:junit:4.13.2'
+ testImplementation 'org.hamcrest:hamcrest:2.2'
+}
+
+generateGrammarSource {
+ maxHeapSize = "64m"
+ // -Werror: any ANTLR warning (e.g. 184, token shadowing) fails the build
+ arguments += ["-visitor", "-listener", "-Werror", "-package", "com.mpl.parser"]
+ outputDirectory = file("${project.buildDir}/generated-src/antlr/main/com/mpl/parser")
+}
+
+compileJava.dependsOn generateGrammarSource
+
+sourceSets {
+ main {
+ antlr {
+ // The Gradle ANTLR plugin defaults to src/main/antlr; the grammar
+ // lives in src/main/antlr4 (Maven layout).
+ srcDirs = ['src/main/antlr4']
+ }
+ java {
+ srcDirs += "${project.buildDir}/generated-src/antlr/main"
+ }
+ }
+}
+
+test {
+ // ConformanceCountTest reads these; declaring them makes the up-to-date
+ // check re-run tests when the README claim or the corpus changes.
+ inputs.file('README.md')
+ inputs.dir('conformance/corpus')
+ testLogging {
+ events "passed", "skipped", "failed"
+ exceptionFormat "full"
+ }
+}
+
+// ParseExamples lives in the test source set, so the task needs the test
+// runtime classpath (with main.runtimeClasspath the class was never found).
+task parseExamples(type: JavaExec, dependsOn: testClasses) {
+ mainClass = 'com.mpl.test.ParseExamples'
+ classpath = sourceSets.test.runtimeClasspath
+ args = ['examples']
+}
+
+// Grammar-check CLI (see ParseCheck.java): file paths or '-' for stdin via
+// --args passthrough, e.g. ./gradlew -q parseCheck --args='examples/01_hello_world.mpl'
+task parseCheck(type: JavaExec, dependsOn: classes) {
+ mainClass = 'com.mpl.tools.ParseCheck'
+ classpath = sourceSets.main.runtimeClasspath
+ standardInput = System.in
+}
\ No newline at end of file
diff --git a/conformance/DIVERGENCES.md b/conformance/DIVERGENCES.md
new file mode 100644
index 0000000..e6c2115
--- /dev/null
+++ b/conformance/DIVERGENCES.md
@@ -0,0 +1,256 @@
+# DIVERGENCES — where the two parsers disagree
+
+Each entry is a minimized program that one parser accepts and the other
+rejects (JS = the parse phase of `js/mpl.js`; ANTLR = the grammar via
+`./gradlew parseCheck`). Divergences are recorded, never auto-fixed —
+which parser is right is a ratification question for Stage 3. Rulings
+happen in `JUDGMENT_CALLS.md`.
+
+Entries below are appended by `conformance/harness/fuzz.mjs`
+(deterministic: seed and index reproduce the original program), except
+where a different source is noted.
+
+## Divergence (found during C3 corpus construction)
+
+```
+✎ "drop\qme";
+```
+
+- JS interpreter: accepts (prints `dropqme` — an unknown string escape
+ drops the backslash silently)
+- ANTLR grammar: rejects (token recognition error at: '"drop\q')
+- RESOLVED by ruling 12 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 49)
+
+```
+
+```
+
+- JS interpreter: rejects (err_unexpected at 1:1)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 20 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 11)
+
+```
+"a\zb"
+```
+
+- JS interpreter: accepts (runs)
+- ANTLR grammar: rejects (1:0: token recognition error at: '"a\z')
+- RESOLVED by ruling 12 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 86)
+
+```
+((f);)
+```
+
+- JS interpreter: rejects (err_expect at 1:5)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 21 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 247)
+
+```
+(42;)
+```
+
+- JS interpreter: rejects (err_expect at 1:4)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 21 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 119)
+
+```
+(a;)
+```
+
+- JS interpreter: rejects (err_expect at 1:3)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 21 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 9)
+
+```
+(f∘g)
+```
+
+- JS interpreter: rejects (err_expect at 1:3)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 22 at cd59791
+
+## Divergence (fuzz seed 20260709, index 144)
+
+```
+({"",(a)})
+```
+
+- JS interpreter: rejects (err_expect at 1:5)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 23 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 456)
+
+```
+({"a b",2})
+```
+
+- JS interpreter: rejects (err_expect at 1:8)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 23 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 182)
+
+```
+({(007),true})
+```
+
+- JS interpreter: rejects (err_expect at 1:8)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 23 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 284)
+
+```
+({(1),⊥})
+```
+
+- JS interpreter: rejects (err_expect at 1:6)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 23 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 276)
+
+```
+({5,"a b"})
+```
+
+- JS interpreter: rejects (err_expect at 1:4)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 23 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 427)
+
+```
+({b:y})
+```
+
+- JS interpreter: rejects (err_expect at 1:4)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 24 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 101)
+
+```
+({c,0.5})
+```
+
+- JS interpreter: rejects (err_expect at 1:4)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 23 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 425)
+
+```
+({g:⊥})
+```
+
+- JS interpreter: rejects (err_expect at 1:4)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 24 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 194)
+
+```
+({x,(5)})
+```
+
+- JS interpreter: rejects (err_expect at 1:4)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 23 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 212)
+
+```
+({y:"hi"})
+```
+
+- JS interpreter: rejects (err_expect at 1:4)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 24 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 25)
+
+```
+({y:0})
+```
+
+- JS interpreter: rejects (err_expect at 1:4)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 24 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 347)
+
+```
+({{},{}})
+```
+
+- JS interpreter: rejects (err_expect at 1:5)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 21 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 52)
+
+```
+({λ})
+```
+
+- JS interpreter: rejects (err_expect at 1:4)
+- ANTLR grammar: accepts (parses)
+- RESOLVED by ruling 26 at c447eb7
+
+## Divergence (fuzz seed 20260709, index 76)
+
+```
+λ(b):(42)
+```
+
+- JS interpreter: accepts (runs)
+- ANTLR grammar: rejects (1:4: mismatched input ':' expecting {, ';', PARALLEL, LEFTARROW, IMPLIES, OR, AND, '=', NEQ, '<', '>', LEQ, GEQ, APPROX, SIM, '+', '-', TIMES, DIV, AST, COMPOSE, DEFINITION, HANDLE, ALLOC, RELEASE, '(', '|', MIDDOT})
+- RESOLVED by ruling 25 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 13)
+
+```
+λ(f):42
+```
+
+- JS interpreter: accepts (runs)
+- ANTLR grammar: rejects (1:4: mismatched input ':' expecting {, ';', PARALLEL, LEFTARROW, IMPLIES, OR, AND, '=', NEQ, '<', '>', LEQ, GEQ, APPROX, SIM, '+', '-', TIMES, DIV, AST, COMPOSE, DEFINITION, HANDLE, ALLOC, RELEASE, '(', '|', MIDDOT})
+- RESOLVED by ruling 25 at ad01bbd
+
+## Divergence (fuzz seed 20260709, index 29)
+
+```
+λ(y):f
+```
+
+- JS interpreter: accepts (runs)
+- ANTLR grammar: rejects (1:4: mismatched input ':' expecting {, ';', PARALLEL, LEFTARROW, IMPLIES, OR, AND, '=', NEQ, '<', '>', LEQ, GEQ, APPROX, SIM, '+', '-', TIMES, DIV, AST, COMPOSE, DEFINITION, HANDLE, ALLOC, RELEASE, '(', '|', MIDDOT})
+- RESOLVED by ruling 25 at ad01bbd
+
+## Divergence (fuzz seed 20260710, index 178 — found during Stage 3 A7)
+
+```
+({-42})
+```
+
+- JS interpreter: rejected (err_comment — the lexer committed '{-' to a
+ comment even without a terminator)
+- ANTLR grammar: accepts (MULTILINE_COMMENT requires its '-}'; '{' lexes
+ as a brace, so this is a block containing -42)
+- RESOLVED by grammar alignment (decision: the grammar is the syntax
+ truth) at f5e8407 — no ruling needed; found by the fresh fuzz seed and
+ fixed before commit
diff --git a/conformance/JUDGMENT_CALLS.md b/conformance/JUDGMENT_CALLS.md
new file mode 100644
index 0000000..3c3473e
--- /dev/null
+++ b/conformance/JUDGMENT_CALLS.md
@@ -0,0 +1,276 @@
+# JUDGMENT_CALLS — semantic decisions awaiting ratification
+
+RATIFIED 2026-07-09 — this file is the semantic record of MPL M0.
+
+Every section below is a semantic question Stage 2 surfaced, stated with
+the behavior `js/mpl.js` exhibited at observation time (Stage 2 head,
+`ea66a2a`) and the corpus entries that pinned it. Each `RULING:` line
+records Reverend's ratified decision of 2026-07-09. BLESS rulings kept the
+observed behavior; OVERRIDE/SPLIT/IMPLEMENT/AMEND rulings changed the
+grammar or the interpreter in Stage 3, and the corpus was re-recorded to
+match. The "Observed:" text is the historical record, not the current
+behavior — the rulings govern.
+
+## 1. Division by zero
+
+Question: what does `x ÷ 0` do — error, infinity, or ⊥?
+Observed: raises `err_div0` (both `÷` and `/`, integer or float operands).
+Pins: `043_div_zero`.
+
+RULING: BLESS. `x ÷ 0` (and `/`) raises `err_div0`. Division by zero is undefined.
+
+## 2. The value of a ∀ expression
+
+Question: what does `∀ x ∈ list : body` evaluate to?
+Observed: the value of the last body evaluation; `⊥` for an empty list.
+Pins: `018_forall_value`, `019_forall_scope`.
+
+RULING: OVERRIDE. `∀` is an iterator; the expression's value is `⊥` always (including empty collections). Using a statement as a value is undefined — same principle as ruling 3.
+
+## 3. Result when no guard matches
+
+Question: what is `(false ⟹ e)` with no `|` fallback?
+Observed: an internal no-match that surfaces as `⊥` everywhere except
+directly to the left of `|`.
+Pins: `021_no_guard_match`, `023_alt_chain`.
+
+RULING: BLESS (semantics, not mechanism). An unmatched guard yields `⊥` unless caught by `|`. Implementations choose their own internal sentinel.
+
+## 4. Integer vs float display
+
+Question: is `4 ÷ 2` shown as `2` or `2.0`? Are all numbers one type?
+Observed: all numbers are IEEE doubles; integral values display with no
+decimal point (`2`), non-integral as JS renders them (`0.5`, and
+`0.1 + 0.2` shows `0.30000000000000004`). Literals normalize (`007` → `7`,
+`0.50` → `0.5`).
+Pins: `006_number_display`, `007_float_arithmetic`.
+
+RULING: OVERRIDE. Numbers are exact rationals (arbitrary-precision integer numerator/denominator). Decimal literals convert exactly (`0.1` = 1/10). Display: integers bare; otherwise lowest-terms fraction `num/den`, sign on the numerator, denominator > 0; zero as `0`. Output is valid MPL that re-evaluates to the same value. IEEE doubles are rejected: the language must not lie about `0.1`. `√ vs ℚ` is logged as a standing M1 decision.
+
+## 5. ✎ formatting per type
+
+Question: exactly how does `✎` render each value type?
+Observed: numbers via host `String()`; strings bare at top level but
+quoted inside lists; booleans `true`/`false`; lists `[a, b]` with
+one-space separation; closures as `λ`; `⊥` as `⊥`.
+Pins: `009_string_concat`, `011_list_display`, `031_show_all_types`.
+
+RULING: BLESS, spec'd. `✎` renders: numbers per ruling 4; strings bare at top level, double-quoted inside lists; booleans `true`/`false`; lists `[a, b]` (comma-space); closures as `λ`; `⊥` as `⊥`.
+
+## 6. ⊥ display and propagation
+
+Question: is `⊥` a first-class value or a poison that propagates?
+Observed: a first-class value — it displays as `⊥`, concatenates into
+strings (`"x" + ⊥` → `x⊥`), sits in lists, but arithmetic on it is
+`err_num`.
+Pins: `030_bot`, `052_bot_arith`.
+
+RULING: BLESS. `⊥` is first-class: displays as `⊥`, sits in lists, string concatenation renders it (`"x" + ⊥` → `x⊥`); arithmetic on it is `err_num`.
+
+## 7. Equality across types
+
+Question: what does `=` mean across types and on structures?
+Observed: structural (JSON-serialization) equality — lists compare
+element-wise, cross-type comparisons are `false` (`1 = "1"` → `false`),
+and `⊥ = ⊥` → `true`. Comparing a self-referential closure crashes with a
+keyless host error (unpinnable by the corpus).
+Pins: `034_cross_type_equality`, `033_string_compare`.
+
+RULING: SPLIT. Data equality is structural: element-wise lists, cross-type `=` is `false`, `⊥ = ⊥` is `true`, `0.5 = 1/2` is `true` (same rational). Any equality comparison involving a function raises `err_fn_eq` — function equality is undecidable; a keyed error replaces the current keyless crash.
+
+## 8. Ordering across types
+
+Question: what do `< > ≤ ≥` do on mixed or non-numeric operands?
+Observed: raw host comparison with JS coercion — `1 < "2"` → `true`,
+`"10" < 9` → `false`, `true < 2` → `true`; strings order lexicographically.
+Pins: `035_mixed_compare`, `033_string_compare`.
+
+RULING: OVERRIDE. `< > ≤ ≥` are defined on number×number and string×string (Unicode code-point order) only; anything else raises `err_compare`. Host coercion (`1 < "2"`) is JavaScript soul leakage, not mathematics.
+
+## 9. Closure capture
+
+Question: do closures capture values at definition time or the
+environment?
+Observed: the environment — later mutation of a captured variable is
+visible on the next call (`013` prints 11 then 21).
+Pins: `013_closure_capture`, `026_def_vs_assign_scope`.
+
+RULING: BLESS. Closures capture the environment. (The corpus itself forces this: `factorial` only works because the λ sees its own later binding.)
+
+## 10. Recursion depth
+
+Question: what bounds recursion, and how does exceeding it surface?
+Observed: the host JS stack — deep recursion dies as a keyless RangeError
+before the 500 000-step budget can trigger, so the corpus cannot pin it
+(no error key). Iteration-heavy programs do hit the budget and raise
+`err_steps`. Depth ~500 is comfortably safe.
+Pins: `016_recursion_sum` (works at 500), `053_step_budget` (`err_steps`).
+
+RULING: OVERRIDE. Recursion is bounded by an explicit λ-application depth counter, limit 10 000, raising `err_depth`. A keyless host RangeError is a hole in the error surface; the limit is conformance surface in every implementation.
+
+## 11. The step budget itself
+
+Question: is "500 000 evaluation steps, then `err_steps`" part of the
+language, and is that the right number?
+Observed: hard-coded 500 000; nested `∀` loops over a 10-element list six
+deep exceed it.
+Pins: `053_step_budget`.
+
+RULING: RECLASSIFY. The step budget is an environment resource limit, not language semantics — like out-of-memory. `err_steps` (500 000) remains in the browser implementation; entry 053 leaves the portable corpus and becomes a js/test implementation test.
+
+## 12. String escape round-tripping
+
+Question: which string escapes exist, and what does an unknown one mean?
+Observed: `\n` and `\t` expand; `\"` and `\\` escape themselves; any other
+`\x` silently drops the backslash (`"drop\qme"` → `dropqme`). The ANTLR
+grammar instead REJECTS unknown escapes — a recorded divergence.
+Pins: `008_string_escapes`; divergence in DIVERGENCES.md ("drop\qme" and
+the `"a\zb"` fuzz entry).
+
+RULING: OVERRIDE. Escapes are exactly `\n \t \" \\`; any other `\x` raises `err_escape`, matching the grammar. Silent data-mangling is forbidden.
+
+## 13. Guard condition truthiness
+
+Question: what may a guard condition be?
+Observed: `true` and non-zero numbers fire the guard; `false`, `0`,
+strings, lists and `⊥` do not (they yield the no-match path) — so numbers
+are truthy for `⟹` but nothing else is.
+Pins: `022_guard_truthiness`.
+
+RULING: OVERRIDE. A guard condition must be boolean; any non-boolean condition (numbers included) raises `err_bool`. A condition is a proposition.
+
+## 14. ∧ ∨ operand truth
+
+Question: do `∧`/`∨` accept the same truthiness as `⟹`?
+Observed: no — operands are tested with strict boolean equality, so
+`1 ∧ true` → `false` while `(1 ⟹ x)` fires. Both operators short-circuit
+(observable by side effect). This asymmetry with #13 is the sharpest
+accident in the surface.
+Pins: `036_logic_ops`, `037_logic_short_circuit`.
+
+RULING: SPLIT. `∧ ∨` short-circuit (blessed, observable by side effect) and demand boolean operands — a non-boolean evaluated operand raises `err_bool` instead of silently comparing false. One notion of truth, everywhere; an unevaluated right operand raises nothing.
+
+## 15. Block scoping
+
+Question: does `{ … }` create a scope?
+Observed: no — bindings made inside a brace block leak out (`028` prints
+9). Only λ bodies and each `∀` iteration scope.
+Pins: `028_block_no_scope`, `027_block_sequencing`.
+
+RULING: BLESS. Braces group; they do not scope. Scope is created by binders only (λ parameters, ∀ iteration variables) — the Curry-Howard reading: a discharged hypothesis IS a λ. An explicit local-binding construct (let/where) is logged as a standing M1 decision.
+
+## 16. ≜ vs ← scoping and creation
+
+Question: how do define and assign differ?
+Observed: `≜` always binds in the current scope; `←` mutates the nearest
+enclosing binding and silently creates one in the current scope when
+nothing is bound (assignment-before-definition is legal). Both are
+expressions returning the value; both rebind freely (`x ≜ 1; x ≜ 3` is
+legal re-definition).
+Pins: `024_def_assign_rebind`, `025_def_assign_value`,
+`026_def_vs_assign_scope`.
+
+RULING: OVERRIDE (both halves). `≜` introduces a name exactly once per scope — same-scope redefinition raises `err_redef`; shadowing in inner scopes is legal. `←` mutates the nearest enclosing binding and raises `err_unbound` when none exists — silent creation is the typo trap. Both remain expressions returning the value.
+
+## 17. Type constraints
+
+Question: does `λx∈ℕ:` constrain anything?
+Observed: the constraint parses (including supplementary-plane `𝔹`) and
+is discarded unevaluated — `g ≜ λs∈𝔹: s + "!"` happily takes a string.
+Matches the site's "parsed today, not yet enforced" claim.
+Pins: `039_type_constraint_unenforced`.
+
+RULING: BLESS. Type constraints parse and are discarded, unenforced — this is the published claim and Stage 5's mandate.
+
+## 18. Nullary calls and zero-parameter λ
+
+Question: `f()` parses — but can any function be called that way?
+Observed: no zero-parameter λ can be written (`λ: e` is a parse error),
+so every `f()` is a runtime `err_arity`. The call syntax exists; nothing
+can satisfy it.
+Pins: `046_arity_nullary`, `047_arity_extra`.
+
+RULING: AMEND GRAMMAR. Nullary functions exist: `λ: e` is admitted (bare colon; the parenthesized spelling stays rejected per ruling 25). Effects made M0 procedural the day `✎` entered it; arity 0 is not an exception to ℕ. `f()` calls it; arity mismatches remain `err_arity`.
+
+## 19. ∗ as multiplication
+
+Question: is `∗` (U+2217) an operator, and what does it mean?
+Observed: exactly `×` — same token, same precedence.
+Pins: `041_asterisk_multiplication`.
+
+RULING: BLESS. `∗` (U+2217) is exactly `×`.
+
+## 20. Divergence: empty program
+
+Question: is the empty program valid?
+Observed: the grammar accepts it; the JS interpreter rejects it
+(`err_unexpected` at 1:1).
+Pins: none possible until ruled (decision 3 — divergent programs cannot
+enter the corpus). Repro in DIVERGENCES.md (fuzz index 49).
+
+RULING: OVERRIDE. The empty program is valid and produces no output. The grammar is right; the interpreter accepts it.
+
+## 21. Divergence: sequences inside parentheses
+
+Question: is `( e1 ; e2 )` valid? DECISIONS.md says `(...)` contains one
+seqExpr; the JS parser allows exactly one expression.
+Observed: the grammar accepts `(42;)` and `(a; b)`; the JS interpreter
+rejects both (`err_expect`).
+Pins: none until ruled. Repros in DIVERGENCES.md (fuzz indexes 86, 119,
+247, 233, 279, 406, 468, 101…).
+
+RULING: OVERRIDE. Parentheses contain one seqExpr per the standing DECISIONS ruling: `(e1; e2)` is legal, value = last expression. The interpreter implements its own language.
+
+## 22. Divergence: `∘` composition
+
+Question: does function composition exist in M0?
+Observed: the grammar parses `f ∘ g`; the JS interpreter lexes `∘` (it
+even has the `\circ` escape) but has no parse rule for it — every use is
+`err_expect`.
+Pins: none until ruled. Repro in DIVERGENCES.md (fuzz index 9).
+
+RULING: IMPLEMENT. `∘` is function composition: `(f ∘ g)(args…) = f(g(args…))`. Operands must be functions — a non-function operand raises the expected-a-function key (reuse the existing key if the audit finds one, else introduce `err_fn`). Precedence and associativity follow the grammar.
+
+## 23. Divergence: set literals
+
+Question: `{a, b}` is a set per the grammar's brace disambiguation — does
+the M0 core have sets?
+Observed: the grammar accepts `({5, "a b"})` and friends; the JS
+interpreter has no set support and rejects them (`err_expect`).
+Pins: none until ruled. Repros in DIVERGENCES.md (multiple fuzz indexes).
+
+RULING: PARSE-ONLY. Set literals parse (the interpreter gains the grammar's brace disambiguation) and evaluation raises `err_notyet`. Set semantics are an M1 design, logged.
+
+## 24. Divergence: record literals
+
+Question: `{k: v}` is a record per the grammar — does the M0 core have
+records?
+Observed: the grammar accepts `({y: 0})`; the JS interpreter rejects
+(`err_expect`).
+Pins: none until ruled. Repros in DIVERGENCES.md (fuzz indexes 25, 212,
+425, 427, 447).
+
+RULING: PARSE-ONLY. Record literals: same as 23.
+
+## 25. Divergence: parenthesized λ parameters
+
+Question: DECISIONS.md rejected `λ(a, b):` as a second parameter spelling
+— but who enforces that?
+Observed: inverted from every other divergence — the GRAMMAR rejects
+`λ(a, b): e` (honoring the decision) while the JS interpreter accepts it.
+The interpreter carries a syntax form the language explicitly rejected.
+Pins: none until ruled. Repros in DIVERGENCES.md (fuzz indexes 13, 29,
+76, …).
+
+RULING: OVERRIDE. `λ(a, b): e` is rejected by the interpreter too — the grammar already enforces the ratified DECISIONS ruling.
+
+## 26. Divergence: bare λ and Greek letters as identifiers
+
+Question: the grammar tokenizes Greek letters (LAMBDA_VAR et al.) as
+identifiers, so `{λ}` parses; the JS interpreter only knows λ as the
+abstraction head.
+Observed: grammar accepts `({λ})`; JS rejects (`err_expect` — λ demands a
+parameter list).
+Pins: none until ruled. Repro in DIVERGENCES.md (fuzz index 52).
+
+RULING: AMEND GRAMMAR. `λ` is a reserved token, never an identifier. Only λ; other Greek letters (π et al.) remain identifiers — Fatima wants π.
diff --git a/conformance/SURFACE.md b/conformance/SURFACE.md
new file mode 100644
index 0000000..0b5fc6d
--- /dev/null
+++ b/conformance/SURFACE.md
@@ -0,0 +1,114 @@
+# SURFACE — what `js/mpl.js` actually implements
+
+Audited from the source of `js/mpl.js` at Stage 2 (C3, head `ea66a2a`) and
+pinned by the corpus of that stage. **Historical record**: Stage 3 ratified
+the 26 judgment calls (2026-07-09) and changed the surface where rulings
+overrode it — rationals, boolean conditions, binding discipline, depth
+limit, composition, and parser alignment. Where this file and
+`JUDGMENT_CALLS.md` disagree, the rulings govern; the ratified corpus is
+the executable truth.
+
+## Lexer
+
+- Whitespace: space, tab, CR, LF.
+- Comments: line `-- …`; block `{- … -}`, nesting tracked (unterminated →
+ `err_comment`).
+- Strings: `"…"`, escape `\n` → newline, `\t` → tab, any other `\x` → `x`
+ (the backslash is silently dropped — `\q` becomes `q`); unterminated →
+ `err_string`.
+- ASCII escapes: `\word` for word ∈ {lambda, forall, in, coloneq,
+ leftarrow, implies, and, or, neq, leq, geq, times, div, trace, bot,
+ parallel, circ, ast}; unknown word → `err_escape`.
+- Numbers: `[0-9]+(.[0-9]+)?` via `parseFloat` (all numbers are JS
+ doubles; no scientific notation, no leading `.`).
+- Identifiers: `[a-zA-Z][a-zA-Z0-9_]*`; `true`/`false` are boolean
+ literals. A leading `_` is not an identifier start (`err_char`).
+- Type symbols `ℕ ℤ ℚ ℝ ℂ 𝔹` lex as identifiers (code-point-safe; 𝔹 is
+ supplementary-plane).
+- Single-char tokens: `✎ λ ∀ ∈ ≜ ← ⟹ ∧ ∨ ≠ ≤ ≥ × ÷ ∗ ∘ ‖ ⊥ + - / = < > |
+ ; : , ( ) [ ] { }`.
+- Anything else → `err_char`.
+
+## Parser (loosest to tightest)
+
+`;` sequence → `‖` (desugars to sequence!) → `≜` (right-assoc, id target
+only) → `←` (right-assoc, id target only) → `|` (left-assoc) → `⟹`
+(right-assoc) → `∨` → `∧` → comparison (`= ≠ < > ≤ ≥`, non-associative —
+`1 < 2 < 3` is a parse error) → `+ -` → `× ∗ ÷ /` → unary (`✎`, `-`) →
+call `f(a, …)` (postfix, nullary `f()` parses) → atom.
+
+Atoms: number/string/bool literals, `⊥`, identifiers,
+`λ params [∈ constraint] : body` (≥ 1 parameter; the constraint is parsed
+and **discarded unevaluated**), `∀ id ∈ expr : body`, list `[…]`, parens
+`( expr )` (a single expression — `;` inside parens is a parse error),
+braces `{ seq }` (`{}` evaluates to `⊥`).
+
+Parse-class error keys: `err_char`, `err_escape`, `err_string`,
+`err_comment`, `err_expect`, `err_unexpected`, `err_def_target`,
+`err_assign_target`.
+
+Lexed but unusable: `∘` (compose) has a token and an escape but **no
+parser rule** — any use is `err_expect`.
+
+## Evaluator
+
+- Values: number (double), string, boolean, list, closure, `⊥`.
+- `✎ e` prints `show(value)` and returns the value.
+- `show`: `⊥` → `⊥`; strings bare at top level but **quoted inside
+ lists**; lists `[a, b]`; closures → `λ`; booleans `true`/`false`;
+ numbers via JS `String()` (integral doubles print without `.0`).
+- `+` is numeric addition unless either side is a string — then it is
+ concatenation of `show`-rendered operands. `- × ∗ ÷ /` are numeric only
+ (`err_num`), `÷ 0` → `err_div0`.
+- Guards: `c ⟹ e` fires iff `c` is `true` **or a non-zero number**;
+ strings/lists/`⊥` never fire. A non-firing guard yields NOMATCH, which
+ `|` catches; NOMATCH surfacing anywhere else becomes `⊥`.
+- `∧ ∨`: short-circuit; operands are tested with `=== true`, so non-boolean
+ operands behave as false (`1 ∧ true` → `false` — contrast with `⟹`).
+- Comparison: `=`/`≠` via JSON serialization (structural for lists,
+ cross-type → `false`, `⊥ = ⊥` → `true`, comparing a self-referential
+ closure crashes keyless); `< > ≤ ≥` are raw JS comparisons (mixed-type
+ coercion applies).
+- `≜` binds in the **current** scope; `←` mutates the nearest enclosing
+ binding, creating one in the current scope if none exists. Both return
+ the value; both may rebind.
+- Braces `{…}` do **not** create a scope (bindings leak out). λ bodies and
+ each `∀` iteration do (the `∀` variable shadows and is restored).
+- Closures capture the defining **environment** (later mutations are
+ visible), enabling recursion via `≜`.
+- `∀ x ∈ list : body` requires a list (`err_iter`), evaluates the body per
+ element, and yields the last body value (`⊥` for an empty list).
+- Errors carry a key + 1-based line:col. Runtime keys: `err_undef`,
+ `err_num`, `err_div0`, `err_notfn`, `err_arity`, `err_iter`,
+ `err_steps` (evaluation-step budget: 500 000).
+- Deep recursion overflows the host stack **before** the step budget —
+ a keyless RangeError, unpinnable by the corpus (see JUDGMENT_CALLS).
+
+## Grammar-only surface (no ruling, Stage 4+ material)
+
+The grammar accepts these; the Stage-3 interpreter does not. No ruling
+covers them and the fuzzer's generator does not emit them — they are on
+the record here so the gap is a listed fact, not a surprise:
+
+- `≈` (APPROX) and `∼` (SIM) comparison operators — interpreter: `err_char`.
+- `"""raw strings"""` (RAWSTRING) — interpreter: `err_char` at the second
+ quote pair's content or `err_string`/`err_expect` depending on context.
+- Hex (`0x1F`), binary (`0b101`) and exponent (`1.5e3`) number literals —
+ interpreter lexes the leading digits as a plain number and fails to
+ parse the rest (`err_expect`).
+- `_` as a λ pattern (patternAtom UNDERSCORE) — interpreter: `err_char`.
+
+Dead key: `err_comment` can no longer be raised — since the comment lexer
+matched the grammar (a `{-` without its `-}` is a brace, not an
+unterminated comment), no code path produces it. It stays in the error-key
+list pending removal at the next legitimate interpreter change (no hash
+churn for hygiene alone).
+
+## Explicitly out of corpus scope
+
+- `‖` — parses, and the evaluator runs it as plain sequencing, but its
+ semantics are an M1 design question (locked decision 6): no corpus
+ entry pins it.
+- Everything the grammar has that `js/mpl.js` does not implement (modules,
+ resources, channels, exceptions, metaprogramming, records, sets, choice
+ types, …) — Stage 4/5 artifacts, not Stage 2 ones.
diff --git a/conformance/corpus/001_hello_world/expected.out b/conformance/corpus/001_hello_world/expected.out
new file mode 100644
index 0000000..8ab686e
--- /dev/null
+++ b/conformance/corpus/001_hello_world/expected.out
@@ -0,0 +1 @@
+Hello, World!
diff --git a/conformance/corpus/001_hello_world/meta.json b/conformance/corpus/001_hello_world/meta.json
new file mode 100644
index 0000000..4267604
--- /dev/null
+++ b/conformance/corpus/001_hello_world/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "example", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "seeded from examples/01_hello_world.mpl"}
diff --git a/conformance/corpus/001_hello_world/program.mpl b/conformance/corpus/001_hello_world/program.mpl
new file mode 100644
index 0000000..322a9ed
--- /dev/null
+++ b/conformance/corpus/001_hello_world/program.mpl
@@ -0,0 +1,2 @@
+-- Hello World example
+✎"Hello, World!";
\ No newline at end of file
diff --git a/conformance/corpus/002_factorial/expected.out b/conformance/corpus/002_factorial/expected.out
new file mode 100644
index 0000000..52bd8e4
--- /dev/null
+++ b/conformance/corpus/002_factorial/expected.out
@@ -0,0 +1 @@
+120
diff --git a/conformance/corpus/002_factorial/meta.json b/conformance/corpus/002_factorial/meta.json
new file mode 100644
index 0000000..cafb159
--- /dev/null
+++ b/conformance/corpus/002_factorial/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "example", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "seeded from examples/02_factorial.mpl"}
diff --git a/conformance/corpus/002_factorial/program.mpl b/conformance/corpus/002_factorial/program.mpl
new file mode 100644
index 0000000..1ed756b
--- /dev/null
+++ b/conformance/corpus/002_factorial/program.mpl
@@ -0,0 +1,4 @@
+-- Factorial example with proper precedence
+factorial ≜ λn∈ℕ: (n≤1 ⟹ 1) | (n×factorial(n-1));
+result ≜ factorial(5);
+✎result;
\ No newline at end of file
diff --git a/conformance/corpus/003_arith_precedence/expected.out b/conformance/corpus/003_arith_precedence/expected.out
new file mode 100644
index 0000000..1fd15ed
--- /dev/null
+++ b/conformance/corpus/003_arith_precedence/expected.out
@@ -0,0 +1,5 @@
+14
+20
+5
+2
+4
diff --git a/conformance/corpus/003_arith_precedence/meta.json b/conformance/corpus/003_arith_precedence/meta.json
new file mode 100644
index 0000000..cfca10b
--- /dev/null
+++ b/conformance/corpus/003_arith_precedence/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "× ÷ bind tighter than + -; + - and × ÷ left-associative"}
diff --git a/conformance/corpus/003_arith_precedence/program.mpl b/conformance/corpus/003_arith_precedence/program.mpl
new file mode 100644
index 0000000..ad2e7c4
--- /dev/null
+++ b/conformance/corpus/003_arith_precedence/program.mpl
@@ -0,0 +1,5 @@
+✎(2 + 3 × 4);
+✎((2 + 3) × 4);
+✎(10 - 2 - 3);
+✎(20 ÷ 2 ÷ 5);
+✎(2 + 12 ÷ 4 - 1);
diff --git a/conformance/corpus/004_unary_minus/expected.out b/conformance/corpus/004_unary_minus/expected.out
new file mode 100644
index 0000000..78303ca
--- /dev/null
+++ b/conformance/corpus/004_unary_minus/expected.out
@@ -0,0 +1,5 @@
+-5
+5
+5
+-6
+-3
diff --git a/conformance/corpus/004_unary_minus/meta.json b/conformance/corpus/004_unary_minus/meta.json
new file mode 100644
index 0000000..0fd3793
--- /dev/null
+++ b/conformance/corpus/004_unary_minus/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "unary minus, including doubled and against binary minus"}
diff --git a/conformance/corpus/004_unary_minus/program.mpl b/conformance/corpus/004_unary_minus/program.mpl
new file mode 100644
index 0000000..669aedf
--- /dev/null
+++ b/conformance/corpus/004_unary_minus/program.mpl
@@ -0,0 +1,5 @@
+✎(-5);
+✎(- -5);
+✎(3 - -2);
+✎(-2 × 3);
+✎(-(1 + 2));
diff --git a/conformance/corpus/005_slash_div_alias/expected.out b/conformance/corpus/005_slash_div_alias/expected.out
new file mode 100644
index 0000000..627c08c
--- /dev/null
+++ b/conformance/corpus/005_slash_div_alias/expected.out
@@ -0,0 +1,3 @@
+5/2
+5/2
+3
diff --git a/conformance/corpus/005_slash_div_alias/meta.json b/conformance/corpus/005_slash_div_alias/meta.json
new file mode 100644
index 0000000..915e1c0
--- /dev/null
+++ b/conformance/corpus/005_slash_div_alias/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 4", "notes": "/ is an ASCII alias of ÷"}
diff --git a/conformance/corpus/005_slash_div_alias/program.mpl b/conformance/corpus/005_slash_div_alias/program.mpl
new file mode 100644
index 0000000..0cda671
--- /dev/null
+++ b/conformance/corpus/005_slash_div_alias/program.mpl
@@ -0,0 +1,3 @@
+✎(10 / 4);
+✎(10 ÷ 4);
+✎(9 / 3);
diff --git a/conformance/corpus/006_number_display/expected.out b/conformance/corpus/006_number_display/expected.out
new file mode 100644
index 0000000..20b4ea1
--- /dev/null
+++ b/conformance/corpus/006_number_display/expected.out
@@ -0,0 +1,6 @@
+42
+3/2
+1/2
+2
+7
+1/2
diff --git a/conformance/corpus/006_number_display/meta.json b/conformance/corpus/006_number_display/meta.json
new file mode 100644
index 0000000..2bd2e36
--- /dev/null
+++ b/conformance/corpus/006_number_display/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 4", "notes": "integral doubles display without decimal point; literals normalize"}
diff --git a/conformance/corpus/006_number_display/program.mpl b/conformance/corpus/006_number_display/program.mpl
new file mode 100644
index 0000000..419c0d5
--- /dev/null
+++ b/conformance/corpus/006_number_display/program.mpl
@@ -0,0 +1,6 @@
+✎ 42;
+✎ 1.5;
+✎(1 ÷ 2);
+✎(4 ÷ 2);
+✎ 007;
+✎ 0.50;
diff --git a/conformance/corpus/007_float_arithmetic/expected.out b/conformance/corpus/007_float_arithmetic/expected.out
new file mode 100644
index 0000000..1b55dbb
--- /dev/null
+++ b/conformance/corpus/007_float_arithmetic/expected.out
@@ -0,0 +1,3 @@
+15/4
+3/10
+6
diff --git a/conformance/corpus/007_float_arithmetic/meta.json b/conformance/corpus/007_float_arithmetic/meta.json
new file mode 100644
index 0000000..63e6704
--- /dev/null
+++ b/conformance/corpus/007_float_arithmetic/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 4", "notes": "IEEE double arithmetic, including the 0.1+0.2 representation artifact"}
diff --git a/conformance/corpus/007_float_arithmetic/program.mpl b/conformance/corpus/007_float_arithmetic/program.mpl
new file mode 100644
index 0000000..90603f4
--- /dev/null
+++ b/conformance/corpus/007_float_arithmetic/program.mpl
@@ -0,0 +1,3 @@
+✎(1.5 + 2.25);
+✎(0.1 + 0.2);
+✎(3.0 × 2);
diff --git a/conformance/corpus/008_string_escapes/expected.out b/conformance/corpus/008_string_escapes/expected.out
new file mode 100644
index 0000000..0dede9b
--- /dev/null
+++ b/conformance/corpus/008_string_escapes/expected.out
@@ -0,0 +1,5 @@
+a
+b
+a b
+q"q
+b\b
diff --git a/conformance/corpus/008_string_escapes/meta.json b/conformance/corpus/008_string_escapes/meta.json
new file mode 100644
index 0000000..77d8bad
--- /dev/null
+++ b/conformance/corpus/008_string_escapes/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 12", "notes": "string escapes \\n \\t \\\" \\\\ (unknown escapes like \\q diverge from the grammar — see DIVERGENCES.md, not corpus-pinnable)"}
diff --git a/conformance/corpus/008_string_escapes/program.mpl b/conformance/corpus/008_string_escapes/program.mpl
new file mode 100644
index 0000000..e75664f
--- /dev/null
+++ b/conformance/corpus/008_string_escapes/program.mpl
@@ -0,0 +1,4 @@
+✎ "a\nb";
+✎ "a\tb";
+✎ "q\"q";
+✎ "b\\b";
diff --git a/conformance/corpus/009_string_concat/expected.out b/conformance/corpus/009_string_concat/expected.out
new file mode 100644
index 0000000..d0d3f1a
--- /dev/null
+++ b/conformance/corpus/009_string_concat/expected.out
@@ -0,0 +1,6 @@
+n=5
+5!
+l=[1, 2]
+b=true
+v=⊥
+ab
diff --git a/conformance/corpus/009_string_concat/meta.json b/conformance/corpus/009_string_concat/meta.json
new file mode 100644
index 0000000..a08296c
--- /dev/null
+++ b/conformance/corpus/009_string_concat/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 5", "notes": "+ concatenates when either operand is a string, rendering the other via show"}
diff --git a/conformance/corpus/009_string_concat/program.mpl b/conformance/corpus/009_string_concat/program.mpl
new file mode 100644
index 0000000..7764025
--- /dev/null
+++ b/conformance/corpus/009_string_concat/program.mpl
@@ -0,0 +1,6 @@
+✎("n=" + 5);
+✎(5 + "!");
+✎("l=" + [1, 2]);
+✎("b=" + true);
+✎("v=" + ⊥);
+✎("a" + "b");
diff --git a/conformance/corpus/010_multilingual_strings/expected.out b/conformance/corpus/010_multilingual_strings/expected.out
new file mode 100644
index 0000000..a5fae67
--- /dev/null
+++ b/conformance/corpus/010_multilingual_strings/expected.out
@@ -0,0 +1,3 @@
+مرحبا
+你好
+Salaam
diff --git a/conformance/corpus/010_multilingual_strings/meta.json b/conformance/corpus/010_multilingual_strings/meta.json
new file mode 100644
index 0000000..62e4942
--- /dev/null
+++ b/conformance/corpus/010_multilingual_strings/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "non-ASCII string content passes through byte-intact"}
diff --git a/conformance/corpus/010_multilingual_strings/program.mpl b/conformance/corpus/010_multilingual_strings/program.mpl
new file mode 100644
index 0000000..e067939
--- /dev/null
+++ b/conformance/corpus/010_multilingual_strings/program.mpl
@@ -0,0 +1,3 @@
+✎ "مرحبا";
+✎ "你好";
+✎ "Salaam";
diff --git a/conformance/corpus/011_list_display/expected.out b/conformance/corpus/011_list_display/expected.out
new file mode 100644
index 0000000..28da082
--- /dev/null
+++ b/conformance/corpus/011_list_display/expected.out
@@ -0,0 +1,3 @@
+[1, "two", true, [3, 4], ⊥]
+[]
+[λ]
diff --git a/conformance/corpus/011_list_display/meta.json b/conformance/corpus/011_list_display/meta.json
new file mode 100644
index 0000000..c8059e3
--- /dev/null
+++ b/conformance/corpus/011_list_display/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 5", "notes": "lists display with strings quoted inside; closures display as λ"}
diff --git a/conformance/corpus/011_list_display/program.mpl b/conformance/corpus/011_list_display/program.mpl
new file mode 100644
index 0000000..ff2bead
--- /dev/null
+++ b/conformance/corpus/011_list_display/program.mpl
@@ -0,0 +1,4 @@
+id ≜ λx: x;
+✎ [1, "two", true, [3, 4], ⊥];
+✎ [];
+✎ [id];
diff --git a/conformance/corpus/012_lambda_basics/expected.out b/conformance/corpus/012_lambda_basics/expected.out
new file mode 100644
index 0000000..7359be9
--- /dev/null
+++ b/conformance/corpus/012_lambda_basics/expected.out
@@ -0,0 +1,3 @@
+λ
+7
+1
diff --git a/conformance/corpus/012_lambda_basics/meta.json b/conformance/corpus/012_lambda_basics/meta.json
new file mode 100644
index 0000000..ed165e9
--- /dev/null
+++ b/conformance/corpus/012_lambda_basics/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 5", "notes": "λ definition, display, application, multiple parameters"}
diff --git a/conformance/corpus/012_lambda_basics/program.mpl b/conformance/corpus/012_lambda_basics/program.mpl
new file mode 100644
index 0000000..5fbc1c8
--- /dev/null
+++ b/conformance/corpus/012_lambda_basics/program.mpl
@@ -0,0 +1,5 @@
+id ≜ λx: x;
+✎ id;
+✎ id(7);
+fst ≜ λa, b: a;
+✎ fst(1, 2);
diff --git a/conformance/corpus/013_closure_capture/expected.out b/conformance/corpus/013_closure_capture/expected.out
new file mode 100644
index 0000000..b07697d
--- /dev/null
+++ b/conformance/corpus/013_closure_capture/expected.out
@@ -0,0 +1,2 @@
+11
+21
diff --git a/conformance/corpus/013_closure_capture/meta.json b/conformance/corpus/013_closure_capture/meta.json
new file mode 100644
index 0000000..ebe5695
--- /dev/null
+++ b/conformance/corpus/013_closure_capture/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 9", "notes": "closures capture the environment, not values at definition time"}
diff --git a/conformance/corpus/013_closure_capture/program.mpl b/conformance/corpus/013_closure_capture/program.mpl
new file mode 100644
index 0000000..cebd052
--- /dev/null
+++ b/conformance/corpus/013_closure_capture/program.mpl
@@ -0,0 +1,5 @@
+x ≜ 10;
+f ≜ λy: x + y;
+✎ f(1);
+x ← 20;
+✎ f(1);
diff --git a/conformance/corpus/014_higher_order/expected.out b/conformance/corpus/014_higher_order/expected.out
new file mode 100644
index 0000000..392be62
--- /dev/null
+++ b/conformance/corpus/014_higher_order/expected.out
@@ -0,0 +1,2 @@
+42
+15
diff --git a/conformance/corpus/014_higher_order/meta.json b/conformance/corpus/014_higher_order/meta.json
new file mode 100644
index 0000000..e03651a
--- /dev/null
+++ b/conformance/corpus/014_higher_order/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "curried application and λ literals as call arguments"}
diff --git a/conformance/corpus/014_higher_order/program.mpl b/conformance/corpus/014_higher_order/program.mpl
new file mode 100644
index 0000000..5f23ee5
--- /dev/null
+++ b/conformance/corpus/014_higher_order/program.mpl
@@ -0,0 +1,5 @@
+twice ≜ λf: λx: f(f(x));
+inc ≜ λn: n + 1;
+✎ twice(inc)(40);
+apply ≜ λf, v: f(v);
+✎ apply(λn: n × 3, 5);
diff --git a/conformance/corpus/015_recursion_fib/expected.out b/conformance/corpus/015_recursion_fib/expected.out
new file mode 100644
index 0000000..c3f407c
--- /dev/null
+++ b/conformance/corpus/015_recursion_fib/expected.out
@@ -0,0 +1 @@
+55
diff --git a/conformance/corpus/015_recursion_fib/meta.json b/conformance/corpus/015_recursion_fib/meta.json
new file mode 100644
index 0000000..31ab905
--- /dev/null
+++ b/conformance/corpus/015_recursion_fib/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "binary recursion through a guarded alternative"}
diff --git a/conformance/corpus/015_recursion_fib/program.mpl b/conformance/corpus/015_recursion_fib/program.mpl
new file mode 100644
index 0000000..d850b8a
--- /dev/null
+++ b/conformance/corpus/015_recursion_fib/program.mpl
@@ -0,0 +1,2 @@
+fib ≜ λn: (n ≤ 1 ⟹ n) | (fib(n - 1) + fib(n - 2));
+✎ fib(10);
diff --git a/conformance/corpus/016_recursion_sum/expected.out b/conformance/corpus/016_recursion_sum/expected.out
new file mode 100644
index 0000000..c7610df
--- /dev/null
+++ b/conformance/corpus/016_recursion_sum/expected.out
@@ -0,0 +1 @@
+125250
diff --git a/conformance/corpus/016_recursion_sum/meta.json b/conformance/corpus/016_recursion_sum/meta.json
new file mode 100644
index 0000000..de8a79d
--- /dev/null
+++ b/conformance/corpus/016_recursion_sum/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 10", "notes": "linear recursion 500 deep (within the host stack)"}
diff --git a/conformance/corpus/016_recursion_sum/program.mpl b/conformance/corpus/016_recursion_sum/program.mpl
new file mode 100644
index 0000000..fe8d29f
--- /dev/null
+++ b/conformance/corpus/016_recursion_sum/program.mpl
@@ -0,0 +1,2 @@
+sum ≜ λn: (n = 0 ⟹ 0) | (n + sum(n - 1));
+✎ sum(500);
diff --git a/conformance/corpus/017_forall_accumulate/expected.out b/conformance/corpus/017_forall_accumulate/expected.out
new file mode 100644
index 0000000..c3f407c
--- /dev/null
+++ b/conformance/corpus/017_forall_accumulate/expected.out
@@ -0,0 +1 @@
+55
diff --git a/conformance/corpus/017_forall_accumulate/meta.json b/conformance/corpus/017_forall_accumulate/meta.json
new file mode 100644
index 0000000..4ab6e3e
--- /dev/null
+++ b/conformance/corpus/017_forall_accumulate/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "∀ with an accumulating assignment"}
diff --git a/conformance/corpus/017_forall_accumulate/program.mpl b/conformance/corpus/017_forall_accumulate/program.mpl
new file mode 100644
index 0000000..6d674fe
--- /dev/null
+++ b/conformance/corpus/017_forall_accumulate/program.mpl
@@ -0,0 +1,3 @@
+t ≜ 0;
+∀ n ∈ [1, 2, 3, 4, 5]: t ← t + n × n;
+✎ t;
diff --git a/conformance/corpus/018_forall_value/expected.out b/conformance/corpus/018_forall_value/expected.out
new file mode 100644
index 0000000..ab6c322
--- /dev/null
+++ b/conformance/corpus/018_forall_value/expected.out
@@ -0,0 +1,2 @@
+⊥
+⊥
diff --git a/conformance/corpus/018_forall_value/meta.json b/conformance/corpus/018_forall_value/meta.json
new file mode 100644
index 0000000..18d8d59
--- /dev/null
+++ b/conformance/corpus/018_forall_value/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 2", "notes": "a ∀ expression yields the last body value; empty collection yields ⊥"}
diff --git a/conformance/corpus/018_forall_value/program.mpl b/conformance/corpus/018_forall_value/program.mpl
new file mode 100644
index 0000000..a75cc1b
--- /dev/null
+++ b/conformance/corpus/018_forall_value/program.mpl
@@ -0,0 +1,2 @@
+✎(∀ n ∈ [1, 2, 3]: n × 2);
+✎(∀ n ∈ []: n);
diff --git a/conformance/corpus/019_forall_scope/expected.out b/conformance/corpus/019_forall_scope/expected.out
new file mode 100644
index 0000000..040e114
--- /dev/null
+++ b/conformance/corpus/019_forall_scope/expected.out
@@ -0,0 +1,3 @@
+1
+2
+100
diff --git a/conformance/corpus/019_forall_scope/meta.json b/conformance/corpus/019_forall_scope/meta.json
new file mode 100644
index 0000000..358ce6c
--- /dev/null
+++ b/conformance/corpus/019_forall_scope/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 15", "notes": "the ∀ variable shadows per iteration and the outer binding survives"}
diff --git a/conformance/corpus/019_forall_scope/program.mpl b/conformance/corpus/019_forall_scope/program.mpl
new file mode 100644
index 0000000..5c8a667
--- /dev/null
+++ b/conformance/corpus/019_forall_scope/program.mpl
@@ -0,0 +1,3 @@
+n ≜ 100;
+∀ n ∈ [1, 2]: ✎ n;
+✎ n;
diff --git a/conformance/corpus/020_guarded_alternatives/expected.out b/conformance/corpus/020_guarded_alternatives/expected.out
new file mode 100644
index 0000000..b1e6722
--- /dev/null
+++ b/conformance/corpus/020_guarded_alternatives/expected.out
@@ -0,0 +1,3 @@
+A
+B
+C
diff --git a/conformance/corpus/020_guarded_alternatives/meta.json b/conformance/corpus/020_guarded_alternatives/meta.json
new file mode 100644
index 0000000..3eece2c
--- /dev/null
+++ b/conformance/corpus/020_guarded_alternatives/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 3", "notes": "the canonical conditional: guarded alternatives with fallback"}
diff --git a/conformance/corpus/020_guarded_alternatives/program.mpl b/conformance/corpus/020_guarded_alternatives/program.mpl
new file mode 100644
index 0000000..7a34721
--- /dev/null
+++ b/conformance/corpus/020_guarded_alternatives/program.mpl
@@ -0,0 +1,4 @@
+grade ≜ λs: (s ≥ 90 ⟹ "A") | ((s ≥ 80 ⟹ "B") | "C");
+✎ grade(95);
+✎ grade(85);
+✎ grade(70);
diff --git a/conformance/corpus/021_no_guard_match/expected.out b/conformance/corpus/021_no_guard_match/expected.out
new file mode 100644
index 0000000..ab6c322
--- /dev/null
+++ b/conformance/corpus/021_no_guard_match/expected.out
@@ -0,0 +1,2 @@
+⊥
+⊥
diff --git a/conformance/corpus/021_no_guard_match/meta.json b/conformance/corpus/021_no_guard_match/meta.json
new file mode 100644
index 0000000..67d700e
--- /dev/null
+++ b/conformance/corpus/021_no_guard_match/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 3", "notes": "a guard that never fires, with no | fallback, surfaces as ⊥"}
diff --git a/conformance/corpus/021_no_guard_match/program.mpl b/conformance/corpus/021_no_guard_match/program.mpl
new file mode 100644
index 0000000..0f0f99b
--- /dev/null
+++ b/conformance/corpus/021_no_guard_match/program.mpl
@@ -0,0 +1,3 @@
+✎((false ⟹ 1));
+x ≜ (false ⟹ 1);
+✎ x;
diff --git a/conformance/corpus/022_guard_truthiness/expected.err b/conformance/corpus/022_guard_truthiness/expected.err
new file mode 100644
index 0000000..844c88e
--- /dev/null
+++ b/conformance/corpus/022_guard_truthiness/expected.err
@@ -0,0 +1 @@
+err_bool
diff --git a/conformance/corpus/022_guard_truthiness/meta.json b/conformance/corpus/022_guard_truthiness/meta.json
new file mode 100644
index 0000000..c1030b8
--- /dev/null
+++ b/conformance/corpus/022_guard_truthiness/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 13", "notes": "guard conditions: true or non-zero number fire; strings/lists never do"}
diff --git a/conformance/corpus/022_guard_truthiness/program.mpl b/conformance/corpus/022_guard_truthiness/program.mpl
new file mode 100644
index 0000000..1ca843b
--- /dev/null
+++ b/conformance/corpus/022_guard_truthiness/program.mpl
@@ -0,0 +1 @@
+✎((1 ⟹ "one") | "no");
diff --git a/conformance/corpus/023_alt_chain/expected.out b/conformance/corpus/023_alt_chain/expected.out
new file mode 100644
index 0000000..f1e5eee
--- /dev/null
+++ b/conformance/corpus/023_alt_chain/expected.out
@@ -0,0 +1,2 @@
+3
+2
diff --git a/conformance/corpus/023_alt_chain/meta.json b/conformance/corpus/023_alt_chain/meta.json
new file mode 100644
index 0000000..f86e4df
--- /dev/null
+++ b/conformance/corpus/023_alt_chain/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 3", "notes": "fall-through chains take the first firing arm"}
diff --git a/conformance/corpus/023_alt_chain/program.mpl b/conformance/corpus/023_alt_chain/program.mpl
new file mode 100644
index 0000000..75b5f45
--- /dev/null
+++ b/conformance/corpus/023_alt_chain/program.mpl
@@ -0,0 +1,2 @@
+✎((false ⟹ 1) | (false ⟹ 2) | 3);
+✎((false ⟹ 1) | (true ⟹ 2) | 3);
diff --git a/conformance/corpus/024_def_assign_rebind/expected.out b/conformance/corpus/024_def_assign_rebind/expected.out
new file mode 100644
index 0000000..1191247
--- /dev/null
+++ b/conformance/corpus/024_def_assign_rebind/expected.out
@@ -0,0 +1,2 @@
+1
+2
diff --git a/conformance/corpus/024_def_assign_rebind/meta.json b/conformance/corpus/024_def_assign_rebind/meta.json
new file mode 100644
index 0000000..4859f90
--- /dev/null
+++ b/conformance/corpus/024_def_assign_rebind/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 16", "notes": "≜ and ← both rebind freely; ← works without a prior ≜"}
diff --git a/conformance/corpus/024_def_assign_rebind/program.mpl b/conformance/corpus/024_def_assign_rebind/program.mpl
new file mode 100644
index 0000000..60cbf86
--- /dev/null
+++ b/conformance/corpus/024_def_assign_rebind/program.mpl
@@ -0,0 +1,4 @@
+x ≜ 1;
+✎ x;
+x ← 2;
+✎ x;
diff --git a/conformance/corpus/025_def_assign_value/expected.out b/conformance/corpus/025_def_assign_value/expected.out
new file mode 100644
index 0000000..453dd6a
--- /dev/null
+++ b/conformance/corpus/025_def_assign_value/expected.out
@@ -0,0 +1,4 @@
+7
+8
+2
+2
diff --git a/conformance/corpus/025_def_assign_value/meta.json b/conformance/corpus/025_def_assign_value/meta.json
new file mode 100644
index 0000000..2cc9d1f
--- /dev/null
+++ b/conformance/corpus/025_def_assign_value/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 16", "notes": "both binding forms are expressions returning the bound value; ≜ chains right"}
diff --git a/conformance/corpus/025_def_assign_value/program.mpl b/conformance/corpus/025_def_assign_value/program.mpl
new file mode 100644
index 0000000..84bcb60
--- /dev/null
+++ b/conformance/corpus/025_def_assign_value/program.mpl
@@ -0,0 +1,5 @@
+✎(a ≜ 7);
+✎(a ← 8);
+b ≜ c ≜ 2;
+✎ b;
+✎ c;
diff --git a/conformance/corpus/026_def_vs_assign_scope/expected.out b/conformance/corpus/026_def_vs_assign_scope/expected.out
new file mode 100644
index 0000000..4392deb
--- /dev/null
+++ b/conformance/corpus/026_def_vs_assign_scope/expected.out
@@ -0,0 +1,2 @@
+99
+99
diff --git a/conformance/corpus/026_def_vs_assign_scope/meta.json b/conformance/corpus/026_def_vs_assign_scope/meta.json
new file mode 100644
index 0000000..a151444
--- /dev/null
+++ b/conformance/corpus/026_def_vs_assign_scope/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 9 and 16", "notes": "inside a λ, ← mutates the captured outer binding; ≜ creates a local one"}
diff --git a/conformance/corpus/026_def_vs_assign_scope/program.mpl b/conformance/corpus/026_def_vs_assign_scope/program.mpl
new file mode 100644
index 0000000..0debb0f
--- /dev/null
+++ b/conformance/corpus/026_def_vs_assign_scope/program.mpl
@@ -0,0 +1,7 @@
+x ≜ 1;
+f ≜ λy: {x ← 99; x};
+f(0);
+✎ x;
+g ≜ λy: {x ≜ 55; x};
+g(0);
+✎ x;
diff --git a/conformance/corpus/027_block_sequencing/expected.out b/conformance/corpus/027_block_sequencing/expected.out
new file mode 100644
index 0000000..0dbf973
--- /dev/null
+++ b/conformance/corpus/027_block_sequencing/expected.out
@@ -0,0 +1,3 @@
+3
+⊥
+4
diff --git a/conformance/corpus/027_block_sequencing/meta.json b/conformance/corpus/027_block_sequencing/meta.json
new file mode 100644
index 0000000..faf24bd
--- /dev/null
+++ b/conformance/corpus/027_block_sequencing/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 15", "notes": "a block yields its last expression; {} yields ⊥; trailing ; permitted"}
diff --git a/conformance/corpus/027_block_sequencing/program.mpl b/conformance/corpus/027_block_sequencing/program.mpl
new file mode 100644
index 0000000..a274be8
--- /dev/null
+++ b/conformance/corpus/027_block_sequencing/program.mpl
@@ -0,0 +1,3 @@
+✎({1; 2; 3});
+✎({});
+✎({4;});
diff --git a/conformance/corpus/028_block_no_scope/expected.out b/conformance/corpus/028_block_no_scope/expected.out
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/conformance/corpus/028_block_no_scope/expected.out
@@ -0,0 +1 @@
+9
diff --git a/conformance/corpus/028_block_no_scope/meta.json b/conformance/corpus/028_block_no_scope/meta.json
new file mode 100644
index 0000000..b13a0cd
--- /dev/null
+++ b/conformance/corpus/028_block_no_scope/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 15", "notes": "braces do NOT create a scope: bindings made inside leak out"}
diff --git a/conformance/corpus/028_block_no_scope/program.mpl b/conformance/corpus/028_block_no_scope/program.mpl
new file mode 100644
index 0000000..e789759
--- /dev/null
+++ b/conformance/corpus/028_block_no_scope/program.mpl
@@ -0,0 +1,2 @@
+{y ≜ 9; 0};
+✎ y;
diff --git a/conformance/corpus/029_comments/expected.out b/conformance/corpus/029_comments/expected.out
new file mode 100644
index 0000000..01e79c3
--- /dev/null
+++ b/conformance/corpus/029_comments/expected.out
@@ -0,0 +1,3 @@
+1
+2
+3
diff --git a/conformance/corpus/029_comments/meta.json b/conformance/corpus/029_comments/meta.json
new file mode 100644
index 0000000..9c0e7a5
--- /dev/null
+++ b/conformance/corpus/029_comments/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "line comments and nested block comments"}
diff --git a/conformance/corpus/029_comments/program.mpl b/conformance/corpus/029_comments/program.mpl
new file mode 100644
index 0000000..9cc3f1b
--- /dev/null
+++ b/conformance/corpus/029_comments/program.mpl
@@ -0,0 +1,4 @@
+-- line comment
+✎ 1; {- block -} ✎ 2;
+{- outer {- nested -} outer -}
+✎ 3;
diff --git a/conformance/corpus/030_bot/expected.out b/conformance/corpus/030_bot/expected.out
new file mode 100644
index 0000000..1ac1e33
--- /dev/null
+++ b/conformance/corpus/030_bot/expected.out
@@ -0,0 +1,3 @@
+⊥
+x⊥
+[⊥, 1]
diff --git a/conformance/corpus/030_bot/meta.json b/conformance/corpus/030_bot/meta.json
new file mode 100644
index 0000000..c481201
--- /dev/null
+++ b/conformance/corpus/030_bot/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 6", "notes": "⊥ displays as ⊥ and concatenates/nests as a value"}
diff --git a/conformance/corpus/030_bot/program.mpl b/conformance/corpus/030_bot/program.mpl
new file mode 100644
index 0000000..70017a5
--- /dev/null
+++ b/conformance/corpus/030_bot/program.mpl
@@ -0,0 +1,3 @@
+✎ ⊥;
+✎("x" + ⊥);
+✎ [⊥, 1];
diff --git a/conformance/corpus/031_show_all_types/expected.out b/conformance/corpus/031_show_all_types/expected.out
new file mode 100644
index 0000000..b11e567
--- /dev/null
+++ b/conformance/corpus/031_show_all_types/expected.out
@@ -0,0 +1,8 @@
+42
+3/2
+s
+true
+false
+[1]
+⊥
+λ
diff --git a/conformance/corpus/031_show_all_types/meta.json b/conformance/corpus/031_show_all_types/meta.json
new file mode 100644
index 0000000..0e4b467
--- /dev/null
+++ b/conformance/corpus/031_show_all_types/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "one ✎ per value type"}
diff --git a/conformance/corpus/031_show_all_types/program.mpl b/conformance/corpus/031_show_all_types/program.mpl
new file mode 100644
index 0000000..4bfe2fd
--- /dev/null
+++ b/conformance/corpus/031_show_all_types/program.mpl
@@ -0,0 +1,9 @@
+f ≜ λx: x;
+✎ 42;
+✎ 1.5;
+✎ "s";
+✎ true;
+✎ false;
+✎ [1];
+✎ ⊥;
+✎ f;
diff --git a/conformance/corpus/032_comparisons/expected.out b/conformance/corpus/032_comparisons/expected.out
new file mode 100644
index 0000000..064310a
--- /dev/null
+++ b/conformance/corpus/032_comparisons/expected.out
@@ -0,0 +1,6 @@
+true
+true
+false
+false
+true
+true
diff --git a/conformance/corpus/032_comparisons/meta.json b/conformance/corpus/032_comparisons/meta.json
new file mode 100644
index 0000000..0d26684
--- /dev/null
+++ b/conformance/corpus/032_comparisons/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 8", "notes": "all six comparison operators on numbers"}
diff --git a/conformance/corpus/032_comparisons/program.mpl b/conformance/corpus/032_comparisons/program.mpl
new file mode 100644
index 0000000..5f85b07
--- /dev/null
+++ b/conformance/corpus/032_comparisons/program.mpl
@@ -0,0 +1,6 @@
+✎(1 < 2);
+✎(2 ≤ 2);
+✎(3 > 4);
+✎(4 ≥ 5);
+✎(1 = 1);
+✎(1 ≠ 2);
diff --git a/conformance/corpus/033_string_compare/expected.out b/conformance/corpus/033_string_compare/expected.out
new file mode 100644
index 0000000..1140ff5
--- /dev/null
+++ b/conformance/corpus/033_string_compare/expected.out
@@ -0,0 +1,4 @@
+true
+true
+true
+true
diff --git a/conformance/corpus/033_string_compare/meta.json b/conformance/corpus/033_string_compare/meta.json
new file mode 100644
index 0000000..3593c71
--- /dev/null
+++ b/conformance/corpus/033_string_compare/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 7 and 8", "notes": "lexicographic order and structural equality on strings"}
diff --git a/conformance/corpus/033_string_compare/program.mpl b/conformance/corpus/033_string_compare/program.mpl
new file mode 100644
index 0000000..602bf17
--- /dev/null
+++ b/conformance/corpus/033_string_compare/program.mpl
@@ -0,0 +1,4 @@
+✎("a" < "b");
+✎("abc" = "abc");
+✎("abc" ≠ "abd");
+✎("b" ≥ "a");
diff --git a/conformance/corpus/034_cross_type_equality/expected.out b/conformance/corpus/034_cross_type_equality/expected.out
new file mode 100644
index 0000000..40f7abf
--- /dev/null
+++ b/conformance/corpus/034_cross_type_equality/expected.out
@@ -0,0 +1,6 @@
+false
+false
+true
+true
+true
+false
diff --git a/conformance/corpus/034_cross_type_equality/meta.json b/conformance/corpus/034_cross_type_equality/meta.json
new file mode 100644
index 0000000..fa99f96
--- /dev/null
+++ b/conformance/corpus/034_cross_type_equality/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 7", "notes": "equality is structural per type and false across types; ⊥ equals ⊥"}
diff --git a/conformance/corpus/034_cross_type_equality/program.mpl b/conformance/corpus/034_cross_type_equality/program.mpl
new file mode 100644
index 0000000..ede0171
--- /dev/null
+++ b/conformance/corpus/034_cross_type_equality/program.mpl
@@ -0,0 +1,6 @@
+✎(1 = "1");
+✎(true = 1);
+✎([1] = [1]);
+✎([] = []);
+✎(⊥ = ⊥);
+✎("" = ⊥);
diff --git a/conformance/corpus/035_mixed_compare/expected.err b/conformance/corpus/035_mixed_compare/expected.err
new file mode 100644
index 0000000..6b9fd10
--- /dev/null
+++ b/conformance/corpus/035_mixed_compare/expected.err
@@ -0,0 +1 @@
+err_compare
diff --git a/conformance/corpus/035_mixed_compare/meta.json b/conformance/corpus/035_mixed_compare/meta.json
new file mode 100644
index 0000000..ba96397
--- /dev/null
+++ b/conformance/corpus/035_mixed_compare/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 8", "notes": "ordering across types follows host coercion — observed, flagged as a judgment call"}
diff --git a/conformance/corpus/035_mixed_compare/program.mpl b/conformance/corpus/035_mixed_compare/program.mpl
new file mode 100644
index 0000000..5386a62
--- /dev/null
+++ b/conformance/corpus/035_mixed_compare/program.mpl
@@ -0,0 +1 @@
+✎(1 < "2");
diff --git a/conformance/corpus/036_logic_ops/expected.out b/conformance/corpus/036_logic_ops/expected.out
new file mode 100644
index 0000000..2cdda45
--- /dev/null
+++ b/conformance/corpus/036_logic_ops/expected.out
@@ -0,0 +1,4 @@
+true
+false
+true
+false
diff --git a/conformance/corpus/036_logic_ops/meta.json b/conformance/corpus/036_logic_ops/meta.json
new file mode 100644
index 0000000..d56aeaf
--- /dev/null
+++ b/conformance/corpus/036_logic_ops/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 14", "notes": "∧ ∨ test operands with strict boolean truth — numbers are not truthy here"}
diff --git a/conformance/corpus/036_logic_ops/program.mpl b/conformance/corpus/036_logic_ops/program.mpl
new file mode 100644
index 0000000..972a3f5
--- /dev/null
+++ b/conformance/corpus/036_logic_ops/program.mpl
@@ -0,0 +1,4 @@
+✎(true ∧ true);
+✎(true ∧ false);
+✎(false ∨ true);
+✎(false ∨ false);
diff --git a/conformance/corpus/037_logic_short_circuit/expected.out b/conformance/corpus/037_logic_short_circuit/expected.out
new file mode 100644
index 0000000..bb5ee5c
--- /dev/null
+++ b/conformance/corpus/037_logic_short_circuit/expected.out
@@ -0,0 +1,3 @@
+0
+0
+1
diff --git a/conformance/corpus/037_logic_short_circuit/meta.json b/conformance/corpus/037_logic_short_circuit/meta.json
new file mode 100644
index 0000000..30f1dba
--- /dev/null
+++ b/conformance/corpus/037_logic_short_circuit/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 14", "notes": "∧ skips its right side on false; ∨ skips it on true (observable via side effect)"}
diff --git a/conformance/corpus/037_logic_short_circuit/program.mpl b/conformance/corpus/037_logic_short_circuit/program.mpl
new file mode 100644
index 0000000..5ec3412
--- /dev/null
+++ b/conformance/corpus/037_logic_short_circuit/program.mpl
@@ -0,0 +1,8 @@
+x ≜ 0;
+f ≜ λv: {x ← x + 1; v};
+false ∧ f(true);
+✎ x;
+true ∨ f(true);
+✎ x;
+true ∧ f(true);
+✎ x;
diff --git a/conformance/corpus/038_ascii_escapes/expected.out b/conformance/corpus/038_ascii_escapes/expected.out
new file mode 100644
index 0000000..a45fd52
--- /dev/null
+++ b/conformance/corpus/038_ascii_escapes/expected.out
@@ -0,0 +1 @@
+24
diff --git a/conformance/corpus/038_ascii_escapes/meta.json b/conformance/corpus/038_ascii_escapes/meta.json
new file mode 100644
index 0000000..f144ed8
--- /dev/null
+++ b/conformance/corpus/038_ascii_escapes/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "a program written entirely in ASCII escapes behaves like its glyph spelling"}
diff --git a/conformance/corpus/038_ascii_escapes/program.mpl b/conformance/corpus/038_ascii_escapes/program.mpl
new file mode 100644
index 0000000..5323b1e
--- /dev/null
+++ b/conformance/corpus/038_ascii_escapes/program.mpl
@@ -0,0 +1,2 @@
+f \coloneq \lambda n: (n \leq 1 \implies 1) | (n \times f(n - 1));
+\trace f(4);
diff --git a/conformance/corpus/039_type_constraint_unenforced/expected.out b/conformance/corpus/039_type_constraint_unenforced/expected.out
new file mode 100644
index 0000000..a123a3a
--- /dev/null
+++ b/conformance/corpus/039_type_constraint_unenforced/expected.out
@@ -0,0 +1,2 @@
+2
+hi!
diff --git a/conformance/corpus/039_type_constraint_unenforced/meta.json b/conformance/corpus/039_type_constraint_unenforced/meta.json
new file mode 100644
index 0000000..657a604
--- /dev/null
+++ b/conformance/corpus/039_type_constraint_unenforced/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 17", "notes": "∈-constraints parse (incl. supplementary-plane 𝔹) and are discarded unevaluated"}
diff --git a/conformance/corpus/039_type_constraint_unenforced/program.mpl b/conformance/corpus/039_type_constraint_unenforced/program.mpl
new file mode 100644
index 0000000..829efe3
--- /dev/null
+++ b/conformance/corpus/039_type_constraint_unenforced/program.mpl
@@ -0,0 +1,4 @@
+f ≜ λx∈ℕ: x + 1;
+✎ f(1);
+g ≜ λs∈𝔹: s + "!";
+✎ g("hi");
diff --git a/conformance/corpus/040_trace_returns_value/expected.out b/conformance/corpus/040_trace_returns_value/expected.out
new file mode 100644
index 0000000..b40f8fa
--- /dev/null
+++ b/conformance/corpus/040_trace_returns_value/expected.out
@@ -0,0 +1,4 @@
+5
+5
+side
+side
diff --git a/conformance/corpus/040_trace_returns_value/meta.json b/conformance/corpus/040_trace_returns_value/meta.json
new file mode 100644
index 0000000..9193a4d
--- /dev/null
+++ b/conformance/corpus/040_trace_returns_value/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "✎ is an expression: prints and returns its operand"}
diff --git a/conformance/corpus/040_trace_returns_value/program.mpl b/conformance/corpus/040_trace_returns_value/program.mpl
new file mode 100644
index 0000000..8c90803
--- /dev/null
+++ b/conformance/corpus/040_trace_returns_value/program.mpl
@@ -0,0 +1,3 @@
+✎(✎ 5);
+v ≜ ✎ "side";
+✎ v;
diff --git a/conformance/corpus/041_asterisk_multiplication/expected.out b/conformance/corpus/041_asterisk_multiplication/expected.out
new file mode 100644
index 0000000..184d152
--- /dev/null
+++ b/conformance/corpus/041_asterisk_multiplication/expected.out
@@ -0,0 +1,2 @@
+12
+5
diff --git a/conformance/corpus/041_asterisk_multiplication/meta.json b/conformance/corpus/041_asterisk_multiplication/meta.json
new file mode 100644
index 0000000..04b12e0
--- /dev/null
+++ b/conformance/corpus/041_asterisk_multiplication/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 19", "notes": "∗ (U+2217) is multiplication, same as ×"}
diff --git a/conformance/corpus/041_asterisk_multiplication/program.mpl b/conformance/corpus/041_asterisk_multiplication/program.mpl
new file mode 100644
index 0000000..9400f9e
--- /dev/null
+++ b/conformance/corpus/041_asterisk_multiplication/program.mpl
@@ -0,0 +1,2 @@
+✎(3 ∗ 4);
+✎(2 ∗ 2.5);
diff --git a/conformance/corpus/042_nested_calls_in_list/expected.out b/conformance/corpus/042_nested_calls_in_list/expected.out
new file mode 100644
index 0000000..0c709c0
--- /dev/null
+++ b/conformance/corpus/042_nested_calls_in_list/expected.out
@@ -0,0 +1 @@
+[11, 12]
diff --git a/conformance/corpus/042_nested_calls_in_list/meta.json b/conformance/corpus/042_nested_calls_in_list/meta.json
new file mode 100644
index 0000000..ecbb513
--- /dev/null
+++ b/conformance/corpus/042_nested_calls_in_list/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "calls inside list literals; λ argument"}
diff --git a/conformance/corpus/042_nested_calls_in_list/program.mpl b/conformance/corpus/042_nested_calls_in_list/program.mpl
new file mode 100644
index 0000000..0f3eb89
--- /dev/null
+++ b/conformance/corpus/042_nested_calls_in_list/program.mpl
@@ -0,0 +1,2 @@
+m ≜ λf: [f(1), f(2)];
+✎ m(λn: n + 10);
diff --git a/conformance/corpus/043_div_zero/expected.err b/conformance/corpus/043_div_zero/expected.err
new file mode 100644
index 0000000..97bc860
--- /dev/null
+++ b/conformance/corpus/043_div_zero/expected.err
@@ -0,0 +1 @@
+err_div0
diff --git a/conformance/corpus/043_div_zero/meta.json b/conformance/corpus/043_div_zero/meta.json
new file mode 100644
index 0000000..b9cea76
--- /dev/null
+++ b/conformance/corpus/043_div_zero/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 1", "notes": "division by zero"}
diff --git a/conformance/corpus/043_div_zero/program.mpl b/conformance/corpus/043_div_zero/program.mpl
new file mode 100644
index 0000000..17c937c
--- /dev/null
+++ b/conformance/corpus/043_div_zero/program.mpl
@@ -0,0 +1 @@
+✎(1 ÷ 0);
diff --git a/conformance/corpus/044_undef/expected.err b/conformance/corpus/044_undef/expected.err
new file mode 100644
index 0000000..b393835
--- /dev/null
+++ b/conformance/corpus/044_undef/expected.err
@@ -0,0 +1 @@
+err_undef
diff --git a/conformance/corpus/044_undef/meta.json b/conformance/corpus/044_undef/meta.json
new file mode 100644
index 0000000..3fe4b5b
--- /dev/null
+++ b/conformance/corpus/044_undef/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "unbound identifier"}
diff --git a/conformance/corpus/044_undef/program.mpl b/conformance/corpus/044_undef/program.mpl
new file mode 100644
index 0000000..2356297
--- /dev/null
+++ b/conformance/corpus/044_undef/program.mpl
@@ -0,0 +1 @@
+✎ nope;
diff --git a/conformance/corpus/045_notfn/expected.err b/conformance/corpus/045_notfn/expected.err
new file mode 100644
index 0000000..bf3ac71
--- /dev/null
+++ b/conformance/corpus/045_notfn/expected.err
@@ -0,0 +1 @@
+err_notfn
diff --git a/conformance/corpus/045_notfn/meta.json b/conformance/corpus/045_notfn/meta.json
new file mode 100644
index 0000000..7d2c6bc
--- /dev/null
+++ b/conformance/corpus/045_notfn/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "calling a non-closure"}
diff --git a/conformance/corpus/045_notfn/program.mpl b/conformance/corpus/045_notfn/program.mpl
new file mode 100644
index 0000000..1f1c9f4
--- /dev/null
+++ b/conformance/corpus/045_notfn/program.mpl
@@ -0,0 +1,2 @@
+x ≜ 5;
+x(1);
diff --git a/conformance/corpus/046_arity_nullary/expected.err b/conformance/corpus/046_arity_nullary/expected.err
new file mode 100644
index 0000000..e6e3387
--- /dev/null
+++ b/conformance/corpus/046_arity_nullary/expected.err
@@ -0,0 +1 @@
+err_arity
diff --git a/conformance/corpus/046_arity_nullary/meta.json b/conformance/corpus/046_arity_nullary/meta.json
new file mode 100644
index 0000000..625fed4
--- /dev/null
+++ b/conformance/corpus/046_arity_nullary/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 18", "notes": "nullary call syntax parses; arity is checked at runtime"}
diff --git a/conformance/corpus/046_arity_nullary/program.mpl b/conformance/corpus/046_arity_nullary/program.mpl
new file mode 100644
index 0000000..c2f612a
--- /dev/null
+++ b/conformance/corpus/046_arity_nullary/program.mpl
@@ -0,0 +1,2 @@
+f ≜ λx: x;
+f();
diff --git a/conformance/corpus/047_arity_extra/expected.err b/conformance/corpus/047_arity_extra/expected.err
new file mode 100644
index 0000000..e6e3387
--- /dev/null
+++ b/conformance/corpus/047_arity_extra/expected.err
@@ -0,0 +1 @@
+err_arity
diff --git a/conformance/corpus/047_arity_extra/meta.json b/conformance/corpus/047_arity_extra/meta.json
new file mode 100644
index 0000000..89f090b
--- /dev/null
+++ b/conformance/corpus/047_arity_extra/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "too many arguments"}
diff --git a/conformance/corpus/047_arity_extra/program.mpl b/conformance/corpus/047_arity_extra/program.mpl
new file mode 100644
index 0000000..234af56
--- /dev/null
+++ b/conformance/corpus/047_arity_extra/program.mpl
@@ -0,0 +1,2 @@
+f ≜ λa: a;
+f(1, 2);
diff --git a/conformance/corpus/048_iter_nonlist/expected.err b/conformance/corpus/048_iter_nonlist/expected.err
new file mode 100644
index 0000000..4b8f125
--- /dev/null
+++ b/conformance/corpus/048_iter_nonlist/expected.err
@@ -0,0 +1 @@
+err_iter
diff --git a/conformance/corpus/048_iter_nonlist/meta.json b/conformance/corpus/048_iter_nonlist/meta.json
new file mode 100644
index 0000000..040ed07
--- /dev/null
+++ b/conformance/corpus/048_iter_nonlist/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "∀ over a non-list"}
diff --git a/conformance/corpus/048_iter_nonlist/program.mpl b/conformance/corpus/048_iter_nonlist/program.mpl
new file mode 100644
index 0000000..b5f964a
--- /dev/null
+++ b/conformance/corpus/048_iter_nonlist/program.mpl
@@ -0,0 +1 @@
+∀ x ∈ 5: x;
diff --git a/conformance/corpus/049_num_bool_plus/expected.err b/conformance/corpus/049_num_bool_plus/expected.err
new file mode 100644
index 0000000..fb9e88e
--- /dev/null
+++ b/conformance/corpus/049_num_bool_plus/expected.err
@@ -0,0 +1 @@
+err_num
diff --git a/conformance/corpus/049_num_bool_plus/meta.json b/conformance/corpus/049_num_bool_plus/meta.json
new file mode 100644
index 0000000..641d2e5
--- /dev/null
+++ b/conformance/corpus/049_num_bool_plus/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "numeric + with a non-number, non-string operand"}
diff --git a/conformance/corpus/049_num_bool_plus/program.mpl b/conformance/corpus/049_num_bool_plus/program.mpl
new file mode 100644
index 0000000..7e2d989
--- /dev/null
+++ b/conformance/corpus/049_num_bool_plus/program.mpl
@@ -0,0 +1 @@
+✎(true + 1);
diff --git a/conformance/corpus/050_num_string_minus/expected.err b/conformance/corpus/050_num_string_minus/expected.err
new file mode 100644
index 0000000..fb9e88e
--- /dev/null
+++ b/conformance/corpus/050_num_string_minus/expected.err
@@ -0,0 +1 @@
+err_num
diff --git a/conformance/corpus/050_num_string_minus/meta.json b/conformance/corpus/050_num_string_minus/meta.json
new file mode 100644
index 0000000..cad2f48
--- /dev/null
+++ b/conformance/corpus/050_num_string_minus/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "- is numeric only, no string analog"}
diff --git a/conformance/corpus/050_num_string_minus/program.mpl b/conformance/corpus/050_num_string_minus/program.mpl
new file mode 100644
index 0000000..7a45f92
--- /dev/null
+++ b/conformance/corpus/050_num_string_minus/program.mpl
@@ -0,0 +1 @@
+✎("a" - "b");
diff --git a/conformance/corpus/051_neg_string/expected.err b/conformance/corpus/051_neg_string/expected.err
new file mode 100644
index 0000000..fb9e88e
--- /dev/null
+++ b/conformance/corpus/051_neg_string/expected.err
@@ -0,0 +1 @@
+err_num
diff --git a/conformance/corpus/051_neg_string/meta.json b/conformance/corpus/051_neg_string/meta.json
new file mode 100644
index 0000000..7ae8b0f
--- /dev/null
+++ b/conformance/corpus/051_neg_string/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "unary minus is numeric only"}
diff --git a/conformance/corpus/051_neg_string/program.mpl b/conformance/corpus/051_neg_string/program.mpl
new file mode 100644
index 0000000..3f60494
--- /dev/null
+++ b/conformance/corpus/051_neg_string/program.mpl
@@ -0,0 +1 @@
+✎(-"a");
diff --git a/conformance/corpus/052_bot_arith/expected.err b/conformance/corpus/052_bot_arith/expected.err
new file mode 100644
index 0000000..fb9e88e
--- /dev/null
+++ b/conformance/corpus/052_bot_arith/expected.err
@@ -0,0 +1 @@
+err_num
diff --git a/conformance/corpus/052_bot_arith/meta.json b/conformance/corpus/052_bot_arith/meta.json
new file mode 100644
index 0000000..397b1f0
--- /dev/null
+++ b/conformance/corpus/052_bot_arith/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 6", "notes": "arithmetic on ⊥"}
diff --git a/conformance/corpus/052_bot_arith/program.mpl b/conformance/corpus/052_bot_arith/program.mpl
new file mode 100644
index 0000000..0d89c15
--- /dev/null
+++ b/conformance/corpus/052_bot_arith/program.mpl
@@ -0,0 +1 @@
+✎(⊥ + 1);
diff --git a/conformance/corpus/054_reject_underscore_ident/expected.err b/conformance/corpus/054_reject_underscore_ident/expected.err
new file mode 100644
index 0000000..7cb868b
--- /dev/null
+++ b/conformance/corpus/054_reject_underscore_ident/expected.err
@@ -0,0 +1 @@
+err_char
diff --git a/conformance/corpus/054_reject_underscore_ident/meta.json b/conformance/corpus/054_reject_underscore_ident/meta.json
new file mode 100644
index 0000000..b688d0d
--- /dev/null
+++ b/conformance/corpus/054_reject_underscore_ident/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "identifiers may not start with _"}
diff --git a/conformance/corpus/054_reject_underscore_ident/program.mpl b/conformance/corpus/054_reject_underscore_ident/program.mpl
new file mode 100644
index 0000000..d724212
--- /dev/null
+++ b/conformance/corpus/054_reject_underscore_ident/program.mpl
@@ -0,0 +1 @@
+_x ← 1;
diff --git a/conformance/corpus/055_reject_juxtaposition/expected.err b/conformance/corpus/055_reject_juxtaposition/expected.err
new file mode 100644
index 0000000..67ce62a
--- /dev/null
+++ b/conformance/corpus/055_reject_juxtaposition/expected.err
@@ -0,0 +1 @@
+err_expect
diff --git a/conformance/corpus/055_reject_juxtaposition/meta.json b/conformance/corpus/055_reject_juxtaposition/meta.json
new file mode 100644
index 0000000..fb323e0
--- /dev/null
+++ b/conformance/corpus/055_reject_juxtaposition/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "juxtaposition call f x is not a call syntax"}
diff --git a/conformance/corpus/055_reject_juxtaposition/program.mpl b/conformance/corpus/055_reject_juxtaposition/program.mpl
new file mode 100644
index 0000000..d30f1d7
--- /dev/null
+++ b/conformance/corpus/055_reject_juxtaposition/program.mpl
@@ -0,0 +1,2 @@
+f ≜ λn: n;
+f 5;
diff --git a/conformance/corpus/056_reject_ternary/expected.err b/conformance/corpus/056_reject_ternary/expected.err
new file mode 100644
index 0000000..7cb868b
--- /dev/null
+++ b/conformance/corpus/056_reject_ternary/expected.err
@@ -0,0 +1 @@
+err_char
diff --git a/conformance/corpus/056_reject_ternary/meta.json b/conformance/corpus/056_reject_ternary/meta.json
new file mode 100644
index 0000000..eefb421
--- /dev/null
+++ b/conformance/corpus/056_reject_ternary/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "no ternary; conditionals are guarded alternatives"}
diff --git a/conformance/corpus/056_reject_ternary/program.mpl b/conformance/corpus/056_reject_ternary/program.mpl
new file mode 100644
index 0000000..f23b8af
--- /dev/null
+++ b/conformance/corpus/056_reject_ternary/program.mpl
@@ -0,0 +1,2 @@
+x ≜ true;
+✎(x ? 1 : 0);
diff --git a/conformance/corpus/057_reject_output_emoji/expected.err b/conformance/corpus/057_reject_output_emoji/expected.err
new file mode 100644
index 0000000..7cb868b
--- /dev/null
+++ b/conformance/corpus/057_reject_output_emoji/expected.err
@@ -0,0 +1 @@
+err_char
diff --git a/conformance/corpus/057_reject_output_emoji/meta.json b/conformance/corpus/057_reject_output_emoji/meta.json
new file mode 100644
index 0000000..9e784fb
--- /dev/null
+++ b/conformance/corpus/057_reject_output_emoji/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "output is ✎ only"}
diff --git a/conformance/corpus/057_reject_output_emoji/program.mpl b/conformance/corpus/057_reject_output_emoji/program.mpl
new file mode 100644
index 0000000..2830c94
--- /dev/null
+++ b/conformance/corpus/057_reject_output_emoji/program.mpl
@@ -0,0 +1 @@
+📤 "hi";
diff --git a/conformance/corpus/058_reject_unterminated_string/expected.err b/conformance/corpus/058_reject_unterminated_string/expected.err
new file mode 100644
index 0000000..9194637
--- /dev/null
+++ b/conformance/corpus/058_reject_unterminated_string/expected.err
@@ -0,0 +1 @@
+err_string
diff --git a/conformance/corpus/058_reject_unterminated_string/meta.json b/conformance/corpus/058_reject_unterminated_string/meta.json
new file mode 100644
index 0000000..684e056
--- /dev/null
+++ b/conformance/corpus/058_reject_unterminated_string/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "unterminated string literal"}
diff --git a/conformance/corpus/058_reject_unterminated_string/program.mpl b/conformance/corpus/058_reject_unterminated_string/program.mpl
new file mode 100644
index 0000000..2013e6c
--- /dev/null
+++ b/conformance/corpus/058_reject_unterminated_string/program.mpl
@@ -0,0 +1 @@
+✎ "abc;
diff --git a/conformance/corpus/059_reject_unknown_escape/expected.err b/conformance/corpus/059_reject_unknown_escape/expected.err
new file mode 100644
index 0000000..1955119
--- /dev/null
+++ b/conformance/corpus/059_reject_unknown_escape/expected.err
@@ -0,0 +1 @@
+err_escape
diff --git a/conformance/corpus/059_reject_unknown_escape/meta.json b/conformance/corpus/059_reject_unknown_escape/meta.json
new file mode 100644
index 0000000..7e8f326
--- /dev/null
+++ b/conformance/corpus/059_reject_unknown_escape/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "unknown ASCII escape word"}
diff --git a/conformance/corpus/059_reject_unknown_escape/program.mpl b/conformance/corpus/059_reject_unknown_escape/program.mpl
new file mode 100644
index 0000000..1978605
--- /dev/null
+++ b/conformance/corpus/059_reject_unknown_escape/program.mpl
@@ -0,0 +1 @@
+\foo 1;
diff --git a/conformance/corpus/060_reject_unmatched_brace/expected.err b/conformance/corpus/060_reject_unmatched_brace/expected.err
new file mode 100644
index 0000000..67ce62a
--- /dev/null
+++ b/conformance/corpus/060_reject_unmatched_brace/expected.err
@@ -0,0 +1 @@
+err_expect
diff --git a/conformance/corpus/060_reject_unmatched_brace/meta.json b/conformance/corpus/060_reject_unmatched_brace/meta.json
new file mode 100644
index 0000000..b12a2e8
--- /dev/null
+++ b/conformance/corpus/060_reject_unmatched_brace/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "unclosed brace"}
diff --git a/conformance/corpus/060_reject_unmatched_brace/program.mpl b/conformance/corpus/060_reject_unmatched_brace/program.mpl
new file mode 100644
index 0000000..9f1d2fc
--- /dev/null
+++ b/conformance/corpus/060_reject_unmatched_brace/program.mpl
@@ -0,0 +1 @@
+{1; 2;
diff --git a/conformance/corpus/061_reject_unterminated_comment/expected.err b/conformance/corpus/061_reject_unterminated_comment/expected.err
new file mode 100644
index 0000000..67ce62a
--- /dev/null
+++ b/conformance/corpus/061_reject_unterminated_comment/expected.err
@@ -0,0 +1 @@
+err_expect
diff --git a/conformance/corpus/061_reject_unterminated_comment/meta.json b/conformance/corpus/061_reject_unterminated_comment/meta.json
new file mode 100644
index 0000000..902898d
--- /dev/null
+++ b/conformance/corpus/061_reject_unterminated_comment/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "unterminated block comment: '{-' without a matching '-}' is not a comment token, so the brace lexes bare and the program fails to parse (matches the grammar's MULTILINE_COMMENT)"}
diff --git a/conformance/corpus/061_reject_unterminated_comment/program.mpl b/conformance/corpus/061_reject_unterminated_comment/program.mpl
new file mode 100644
index 0000000..dc5ec5a
--- /dev/null
+++ b/conformance/corpus/061_reject_unterminated_comment/program.mpl
@@ -0,0 +1,2 @@
+{- never closed
+✎ 1;
diff --git a/conformance/corpus/062_reject_sum_token/expected.err b/conformance/corpus/062_reject_sum_token/expected.err
new file mode 100644
index 0000000..7cb868b
--- /dev/null
+++ b/conformance/corpus/062_reject_sum_token/expected.err
@@ -0,0 +1 @@
+err_char
diff --git a/conformance/corpus/062_reject_sum_token/meta.json b/conformance/corpus/062_reject_sum_token/meta.json
new file mode 100644
index 0000000..145e892
--- /dev/null
+++ b/conformance/corpus/062_reject_sum_token/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "∑ is M1, not a token"}
diff --git a/conformance/corpus/062_reject_sum_token/program.mpl b/conformance/corpus/062_reject_sum_token/program.mpl
new file mode 100644
index 0000000..3d2e592
--- /dev/null
+++ b/conformance/corpus/062_reject_sum_token/program.mpl
@@ -0,0 +1 @@
+✎(∑ [1, 2]);
diff --git a/conformance/corpus/063_reject_sqrt_token/expected.err b/conformance/corpus/063_reject_sqrt_token/expected.err
new file mode 100644
index 0000000..7cb868b
--- /dev/null
+++ b/conformance/corpus/063_reject_sqrt_token/expected.err
@@ -0,0 +1 @@
+err_char
diff --git a/conformance/corpus/063_reject_sqrt_token/meta.json b/conformance/corpus/063_reject_sqrt_token/meta.json
new file mode 100644
index 0000000..216ddc8
--- /dev/null
+++ b/conformance/corpus/063_reject_sqrt_token/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "√ is M1, not a token"}
diff --git a/conformance/corpus/063_reject_sqrt_token/program.mpl b/conformance/corpus/063_reject_sqrt_token/program.mpl
new file mode 100644
index 0000000..135f6e8
--- /dev/null
+++ b/conformance/corpus/063_reject_sqrt_token/program.mpl
@@ -0,0 +1 @@
+✎(√4);
diff --git a/conformance/corpus/064_reject_modulo/expected.err b/conformance/corpus/064_reject_modulo/expected.err
new file mode 100644
index 0000000..7cb868b
--- /dev/null
+++ b/conformance/corpus/064_reject_modulo/expected.err
@@ -0,0 +1 @@
+err_char
diff --git a/conformance/corpus/064_reject_modulo/meta.json b/conformance/corpus/064_reject_modulo/meta.json
new file mode 100644
index 0000000..0ee355f
--- /dev/null
+++ b/conformance/corpus/064_reject_modulo/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "% is M1, not a token"}
diff --git a/conformance/corpus/064_reject_modulo/program.mpl b/conformance/corpus/064_reject_modulo/program.mpl
new file mode 100644
index 0000000..a1c6840
--- /dev/null
+++ b/conformance/corpus/064_reject_modulo/program.mpl
@@ -0,0 +1 @@
+✎(5 % 2);
diff --git a/conformance/corpus/065_reject_range/expected.err b/conformance/corpus/065_reject_range/expected.err
new file mode 100644
index 0000000..7cb868b
--- /dev/null
+++ b/conformance/corpus/065_reject_range/expected.err
@@ -0,0 +1 @@
+err_char
diff --git a/conformance/corpus/065_reject_range/meta.json b/conformance/corpus/065_reject_range/meta.json
new file mode 100644
index 0000000..aab0034
--- /dev/null
+++ b/conformance/corpus/065_reject_range/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "range syntax [a..b] is M1"}
diff --git a/conformance/corpus/065_reject_range/program.mpl b/conformance/corpus/065_reject_range/program.mpl
new file mode 100644
index 0000000..0e82c2d
--- /dev/null
+++ b/conformance/corpus/065_reject_range/program.mpl
@@ -0,0 +1 @@
+✎ [1..5];
diff --git a/conformance/corpus/066_reject_not_token/expected.err b/conformance/corpus/066_reject_not_token/expected.err
new file mode 100644
index 0000000..7cb868b
--- /dev/null
+++ b/conformance/corpus/066_reject_not_token/expected.err
@@ -0,0 +1 @@
+err_char
diff --git a/conformance/corpus/066_reject_not_token/meta.json b/conformance/corpus/066_reject_not_token/meta.json
new file mode 100644
index 0000000..b5c2708
--- /dev/null
+++ b/conformance/corpus/066_reject_not_token/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09 (Stage 3 batch — behavior blessed as observed; no single ruling)", "notes": "¬ is M1, not a token"}
diff --git a/conformance/corpus/066_reject_not_token/program.mpl b/conformance/corpus/066_reject_not_token/program.mpl
new file mode 100644
index 0000000..94e0b71
--- /dev/null
+++ b/conformance/corpus/066_reject_not_token/program.mpl
@@ -0,0 +1 @@
+✎(¬true);
diff --git a/conformance/corpus/067_empty_program/expected.out b/conformance/corpus/067_empty_program/expected.out
new file mode 100644
index 0000000..e69de29
diff --git a/conformance/corpus/067_empty_program/meta.json b/conformance/corpus/067_empty_program/meta.json
new file mode 100644
index 0000000..c8ce59d
--- /dev/null
+++ b/conformance/corpus/067_empty_program/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 20", "notes": "ruling 20: the empty program is valid and silent"}
diff --git a/conformance/corpus/067_empty_program/program.mpl b/conformance/corpus/067_empty_program/program.mpl
new file mode 100644
index 0000000..e69de29
diff --git a/conformance/corpus/068_paren_sequence/expected.out b/conformance/corpus/068_paren_sequence/expected.out
new file mode 100644
index 0000000..2b24e31
--- /dev/null
+++ b/conformance/corpus/068_paren_sequence/expected.out
@@ -0,0 +1,2 @@
+2
+6
diff --git a/conformance/corpus/068_paren_sequence/meta.json b/conformance/corpus/068_paren_sequence/meta.json
new file mode 100644
index 0000000..6c1d00f
--- /dev/null
+++ b/conformance/corpus/068_paren_sequence/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 21", "notes": "ruling 21: parentheses contain one seqExpr"}
diff --git a/conformance/corpus/068_paren_sequence/program.mpl b/conformance/corpus/068_paren_sequence/program.mpl
new file mode 100644
index 0000000..0c15abc
--- /dev/null
+++ b/conformance/corpus/068_paren_sequence/program.mpl
@@ -0,0 +1,2 @@
+✎((1; 2));
+✎((x ≜ 5; x + 1));
diff --git a/conformance/corpus/069_compose_apply/expected.out b/conformance/corpus/069_compose_apply/expected.out
new file mode 100644
index 0000000..ce2e38b
--- /dev/null
+++ b/conformance/corpus/069_compose_apply/expected.out
@@ -0,0 +1,2 @@
+7
+9
diff --git a/conformance/corpus/069_compose_apply/meta.json b/conformance/corpus/069_compose_apply/meta.json
new file mode 100644
index 0000000..776e8ad
--- /dev/null
+++ b/conformance/corpus/069_compose_apply/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 22", "notes": "ruling 22: (f ∘ g)(x) = f(g(x)); binds tighter than ×"}
diff --git a/conformance/corpus/069_compose_apply/program.mpl b/conformance/corpus/069_compose_apply/program.mpl
new file mode 100644
index 0000000..2d9279b
--- /dev/null
+++ b/conformance/corpus/069_compose_apply/program.mpl
@@ -0,0 +1,4 @@
+f ≜ λx: x + 1;
+g ≜ λx: x × 2;
+✎((f ∘ g)(3));
+✎((f ∘ g)(1) × 3);
diff --git a/conformance/corpus/070_compose_assoc/expected.out b/conformance/corpus/070_compose_assoc/expected.out
new file mode 100644
index 0000000..d2de525
--- /dev/null
+++ b/conformance/corpus/070_compose_assoc/expected.out
@@ -0,0 +1,2 @@
+15
+15
diff --git a/conformance/corpus/070_compose_assoc/meta.json b/conformance/corpus/070_compose_assoc/meta.json
new file mode 100644
index 0000000..9302d24
--- /dev/null
+++ b/conformance/corpus/070_compose_assoc/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 22", "notes": "ruling 22: composition associates"}
diff --git a/conformance/corpus/070_compose_assoc/program.mpl b/conformance/corpus/070_compose_assoc/program.mpl
new file mode 100644
index 0000000..a85b16c
--- /dev/null
+++ b/conformance/corpus/070_compose_assoc/program.mpl
@@ -0,0 +1,5 @@
+f ≜ λx: x + 1;
+g ≜ λx: x × 2;
+h ≜ λx: x - 3;
+✎(((f ∘ g) ∘ h)(10));
+✎((f ∘ (g ∘ h))(10));
diff --git a/conformance/corpus/071_compose_nonfn/expected.err b/conformance/corpus/071_compose_nonfn/expected.err
new file mode 100644
index 0000000..bf3ac71
--- /dev/null
+++ b/conformance/corpus/071_compose_nonfn/expected.err
@@ -0,0 +1 @@
+err_notfn
diff --git a/conformance/corpus/071_compose_nonfn/meta.json b/conformance/corpus/071_compose_nonfn/meta.json
new file mode 100644
index 0000000..d3ff903
--- /dev/null
+++ b/conformance/corpus/071_compose_nonfn/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 22", "notes": "ruling 22: non-function ∘ operand"}
diff --git a/conformance/corpus/071_compose_nonfn/program.mpl b/conformance/corpus/071_compose_nonfn/program.mpl
new file mode 100644
index 0000000..ec6d22a
--- /dev/null
+++ b/conformance/corpus/071_compose_nonfn/program.mpl
@@ -0,0 +1 @@
+✎((1 ∘ 2)(3));
diff --git a/conformance/corpus/072_set_literal_notyet/expected.err b/conformance/corpus/072_set_literal_notyet/expected.err
new file mode 100644
index 0000000..725d793
--- /dev/null
+++ b/conformance/corpus/072_set_literal_notyet/expected.err
@@ -0,0 +1 @@
+err_notyet
diff --git a/conformance/corpus/072_set_literal_notyet/meta.json b/conformance/corpus/072_set_literal_notyet/meta.json
new file mode 100644
index 0000000..d7712ff
--- /dev/null
+++ b/conformance/corpus/072_set_literal_notyet/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 23", "notes": "ruling 23: sets parse, evaluation is M1"}
diff --git a/conformance/corpus/072_set_literal_notyet/program.mpl b/conformance/corpus/072_set_literal_notyet/program.mpl
new file mode 100644
index 0000000..1a6a9e4
--- /dev/null
+++ b/conformance/corpus/072_set_literal_notyet/program.mpl
@@ -0,0 +1 @@
+{1, 2};
diff --git a/conformance/corpus/073_record_literal_notyet/expected.err b/conformance/corpus/073_record_literal_notyet/expected.err
new file mode 100644
index 0000000..725d793
--- /dev/null
+++ b/conformance/corpus/073_record_literal_notyet/expected.err
@@ -0,0 +1 @@
+err_notyet
diff --git a/conformance/corpus/073_record_literal_notyet/meta.json b/conformance/corpus/073_record_literal_notyet/meta.json
new file mode 100644
index 0000000..bb00186
--- /dev/null
+++ b/conformance/corpus/073_record_literal_notyet/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 24", "notes": "ruling 24: records parse, evaluation is M1"}
diff --git a/conformance/corpus/073_record_literal_notyet/program.mpl b/conformance/corpus/073_record_literal_notyet/program.mpl
new file mode 100644
index 0000000..2443022
--- /dev/null
+++ b/conformance/corpus/073_record_literal_notyet/program.mpl
@@ -0,0 +1 @@
+{k: 1};
diff --git a/conformance/corpus/074_nullary_lambda/expected.out b/conformance/corpus/074_nullary_lambda/expected.out
new file mode 100644
index 0000000..d81cc07
--- /dev/null
+++ b/conformance/corpus/074_nullary_lambda/expected.out
@@ -0,0 +1 @@
+42
diff --git a/conformance/corpus/074_nullary_lambda/meta.json b/conformance/corpus/074_nullary_lambda/meta.json
new file mode 100644
index 0000000..1eeb84b
--- /dev/null
+++ b/conformance/corpus/074_nullary_lambda/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 18", "notes": "ruling 18: nullary λ with bare colon"}
diff --git a/conformance/corpus/074_nullary_lambda/program.mpl b/conformance/corpus/074_nullary_lambda/program.mpl
new file mode 100644
index 0000000..0d8a180
--- /dev/null
+++ b/conformance/corpus/074_nullary_lambda/program.mpl
@@ -0,0 +1,2 @@
+f ≜ λ: 41 + 1;
+✎ f();
diff --git a/conformance/corpus/075_redef/expected.err b/conformance/corpus/075_redef/expected.err
new file mode 100644
index 0000000..31a328b
--- /dev/null
+++ b/conformance/corpus/075_redef/expected.err
@@ -0,0 +1 @@
+err_redef
diff --git a/conformance/corpus/075_redef/meta.json b/conformance/corpus/075_redef/meta.json
new file mode 100644
index 0000000..1cf0c7d
--- /dev/null
+++ b/conformance/corpus/075_redef/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 16", "notes": "ruling 16: same-scope redefinition"}
diff --git a/conformance/corpus/075_redef/program.mpl b/conformance/corpus/075_redef/program.mpl
new file mode 100644
index 0000000..3ac295c
--- /dev/null
+++ b/conformance/corpus/075_redef/program.mpl
@@ -0,0 +1,2 @@
+x ≜ 1;
+x ≜ 2;
diff --git a/conformance/corpus/076_shadowing/expected.out b/conformance/corpus/076_shadowing/expected.out
new file mode 100644
index 0000000..af74fdc
--- /dev/null
+++ b/conformance/corpus/076_shadowing/expected.out
@@ -0,0 +1,2 @@
+5
+1
diff --git a/conformance/corpus/076_shadowing/meta.json b/conformance/corpus/076_shadowing/meta.json
new file mode 100644
index 0000000..495c6c8
--- /dev/null
+++ b/conformance/corpus/076_shadowing/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 15 and 16", "notes": "ruling 16: inner-scope shadowing is legal"}
diff --git a/conformance/corpus/076_shadowing/program.mpl b/conformance/corpus/076_shadowing/program.mpl
new file mode 100644
index 0000000..1f7a830
--- /dev/null
+++ b/conformance/corpus/076_shadowing/program.mpl
@@ -0,0 +1,4 @@
+x ≜ 1;
+f ≜ λy: (x ≜ 5; x + y);
+✎ f(0);
+✎ x;
diff --git a/conformance/corpus/077_unbound_assign/expected.err b/conformance/corpus/077_unbound_assign/expected.err
new file mode 100644
index 0000000..ac4770b
--- /dev/null
+++ b/conformance/corpus/077_unbound_assign/expected.err
@@ -0,0 +1 @@
+err_unbound
diff --git a/conformance/corpus/077_unbound_assign/meta.json b/conformance/corpus/077_unbound_assign/meta.json
new file mode 100644
index 0000000..cf969e3
--- /dev/null
+++ b/conformance/corpus/077_unbound_assign/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 16", "notes": "ruling 16: ← needs an existing binding"}
diff --git a/conformance/corpus/077_unbound_assign/program.mpl b/conformance/corpus/077_unbound_assign/program.mpl
new file mode 100644
index 0000000..29780f5
--- /dev/null
+++ b/conformance/corpus/077_unbound_assign/program.mpl
@@ -0,0 +1 @@
+y ← 1;
diff --git a/conformance/corpus/078_bool_logic/expected.err b/conformance/corpus/078_bool_logic/expected.err
new file mode 100644
index 0000000..844c88e
--- /dev/null
+++ b/conformance/corpus/078_bool_logic/expected.err
@@ -0,0 +1 @@
+err_bool
diff --git a/conformance/corpus/078_bool_logic/meta.json b/conformance/corpus/078_bool_logic/meta.json
new file mode 100644
index 0000000..4a40444
--- /dev/null
+++ b/conformance/corpus/078_bool_logic/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 14", "notes": "ruling 14: ∧ ∨ demand boolean operands"}
diff --git a/conformance/corpus/078_bool_logic/program.mpl b/conformance/corpus/078_bool_logic/program.mpl
new file mode 100644
index 0000000..6ced309
--- /dev/null
+++ b/conformance/corpus/078_bool_logic/program.mpl
@@ -0,0 +1 @@
+✎(1 ∧ true);
diff --git a/conformance/corpus/079_short_circuit_safe/expected.out b/conformance/corpus/079_short_circuit_safe/expected.out
new file mode 100644
index 0000000..1d474d5
--- /dev/null
+++ b/conformance/corpus/079_short_circuit_safe/expected.out
@@ -0,0 +1,2 @@
+false
+true
diff --git a/conformance/corpus/079_short_circuit_safe/meta.json b/conformance/corpus/079_short_circuit_safe/meta.json
new file mode 100644
index 0000000..6315a01
--- /dev/null
+++ b/conformance/corpus/079_short_circuit_safe/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 14", "notes": "ruling 14: short-circuit — unevaluated operand raises nothing"}
diff --git a/conformance/corpus/079_short_circuit_safe/program.mpl b/conformance/corpus/079_short_circuit_safe/program.mpl
new file mode 100644
index 0000000..0922070
--- /dev/null
+++ b/conformance/corpus/079_short_circuit_safe/program.mpl
@@ -0,0 +1,2 @@
+✎(false ∧ (1 ÷ 0));
+✎(true ∨ (1 ÷ 0));
diff --git a/conformance/corpus/080_depth_limit/expected.err b/conformance/corpus/080_depth_limit/expected.err
new file mode 100644
index 0000000..ee74d8e
--- /dev/null
+++ b/conformance/corpus/080_depth_limit/expected.err
@@ -0,0 +1 @@
+err_depth
diff --git a/conformance/corpus/080_depth_limit/meta.json b/conformance/corpus/080_depth_limit/meta.json
new file mode 100644
index 0000000..9eb157e
--- /dev/null
+++ b/conformance/corpus/080_depth_limit/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 10", "notes": "ruling 10: λ-application depth limit 10000"}
diff --git a/conformance/corpus/080_depth_limit/program.mpl b/conformance/corpus/080_depth_limit/program.mpl
new file mode 100644
index 0000000..9821b75
--- /dev/null
+++ b/conformance/corpus/080_depth_limit/program.mpl
@@ -0,0 +1,2 @@
+loop ≜ λn: loop(n + 1);
+loop(0);
diff --git a/conformance/corpus/081_depth_headroom/expected.out b/conformance/corpus/081_depth_headroom/expected.out
new file mode 100644
index 0000000..d58c55a
--- /dev/null
+++ b/conformance/corpus/081_depth_headroom/expected.out
@@ -0,0 +1 @@
+9000
diff --git a/conformance/corpus/081_depth_headroom/meta.json b/conformance/corpus/081_depth_headroom/meta.json
new file mode 100644
index 0000000..9c8f97a
--- /dev/null
+++ b/conformance/corpus/081_depth_headroom/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 10", "notes": "ruling 10: depth 9000 works — the limit is real headroom"}
diff --git a/conformance/corpus/081_depth_headroom/program.mpl b/conformance/corpus/081_depth_headroom/program.mpl
new file mode 100644
index 0000000..6c8f6f4
--- /dev/null
+++ b/conformance/corpus/081_depth_headroom/program.mpl
@@ -0,0 +1,2 @@
+sum ≜ λn: (n = 0 ⟹ 0) | (1 + sum(n - 1));
+✎ sum(9000);
diff --git a/conformance/corpus/082_fn_equality/expected.err b/conformance/corpus/082_fn_equality/expected.err
new file mode 100644
index 0000000..9c7eb15
--- /dev/null
+++ b/conformance/corpus/082_fn_equality/expected.err
@@ -0,0 +1 @@
+err_fn_eq
diff --git a/conformance/corpus/082_fn_equality/meta.json b/conformance/corpus/082_fn_equality/meta.json
new file mode 100644
index 0000000..5948bd3
--- /dev/null
+++ b/conformance/corpus/082_fn_equality/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 7", "notes": "ruling 7: function equality is err_fn_eq"}
diff --git a/conformance/corpus/082_fn_equality/program.mpl b/conformance/corpus/082_fn_equality/program.mpl
new file mode 100644
index 0000000..5e4b513
--- /dev/null
+++ b/conformance/corpus/082_fn_equality/program.mpl
@@ -0,0 +1 @@
+✎((λx: x) = (λx: x));
diff --git a/conformance/corpus/083_fn_equality_mixed/expected.err b/conformance/corpus/083_fn_equality_mixed/expected.err
new file mode 100644
index 0000000..9c7eb15
--- /dev/null
+++ b/conformance/corpus/083_fn_equality_mixed/expected.err
@@ -0,0 +1 @@
+err_fn_eq
diff --git a/conformance/corpus/083_fn_equality_mixed/meta.json b/conformance/corpus/083_fn_equality_mixed/meta.json
new file mode 100644
index 0000000..5c5d3a2
--- /dev/null
+++ b/conformance/corpus/083_fn_equality_mixed/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 7", "notes": "ruling 7: any equality involving a function"}
diff --git a/conformance/corpus/083_fn_equality_mixed/program.mpl b/conformance/corpus/083_fn_equality_mixed/program.mpl
new file mode 100644
index 0000000..ce28cf3
--- /dev/null
+++ b/conformance/corpus/083_fn_equality_mixed/program.mpl
@@ -0,0 +1,2 @@
+f ≜ λx: x;
+✎(f = 1);
diff --git a/conformance/corpus/084_rational_display/expected.out b/conformance/corpus/084_rational_display/expected.out
new file mode 100644
index 0000000..00c1d2e
--- /dev/null
+++ b/conformance/corpus/084_rational_display/expected.out
@@ -0,0 +1,5 @@
+3/10
+-1/2
+1/2
+1/2
+0
diff --git a/conformance/corpus/084_rational_display/meta.json b/conformance/corpus/084_rational_display/meta.json
new file mode 100644
index 0000000..4122031
--- /dev/null
+++ b/conformance/corpus/084_rational_display/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 4", "notes": "ruling 4: lowest-terms display, sign on numerator, zero as 0"}
diff --git a/conformance/corpus/084_rational_display/program.mpl b/conformance/corpus/084_rational_display/program.mpl
new file mode 100644
index 0000000..fa5785d
--- /dev/null
+++ b/conformance/corpus/084_rational_display/program.mpl
@@ -0,0 +1,5 @@
+✎(0.1 + 0.2);
+✎(-1 ÷ 2);
+✎(1 ÷ 3 + 1 ÷ 6);
+✎(2 ÷ 4);
+✎(0 ÷ 5);
diff --git a/conformance/corpus/085_rational_eq/expected.out b/conformance/corpus/085_rational_eq/expected.out
new file mode 100644
index 0000000..bb101b6
--- /dev/null
+++ b/conformance/corpus/085_rational_eq/expected.out
@@ -0,0 +1,2 @@
+true
+true
diff --git a/conformance/corpus/085_rational_eq/meta.json b/conformance/corpus/085_rational_eq/meta.json
new file mode 100644
index 0000000..7512475
--- /dev/null
+++ b/conformance/corpus/085_rational_eq/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 4 and 7", "notes": "rulings 4 and 7: same rational, one value"}
diff --git a/conformance/corpus/085_rational_eq/program.mpl b/conformance/corpus/085_rational_eq/program.mpl
new file mode 100644
index 0000000..a59f344
--- /dev/null
+++ b/conformance/corpus/085_rational_eq/program.mpl
@@ -0,0 +1,2 @@
+✎(0.5 = 1 ÷ 2);
+✎(1 ÷ 3 = 2 ÷ 6);
diff --git a/conformance/corpus/086_rational_roundtrip/expected.out b/conformance/corpus/086_rational_roundtrip/expected.out
new file mode 100644
index 0000000..0e1918e
--- /dev/null
+++ b/conformance/corpus/086_rational_roundtrip/expected.out
@@ -0,0 +1,2 @@
+true
+3/10
diff --git a/conformance/corpus/086_rational_roundtrip/meta.json b/conformance/corpus/086_rational_roundtrip/meta.json
new file mode 100644
index 0000000..ebbd4af
--- /dev/null
+++ b/conformance/corpus/086_rational_roundtrip/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 4", "notes": "ruling 4: display re-evaluates to the same value"}
diff --git a/conformance/corpus/086_rational_roundtrip/program.mpl b/conformance/corpus/086_rational_roundtrip/program.mpl
new file mode 100644
index 0000000..3194210
--- /dev/null
+++ b/conformance/corpus/086_rational_roundtrip/program.mpl
@@ -0,0 +1,3 @@
+x ≜ 3 ÷ 10;
+✎(x = 0.3);
+✎ x;
diff --git a/conformance/corpus/087_greek_identifiers/expected.out b/conformance/corpus/087_greek_identifiers/expected.out
new file mode 100644
index 0000000..cfbeb15
--- /dev/null
+++ b/conformance/corpus/087_greek_identifiers/expected.out
@@ -0,0 +1,2 @@
+4
+6
diff --git a/conformance/corpus/087_greek_identifiers/meta.json b/conformance/corpus/087_greek_identifiers/meta.json
new file mode 100644
index 0000000..c089948
--- /dev/null
+++ b/conformance/corpus/087_greek_identifiers/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 26", "notes": "ruling 26: Greek letters are identifiers (λ is not)"}
diff --git a/conformance/corpus/087_greek_identifiers/program.mpl b/conformance/corpus/087_greek_identifiers/program.mpl
new file mode 100644
index 0000000..09ed01e
--- /dev/null
+++ b/conformance/corpus/087_greek_identifiers/program.mpl
@@ -0,0 +1,4 @@
+π ≜ 3;
+✎(π + 1);
+ρ ≜ π × 2;
+✎ ρ;
diff --git a/conformance/corpus/088_reject_paren_lambda/expected.err b/conformance/corpus/088_reject_paren_lambda/expected.err
new file mode 100644
index 0000000..67ce62a
--- /dev/null
+++ b/conformance/corpus/088_reject_paren_lambda/expected.err
@@ -0,0 +1 @@
+err_expect
diff --git a/conformance/corpus/088_reject_paren_lambda/meta.json b/conformance/corpus/088_reject_paren_lambda/meta.json
new file mode 100644
index 0000000..1baa320
--- /dev/null
+++ b/conformance/corpus/088_reject_paren_lambda/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 25", "notes": "ruling 25: parenthesized λ parameters rejected"}
diff --git a/conformance/corpus/088_reject_paren_lambda/program.mpl b/conformance/corpus/088_reject_paren_lambda/program.mpl
new file mode 100644
index 0000000..5b4108d
--- /dev/null
+++ b/conformance/corpus/088_reject_paren_lambda/program.mpl
@@ -0,0 +1 @@
+f ≜ λ(a, b): a;
diff --git a/conformance/corpus/089_reject_bare_lambda/expected.err b/conformance/corpus/089_reject_bare_lambda/expected.err
new file mode 100644
index 0000000..67ce62a
--- /dev/null
+++ b/conformance/corpus/089_reject_bare_lambda/expected.err
@@ -0,0 +1 @@
+err_expect
diff --git a/conformance/corpus/089_reject_bare_lambda/meta.json b/conformance/corpus/089_reject_bare_lambda/meta.json
new file mode 100644
index 0000000..875ec3f
--- /dev/null
+++ b/conformance/corpus/089_reject_bare_lambda/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 26", "notes": "ruling 26: λ is reserved, never an identifier"}
diff --git a/conformance/corpus/089_reject_bare_lambda/program.mpl b/conformance/corpus/089_reject_bare_lambda/program.mpl
new file mode 100644
index 0000000..c248b76
--- /dev/null
+++ b/conformance/corpus/089_reject_bare_lambda/program.mpl
@@ -0,0 +1 @@
+✎({λ});
diff --git a/conformance/corpus/090_reject_unknown_string_escape/expected.err b/conformance/corpus/090_reject_unknown_string_escape/expected.err
new file mode 100644
index 0000000..1955119
--- /dev/null
+++ b/conformance/corpus/090_reject_unknown_string_escape/expected.err
@@ -0,0 +1 @@
+err_escape
diff --git a/conformance/corpus/090_reject_unknown_string_escape/meta.json b/conformance/corpus/090_reject_unknown_string_escape/meta.json
new file mode 100644
index 0000000..ffab80d
--- /dev/null
+++ b/conformance/corpus/090_reject_unknown_string_escape/meta.json
@@ -0,0 +1 @@
+{"status": "ratified", "source": "coverage", "decision": "Ratified 2026-07-09, ruling 12", "notes": "ruling 12: unknown string escapes are err_escape"}
diff --git a/conformance/corpus/090_reject_unknown_string_escape/program.mpl b/conformance/corpus/090_reject_unknown_string_escape/program.mpl
new file mode 100644
index 0000000..eb787c9
--- /dev/null
+++ b/conformance/corpus/090_reject_unknown_string_escape/program.mpl
@@ -0,0 +1 @@
+✎ "a\qb";
diff --git a/conformance/harness/fuzz.mjs b/conformance/harness/fuzz.mjs
new file mode 100644
index 0000000..0b56eb4
--- /dev/null
+++ b/conformance/harness/fuzz.mjs
@@ -0,0 +1,325 @@
+// Differential fuzzer: generates bounded, seeded, deterministic M0-core
+// programs and feeds each to both parsers — the JS interpreter's parse
+// phase and the ANTLR grammar via the ParseCheck CLI. Accept/reject
+// disagreements are minimized (greedy unit removal preserving the
+// disagreement) and appended to conformance/DIVERGENCES.md.
+//
+// Divergences are recorded, never auto-fixed: which parser is right is a
+// ratification question (Stage 3), not a fuzzer's call.
+//
+// Usage: node conformance/harness/fuzz.mjs [--seed=N] [--n=N]
+// Defaults: seed 20260709, n 500. Same seed + n → identical stdout, so
+// two consecutive runs diff clean (the DIVERGENCES.md append is
+// deduplicated by repro text and does not affect stdout).
+import fs from 'node:fs';
+import os from 'node:os';
+import path from 'node:path';
+import { execFileSync } from 'node:child_process';
+import { fileURLToPath } from 'node:url';
+import { createRequire } from 'node:module';
+
+const require = createRequire(import.meta.url);
+const { runMPL } = require('../../js/mpl.js');
+
+const HERE = path.dirname(fileURLToPath(import.meta.url));
+const REPO = path.join(HERE, '..', '..');
+const DIVERGENCES = path.join(HERE, '..', 'DIVERGENCES.md');
+
+const argOf = (name, dflt) => {
+ const a = process.argv.find(x => x.startsWith(`--${name}=`));
+ return a ? Number(a.split('=')[1]) : dflt;
+};
+const SEED = argOf('seed', 20260709);
+const N = argOf('n', 500);
+
+// ---------------------------------------------------------------- PRNG --
+function mulberry32(seed) {
+ let a = seed >>> 0;
+ return () => {
+ a |= 0; a = (a + 0x6D2B79F5) | 0;
+ let t = Math.imul(a ^ (a >>> 15), 1 | a);
+ t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
+ return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
+ };
+}
+
+// ----------------------------------------------------------- generator --
+// Sticks to the M0-core surface SURFACE.md documents (no records, sets,
+// modules, …) plus "spice" templates probing known-risky syntax edges.
+// ‖ appears only as a parse probe; its semantics stay unpinned (decision 6).
+function makeGen(rng) {
+ const pick = xs => xs[Math.floor(rng() * xs.length)];
+ const ids = ['a', 'b', 'c', 'f', 'g', 'x', 'y'];
+ const nums = ['0', '1', '2', '5', '42', '1.5', '0.5', '007'];
+ const strs = ['"hi"', '"a b"', '"x\\ny"', '"مرحبا"', '""'];
+
+ function atom(d) {
+ const r = rng();
+ if (d <= 0) return r < 0.5 ? pick(nums) : pick(ids);
+ if (r < 0.25) return pick(nums);
+ if (r < 0.35) return pick(strs);
+ if (r < 0.45) return pick(ids);
+ if (r < 0.52) return pick(['true', 'false', '⊥']);
+ if (r < 0.62) return `[${list(d - 1)}]`;
+ if (r < 0.72) return `(${expr(d - 1)})`;
+ if (r < 0.80) return `λ${params()}: ${expr(d - 1)}`;
+ if (r < 0.86) return `∀ ${pick(ids)} ∈ [${list(d - 1)}]: ${expr(d - 1)}`;
+ if (r < 0.93) return `{${expr(d - 1)}; ${expr(d - 1)}}`;
+ return `${pick(ids)}(${rng() < 0.2 ? '' : list(d - 1)})`;
+ }
+ function params() {
+ const n = rng() < 0.7 ? 1 : 2;
+ const ps = Array.from({ length: n }, () => pick(ids)).join(', ');
+ return rng() < 0.15 ? `${ps} ∈ ℕ` : ps;
+ }
+ function list(d) {
+ const n = Math.floor(rng() * 3);
+ return Array.from({ length: n + 1 }, () => expr(Math.max(0, d))).join(', ');
+ }
+ function expr(d) {
+ if (d <= 0) return atom(0);
+ const r = rng();
+ if (r < 0.30) return `${expr(d - 1)} ${pick(['+', '-', '×', '÷', '/', '∗'])} ${atom(d - 1)}`;
+ if (r < 0.42) return `${atom(d - 1)} ${pick(['=', '≠', '<', '>', '≤', '≥'])} ${atom(d - 1)}`;
+ if (r < 0.50) return `${atom(d - 1)} ${pick(['∧', '∨'])} ${atom(d - 1)}`;
+ if (r < 0.62) return `(${expr(d - 1)} ⟹ ${expr(d - 1)}) | ${atom(d - 1)}`;
+ if (r < 0.68) return `✎ ${atom(d - 1)}`;
+ if (r < 0.74) return `-${atom(d - 1)}`;
+ if (r < 0.78) return `${pick(ids)} ‖ ${atom(d - 1)}`;
+ return atom(d);
+ }
+ function stmt(d) {
+ const r = rng();
+ if (r < 0.35) return `${pick(ids)} ≜ ${expr(d)};`;
+ if (r < 0.55) return `${pick(ids)} ← ${expr(d)};`;
+ if (r < 0.8) return `✎(${expr(d)});`;
+ return `${expr(d)};`;
+ }
+ // Known-risky syntax edges. Each is plausible M0-core spelling whose
+ // acceptance the two parsers might not agree on.
+ const spice = [
+ d => `(${expr(d)}; ${expr(d)});`,
+ d => `f ≜ λ(${pick(ids)}, ${pick(ids)}): ${expr(d)};`,
+ () => `✎ "a\\${pick(['q', 'w', 'z'])}b";`,
+ () => `✎(1e3);`,
+ d => `✎(${atom(d)} < ${atom(d)} < ${atom(d)});`,
+ () => `✎(f ∘ g);`,
+ d => `a ≜ b ≜ ${expr(d)};`,
+ d => `✎ ✎ ${atom(d)};`,
+ d => `✎(- -${atom(d)});`,
+ () => `f ≜ λ: 1;`,
+ () => ``,
+ d => `✎({${atom(d)}, ${atom(d)}});`,
+ d => `✎({${pick(ids)}: ${atom(d)}});`,
+ () => `✎(\\ast 2 3);`,
+ d => `${expr(d)}`, // no trailing semicolon
+ d => `;${stmt(d)}`, // leading semicolon
+ () => `✎ 1;; ✎ 2;`, // empty statement
+ () => `✎ .5;`, // leading-dot number
+ () => `✎ 1.;`, // trailing-dot number
+ d => `∀ ${pick(ids)} ∈ ${atom(d)}: ${stmt(d)}`, // stmt as ∀ body
+ ];
+ return function program(idx) {
+ const rBody = () => Array.from({ length: 1 + Math.floor(rng() * 3) },
+ () => stmt(1 + Math.floor(rng() * 2))).join('\n');
+ if (rng() < 0.35) {
+ const s = pick(spice)(1);
+ return rng() < 0.5 ? s : `${rBody()}\n${s}`;
+ }
+ return rBody();
+ };
+}
+
+// --------------------------------------------------------- JS verdict --
+const PARSE_KEYS = new Set(['err_char', 'err_escape', 'err_string',
+ 'err_comment', 'err_expect', 'err_unexpected', 'err_def_target',
+ 'err_assign_target']);
+
+// accepts=true means "the JS parse phase accepted it" — runtime errors and
+// keyless host crashes happen after parsing and count as accept.
+function jsVerdict(src) {
+ try {
+ runMPL(src, () => {});
+ return { accepts: true, detail: 'runs' };
+ } catch (e) {
+ if (e.key && PARSE_KEYS.has(e.key)) {
+ return { accepts: false, detail: `${e.key} at ${e.line}:${e.col}` };
+ }
+ return { accepts: true, detail: e.key ? `runtime ${e.key}` : `host ${e.constructor.name}` };
+ }
+}
+
+// ------------------------------------------------------ ANTLR verdict --
+// ParseCheck is the CLI seam. Invoking it through gradle costs ~1s of JVM
+// and build-system startup per call, which the minimizer cannot afford, so
+// the classpath is resolved once and ParseCheck runs under plain `java`.
+// Falls back to `./gradlew parseCheck` if the classpath cannot be found.
+function resolveParseCheck() {
+ execFileSync('./gradlew', ['-q', 'classes'], { cwd: REPO, stdio: 'ignore' });
+ const classes = path.join(REPO, 'build', 'classes', 'java', 'main');
+ const cache = path.join(os.homedir(), '.gradle', 'caches', 'modules-2',
+ 'files-2.1', 'org.antlr', 'antlr4-runtime');
+ let jar = null;
+ if (fs.existsSync(cache) && fs.existsSync(classes)) {
+ const stack = [cache];
+ while (stack.length) {
+ const d = stack.pop();
+ for (const f of fs.readdirSync(d, { withFileTypes: true })) {
+ const p = path.join(d, f.name);
+ if (f.isDirectory()) stack.push(p);
+ else if (f.name.endsWith('.jar') && !f.name.includes('sources')) jar = p;
+ }
+ }
+ }
+ if (jar) return files => ['java', ['-cp', `${classes}:${jar}`, 'com.mpl.tools.ParseCheck', ...files]];
+ return files => ['./gradlew', ['-q', 'parseCheck', `--args=${files.join(' ')}`]];
+}
+const parseCheckCmd = resolveParseCheck();
+const antlrCache = new Map();
+
+function antlrVerdicts(programs) {
+ const result = new Array(programs.length);
+ const misses = [];
+ programs.forEach((p, i) => {
+ if (antlrCache.has(p)) result[i] = antlrCache.get(p);
+ else misses.push(i);
+ });
+ if (misses.length) {
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'mplfuzz-'));
+ const files = misses.map((mi, k) => {
+ const f = path.join(dir, `p${String(k).padStart(4, '0')}.mpl`);
+ fs.writeFileSync(f, programs[mi]);
+ return f;
+ });
+ let stdout = '';
+ const [cmd, args] = parseCheckCmd(files);
+ try {
+ stdout = execFileSync(cmd, args, { cwd: REPO, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });
+ } catch (e) {
+ stdout = e.stdout || '';
+ }
+ const rejected = new Map();
+ for (const line of stdout.split('\n')) {
+ const m = line.match(/p(\d{4})\.mpl:(.*)$/);
+ if (m) rejected.set(Number(m[1]), m[2].trim());
+ }
+ misses.forEach((mi, k) => {
+ const v = rejected.has(k)
+ ? { accepts: false, detail: rejected.get(k) }
+ : { accepts: true, detail: 'parses' };
+ antlrCache.set(programs[mi], v);
+ result[mi] = v;
+ });
+ fs.rmSync(dir, { recursive: true, force: true });
+ }
+ return result;
+}
+
+// -------------------------------------------------------- minimization --
+// Greedy unit removal: units are strings, escape words, identifiers,
+// numbers, or single characters. Each round batch-checks every single-unit
+// deletion and keeps the first candidate that preserves the disagreement.
+const UNIT = /"(?:[^"\\]|\\.)*"|\\[a-zA-Z]+|[a-zA-Z][a-zA-Z0-9_]*|[0-9]+(?:\.[0-9]+)?|\s+|./gsu;
+
+// One reduction round over an array of parts: try deleting a window of w
+// consecutive parts at every offset (largest w first), batch-checking the
+// survivors; returns the first reduced array that preserves the
+// disagreement, or null when no deletion does.
+function reduceOnce(parts, joiner, wanted) {
+ // All window sizes go into ONE batched ParseCheck call; the largest
+ // window that preserves the disagreement wins.
+ const candidates = [];
+ for (let w = Math.min(8, parts.length - 1); w >= 1; w = Math.floor(w / 2)) {
+ for (let i = 0; i + w <= parts.length; i++) {
+ const cand = parts.slice(0, i).concat(parts.slice(i + w));
+ if (jsVerdict(cand.join(joiner)).accepts === wanted.js) candidates.push({ w, cand });
+ }
+ }
+ if (!candidates.length) return null;
+ const antlr = antlrVerdicts(candidates.map(c => c.cand.join(joiner)));
+ const hit = candidates.findIndex((c, i) => antlr[i].accepts === wanted.antlr);
+ return hit === -1 ? null : candidates[hit].cand;
+}
+
+function minimize(src, wanted) {
+ // Phase 1: whole lines. Phase 2: lexical units.
+ let lines = src.split('\n').filter(l => l.trim() !== '');
+ for (let r = 0; r < 30 && lines.length > 1; r++) {
+ const red = reduceOnce(lines, '\n', wanted);
+ if (!red) break;
+ lines = red;
+ }
+ let units = lines.join('\n').match(UNIT) || [];
+ for (let r = 0; r < 60 && units.length > 1; r++) {
+ const red = reduceOnce(units, '', wanted);
+ if (!red) break;
+ units = red;
+ }
+ return units.join('').trim();
+}
+
+// ---------------------------------------------------------------- run --
+const rng = mulberry32(SEED);
+const gen = makeGen(rng);
+console.log(`fuzz: seed=${SEED} n=${N}`);
+
+const programs = Array.from({ length: N }, (_, i) => gen(i));
+const js = programs.map(jsVerdict);
+const antlr = antlrVerdicts(programs);
+
+let agreeAccept = 0, agreeReject = 0;
+const divergences = [];
+for (let i = 0; i < N; i++) {
+ if (js[i].accepts === antlr[i].accepts) {
+ js[i].accepts ? agreeAccept++ : agreeReject++;
+ continue;
+ }
+ divergences.push(i);
+}
+console.log(`agreement: ${agreeAccept} both-accept, ${agreeReject} both-reject`);
+console.log(`disagreements: ${divergences.length}`);
+
+// Minimize, dedupe by canonical shape (identifiers, numbers and string
+// bodies normalized — `({b: y})` and `({g: ⊥})` share one root cause),
+// report deterministically.
+const canon = s => s
+ .replace(/"(?:[^"\\]|\\.)*"/g, '"s"')
+ .replace(/\b(?!true\b|false\b)[a-zA-Z][a-zA-Z0-9_]*\b/g, 'v')
+ .replace(/[0-9]+(?:\.[0-9]+)?/g, '1')
+ .replace(/\s+/g, ' ');
+const seen = new Set();
+const findings = [];
+for (const i of divergences) {
+ const wanted = { js: js[i].accepts, antlr: antlr[i].accepts };
+ const repro = minimize(programs[i], wanted);
+ const key = `${canon(repro)}|js=${wanted.js}`;
+ if (seen.has(key)) continue;
+ seen.add(key);
+ const [jsV] = [jsVerdict(repro)];
+ const [antlrV] = antlrVerdicts([repro]);
+ findings.push({ repro, index: i, jsV, antlrV });
+}
+findings.sort((a, b) => a.repro < b.repro ? -1 : a.repro > b.repro ? 1 : 0);
+
+for (const f of findings) {
+ console.log('---');
+ console.log(`repro (seed ${SEED}, index ${f.index}):`);
+ console.log(f.repro);
+ console.log(` js: ${f.jsV.accepts ? 'ACCEPTS' : 'REJECTS'} (${f.jsV.detail})`);
+ console.log(` antlr: ${f.antlrV.accepts ? 'ACCEPTS' : 'REJECTS'} (${f.antlrV.detail})`);
+}
+console.log(`${findings.length} unique minimized divergences (recorded in conformance/DIVERGENCES.md)`);
+
+// Append new findings to DIVERGENCES.md (dedup by repro text so reruns are
+// idempotent; stdout above never depends on what was already in the file).
+let doc = fs.existsSync(DIVERGENCES) ? fs.readFileSync(DIVERGENCES, 'utf8') : '';
+let appended = '';
+for (const f of findings) {
+ if (doc.includes('```\n' + f.repro + '\n```')) continue;
+ appended += `\n## Divergence (fuzz seed ${SEED}, index ${f.index})\n\n` +
+ '```\n' + f.repro + '\n```\n\n' +
+ `- JS interpreter: ${f.jsV.accepts ? 'accepts' : 'rejects'} (${f.jsV.detail})\n` +
+ `- ANTLR grammar: ${f.antlrV.accepts ? 'accepts' : 'rejects'} (${f.antlrV.detail})\n` +
+ `- RULING: pending (see JUDGMENT_CALLS.md)\n`;
+}
+if (appended) fs.writeFileSync(DIVERGENCES, doc + appended);
diff --git a/conformance/harness/run.mjs b/conformance/harness/run.mjs
new file mode 100644
index 0000000..d3b1729
--- /dev/null
+++ b/conformance/harness/run.mjs
@@ -0,0 +1,116 @@
+// Conformance harness — zero dependencies (node:test not even needed:
+// entries are data, not code). See conformance/README notes in SURFACE.md.
+//
+// Modes:
+// --all run every corpus entry; informational; exit 0 unless the
+// harness itself errors (malformed entry, unreadable corpus)
+// --ratified run only entries with "status": "ratified"; exit 0 iff all
+// pass; exits 0 vacuously when zero entries are ratified.
+// This is what CI gates on.
+//
+// Every case is executed twice and the observations compared; a mismatch is
+// a determinism failure (NONDET) and fails the case.
+//
+// Expectations (exactly one per entry):
+// expected.out — exact stdout, single trailing newline normalized
+// expected.err — the interpreter's error KEY (e.g. err_div0), one per
+// line; never localized message text
+import fs from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { createRequire } from 'node:module';
+
+// Same loader mechanism as js/test/load.mjs: the artifact is CommonJS-
+// guarded; the loader adapts, the artifact is never modified.
+const require = createRequire(import.meta.url);
+const { runMPL } = require('../../js/mpl.js');
+
+const CORPUS = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'corpus');
+
+function harnessError(msg) {
+ console.error(`harness error: ${msg}`);
+ process.exit(2);
+}
+
+// One observation: printed lines plus the error key (null if none thrown).
+// A keyless exception is recorded distinctly — it is a host-level crash,
+// not an MPL error, and can never match an expected.err key.
+function observe(src) {
+ const lines = [];
+ try {
+ runMPL(src, s => lines.push(s));
+ return { lines, key: null };
+ } catch (e) {
+ return { lines, key: e.key || `UNKEYED:${e.constructor.name}` };
+ }
+}
+
+// Exact stdout with a single trailing newline normalized on both sides.
+const norm = s => (s === '' ? '' : s.replace(/\n*$/, '') + '\n');
+
+function loadEntry(dir) {
+ const p = n => path.join(CORPUS, dir, n);
+ if (!fs.existsSync(p('program.mpl'))) harnessError(`${dir}: missing program.mpl`);
+ if (!fs.existsSync(p('meta.json'))) harnessError(`${dir}: missing meta.json`);
+ let meta;
+ try { meta = JSON.parse(fs.readFileSync(p('meta.json'), 'utf8')); }
+ catch (e) { harnessError(`${dir}: bad meta.json: ${e.message}`); }
+ if (meta.status !== 'unratified' && meta.status !== 'ratified') {
+ harnessError(`${dir}: meta.status must be "unratified" or "ratified"`);
+ }
+ const hasOut = fs.existsSync(p('expected.out'));
+ const hasErr = fs.existsSync(p('expected.err'));
+ if (hasOut === hasErr) harnessError(`${dir}: need exactly one of expected.out / expected.err`);
+ return {
+ dir,
+ meta,
+ program: fs.readFileSync(p('program.mpl'), 'utf8'),
+ out: hasOut ? fs.readFileSync(p('expected.out'), 'utf8') : null,
+ err: hasErr ? fs.readFileSync(p('expected.err'), 'utf8').split('\n').filter(Boolean) : null,
+ };
+}
+
+function runEntry(e) {
+ const first = observe(e.program);
+ const second = observe(e.program);
+ if (JSON.stringify(first) !== JSON.stringify(second)) {
+ return { verdict: 'NONDET', detail: 'two runs disagreed' };
+ }
+ if (e.out !== null) {
+ if (first.key !== null) return { verdict: 'FAIL', detail: `threw ${first.key}, expected output` };
+ const actual = first.lines.length ? first.lines.join('\n') + '\n' : '';
+ if (norm(actual) !== norm(e.out)) {
+ return { verdict: 'FAIL', detail: `output ${JSON.stringify(actual)} != expected ${JSON.stringify(norm(e.out))}` };
+ }
+ return { verdict: 'PASS' };
+ }
+ const keys = first.key === null ? [] : [first.key];
+ if (JSON.stringify(keys) !== JSON.stringify(e.err)) {
+ return { verdict: 'FAIL', detail: `error keys ${JSON.stringify(keys)} != expected ${JSON.stringify(e.err)}` };
+ }
+ return { verdict: 'PASS' };
+}
+
+const mode = process.argv[2];
+if (mode !== '--all' && mode !== '--ratified') {
+ harnessError('usage: node conformance/harness/run.mjs --all | --ratified');
+}
+
+if (!fs.existsSync(CORPUS)) harnessError(`no corpus directory at ${CORPUS}`);
+let dirs = fs.readdirSync(CORPUS).filter(d => fs.statSync(path.join(CORPUS, d)).isDirectory()).sort();
+const entries = dirs.map(loadEntry);
+const selected = mode === '--ratified' ? entries.filter(e => e.meta.status === 'ratified') : entries;
+
+if (mode === '--ratified' && selected.length === 0) {
+ console.log('0 entries ratified — vacuously green (ratification is Stage 3).');
+ process.exit(0);
+}
+
+let pass = 0, fail = 0;
+for (const e of selected) {
+ const r = runEntry(e);
+ if (r.verdict === 'PASS') pass++; else fail++;
+ console.log(`${r.verdict} ${e.dir}${r.detail ? ' — ' + r.detail : ''}`);
+}
+console.log(`${selected.length} cases: ${pass} pass, ${fail} fail (${entries.length - selected.length} not selected)`);
+process.exit(mode === '--ratified' && fail > 0 ? 1 : 0);
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
new file mode 100644
index 0000000..696ea69
--- /dev/null
+++ b/docs/ARCHITECTURE.md
@@ -0,0 +1,285 @@
+# MPL Architecture
+
+This document describes the high-level architecture of the Mathematical Programming Language (MPL) implementation.
+
+**Status**: only the lexing and parsing layers exist today (see the README's
+project status). Everything from semantic analysis down — and the runtime,
+error-message, performance and security sections below — describes the
+*target* architecture, not shipped code.
+
+## Overview
+
+MPL is designed as a multi-layer system that transforms mathematical notation into executable code:
+
+```
+┌─────────────────────────────────────────────────────┐
+│ User Input │
+│ (Unicode Symbols / ASCII Escapes / Voice / Visual) │
+└────────────────────┬───────────────────────────────┘
+ │
+┌────────────────────▼───────────────────────────────┐
+│ Input Processing Layer │
+│ • Unicode Normalization (NFC) │
+│ • Bidirectional Text Support │
+│ • ASCII Escape Expansion │
+└────────────────────┬───────────────────────────────┘
+ │
+┌────────────────────▼───────────────────────────────┐
+│ Lexical Analysis │
+│ • ANTLR 4 Lexer (MPL.g4) │
+│ • Token Stream Generation │
+│ • Symbol Recognition │
+└────────────────────┬───────────────────────────────┘
+ │
+┌────────────────────▼───────────────────────────────┐
+│ Syntactic Analysis │
+│ • ANTLR 4 Parser (MPL.g4) │
+│ • Precedence Resolution │
+│ • AST Construction │
+└────────────────────┬───────────────────────────────┘
+ │
+┌────────────────────▼───────────────────────────────┐
+│ Semantic Analysis │
+│ • Type Inference │
+│ • Effect Analysis │
+│ • Symbol Resolution │
+└────────────────────┬───────────────────────────────┘
+ │
+┌────────────────────▼───────────────────────────────┐
+│ Optimization │
+│ • Constant Folding │
+│ • Dead Code Elimination │
+│ • Parallelism Detection │
+└────────────────────┬───────────────────────────────┘
+ │
+┌────────────────────▼───────────────────────────────┐
+│ Code Generation │
+│ • Target Platform Selection │
+│ • Bytecode / Native Code Generation │
+│ • Runtime Library Linking │
+└─────────────────────────────────────────────────────┘
+```
+
+## Core Components
+
+### 1. Grammar Definition (`src/main/antlr4/MPL.g4`)
+
+The heart of MPL is its ANTLR 4 grammar that defines:
+- **Mathematical Operators**: every glyph with exactly one meaning and one ASCII escape ([glyph-escapes.md](../glyph-escapes.md))
+- **Effect Operators**: Exception handling (↯/↴), concurrency (‖), resources (⊕/⊖)
+- **Precedence Rules**: a documented chain ([precedence.csv](../precedence.csv))
+- **CI-clean**: compiles with zero ANTLR errors and warnings (`-Werror`)
+
+Key grammar rules (excerpted from the real grammar):
+```antlr
+// Definition and assignment levels of the precedence chain
+defExpr : assignExpr (DEFINITION defExpr)? ; // x ≜ e
+assignExpr : condExpr (LEFTARROW assignExpr)? ; // x ← e
+
+// Guarded alternatives: (condition ⟹ result) | fallback
+condExpr : impliesExpr (BAR impliesExpr)* ;
+
+// λx: body, λx,y: body, λx∈ℝ: body
+lambda : LAMBDA_VAR pattern (IN condExpr)? COLON expr ;
+```
+
+### 2. Symbol System
+
+MPL uses a three-tier symbol system:
+
+1. **Unicode Symbols** (Primary)
+ - Direct mathematical notation: ∀, λ, ∈, ⟹
+ - Effect operators: ↯, ↴, ‖, ⇀, ↽
+ - Type symbols: ℕ, ℤ, ℚ, ℝ, ℂ, 𝔹
+
+2. **ASCII Escapes** (Fallback)
+ - Every symbol has exactly one escape: `\forall`, `\lambda`, …
+ - Defined in `glyph-escapes.md` (kept in lockstep with the lexer)
+
+3. **Multi-Modal Input** (Future)
+ - Voice recognition for mathematical terms
+ - Visual palette selection
+ - Handwriting recognition
+
+### 3. Type System (planned, M1)
+
+MPL features a hybrid type system:
+
+```
+Types := BaseType | FunctionType | CollectionType | EffectType
+
+BaseType := ℕ | ℤ | ℚ | ℝ | ℂ | 𝔹 | String | Unit
+FunctionType := Type → Type
+CollectionType := [Type] | {Type} | (Type₁, Type₂, ...)
+EffectType := Type ! {Exception, IO, Concurrent, Resource}
+```
+
+Type inference follows Hindley-Milner with extensions for:
+- Numeric type promotion
+- Effect tracking
+- Parallel composition
+
+### 4. Effect System
+
+MPL tracks computational effects at the type level:
+
+| Effect | Symbol | Purpose |
+|--------|--------|---------|
+| Exception | ↯/↴ | Throwing and catching errors |
+| Concurrency | ‖ | Parallel execution |
+| Channels | ⇀/↽ | Message passing |
+| Resources | ⊕/⊖ | Acquisition/release |
+| Atomicity | ⌈⌉ | Atomic sections |
+| Metaprogramming | ⌜⌝/⌞⌟ | Code quotation/evaluation |
+
+### 5. Parser Implementation
+
+The parser is built using ANTLR 4 with Java:
+
+```java
+// Parser initialization
+MPLLexer lexer = new MPLLexer(CharStreams.fromString(input));
+MPLParser parser = new MPLParser(new CommonTokenStream(lexer));
+
+// Parse with error handling
+parser.addErrorListener(new MPLErrorListener());
+ParseTree tree = parser.program();
+
+// Visit AST
+MPLVisitor visitor = new MPLASTBuilder();
+AST ast = visitor.visit(tree);
+```
+
+### 6. Runtime Architecture (planned)
+
+The MPL runtime provides:
+
+1. **Memory Management**
+ - Automatic reference counting
+ - Resource scope tracking (RAII)
+ - Parallel GC for concurrent code
+
+2. **Concurrency Runtime**
+ - Green threads for ‖ operator
+ - Channel implementation for ⇀/↽
+ - STM for atomic sections ⌈⌉
+
+3. **Standard Library**
+ - Mathematical functions
+ - I/O operations
+ - Collection manipulation
+ - Network primitives
+
+## Compilation Pipeline
+
+### Phase 1: Lexical Analysis
+1. Unicode normalization (NFC)
+2. Symbol recognition
+3. ASCII escape expansion
+4. Token stream generation
+
+### Phase 2: Parsing
+1. Grammar rule matching
+2. Precedence resolution
+3. AST construction
+4. Syntax error recovery
+
+### Phase 3: Semantic Analysis (planned)
+1. Symbol table construction
+2. Type inference
+3. Effect analysis
+4. Semantic error checking
+
+### Phase 4: Optimization (planned)
+1. Constant folding
+2. Common subexpression elimination
+3. Parallelism detection
+4. Effect optimization
+
+### Phase 5: Code Generation (planned)
+Options for different targets:
+- **JVM Bytecode**: For Java interoperability
+- **LLVM IR**: For native compilation
+- **JavaScript**: For web execution
+- **Python**: For educational use
+
+## Error Handling (planned)
+
+Today the parser emits standard ANTLR diagnostics. The goal is comprehensive error messages with:
+1. **Unicode-aware positioning**: Correct column numbers for multi-byte characters
+2. **Multi-language messages**: Errors in user's native language
+3. **Visual error display**: Highlighting problematic symbols
+4. **Suggestion system**: Common fixes for typical mistakes
+
+Envisioned example error:
+```
+Error at line 3, column 12:
+ (x > 0 ⟹ x | -x
+ ^
+ Syntax error: missing ')' before '|'
+ Guarded alternatives read: (condition ⟹ result) | fallback
+```
+
+## Performance Considerations (planned)
+
+1. **Parser Performance**
+ - O(n) parsing for most constructs
+ - Memoization for complex expressions
+ - Incremental parsing support
+
+2. **Unicode Handling**
+ - Zero-copy string processing
+ - Efficient symbol lookup tables
+ - Caching for escape conversions
+
+3. **Parallel Execution**
+ - Work-stealing for ‖ operator
+ - Lock-free channel implementation
+ - NUMA-aware memory allocation
+
+## Extension Points
+
+The architecture supports extensions via:
+
+1. **Grammar Extensions**: New operators in MPL.g4
+2. **Type Extensions**: Custom type definitions
+3. **Effect Extensions**: New computational effects
+4. **Backend Extensions**: Additional compilation targets
+
+## Security Considerations (planned)
+
+1. **Input Validation**
+ - Unicode homograph detection
+ - Bidirectional text sanitization
+ - Resource limit enforcement
+
+2. **Sandboxing**
+ - Capability-based security for I/O
+ - Memory limits for student code
+ - Time limits for execution
+
+3. **Effect Isolation**
+ - Effect types prevent unauthorized operations
+ - Resource tracking prevents leaks
+ - Concurrency limits prevent DoS
+
+## Future Architecture Goals
+
+1. **Language Server Protocol (LSP)**
+ - Real-time error checking
+ - Symbol completion
+ - Refactoring support
+
+2. **REPL Implementation**
+ - Interactive development
+ - Notebook integration
+ - Visualization support
+
+3. **Distributed Execution**
+ - Cluster support for ‖
+ - Distributed channels
+ - Fault tolerance
+
+---
+
+This architecture enables MPL to achieve its goal of cognitive universality while maintaining performance and safety suitable for educational environments.
\ No newline at end of file
diff --git a/examples/02_factorial.mpl b/examples/02_factorial.mpl
index 1010b97..1ed756b 100644
--- a/examples/02_factorial.mpl
+++ b/examples/02_factorial.mpl
@@ -1,4 +1,4 @@
-- Factorial example with proper precedence
factorial ≜ λn∈ℕ: (n≤1 ⟹ 1) | (n×factorial(n-1));
-result ← factorial(5);
+result ≜ factorial(5);
✎result;
\ No newline at end of file
diff --git a/examples/03_file_processing.mpl b/examples/03_file_processing.mpl
index 87fdb4b..890c0c9 100644
--- a/examples/03_file_processing.mpl
+++ b/examples/03_file_processing.mpl
@@ -4,4 +4,4 @@ processFile ≜ λpath: {
result ← transform(data);
writeFile(result, 🖫"output.txt");
⟨"success"|"failed"⟩
-} ↴ {↯e ⇒ ⟨⊥|e⟩};
\ No newline at end of file
+} ↴ {↯e ⟹ ⟨⊥|e⟩};
\ No newline at end of file
diff --git a/examples/05_module_definition.mpl b/examples/05_module_definition.mpl
index 8d1063d..d0e2762 100644
--- a/examples/05_module_definition.mpl
+++ b/examples/05_module_definition.mpl
@@ -1,8 +1,8 @@
-- Module definition example
𝓜 Mathematics ⇒ {
π ≜ 3.14159;
- sin ≜ λx∈ℝ: {- implementation -};
- cos ≜ λx∈ℝ: {- implementation -}
+ sin ≜ λx∈ℝ: ⊥ {- implementation deferred until MPL executes -};
+ cos ≜ λx∈ℝ: ⊥ {- implementation deferred until MPL executes -}
};
angle ← π/4;
diff --git a/glyph-escapes.md b/glyph-escapes.md
index b9992c2..c3158e4 100644
--- a/glyph-escapes.md
+++ b/glyph-escapes.md
@@ -1,10 +1,16 @@
# MPL Glyph Escape Sequences
-This document provides the authoritative mapping between ASCII escape sequences and UTF-8 glyphs for the Mathematical Programming Language (MPL).
+This document is the authoritative mapping between ASCII escape sequences and
+UTF-8 glyphs for the Mathematical Programming Language (MPL). It matches the
+lexer rules in [`src/main/antlr4/MPL.g4`](src/main/antlr4/MPL.g4) exactly:
+every escape below is accepted by the lexer, and no other escapes exist.
-## Core Mathematical Symbols
+Each glyph has **exactly one** ASCII escape (One Right Answer). Symbols that
+are plain ASCII (`; = < > + - ( ) [ ] { } : , _ | /` and the keywords
+`true`/`false`) need no escape and have none.
+
+## Greek Letters (Variables)
-### Greek Letters (Variables)
| ASCII Escape | Unicode | Glyph | Usage |
|-------------|---------|-------|-------|
| `\alpha` | U+03B1 | α | Variable |
@@ -17,12 +23,12 @@ This document provides the authoritative mapping between ASCII escape sequences
| `\theta` | U+03B8 | θ | Variable |
| `\iota` | U+03B9 | ι | Variable |
| `\kappa` | U+03BA | κ | Variable |
-| `\lambda` or `\lam` | U+03BB | λ | Lambda/Function |
+| `\lambda` | U+03BB | λ | Lambda / variable |
| `\mu` | U+03BC | μ | Variable |
| `\nu` | U+03BD | ν | Variable |
| `\xi` | U+03BE | ξ | Variable |
| `\omicron` | U+03BF | ο | Variable |
-| `\pi` | U+03C0 | π | Variable/Constant |
+| `\pi` | U+03C0 | π | Variable |
| `\rho` | U+03C1 | ρ | Variable |
| `\sigma` | U+03C3 | σ | Variable |
| `\tau` | U+03C4 | τ | Variable |
@@ -32,110 +38,94 @@ This document provides the authoritative mapping between ASCII escape sequences
| `\psi` | U+03C8 | ψ | Variable |
| `\omega` | U+03C9 | ω | Variable |
-### Set Theory
+## Type Symbols
+
+| ASCII Escape | Unicode | Glyph | Usage |
+|-------------|---------|-------|-------|
+| `\nat` | U+2115 | ℕ | Natural numbers |
+| `\int` | U+2124 | ℤ | Integers |
+| `\rat` | U+211A | ℚ | Rational numbers |
+| `\real` | U+211D | ℝ | Real numbers |
+| `\complex` | U+2102 | ℂ | Complex numbers |
+| `\bool` | U+1D539 | 𝔹 | Booleans |
+| `\bot` | U+22A5 | ⊥ | Bottom |
+
+## Logic and Sets
+
| ASCII Escape | Unicode | Glyph | Usage |
|-------------|---------|-------|-------|
-| `\emptyset` | U+2205 | ∅ | Empty set |
-| `\union` or `\cup` | U+222A | ∪ | Set union |
-| `\intersect` or `\cap` | U+2229 | ∩ | Set intersection |
-| `\subset` | U+2282 | ⊂ | Proper subset |
-| `\supset` | U+2283 | ⊃ | Proper superset |
| `\in` | U+2208 | ∈ | Element of |
-| `\notin` | U+2209 | ∉ | Not element of |
-| `\subseteq` | U+2286 | ⊆ | Subset or equal |
-| `\supseteq` | U+2287 | ⊇ | Superset or equal |
+| `\emptyset` | U+2205 | ∅ | Empty set |
+| `\and` | U+2227 | ∧ | Logical and |
+| `\or` | U+2228 | ∨ | Logical or |
+| `\implies` | U+27F9 | ⟹ | Implication / guard arrow |
+| `\forall` | U+2200 | ∀ | Universal quantifier (iteration) |
-### Logic
-| ASCII Escape | Unicode | Glyph | Usage |
-|-------------|---------|-------|-------|
-| `\and` or `\wedge` | U+2227 | ∧ | Logical and |
-| `\or` or `\vee` | U+2228 | ∨ | Logical or |
-| `\not` or `\neg` | U+00AC | ¬ | Logical not |
-| `\implies` or `\Rightarrow` | U+27F9 | ⟹ | Implication |
-| `\iff` or `\Leftrightarrow` | U+27FA | ⟺ | If and only if |
-| `\forall` | U+2200 | ∀ | Universal quantifier |
-| `\exists` | U+2203 | ∃ | Existential quantifier |
+## Operations
-### Operations
| ASCII Escape | Unicode | Glyph | Usage |
|-------------|---------|-------|-------|
| `\times` | U+00D7 | × | Multiplication |
-| `\div` | U+00F7 | ÷ | Division |
+| `\div` | U+00F7 | ÷ | Division (`/` is an ASCII alias) |
| `\ast` | U+2217 | ∗ | Generic operator |
| `\circ` | U+2218 | ∘ | Function composition |
-### Relations
+## Relations
+
| ASCII Escape | Unicode | Glyph | Usage |
|-------------|---------|-------|-------|
-| `\neq` or `\ne` | U+2260 | ≠ | Not equal |
-| `\leq` or `\le` | U+2264 | ≤ | Less than or equal |
-| `\geq` or `\ge` | U+2265 | ≥ | Greater than or equal |
+| `\neq` | U+2260 | ≠ | Not equal |
+| `\leq` | U+2264 | ≤ | Less than or equal |
+| `\geq` | U+2265 | ≥ | Greater than or equal |
| `\approx` | U+2248 | ≈ | Approximately equal |
| `\sim` | U+223C | ∼ | Similar to |
-### Special Symbols
+## Definition and Assignment
+
| ASCII Escape | Unicode | Glyph | Usage |
|-------------|---------|-------|-------|
-| `\leftarrow` or `\gets` | U+2190 | ← | Assignment |
+| `\leftarrow` | U+2190 | ← | Assignment |
| `\coloneq` | U+225C | ≜ | Definition |
-| `\rightarrow` or `\to` | U+2192 | → | Function type |
-## Effect Extensions
+## Effect Operators
| ASCII Escape | Unicode | Glyph | Usage |
|-------------|---------|-------|-------|
| `\raise` | U+21AF | ↯ | Raise exception |
-| `\handle` | U+21B4 | ↴ | Handle exception |
+| `\handle` | U+21B4 | ↴ | Handle exception (postfix) |
| `\parallel` | U+2016 | ‖ | Parallel composition |
| `\lceil` | U+2308 | ⌈ | Atomic section start |
| `\rceil` | U+2309 | ⌉ | Atomic section end |
-| `\oplus` | U+2295 | ⊕ | Allocate resource |
-| `\ominus` | U+2296 | ⊖ | Release resource |
-| `\module` | U+1D49C | 𝓜 | Module declaration |
-| `\Leftarrow` | U+21D0 | ⇐ | Import |
-| `\Rightarrow` | U+21D2 | ⇒ | Export |
-| `\send` | U+21C0 | ⇀ | Send (network) |
-| `\receive` | U+21BD | ↽ | Receive (network) |
+| `\oplus` | U+2295 | ⊕ | Allocate resource (postfix) |
+| `\ominus` | U+2296 | ⊖ | Release resource (postfix) |
+| `\send` | U+21C0 | ⇀ | Send to channel: `⇀_ch expr` |
+| `\receive` | U+21BD | ↽ | Receive from channel: `↽_ch expr` |
+| `\trace` | U+270E | ✎ | Output / trace |
+| `\break` | U+29C8 | ⧈ | Breakpoint |
+| `\delay` | U+23F2 | ⏲ | Delay |
+| `\periodic` | U+27F3 | ⟳ | Periodic task |
-## Additional Operators
+## Modules and Metaprogramming
| ASCII Escape | Unicode | Glyph | Usage |
|-------------|---------|-------|-------|
-| `\langle` | U+27E8 | ⟨ | Choice type/angle bracket left |
-| `\rangle` | U+27E9 | ⟩ | Choice type/angle bracket right |
+| `\module` | U+1D4DC | 𝓜 | Module declaration |
+| `\Rightarrow` | U+21D2 | ⇒ | Export (module body follows) |
+| `\middot` | U+2027 | ‧ | Qualified module access |
| `\path` | U+1F5AB | 🖫 | File path prefix |
-| `\up` | U+21E1 | ⇡ | Stream position up |
-| `\down` | U+21E3 | ⇣ | Stream position down |
-| `\swap` | U+21C6 | ⇆ | Atomic swap |
-| `\llangle` | U+27EA | ⟪ | Deep update path start |
-| `\rrangle` | U+27EB | ⟫ | Deep update path end |
| `\ulcorner` | U+231C | ⌜ | Code quotation start |
| `\urcorner` | U+231D | ⌝ | Code quotation end |
| `\llcorner` | U+231E | ⌞ | Code evaluation start |
| `\lrcorner` | U+231F | ⌟ | Code evaluation end |
-| `\query` | U+003F | ? | Introspection |
-| `\break` | U+2A08 | ⧈ | Breakpoint |
-| `\trace` | U+270E | ✎ | Trace/log |
-| `\delay` | U+23F2 | ⏲ | Delay |
-| `\periodic` | U+27F3 | ⟳ | Periodic task |
| `\lbracket` | U+3014 | 〔 | RAII scope start |
| `\rbracket` | U+3015 | 〕 | RAII scope end |
-
-## Type System Symbols
-
-| ASCII Escape | Unicode | Glyph | Usage |
-|-------------|---------|-------|-------|
-| `\nat` or `\N` | U+2115 | ℕ | Natural numbers |
-| `\int` or `\Z` | U+2124 | ℤ | Integers |
-| `\rat` or `\Q` | U+211A | ℚ | Rational numbers |
-| `\real` or `\R` | U+211D | ℝ | Real numbers |
-| `\complex` or `\C` | U+2102 | ℂ | Complex numbers |
-| `\bool` or `\B` | U+1D539 | 𝔹 | Booleans |
-| `\bot` | U+22A5 | ⊥ | Bottom type |
+| `\langle` | U+27E8 | ⟨ | Choice type start |
+| `\rangle` | U+27E9 | ⟩ | Choice type end |
## String Escape Sequences
-String literals in MPL support the following escape sequences within double-quoted strings:
+String literals in MPL support the following escape sequences within
+double-quoted strings:
| Escape Sequence | Character | Description |
|----------------|-----------|-------------|
@@ -153,18 +143,20 @@ Examples:
- `"Unicode: \u{1F600}"` - Unicode emoji 😀
- `"""Raw string - no \n escapes"""` - Raw multi-line string
+## Deferred to M1
+
+The following glyphs appeared in earlier drafts but are **not** part of the
+M0 grammar. Each returns only together with a defined semantic:
+
+∪ ∩ ⊂ ⊃ ⊆ ⊇ ∉ ¬ ⟺ ∃ ⇐ → ⇡ ⇣ ⇆ ⟪ ⟫ ∑ √ ² `?` `%`
+
## Usage Notes
1. **Input methods:**
- Direct Unicode input (recommended for supported editors)
- - ASCII escape sequences (for compatibility)
- - Editor-specific shortcuts (e.g., Ctrl+Alt+g → γ)
+ - ASCII escape sequences (for compatibility, work in any editor)
2. **Lexer behavior:**
- - Escapes are processed during tokenization
- - Unknown escapes result in compilation error
- - Mixed Unicode/ASCII in same file is allowed
-
-3. **Pretty-printing:**
- - Always outputs Unicode glyphs (never escapes)
- - Configurable fallback to ASCII for terminals without Unicode support
\ No newline at end of file
+ - Escapes are alternatives in the lexer rules, processed during tokenization
+ - Unknown escapes are a lexical error
+ - Mixed Unicode/ASCII in the same file is allowed
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..e644113
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..b82aa23
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,7 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
new file mode 100755
index 0000000..1aa94a4
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,249 @@
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
+done
+
+# This is normally unused
+# shellcheck disable=SC2034
+APP_BASE_NAME=${0##*/}
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+ echo "$*"
+} >&2
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD=$JAVA_HOME/jre/sh/java
+ else
+ JAVACMD=$JAVA_HOME/bin/java
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD=java
+ if ! command -v java >/dev/null 2>&1
+ then
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
+ fi
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
+ done
+fi
+
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -classpath "$CLASSPATH" \
+ org.gradle.wrapper.GradleWrapperMain \
+ "$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+ die "xargs is not available"
+fi
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..7101f8e
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,92 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%"=="" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if %ERRORLEVEL% equ 0 goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if %ERRORLEVEL% equ 0 goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/js/README.md b/js/README.md
new file mode 100644
index 0000000..73dcd65
--- /dev/null
+++ b/js/README.md
@@ -0,0 +1,20 @@
+# js/mpl.js — the browser interpreter
+
+`mpl.js` is the M0-core interpreter that runs at
+[mpl.codes](https://mpl.codes). This file is the deployed artifact: the
+copy in this repo, the copy baked into the site image, and the file served
+at `https://mpl.codes/js/mpl.js` are byte-identical (same sha256).
+
+The site repo (`developtheweb/mpl_codes`) does not carry its own copy; its
+image build fetches this file pinned to an exact commit SHA and verifies it
+against a pinned sha256 checksum. A mismatch fails the site build.
+
+Rules for changing this file:
+
+- Never edit it in a commit that does not also state the behavioral change
+ in `DECISIONS.md`.
+- Keep it dependency-free and transformation-free — no build step may
+ minify it, wrap it, or inject banners, because that would break byte
+ identity with the deployed file.
+- Run `node --test "js/test/*.test.mjs"` before committing; CI runs the
+ same suite.
diff --git a/js/mpl.js b/js/mpl.js
new file mode 100644
index 0000000..ed85a4a
--- /dev/null
+++ b/js/mpl.js
@@ -0,0 +1,179 @@
+'use strict';
+/* ============ MPL M0 interpreter (ratified semantics: conformance/JUDGMENT_CALLS.md) ============ */
+const BOT=Symbol('⊥'),NOMATCH=Symbol('nomatch');
+/* Numbers are exact rationals (ruling 4): BigInt numerator/denominator,
+ gcd-reduced, denominator > 0, constructed once at creation. */
+const gcd=(a,b)=>{a=a<0n?-a:a;b=b<0n?-b:b;while(b){const t=a%b;a=b;b=t}return a};
+const rat=(n,d=1n)=>{if(d<0n){n=-n;d=-d}const g=gcd(n,d)||1n;return{q:true,n:n/g,d:d/g}};
+const isRat=v=>!!v&&typeof v==='object'&&v.q===true;
+const R={add:(a,b)=>rat(a.n*b.d+b.n*a.d,a.d*b.d),sub:(a,b)=>rat(a.n*b.d-b.n*a.d,a.d*b.d),
+ mul:(a,b)=>rat(a.n*b.n,a.d*b.d),neg:a=>rat(-a.n,a.d),
+ cmp:(a,b)=>{const l=a.n*b.d,r=b.n*a.d;return lr?1:0},eq:(a,b)=>a.n===b.n&&a.d===b.d};
+/* String ordering is Unicode code-point order (ruling 8). No locale, ever. */
+const cmpStr=(a,b)=>{const A=[...a],B=[...b],m=Math.min(A.length,B.length);
+ for(let i=0;itoks.push({t,v,line:l,col:c});const err=(key,l,c)=>{const e=new Error(key);e.key=key;e.line=l;e.col=c;throw e};
+while(i{for(let k=0;k':'gt','+':'plus','-':'minus','×':'mul','∗':'mul','÷':'divi','/':'divi','∘':'compose','‖':'par','⊥':'bot','|':'bar',';':'semi',':':'colon',',':'comma','(':'lp',')':'rp','[':'lb',']':'rb','{':'lc','}':'rc'};return[map[g],g,l,c]}
+function parse(toks){let p=0;const peek=()=>toks[p],at=t=>toks[p].t===t;
+const err=(key,tok)=>{const e=new Error(key);e.key=key;e.line=tok.line;e.col=tok.col;throw e};
+const eat=t=>{if(!at(t))err('err_expect',peek());return toks[p++]};
+function program(){const s=at('eof')?{k:'seq',es:[]}:seq();eat('eof');return s}
+function seq(){const es=[expr()];while(at('semi')){p++;if(at('eof')||at('rc')||at('rp')||at('rb'))break;es.push(expr())}return es.length===1?es[0]:{k:'seq',es}}
+function expr(){return parallel()}
+function parallel(){let l=def();while(at('par')){p++;l={k:'seq',es:[l,def()]}}return l}
+function def(){const l=assign();if(at('def')){const tk=toks[p++];if(l.k!=='id')err('err_def_target',tk);return{k:'def',name:l.v,e:def(),line:tk.line,col:tk.col}}return l}
+function assign(){const l=cond();if(at('assign')){const tk=toks[p++];if(l.k!=='id')err('err_assign_target',tk);return{k:'set',name:l.v,e:assign(),line:tk.line,col:tk.col}}return l}
+function cond(){let l=implies();while(at('bar')){p++;l={k:'alt',l,r:implies()}}return l}
+function implies(){const l=lor();if(at('implies')){const tk=toks[p++];return{k:'imp',c:l,e:implies(),line:tk.line,col:tk.col}}return l}
+function lor(){let l=land();while(at('or')){const tk=toks[p++];l={k:'or',l,r:land(),line:tk.line,col:tk.col}}return l}
+function land(){let l=compare();while(at('and')){const tk=toks[p++];l={k:'and',l,r:compare(),line:tk.line,col:tk.col}}return l}
+function compare(){const l=add();const ops={eq:1,neq:1,lt:1,gt:1,leq:1,geq:1};if(ops[peek().t]){const tk=toks[p++];return{k:'cmp',o:tk.t,l,r:add(),line:tk.line,col:tk.col}}return l}
+function add(){let l=mul();while(at('plus')||at('minus')){const o=toks[p++].t;l={k:'bin',o,l,r:mul(),line:toks[p-1].line,col:toks[p-1].col}}return l}
+function mul(){let l=compose();while(at('mul')||at('divi')){const o=toks[p++].t;l={k:'bin',o,l,r:compose(),line:toks[p-1].line,col:toks[p-1].col}}return l}
+function compose(){let l=unary();while(at('compose')){const tk=toks[p++];l={k:'comp',l,r:unary(),line:tk.line,col:tk.col}}return l}
+function unary(){if(at('trace')){const tk=toks[p++];return{k:'trace',e:unary(),line:tk.line,col:tk.col}}if(at('minus')){const tk=toks[p++];return{k:'neg',e:unary(),line:tk.line,col:tk.col}}return postfix()}
+function postfix(){let e=atom();for(;;){if(at('lp')){const tk=toks[p++];const args=[];if(!at('rp')){args.push(expr());while(at('comma')){p++;args.push(expr())}}eat('rp');e={k:'call',f:e,args,line:tk.line,col:tk.col};continue}break}return e}
+function pattern(){const names=[eat('id').v];while(at('comma')){p++;names.push(eat('id').v)}return names}
+function atom(){const tk=peek();
+if(at('num')||at('str')||at('bool')){p++;return{k:'lit',v:tk.v}}
+if(at('bot')){p++;return{k:'lit',v:BOT}}
+if(at('id')){p++;return{k:'id',v:tk.v,line:tk.line,col:tk.col}}
+if(at('lambda')){p++;let ps=[];if(!at('colon')){ps=pattern();if(at('in')){p++;cond()}}eat('colon');return{k:'lam',ps,body:expr()}}
+if(at('forall')){p++;const v=eat('id').v;eat('in');const it=cond();eat('colon');return{k:'forall',v,it,body:expr(),line:tk.line,col:tk.col}}
+if(at('lb')){p++;const es=[];if(!at('rb')){es.push(expr());while(at('comma')){p++;es.push(expr())}}eat('rb');return{k:'list',es}}
+if(at('lp')){p++;const e=seq();eat('rp');return e}
+if(at('lc')){p++;if(at('rc')){p++;return{k:'lit',v:BOT}}
+if(at('id')&&toks[p+1].t==='colon'){const fields=[];for(;;){const key=eat('id').v;eat('colon');fields.push([key,expr()]);if(at('comma')){p++;continue}break}eat('rc');return{k:'record',fields,line:tk.line,col:tk.col}}
+const first=expr();
+if(at('comma')){const es=[first];while(at('comma')){p++;es.push(expr())}eat('rc');return{k:'setlit',es,line:tk.line,col:tk.col}}
+const es=[first];while(at('semi')){p++;if(at('eof')||at('rc')||at('rp')||at('rb'))break;es.push(expr())}eat('rc');return es.length===1?first:{k:'seq',es}}
+err('err_unexpected',tk)}
+return program()}
+function runMPL(src,print){const ast=parse(lex(src));const global={vars:new Map(),parent:null};
+const lookup=(sc,n)=>{for(let s=sc;s;s=s.parent)if(s.vars.has(n))return s;return null};
+const rte=(key,node)=>{const e=new Error(key);e.key=key;e.line=node.line;e.col=node.col;throw e};
+const num=(v,node)=>{if(!isRat(v))rte('err_num',node);return v};
+const show=v=>v===BOT?'⊥':typeof v==='string'?v:Array.isArray(v)?'['+v.map(showQ).join(', ')+']':isRat(v)?(v.d===1n?String(v.n):v.n+'/'+v.d):typeof v==='object'&&v&&v.closure?'λ':typeof v==='boolean'?(v?'true':'false'):String(v);
+const showQ=v=>typeof v==='string'?'"'+v+'"':show(v);
+/* Equality is structural on data; any function involved raises err_fn_eq
+ (ruling 7). */
+const fnIn=v=>!!v&&typeof v==='object'&&(v.closure?true:Array.isArray(v)?v.some(fnIn):false);
+const dEq=(a,b)=>isRat(a)&&isRat(b)?R.eq(a,b):Array.isArray(a)&&Array.isArray(b)?a.length===b.length&&a.every((x,ix)=>dEq(x,b[ix])):a===b;
+let steps=0,depth=0;const strip=v=>v===NOMATCH?BOT:v;
+/* Explicit-stack machine (ruling 10): the work stack lives on the heap, so
+ recursion is bounded by the λ-application depth counter — limit 10000,
+ err_depth — never by the host stack. No keyless host error is reachable.
+ err_steps (500000 node evaluations) is this implementation's resource
+ limit (ruling 11), counted once per frame like the old per-ev-call count.
+ Guard conditions and ∧ ∨ operands must be boolean — err_bool (rulings
+ 13, 14; ∧ ∨ short-circuit, so an unevaluated operand raises nothing).
+ ≜ binds once per scope (err_redef); ← requires an existing binding
+ (err_unbound) — ruling 16. */
+function ev(root,sc0){
+const K=[{n:root,sc:sc0,st:0}];let ret;
+const push=(n,sc)=>{K.push({n,sc,st:0});if(++steps>500000){const e=new Error('err_steps');e.key='err_steps';e.line=n.line||1;e.col=n.col||1;throw e}};
+const bool=(v,n)=>{if(typeof v!=='boolean')rte('err_bool',n);return v};
+const apply=f=>{const n=f.n;K.pop();K.push({n:{k:'papply',fn:f.fn,args:f.args,line:n.line,col:n.col},sc:null,st:0})};
+while(K.length){const f=K[K.length-1],n=f.n,sc=f.sc;
+switch(n.k){
+case 'lit':ret=n.v;K.pop();break;
+case 'id':{const s=lookup(sc,n.v);if(!s)rte('err_undef',n);ret=s.vars.get(n.v);K.pop();break}
+case 'lam':ret={closure:true,ps:n.ps,body:n.body,sc};K.pop();break;
+case 'seq':{if(f.st>0)f.last=strip(ret);
+ if(f.st0:n.o==='leq'?d<=0:d>=0}
+ K.pop()}break}
+case 'bin':{if(f.st===0){f.st=1;push(n.l,sc)}
+ else if(f.st===1){f.a=strip(ret);f.st=2;push(n.r,sc)}
+ else{const a=f.a,b=strip(ret);
+ if(n.o==='plus')ret=(typeof a==='string'||typeof b==='string')?show(a)+show(b):R.add(num(a,n),num(b,n));
+ else if(n.o==='minus')ret=R.sub(num(a,n),num(b,n));
+ else if(n.o==='mul')ret=R.mul(num(a,n),num(b,n));
+ else{const bb=num(b,n);if(bb.n===0n)rte('err_div0',n);const aa=num(a,n);ret=rat(aa.n*bb.d,aa.d*bb.n)}
+ K.pop()}break}
+case 'neg':{if(f.st===0){f.st=1;push(n.e,sc)}else{ret=R.neg(num(strip(ret),n));K.pop()}break}
+case 'trace':{if(f.st===0){f.st=1;push(n.e,sc)}else{const v=strip(ret);print(show(v));ret=v;K.pop()}break}
+case 'call':{if(f.st===0){f.st=1;push(n.f,sc)}
+ else if(f.st===1){const fn=strip(ret);if(!fn||!fn.closure)rte('err_notfn',n);f.fn=fn;f.args=[];
+ if(n.args.length){f.st=2;push(n.args[0],sc)}else apply(f)}
+ else if(f.st===2){f.args.push(strip(ret));
+ if(f.args.length10000)rte('err_depth',n);
+ const inner={vars:new Map(),parent:fn.sc};fn.ps.forEach((pn,ix)=>inner.vars.set(pn,n.args[ix]));
+ f.st=3;push(fn.body,inner)}}
+ else if(f.st===1){f.st=2;push({k:'papply',fn:fn.comp[0],args:[strip(ret)],line:n.line,col:n.col},null)}
+ else if(f.st===2){K.pop()}
+ else{depth--;ret=strip(ret);K.pop()}break}
+case 'comp':{if(f.st===0){f.st=1;push(n.l,sc)}
+ else if(f.st===1){f.a=strip(ret);f.st=2;push(n.r,sc)}
+ else{const a=f.a,b=strip(ret);if(!a||!a.closure||!b||!b.closure)rte('err_notfn',n);ret={closure:true,comp:[a,b]};K.pop()}break}
+case 'forall':{if(f.st===0){f.st=1;push(n.it,sc)}
+ else if(f.st===1){const it=strip(ret);if(!Array.isArray(it))rte('err_iter',n);f.it=it;f.i=0;f.st=2;
+ if(it.length)push(n.body,{vars:new Map([[n.v,it[f.i++]]]),parent:sc});else{ret=BOT;K.pop()}}
+ else{/* ruling 2: ∀ is an iterator — its value is ⊥ always */
+ if(f.i {
+ const src = 'l ≜ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];\n' +
+ '∀ a ∈ l: ∀ b ∈ l: ∀ c ∈ l: ∀ d ∈ l: ∀ e ∈ l: ∀ f ∈ l: 0;\n';
+ try {
+ runMPL(src, () => {});
+ assert.fail('should have hit the step budget');
+ } catch (e) {
+ assert.equal(e.key, 'err_steps');
+ }
+});
diff --git a/js/test/load.mjs b/js/test/load.mjs
new file mode 100644
index 0000000..377811f
--- /dev/null
+++ b/js/test/load.mjs
@@ -0,0 +1,11 @@
+// Single shared loader for the interpreter artifact. js/mpl.js must stay
+// byte-identical to the file served at mpl.codes, so the loader adapts to
+// the artifact — never the other way around. The artifact ends with a
+// CommonJS export guard, so createRequire is sufficient today; if that
+// guard ever changes, adapt here (e.g. node:vm), do not edit js/mpl.js.
+import { createRequire } from 'node:module';
+
+const require = createRequire(import.meta.url);
+const { runMPL, ESCAPES } = require('../mpl.js');
+
+export { runMPL, ESCAPES };
diff --git a/js/test/mpl.test.mjs b/js/test/mpl.test.mjs
new file mode 100644
index 0000000..ac2fca8
--- /dev/null
+++ b/js/test/mpl.test.mjs
@@ -0,0 +1,144 @@
+'use strict';
+/* Interpreter tests — run with: node --test "js/test/*.test.mjs"
+ * Asserts EXACT outputs for every program mpl.codes ships, so the site can
+ * never claim an example works that doesn't. Migrated from the mpl_codes
+ * test suite (test/mpl.test.js @ 5b50cc0) with every assertion's input and
+ * expected value preserved exactly; only the runner mechanics changed.
+ */
+import test from 'node:test';
+import assert from 'node:assert/strict';
+import fs from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+import { runMPL, ESCAPES } from './load.mjs';
+import { SYMBOLS, EXERCISES, DEFAULT_PROGRAM, HERO_PROGRAM } from './fixtures.mjs';
+
+const __dirname = path.dirname(fileURLToPath(import.meta.url));
+
+function run(src) {
+ const out = [];
+ runMPL(src, s => out.push(s));
+ return out;
+}
+
+test('hero program computes factorial', () => {
+ assert.deepEqual(run(HERO_PROGRAM), ['5! = 120']);
+});
+
+test('default playground program', () => {
+ assert.deepEqual(run(DEFAULT_PROGRAM), ['Salaam, Fatima!', '5! = 120']);
+});
+
+const EXPECTED_EXERCISES = [
+ ['Hello, World!', 'Jambo!', '你好!', 'مرحبا!'],
+ ['Area = 15'],
+ ['5! = 120'],
+ ['Σ = 55'],
+ ['2', '4', '6', '8'],
+ ['42'],
+];
+
+test('all six exercises produce their documented output', () => {
+ assert.equal(EXERCISES.length, EXPECTED_EXERCISES.length);
+ EXERCISES.forEach((ex, i) => {
+ assert.deepEqual(run(ex.code), EXPECTED_EXERCISES[i], `exercise ${i + 1}`);
+ });
+});
+
+test('all six type symbols lex as inert ∈-constraint atoms', () => {
+ // ℕ ℤ ℚ ℝ ℂ 𝔹 parse in constraint position and are discarded unevaluated
+ // (§5: "parsed today, not yet enforced"). 𝔹 is supplementary-plane: the
+ // lexer must treat the surrogate pair as one code point.
+ for (const T of ['ℕ', 'ℤ', 'ℚ', 'ℝ', 'ℂ', '𝔹']) {
+ assert.deepEqual(run(`f ≜ λx∈${T}: (x ⟹ 1) | 0;\n✎ f(true);`), ['1'],
+ `type symbol ${T}`);
+ }
+});
+
+test('𝔹 (U+1D539) lexes as one code point, not two surrogate halves', () => {
+ // The exact gate case:
+ assert.deepEqual(run('f ≜ λx∈𝔹: (x ⟹ 1) | 0; ✎ f(true);'), ['1']);
+ // And no half-pair matching: 𝕊 (U+1D54A) shares 𝔹's high surrogate
+ // \uD835 but is NOT a type symbol — it must be rejected whole.
+ try {
+ run('✎ 𝕊;');
+ assert.fail('𝕊 should not lex');
+ } catch (e) {
+ assert.equal(e.key, 'err_char');
+ }
+});
+
+test('vendored examples 01 and 02 run in the M0 browser core', () => {
+ // 03–10 use constructs beyond the browser core (modules, resources,
+ // channels, metaprogramming) — running them is deliberately NOT claimed.
+ const ex = n => fs.readFileSync(path.join(__dirname, '..', '..', 'examples', n), 'utf8');
+ assert.deepEqual(run(ex('01_hello_world.mpl')), ['Hello, World!']);
+ assert.deepEqual(run(ex('02_factorial.mpl')), ['120']);
+});
+
+test('undefined name reports err_undef at 1:1', () => {
+ try {
+ run('x + 1;');
+ assert.fail('should have thrown');
+ } catch (e) {
+ assert.equal(e.key, 'err_undef');
+ assert.equal(e.line, 1);
+ assert.equal(e.col, 1);
+ }
+});
+
+test('division by zero reports err_div0', () => {
+ try {
+ run('✎ 1 ÷ 0;');
+ assert.fail('should have thrown');
+ } catch (e) {
+ assert.equal(e.key, 'err_div0');
+ }
+});
+
+test('SYMBOLS table: one escape per glyph, all escapes known to the lexer', () => {
+ const glyphs = new Set();
+ const escapes = new Set();
+ for (const [glyph, esc] of SYMBOLS) {
+ assert.ok(!glyphs.has(glyph), `duplicate glyph ${glyph}`);
+ assert.ok(!escapes.has(esc), `duplicate escape ${esc}`);
+ glyphs.add(glyph);
+ escapes.add(esc);
+ if (esc.startsWith('\\')) {
+ // the palette's escape must be exactly what the lexer expands
+ assert.equal(ESCAPES[esc.slice(1)], glyph,
+ `lexer ESCAPES['${esc.slice(1)}'] must map to ${glyph}`);
+ } else {
+ // ASCII symbols (like |) are their own spelling
+ assert.equal(esc, glyph);
+ }
+ }
+});
+
+test('every palette escape lexes identically to its glyph', () => {
+ // One program that uses all fifteen backslash-escaped glyphs.
+ const glyphProgram = [
+ 'check ≜ λa, b: ((a ≤ b) ∧ (b ≥ a) ∧ (a ≠ b) ⟹ ✎ "cmp") | ⊥;',
+ 'check(1, 2);',
+ 't ≜ 0;', // ruling 16: first binding is ≜ (← still covered by the ∀ line)
+ '∀ n ∈ [1, 2, 3]: t ← t + n;',
+ '✎(t × 2);',
+ '✎(t ÷ 2);',
+ '✎((true ∨ false) ⟹ "or");',
+ ].join('\n');
+ // Verify coverage: every escaped SYMBOLS glyph appears in the program.
+ for (const [glyph, esc] of SYMBOLS) {
+ if (esc.startsWith('\\')) {
+ assert.ok(glyphProgram.includes(glyph), `probe program must use ${glyph}`);
+ }
+ }
+ // Build the escape-spelled variant (a space terminates each escape word).
+ let escProgram = glyphProgram;
+ for (const [glyph, esc] of SYMBOLS) {
+ if (esc.startsWith('\\')) escProgram = escProgram.split(glyph).join(esc + ' ');
+ }
+ const expected = ['cmp', '12', '3', 'or'];
+ assert.deepEqual(run(glyphProgram), expected);
+ assert.deepEqual(run(escProgram), expected, 'escape spelling must behave identically');
+});
diff --git a/math_prog_lang.md b/math_prog_lang.md
index 74c13f3..d353733 100644
--- a/math_prog_lang.md
+++ b/math_prog_lang.md
@@ -1,180 +1,204 @@
# Mathematical Programming Language (MPL)
-## Core Symbol Set
+This is the language specification. The single source of truth for what
+parses is the grammar, [`src/main/antlr4/MPL.g4`](src/main/antlr4/MPL.g4);
+every symbol and example below is part of the M0 grammar unless explicitly
+marked "M1".
+
+## Core Symbol Set (M0)
### Mathematical Foundation (LaTeX)
- **Variables:** α,β,γ,δ,ε,ζ,η,θ,ι,κ,λ,μ,ν,ξ,ο,π,ρ,σ,τ,υ,φ,χ,ψ,ω
-- **Collections:** ∅,∪,∩,⊂,⊃,∈,∉,⊆,⊇
-- **Logic:** ∧,∨,¬,⟹,⟺,∀,∃
-- **Operations:** +,-,×,÷,∗,∘
+- **Collections:** ∅,∈
+- **Logic:** ∧,∨,⟹,∀
+- **Operations:** +,-,×,÷ (ASCII alias `/`),∗,∘
- **Relations:** =,≠,<,>,≤,≥,≈,∼
-- **Functions:** f: A → B, λ
+- **Functions:** λ (calls are `f(a, b)`)
- **Assignment:** ←
- **Definition:** ≜
- **Structure:** (),[],{},⟨⟩
-### Effect Extensions (11 new glyphs)
+### Effect Extensions
- **↯** Raise exception
-- **↴** Handle exception
+- **↴** Handle exception (postfix: `expr ↴ { ↯pattern ⟹ expr }`)
- **‖** Parallel composition
-- **⌈⌉** Atomic section/lock
-- **⊕** Allocate resource
-- **⊖** Release resource
+- **⌈⌉** Atomic section/lock (optional subscript: `⌈…⌉_lock`)
+- **⊕** Allocate resource (postfix: `database ⊕`)
+- **⊖** Release resource (postfix: `conn ⊖`)
- **𝓜** Module declaration
-- **⇐** Import
-- **⇒** Export
-- **⇀** Send (network)
-- **↽** Receive (network)
+- **⇒** Export
+- **‧** Qualified module access (`Mathematics‧sin`)
+- **⇀** Send to channel (`⇀_ch expr`)
+- **↽** Receive from channel (`↽_ch expr`)
### Additional Operators
- **⟨v|e⟩** Choice type (value or error)
-- **🖫** File path prefix
-- **⇡⇣** Stream positioning
-- **⇆** Atomic swap
-- **⟪⟫** Deep update path
+- **🖫** File path prefix (`🖫"file.txt"` or `🖫identifier`)
- **⌜⌝** Code quotation
- **⌞⌟** Code evaluation
-- **?** Introspection
- **⧈** Breakpoint
-- **✎** Trace/log
+- **✎** Trace/log (the one output operator)
- **⏲** Delay
- **⟳** Periodic task
- **〔〕** RAII scope
+### Reserved for M1 (not in the grammar)
+∪,∩,⊂,⊃,⊆,⊇,∉ (set algebra); ¬,⟺,∃ (extended logic); → (function
+types); ⇐ (import); ⇡⇣ (stream positioning); ⇆ (atomic swap); ⟪⟫ (deep
+update); ? (introspection); ∑,√,²,% (arithmetic extensions). Each returns
+only together with a defined semantic.
+
## Grammar
+The sketches below are illustrative; [`MPL.g4`](src/main/antlr4/MPL.g4) is
+normative.
+
### Basic Expressions
```
expr ::= variable | literal | operation | function_call | block
-variable ::= α | β | γ | ... | ω
-literal ::= number | string | path | list | set
+variable ::= identifier | α | β | γ | ... | ω
+literal ::= number | string | path | list | set | record
operation ::= expr OP expr
-function_call ::= f(expr, ...)
-block ::= { statement; ... }
+function_call ::= f(expr, ...) -- the one call syntax; f() is legal
+block ::= { expr; expr; ... } -- ; separates, trailing ; permitted
```
-### Statements
+### Expression Forms
```
-assignment ::= variable ← expr
-definition ::= variable ≜ expr
-conditional ::= condition ⟹ expr
-iteration ::= ∀variable∈set: expr
+assignment ::= expr ← expr
+definition ::= expr ≜ expr
+conditional ::= (condition ⟹ result) | fallback -- guarded alternatives
+iteration ::= ∀pattern∈domain: expr
+lambda ::= λpattern: expr | λpattern∈domain: expr
parallel ::= expr ‖ expr
-atomic ::= ⌈expr⌉_lock
-exception ::= ↯expr | expr ↴ {↯e ⇒ handler}
+atomic ::= ⌈expr⌉ | ⌈expr⌉_lock
+exception ::= ↯expr | expr ↴ {↯pattern ⟹ handler; ...}
```
### Types
```
basic_type ::= ℕ | ℤ | ℚ | ℝ | ℂ | 𝔹
-function_type ::= domain → codomain
choice_type ::= ⟨type|type⟩
-effect_type ::= type^effect
+function_type ::= domain → codomain -- M1
+effect_type ::= type^effect -- M1
```
## Example Programs
+These are the ten programs in [`examples/`](examples/), verbatim; CI parses
+them on every push (`./gradlew parseExamples`).
+
### Hello World
-```
-✎"Hello, World!"
+```mpl
+-- Hello World example
+✎"Hello, World!";
```
### Factorial
-```
-factorial ≜ λn∈ℕ: n≤1 ⟹ 1 | n×factorial(n-1)
-result ← factorial(5)
-✎result
+```mpl
+-- Factorial example with proper precedence
+factorial ≜ λn∈ℕ: (n≤1 ⟹ 1) | (n×factorial(n-1));
+result ← factorial(5);
+✎result;
```
### File Processing with Error Handling
-```
-processFile ≜ λpath: 🖫path ↴ {
- data ← readFile(path)
- result ← transform(data)
- writeFile(result, 🖫"output.txt")
+```mpl
+-- File processing with error handling
+processFile ≜ λpath: {
+ data ← readFile(🖫path);
+ result ← transform(data);
+ writeFile(result, 🖫"output.txt");
⟨"success"|"failed"⟩
-} ↴ {↯e ⇒ ⟨⊥|e⟩}
+} ↴ {↯e ⟹ ⟨⊥|e⟩};
```
### Concurrent Download
-```
+```mpl
+-- Concurrent download with parallelism
downloadAll ≜ λurls: ∀url∈urls: (
fetchData(url) ‖ processData(url)
-) ⟹ mergeResults()
+) ⟹ mergeResults();
```
### Module Definition
-```
+```mpl
+-- Module definition example
𝓜 Mathematics ⇒ {
- π ≜ 3.14159...
- sin ≜ λx∈ℝ: ...
- cos ≜ λx∈ℝ: ...
-}
+ π ≜ 3.14159;
+ sin ≜ λx∈ℝ: ⊥ {- implementation deferred until MPL executes -};
+ cos ≜ λx∈ℝ: ⊥ {- implementation deferred until MPL executes -}
+};
-angle ← π/4
-result ← Mathematics‧sin(angle)
+angle ← π/4;
+result ← Mathematics‧sin(angle);
```
### Resource Management
-```
+```mpl
+-- Resource management with RAII
databaseQuery ≜ λquery: 〔
- conn ← database ⊕
+ conn ← database ⊕;
⌈
- result ← execute(conn, query)
- ✎"Query executed"
+ result ← execute(conn, query);
+ ✎"Query executed";
result
⌉_db_lock
- conn ⊖
-〕
+ {- conn ⊖ happens automatically at end of 〔〕 -}
+〕;
```
### Metaprogramming
-```
+```mpl
+-- Metaprogramming with code quotation
generateFunction ≜ λname: ⌜
λx: x × 2
-⌝
+⌝;
-doubler ← ⌞generateFunction("doubler")⌟
-result ← doubler(21)
+doubler ← ⌞generateFunction("doubler")⌟;
+result ← doubler(21);
```
### Real-time System
-```
+```mpl
+-- Real-time scheduler with periodic tasks
scheduler ≜ ⟳(
- tasks ← getPendingTasks()
- ∀task∈tasks: execute(task) ‖ monitor(task)
- , 100ms
-)
+ tasks ← getPendingTasks();
+ ∀task∈tasks: execute(task) ‖ monitor(task),
+ 100ms
+);
```
### Network Server
-```
+```mpl
+-- Network server with connection handling
server ≜ λport: 〔
- socket ← bind(port) ⊕
- ∀request: (
- data ← ↽_socket request
- response ← processRequest(data)
+ socket ← bind(port) ⊕;
+ ∀request∈acceptLoop(socket): (
+ data ← ↽_socket request;
+ response ← processRequest(data);
⇀_socket response
) ‖ handleNext()
- socket ⊖
-〕
+ {- socket ⊖ happens automatically at end of 〔〕 -}
+〕;
```
### Type-safe Database
-```
-User ≜ {name: String, age: ℕ∣age>0, email: String}
+```mpl
+-- Type-safe database with refinement types
+User ≜ {name: String, age: ℕ | age>0, email: String};
query ≜ λtable∈Database: ∀row∈table: validateUser(row) ↴ {
↯"Invalid user" ⟹ ⊥
-}
+};
```
## Critical Implementation Decisions
### Lexical Layer
-- **Unicode Normalization:** NFC on ingest, reject mixed forms
-- **Symbol Input:** Cross-platform keymap (Ctrl+Alt+g → γ) + ASCII escapes (\gamma → γ)
-- **Semicolon handling:** Require explicit `;` everywhere except before `}`
+- **Unicode Normalization:** NFC on ingest, reject mixed forms (planned; the parser currently consumes code points as-is)
+- **Symbol Input:** ASCII escapes (\gamma → γ), exactly one per glyph; editor keymaps are future tooling
+- **Semicolon handling:** `;` has one role — it separates expressions in a sequence; a trailing `;` is permitted (so `;` before `}` is legal but not required)
- **Comments:** `--` for single-line comments (to end of line), `{- ... -}` for multi-line comments (nestable)
- **String Literals:**
- Standard strings: `"..."` with escape sequences (`\n`, `\t`, `\\`, `\"`, `\u{XXXXXX}`)
@@ -183,25 +207,31 @@ query ≜ λtable∈Database: ∀row∈table: validateUser(row) ↴ {
- **Number Literals:** Decimal (`123`, `3.14`), hex (`0x1A`), binary (`0b1101`), with optional type suffixes later
### Operator Precedence Table
+
+Authoritative copy: [precedence.csv](precedence.csv).
+
| Level | Operators | Associativity |
|-------|-----------|---------------|
-| 9 | function application | left |
-| 8 | ↯ ✎ ? ⧈ ⏲ (prefix) | right |
-| 7 | ∘ | left |
-| 6 | × ÷ ∗ | left |
-| 5 | + - | left |
-| 4 | = ≠ < > ≤ ≥ ≈ ∼ | non-assoc |
-| 3 | ∧ | left |
-| 2 | ∨ | left |
-| 1 | ⟹ | right |
-| 0 | ← | right |
+| 11 | f(a, b) ‧ ⊕ ⊖ ↴{…} (postfix) | left |
+| 10 | ↯ ✎ ⧈ ⏲ - ⇀_ch ↽_ch (prefix) | right |
+| 9 | ∘ | left |
+| 8 | × ÷ ∗ | left |
+| 7 | + - | left |
+| 6 | = ≠ < > ≤ ≥ ≈ ∼ | non-assoc |
+| 5 | ∧ | left |
+| 4 | ∨ | left |
+| 3 | ⟹ | right |
+| 2 | \| (guarded alternatives) | left |
+| 1 | ← | right |
+| 0 | ≜ | right |
| -1 | ‖ | left |
| -2 | ; | left |
### Grammar Resolutions
-- **Block semantics:** Every statement returns value (ML-style)
-- **Conditional associativity:** Right-associative (a⟹b⟹c = a⟹(b⟹c))
-- **Choice type parsing:** Different tokens for |value vs |type contexts
+- **Block semantics:** Every expression in a sequence yields a value (ML-style)
+- **Conditional associativity:** ⟹ is right-associative (a⟹b⟹c = a⟹(b⟹c)); guarded alternatives chain left: (c₁ ⟹ r₁) | (c₂ ⟹ r₂) | fallback
+- **Choice type parsing:** one BAR token; the `|` inside ⟨a|b⟩ is the guarded-alternative level of the inner expression
+- **Brace disambiguation:** `{a: e, …}` record, `{a, b, …}` set (two or more elements), anything else (incl. `{}`, `{x}`) a block
### Type System Extensions
- **Effect polymorphism:** `map : (A→ᴱ B) → List A →ᴱ List B`
@@ -262,13 +292,16 @@ map ≜ ΛA. ΛB. λf: A→ᴱ B. λxs: List A. …
```
Γ ⊢ e₁ : α Γ ⊢ e₂ : β Γ ⊢ e₃ : β
───────────────────────────────────────────────────────── (HANDLE)
-Γ ⊢ e₁ ↴ { ↯x ⇒ e₂ } : β ▷ Eff = (Eff(e₁) - {Raise ε}) ∪ Eff(e₂)
+Γ ⊢ e₁ ↴ { ↯x ⟹ e₂ } : β ▷ Eff = (Eff(e₁) - {Raise ε}) ∪ Eff(e₂)
```
-### M0 Exit Criteria
-1. All spec examples parse and pretty-print round-trip
-2. No shift/reduce conflicts in grammar
-3. 10,000 random token sequences don't crash parser
+### M0 Exit Criteria (all CI-enforced)
+1. Grammar compiles with zero ANTLR errors and zero warnings (`-Werror`)
+2. All ten example programs parse (`./gradlew parseExamples`)
+3. Every ```mpl code block in the documentation parses (`DocumentationTest`)
+4. Full test suite passes (`./gradlew test`)
+
+Deferred to later milestones: pretty-print round-tripping and parser fuzzing.
## Implementation Roadmap
1. **M0:** ANTLR grammar + 500 LOC test suite
diff --git a/precedence.csv b/precedence.csv
index f564eff..824b974 100644
--- a/precedence.csv
+++ b/precedence.csv
@@ -1,13 +1,15 @@
Level,Operators,Associativity,Description
-9,function application,left,Function call f(x) or f x
-8,"↯ ✎ ? ⧈ ⏲ (prefix)",right,Unary prefix operators
-7,∘,left,Function composition
-6,× ÷ ∗,left,Multiplication and division
-5,+ -,left,Addition and subtraction
-4,= ≠ < > ≤ ≥ ≈ ∼,non-associative,Comparison operators
-3,∧,left,Logical AND
-2,∨,left,Logical OR
-1,⟹,right,Implication
-0,←,right,Assignment
+11,"f(a, b) ‧ ⊕ ⊖ ↴{…}",left,"Postfix operators: function call, qualified module access, resource alloc/release, exception handler"
+10,"↯ ✎ ⧈ ⏲ - ⇀_ch ↽_ch (prefix)",right,"Unary prefix operators (including unary minus) and channel operations"
+9,∘,left,Function composition
+8,× ÷ ∗,left,Multiplication and division (/ is an ASCII alias of ÷)
+7,+ -,left,Addition and subtraction
+6,= ≠ < > ≤ ≥ ≈ ∼,non-associative,Comparison operators
+5,∧,left,Logical AND
+4,∨,left,Logical OR
+3,⟹,right,Implication / guard arrow
+2,|,left,Guarded alternatives: (condition ⟹ result) | fallback
+1,←,right,Assignment
+0,≜,right,Definition
-1,‖,left,Parallel composition
--2,;,left,Statement sequencing
\ No newline at end of file
+-2,;,left,Expression sequencing (trailing ; permitted)
diff --git a/road_map.md b/road_map.md
new file mode 100644
index 0000000..510be0c
--- /dev/null
+++ b/road_map.md
@@ -0,0 +1,213 @@
+# MPL Implementation Audit & Vision-Aligned Roadmap
+
+## Part 1: Code Analysis - Grammar vs Examples
+
+### What Actually Exists
+The ANTLR grammar (`MPL.g4`) successfully defines 70+ mathematical symbols and can parse all 10 example files. However, it's **only a parser** - no execution, no type system, no module system.
+
+### Specific Mismatches Found
+
+1. **Module System Claims vs Reality**
+ - Example 05: `Mathematics‧sin(angle)` implies qualified module access
+ - Grammar: Just tokenizes `‧` (MIDDOT) with no semantic handling
+ - **Gap**: 100% of module functionality missing
+
+2. **Type System Fiction**
+ - Examples: `λn∈ℕ:` suggests type constraints
+ - Grammar: Parses `IN` as a token, no type checking exists
+ - Example 10: `age: ℕ | age>0` implies refinement types
+ - **Gap**: 100% of type system missing
+
+3. **Effect System Illusion**
+ - Examples: `↴ {↯e ⟹ handler}` implies exception handling
+ - Grammar: Just parses symbols as operators
+ - Examples: `〔〕` claims automatic resource cleanup
+ - **Gap**: 100% of effect semantics missing
+
+4. **Parallel Execution Fantasy**
+ - Example 04: `fetchData(url) ‖ processData(url)` implies concurrency
+ - Grammar: `‖` is just an infix operator
+ - **Gap**: 100% of runtime missing
+
+5. **Pattern Matching**
+ - Spec promises it for M1
+ - Grammar: No `match` construct at all
+ - **Gap**: 0% implemented
+
+### Percentage Built vs Envisioned
+- **Parsing**: 90% complete (missing pattern matching)
+- **Execution**: 0% - can't run a single program
+- **Type System**: 0% - no checking whatsoever
+- **Module System**: 0% - no imports/exports work
+- **Effect System**: 0% - symbols without semantics
+- **Standard Library**: 0% - no built-in functions
+
+**Overall: ~15% of envisioned language exists**
+
+## Part 2: Implementation Audit
+
+### What's Implemented
+- 172 lines of ANTLR grammar
+- Lexer recognizing Unicode + ASCII escapes
+- Parser accepting expression/statement syntax
+- Java test harness that parses files
+
+### What's Claimed But Missing
+1. **"Hello World" can't actually print** - `✎` parsed but no runtime
+2. **Factorial can't compute** - no function evaluation
+3. **File operations** are fictional - `🖫` exists but does nothing
+4. **Modules** don't resolve - `𝓜` just starts a block
+5. **No REPL** - can't interactively try symbols
+6. **No error messages** - parser fails with English Java exceptions
+
+### Critical Missing Pieces for Mission
+- **Symbol Input Methods**: How does a child in Cairo type λ?
+- **Visual Output**: Results shown as math, not text
+- **Symbolic Errors**: ⚠ instead of "SyntaxError"
+- **Distribution**: No installer, no website, no accessibility
+
+## Part 3: Vision-Aligned Roadmap
+
+### Phase 0: First Child (2 weeks)
+**Goal**: ONE child writes factorial without seeing English
+
+**Code Changes**:
+```java
+// New: src/main/java/com/mpl/runtime/Interpreter.java
+public class Interpreter {
+ public Value eval(ParseTree tree) {
+ // Minimal evaluator for arithmetic + functions
+ // Support: numbers, +, ×, -, ÷, λ, application
+ }
+}
+
+// New: src/main/java/com/mpl/ui/SymbolPad.java
+public class SymbolPad extends JPanel {
+ // Visual symbol palette - click to insert
+ // Groups: Greek, Math, Logic, Effects
+ // Tooltips show symbol meaning with pictures
+}
+```
+
+**Deliverable**: Video of child clicking symbols to compute `λn: n×n` applied to 5, seeing 25
+
+### Phase 1: Symbol Accessibility (1 month)
+**Goal**: Anyone can input symbols without special knowledge
+
+**Code Changes**:
+```java
+// New: src/main/resources/symbol-input.json
+{
+ "α": ["alpha", "a.", "\\alpha"], // Multiple input methods
+ "λ": ["lambda", "fn", "\\", "\\lambda"],
+ "∀": ["forall", "all", "\\forall"]
+}
+
+// New: src/main/java/com/mpl/input/SmartComplete.java
+// As user types "lam" → suggests λ with visual preview
+```
+
+**Platform Solutions**:
+- Web: Virtual keyboard overlay
+- Mobile: Custom IME with math symbols
+- Desktop: System-wide compose key mappings
+
+**Success Metric**: 10 children from different countries input factorial
+
+### Phase 2: Mathematical Error Messages (1 month)
+**Goal**: Errors shown as math notation, not English text
+
+**Code Changes**:
+```java
+// New: src/main/java/com/mpl/errors/SymbolicError.java
+public class SymbolicError {
+ // Instead of "Type mismatch: expected Int, got String"
+ // Show: ⚠ ℕ ≠ String with visual type hierarchy
+
+ public Diagram renderError() {
+ // Graphical representation of what went wrong
+ // Red highlighting on problematic symbols
+ // Green showing what was expected
+ }
+}
+```
+
+**Examples**:
+- Parse error: Highlights unmatched `(` with blinking `)`
+- Type error: Shows `ℕ ← "text"` with red ✗
+- Missing definition: `? factorial` with suggestion to define
+
+### Phase 3: Visual Execution (2 months)
+**Goal**: See programs run as animated mathematics
+
+**Code Changes**:
+```java
+// New: src/main/java/com/mpl/viz/ExecutionAnimator.java
+// Shows factorial(3) as:
+// factorial(3) → 3 × factorial(2) → 3 × 2 × factorial(1) → 3 × 2 × 1 → 6
+// Each step animated with mathematical transformations
+```
+
+**Features**:
+- Step-through debugging with symbol highlighting
+- Value visualization (sets as Venn diagrams, functions as mappings)
+- Parallel execution shown as split timelines
+
+### Phase 4: Community Seed (2 months)
+**Goal**: First 100 non-English speakers using MPL
+
+**Code Changes**:
+```java
+// New: src/main/java/com/mpl/share/SymbolProgram.java
+// Export programs as mathematical documents (PDF/SVG)
+// QR codes for mobile symbol input
+
+// New: src/main/resources/lessons/
+// Visual tutorials - no text, only symbols and animations
+// Start with arithmetic, build to algorithms
+```
+
+**Distribution**:
+- **mpl.math** domain (not .com - emphasize mathematics)
+- PWA for instant access on any device
+- Offline-first for areas with limited internet
+- Partner with one school in Egypt, one in Japan
+
+### Phase 5: Mathematical Standard Library (3 months)
+**Goal**: Rich set of mathematical functions without English names
+
+**Code Changes**:
+These signatures are a design sketch for a future milestone — the symbols
+(→, ↑, ∃?, 📖, ✍, ⊤) are not in the M0 grammar, so the block is fenced as
+plain text:
+
+```text
+-- Instead of "sort", "map", "filter": (design sketch, not yet parseable)
+↑: List α → List α -- ascending order (up arrow)
+∀→: (α → β) → List α → List β -- universal transformation
+∃?: (α → 𝔹) → List α → List α -- exists predicate filter
+
+-- File operations use pictograms:
+📖: 🖫Path → String -- read (open book)
+✍: String → 🖫Path → ⊤ -- write (writing hand)
+```
+
+### Success Metrics by Phase
+- **Phase 0**: 1 child computes without English
+- **Phase 1**: 10 children from different languages input symbols
+- **Phase 2**: 50 users understand errors without translation
+- **Phase 3**: 100 users debug programs visually
+- **Phase 4**: 500 non-English speakers share programs
+- **Phase 5**: 1000 users building real applications
+
+### What We're NOT Prioritizing
+- Compiler optimizations
+- Corporate adoption
+- Performance benchmarks
+- English documentation
+- Traditional CS curriculum compatibility
+
+### The Revolution Metric
+Each phase asks: **"Could a child who speaks no English use this?"**
+
+If the answer is no, we've failed the mission. The moonshot isn't building a language - it's proving programming belongs to all humanity, not just English speakers.
\ No newline at end of file
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..048daee
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'mpl'
\ No newline at end of file
diff --git a/src/main/antlr4/MPL.g4 b/src/main/antlr4/MPL.g4
new file mode 100644
index 0000000..388593a
--- /dev/null
+++ b/src/main/antlr4/MPL.g4
@@ -0,0 +1,432 @@
+grammar MPL;
+
+// The Java package comes from the '-package com.mpl.parser' argument in
+// build.gradle. An @header package declaration here would duplicate it.
+
+// ============================================================================
+// PARSER RULES
+//
+// Structural decisions (see DECISIONS.md for rationale):
+//
+// * SEMICOLON has exactly one role: it separates expressions in a sequence
+// (`seqExpr`). A trailing semicolon is permitted. There is no separate
+// "statement terminator" concept; the program, blocks, parenthesized
+// groups, atomic sections, RAII scopes and code quotations all contain a
+// single seqExpr.
+//
+// * Braces are disambiguated structurally:
+// - record: `{ name: expr, ... }` — at least one `IDENTIFIER : expr`
+// - set: `{ a, b, ... }` — at least TWO comma-separated exprs
+// - block: everything else, including `{}` and `{ x }`
+// A singleton set cannot be written literally (use ∅ and set operations
+// in M1); singleton braces always parse as a block.
+//
+// * Function calls are `f(a, b)` only — a postfix argument list. Haskell
+// juxtaposition (`f x`) was removed. Nullary calls `f()` are supported.
+//
+// * ≜ defines (right-associative, binds looser than ←); ← assigns.
+//
+// * Guarded alternatives `(condition ⟹ result) | fallback` are the one
+// conditional form, wired in as the condExpr precedence level.
+// ============================================================================
+
+program
+ : seqExpr? EOF
+ ;
+
+seqExpr
+ : expr (SEMICOLON expr)* SEMICOLON?
+ ;
+
+// Expression precedence chain, lowest binding first.
+expr
+ : parallelExpr
+ ;
+
+parallelExpr
+ : defExpr (PARALLEL defExpr)* // ‖ parallel composition
+ ;
+
+defExpr
+ : assignExpr (DEFINITION defExpr)? // ≜ definition (right-assoc)
+ ;
+
+assignExpr
+ : condExpr (LEFTARROW assignExpr)? // ← assignment (right-assoc)
+ ;
+
+// Guarded alternatives: (condition ⟹ result) | fallback
+// The one conditional form. The BAR inside ⟨a|b⟩ is also consumed here.
+condExpr
+ : impliesExpr (BAR impliesExpr)*
+ ;
+
+impliesExpr
+ : orExpr (IMPLIES impliesExpr)? // ⟹ guard/implication (right-assoc)
+ ;
+
+orExpr
+ : andExpr (OR andExpr)* // ∨ logical OR
+ ;
+
+andExpr
+ : cmpExpr (AND cmpExpr)* // ∧ logical AND
+ ;
+
+cmpExpr
+ : addExpr (compareOp addExpr)? // comparisons (non-associative)
+ ;
+
+compareOp
+ : EQ | NEQ | LT | GT | LEQ | GEQ | APPROX | SIM
+ ;
+
+addExpr
+ : mulExpr ((PLUS | MINUS) mulExpr)*
+ ;
+
+mulExpr
+ : composeExpr ((TIMES | DIV | AST) composeExpr)*
+ ;
+
+composeExpr
+ : unaryExpr (COMPOSE unaryExpr)* // ∘ function composition
+ ;
+
+unaryExpr
+ : (prefixOp | channelOp)* postfixExpr
+ ;
+
+// MINUS doubles as unary negation: -x
+prefixOp
+ : RAISE | TRACE | BREAK | DELAY | MINUS
+ ;
+
+// Channel operations are subscripted prefix operators: ⇀_ch expr, ↽_ch expr
+channelOp
+ : (SEND | RECEIVE) UNDERSCORE IDENTIFIER
+ ;
+
+// Postfix operators: call, qualified access, resource alloc/release, handler.
+postfixExpr
+ : atomExpr postfixOp*
+ ;
+
+postfixOp
+ : callArgs // f(a, b) — the one call syntax
+ | MIDDOT IDENTIFIER // Module‧member
+ | ALLOC // resource ⊕
+ | RELEASE // resource ⊖
+ | HANDLE handlerBlock // expr ↴ { ↯pat ⟹ expr; ... }
+ ;
+
+callArgs
+ : LPAREN (expr (COMMA expr)*)? RPAREN
+ ;
+
+handlerBlock
+ : LBRACE handlerClause (SEMICOLON handlerClause)* SEMICOLON? RBRACE
+ ;
+
+// ↯identifier binds the exception; ↯"literal" matches a specific message.
+// The clause arrow is ⟹, mirroring guarded alternatives.
+handlerClause
+ : RAISE (IDENTIFIER | STRING) IMPLIES expr
+ ;
+
+atomExpr
+ : LPAREN seqExpr RPAREN
+ | lambda
+ | forall
+ | choiceType
+ | atomicSection
+ | raiiScope
+ | codeQuote
+ | codeEval
+ | periodicTask
+ | moduleDecl
+ | pathLiteral
+ | record
+ | set
+ | block
+ | primary
+ ;
+
+primary
+ : IDENTIFIER
+ | greekVar
+ | NUMBER
+ | STRING
+ | RAWSTRING
+ | TRUE
+ | FALSE
+ | BOTTOM
+ | EMPTYSET
+ | typeSymbol
+ | list
+ ;
+
+// Ruling 26: λ is reserved — never an identifier. Every other Greek
+// letter remains one (Fatima wants π).
+greekVar
+ : ALPHA | BETA | GAMMA | DELTA | EPSILON | ZETA | ETA | THETA
+ | IOTA | KAPPA | MU | NU | XI | OMICRON | PI
+ | RHO | SIGMA | TAU | UPSILON | PHI | CHI | PSI | OMEGA
+ ;
+
+typeSymbol
+ : NAT | INT | RAT | REAL | COMPLEX | BOOL
+ ;
+
+// λx: body λx,y: body λx∈ℝ: body — parameters are a bare pattern list.
+// Ruling 18: nullary functions exist — `λ: e` (bare colon) is admitted.
+lambda
+ : LAMBDA_VAR (pattern (IN condExpr)?)? COLON expr
+ ;
+
+forall
+ : FORALL pattern IN condExpr COLON expr
+ ;
+
+// The | inside ⟨a|b⟩ is consumed by condExpr, so the rule needs no explicit BAR.
+choiceType
+ : LANGLE expr RANGLE
+ ;
+
+atomicSection
+ : LCEIL seqExpr RCEIL (UNDERSCORE IDENTIFIER)?
+ ;
+
+raiiScope
+ : LRAII seqExpr? RRAII
+ ;
+
+codeQuote
+ : ULCORNER seqExpr URCORNER
+ ;
+
+codeEval
+ : LLCORNER seqExpr LRCORNER
+ ;
+
+periodicTask
+ : PERIODIC LPAREN seqExpr COMMA NUMBER IDENTIFIER? RPAREN
+ ;
+
+moduleDecl
+ : MODULE IDENTIFIER EXPORT block
+ ;
+
+pathLiteral
+ : PATH (STRING | IDENTIFIER)
+ ;
+
+// Rewritten from the left-recursive, empty-tail form that caused error(148).
+pattern
+ : patternAtom (COMMA patternAtom)*
+ ;
+
+patternAtom
+ : IDENTIFIER
+ | greekVar
+ | UNDERSCORE
+ ;
+
+list
+ : LBRACK (expr (COMMA expr)*)? RBRACK
+ ;
+
+// At least two elements — singleton braces parse as a block (see header note).
+set
+ : LBRACE expr (COMMA expr)+ RBRACE
+ ;
+
+record
+ : LBRACE fieldAssignment (COMMA fieldAssignment)* RBRACE
+ ;
+
+fieldAssignment
+ : IDENTIFIER COLON expr
+ ;
+
+block
+ : LBRACE seqExpr? RBRACE
+ ;
+
+// ============================================================================
+// LEXER RULES
+//
+// Exactly one ASCII escape per glyph (One Right Answer). The authoritative
+// escape table is glyph-escapes.md, which must match these rules exactly.
+// ============================================================================
+
+// Keywords
+IN : '∈' | '\\in' ;
+TRUE : 'true' ;
+FALSE : 'false' ;
+
+// Greek letters
+ALPHA : 'α' | '\\alpha' ;
+BETA : 'β' | '\\beta' ;
+GAMMA : 'γ' | '\\gamma' ;
+DELTA : 'δ' | '\\delta' ;
+EPSILON : 'ε' | '\\epsilon' ;
+ZETA : 'ζ' | '\\zeta' ;
+ETA : 'η' | '\\eta' ;
+THETA : 'θ' | '\\theta' ;
+IOTA : 'ι' | '\\iota' ;
+KAPPA : 'κ' | '\\kappa' ;
+LAMBDA_VAR : 'λ' | '\\lambda' ;
+MU : 'μ' | '\\mu' ;
+NU : 'ν' | '\\nu' ;
+XI : 'ξ' | '\\xi' ;
+OMICRON : 'ο' | '\\omicron' ;
+PI : 'π' | '\\pi' ;
+RHO : 'ρ' | '\\rho' ;
+SIGMA : 'σ' | '\\sigma' ;
+TAU : 'τ' | '\\tau' ;
+UPSILON : 'υ' | '\\upsilon' ;
+PHI : 'φ' | '\\phi' ;
+CHI : 'χ' | '\\chi' ;
+PSI : 'ψ' | '\\psi' ;
+OMEGA : 'ω' | '\\omega' ;
+
+// Type symbols
+NAT : 'ℕ' | '\\nat' ;
+INT : 'ℤ' | '\\int' ;
+RAT : 'ℚ' | '\\rat' ;
+REAL : 'ℝ' | '\\real' ;
+COMPLEX : 'ℂ' | '\\complex' ;
+BOOL : '𝔹' | '\\bool' ;
+
+// Operators by precedence
+SEMICOLON : ';' ;
+PARALLEL : '‖' | '\\parallel' ;
+LEFTARROW : '←' | '\\leftarrow' ;
+// '\Rightarrow' belongs to EXPORT (⇒); giving it to IMPLIES too fully
+// shadowed EXPORT's escape (ANTLR warning 184).
+IMPLIES : '⟹' | '\\implies' ;
+OR : '∨' | '\\or' ;
+AND : '∧' | '\\and' ;
+EQ : '=' ;
+NEQ : '≠' | '\\neq' ;
+LT : '<' ;
+GT : '>' ;
+LEQ : '≤' | '\\leq' ;
+GEQ : '≥' | '\\geq' ;
+APPROX : '≈' | '\\approx' ;
+SIM : '∼' | '\\sim' ;
+PLUS : '+' ;
+MINUS : '-' ;
+TIMES : '×' | '\\times' ;
+DIV : '÷' | '\\div' | '/' ;
+AST : '∗' | '\\ast' ;
+COMPOSE : '∘' | '\\circ' ;
+
+// Unary operators
+RAISE : '↯' | '\\raise' ;
+TRACE : '✎' | '\\trace' ;
+BREAK : '⧈' | '\\break' ;
+DELAY : '⏲' | '\\delay' ;
+
+// Special operators
+// (LAMBDA was fully shadowed by LAMBDA_VAR — warning 184; LAMBDA_VAR is the
+// single λ token and the lambda parser rule uses it.)
+FORALL : '∀' | '\\forall' ;
+DEFINITION : '≜' | '\\coloneq' ;
+HANDLE : '↴' | '\\handle' ;
+ALLOC : '⊕' | '\\oplus' ;
+RELEASE : '⊖' | '\\ominus' ;
+MODULE : '𝓜' | '\\module' ;
+EXPORT : '⇒' | '\\Rightarrow' ;
+SEND : '⇀' | '\\send' ;
+RECEIVE : '↽' | '\\receive' ;
+PATH : '🖫' | '\\path' ;
+PERIODIC : '⟳' | '\\periodic' ;
+BOTTOM : '⊥' | '\\bot' ;
+EMPTYSET : '∅' | '\\emptyset' ;
+
+// Delimiters
+LPAREN : '(' ;
+RPAREN : ')' ;
+LBRACK : '[' ;
+RBRACK : ']' ;
+LBRACE : '{' ;
+RBRACE : '}' ;
+LANGLE : '⟨' | '\\langle' ;
+RANGLE : '⟩' | '\\rangle' ;
+LCEIL : '⌈' | '\\lceil' ;
+RCEIL : '⌉' | '\\rceil' ;
+LRAII : '〔' | '\\lbracket' ;
+RRAII : '〕' | '\\rbracket' ;
+ULCORNER : '⌜' | '\\ulcorner' ;
+URCORNER : '⌝' | '\\urcorner' ;
+LLCORNER : '⌞' | '\\llcorner' ;
+LRCORNER : '⌟' | '\\lrcorner' ;
+
+// Other symbols
+COLON : ':' ;
+COMMA : ',' ;
+UNDERSCORE : '_' ;
+BAR : '|' ;
+MIDDOT : '‧' | '\\middot' ;
+
+// Identifiers. A leading underscore is NOT allowed: subscripts such as
+// ⌉_db_lock and ↽_socket must lex as UNDERSCORE + IDENTIFIER, not as a
+// single identifier "_db_lock".
+IDENTIFIER
+ : [a-zA-Z][a-zA-Z0-9_]*
+ ;
+
+// Numbers
+NUMBER
+ : INTEGER
+ | FLOAT
+ | HEX
+ | BINARY
+ ;
+
+fragment INTEGER
+ : [0-9]+
+ ;
+
+fragment FLOAT
+ : [0-9]+ '.' [0-9]+
+ | [0-9]+ '.' [0-9]+ [eE] [+-]? [0-9]+
+ ;
+
+fragment HEX
+ : '0x' [0-9a-fA-F]+
+ ;
+
+fragment BINARY
+ : '0b' [01]+
+ ;
+
+// String literals
+STRING
+ : '"' (ESC | ~["\\])* '"'
+ ;
+
+RAWSTRING
+ : '"""' .*? '"""'
+ ;
+
+// Ruling 12: string escapes are exactly \n \t \" \\ — nothing else.
+fragment ESC
+ : '\\' [\\nt"]
+ ;
+
+// Comments
+COMMENT
+ : '--' ~[\r\n]* -> skip
+ ;
+
+MULTILINE_COMMENT
+ : '{-' (MULTILINE_COMMENT | .)*? '-}' -> skip
+ ;
+
+// Whitespace
+WS
+ : [ \t\r\n]+ -> skip
+ ;
diff --git a/src/main/java/com/mpl/tools/ParseCheck.java b/src/main/java/com/mpl/tools/ParseCheck.java
new file mode 100644
index 0000000..c0536be
--- /dev/null
+++ b/src/main/java/com/mpl/tools/ParseCheck.java
@@ -0,0 +1,71 @@
+package com.mpl.tools;
+
+import com.mpl.parser.*;
+import org.antlr.v4.runtime.*;
+import java.io.IOException;
+import java.nio.file.*;
+
+/**
+ * Grammar-check CLI: the stable seam over the ANTLR parser for tooling
+ * (the conformance fuzzer today, the Java runtime in Stage 4).
+ *
+ * Arguments are file paths, or "-" for stdin. Exit 0 iff every input
+ * parses; otherwise exit 1, printing "::: "
+ * for the first error of each failing input (col is 0-based, as ANTLR
+ * reports it).
+ */
+public final class ParseCheck {
+
+ public static void main(String[] args) throws IOException {
+ if (args.length == 0) {
+ System.err.println("Usage: ParseCheck ...");
+ System.exit(2);
+ }
+ boolean allOk = true;
+ for (String arg : args) {
+ String name = arg.equals("-") ? "" : arg;
+ CharStream input;
+ try {
+ // CharStreams works in Unicode code points; the deprecated
+ // ANTLRInputStream broke on supplementary-plane glyphs.
+ input = arg.equals("-")
+ ? CharStreams.fromStream(System.in)
+ : CharStreams.fromPath(Paths.get(arg));
+ } catch (IOException e) {
+ System.out.println(name + ":0:0: " + e.getMessage());
+ allOk = false;
+ continue;
+ }
+ String error = firstError(input);
+ if (error != null) {
+ System.out.println(name + ":" + error);
+ allOk = false;
+ }
+ }
+ System.exit(allOk ? 0 : 1);
+ }
+
+ /** Returns "line:col: message" for the first syntax error, or null. */
+ private static String firstError(CharStream input) {
+ final String[] first = {null};
+ var listener = new BaseErrorListener() {
+ @Override
+ public void syntaxError(Recognizer, ?> recognizer, Object offendingSymbol,
+ int line, int charPositionInLine, String msg,
+ RecognitionException e) {
+ if (first[0] == null) {
+ first[0] = line + ":" + charPositionInLine + ": " + msg;
+ }
+ }
+ };
+ MPLLexer lexer = new MPLLexer(input);
+ lexer.removeErrorListeners();
+ lexer.addErrorListener(listener);
+ CommonTokenStream tokens = new CommonTokenStream(lexer);
+ MPLParser parser = new MPLParser(tokens);
+ parser.removeErrorListeners();
+ parser.addErrorListener(listener);
+ parser.program();
+ return first[0];
+ }
+}
diff --git a/src/test/java/com/mpl/test/ConformanceCountTest.java b/src/test/java/com/mpl/test/ConformanceCountTest.java
new file mode 100644
index 0000000..95bf8e0
--- /dev/null
+++ b/src/test/java/com/mpl/test/ConformanceCountTest.java
@@ -0,0 +1,32 @@
+package com.mpl.test;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import java.nio.file.*;
+import java.util.regex.*;
+
+/**
+ * The README's stated conformance-test count must equal the number of
+ * corpus entries, so the public claim can never silently rot: adding or
+ * removing an entry without updating the README fails CI (Stage 3, A8).
+ */
+public class ConformanceCountTest {
+
+ @Test
+ public void readmeCountMatchesCorpus() throws Exception {
+ String readme = Files.readString(Paths.get("README.md"));
+ long dirs;
+ try (var stream = Files.list(Paths.get("conformance/corpus"))) {
+ dirs = stream.filter(Files::isDirectory).count();
+ }
+ Matcher m = Pattern.compile("(\\d+) ratified conformance tests").matcher(readme);
+ int mentions = 0;
+ while (m.find()) {
+ mentions++;
+ assertEquals("README claims " + m.group(1)
+ + " ratified conformance tests, but conformance/corpus has " + dirs,
+ dirs, Long.parseLong(m.group(1)));
+ }
+ assertTrue("README must state the ratified conformance test count", mentions >= 1);
+ }
+}
diff --git a/src/test/java/com/mpl/test/DocumentationTest.java b/src/test/java/com/mpl/test/DocumentationTest.java
new file mode 100644
index 0000000..ee75815
--- /dev/null
+++ b/src/test/java/com/mpl/test/DocumentationTest.java
@@ -0,0 +1,53 @@
+package com.mpl.test;
+
+import org.junit.Assert;
+import org.junit.Test;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Documentation-consistency test: every fenced ```mpl code block in the
+ * project documentation must parse with the shipped grammar. This keeps the
+ * docs and the grammar from describing different languages.
+ */
+public class DocumentationTest extends MPLTestBase {
+
+ private static final Pattern MPL_BLOCK =
+ Pattern.compile("```mpl\\R(.*?)```", Pattern.DOTALL);
+
+ @Test
+ public void testReadmeCodeBlocksParse() throws IOException {
+ assertAllMplBlocksParse(Paths.get("README.md"));
+ }
+
+ @Test
+ public void testSpecCodeBlocksParse() throws IOException {
+ assertAllMplBlocksParse(Paths.get("math_prog_lang.md"));
+ }
+
+ @Test
+ public void testWhitepaperCodeBlocksParse() throws IOException {
+ assertAllMplBlocksParse(Paths.get("whitepaper", "mpl-whitepaper.md"));
+ assertAllMplBlocksParse(Paths.get("whitepaper", "mpl-whitepaper-appendices.md"));
+ }
+
+ private void assertAllMplBlocksParse(Path doc) throws IOException {
+ String content = Files.readString(doc);
+ Matcher m = MPL_BLOCK.matcher(content);
+ int count = 0;
+ while (m.find()) {
+ count++;
+ String code = m.group(1);
+ ParseResult result = parseWithDiagnostics(code);
+ if (!result.errors.isEmpty()) {
+ Assert.fail(doc + " ```mpl block #" + count + " does not parse:\n"
+ + code + "\nErrors:\n" + String.join("\n", result.errors));
+ }
+ }
+ Assert.assertTrue("No ```mpl blocks found in " + doc, count > 0);
+ }
+}
diff --git a/src/test/java/com/mpl/test/ExampleTest.java b/src/test/java/com/mpl/test/ExampleTest.java
new file mode 100644
index 0000000..0bd1d98
--- /dev/null
+++ b/src/test/java/com/mpl/test/ExampleTest.java
@@ -0,0 +1,92 @@
+package com.mpl.test;
+
+import org.junit.Test;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.stream.Stream;
+
+/**
+ * Test that all example files parse correctly
+ */
+public class ExampleTest extends MPLTestBase {
+
+ @Test
+ public void testAllExamples() throws IOException {
+ Path examplesDir = Paths.get("examples");
+
+ try (Stream paths = Files.walk(examplesDir)) {
+ paths.filter(Files::isRegularFile)
+ .filter(p -> p.toString().endsWith(".mpl"))
+ .forEach(this::testExampleFile);
+ }
+ }
+
+ private void testExampleFile(Path file) {
+ try {
+ System.out.println("Testing: " + file);
+ String content = Files.readString(file);
+ assertParses(content);
+ System.out.println(" ✓ Parsed successfully");
+ } catch (Exception e) {
+ throw new AssertionError("Failed to parse " + file + ": " + e.getMessage(), e);
+ }
+ }
+
+ @Test
+ public void test01HelloWorld() throws IOException {
+ testSpecificExample("01_hello_world.mpl");
+ }
+
+ @Test
+ public void test02Factorial() throws IOException {
+ testSpecificExample("02_factorial.mpl");
+ }
+
+ @Test
+ public void test03FileProcessing() throws IOException {
+ testSpecificExample("03_file_processing.mpl");
+ }
+
+ @Test
+ public void test04ConcurrentDownload() throws IOException {
+ testSpecificExample("04_concurrent_download.mpl");
+ }
+
+ @Test
+ public void test05ModuleDefinition() throws IOException {
+ testSpecificExample("05_module_definition.mpl");
+ }
+
+ @Test
+ public void test06ResourceManagement() throws IOException {
+ testSpecificExample("06_resource_management.mpl");
+ }
+
+ @Test
+ public void test07Metaprogramming() throws IOException {
+ testSpecificExample("07_metaprogramming.mpl");
+ }
+
+ @Test
+ public void test08RealtimeSystem() throws IOException {
+ testSpecificExample("08_realtime_system.mpl");
+ }
+
+ @Test
+ public void test09NetworkServer() throws IOException {
+ testSpecificExample("09_network_server.mpl");
+ }
+
+ @Test
+ public void test10TypeSafeDatabase() throws IOException {
+ testSpecificExample("10_type_safe_database.mpl");
+ }
+
+ private void testSpecificExample(String filename) throws IOException {
+ Path file = Paths.get("examples", filename);
+ String content = Files.readString(file);
+ assertParses(content);
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/com/mpl/test/LexerTest.java b/src/test/java/com/mpl/test/LexerTest.java
new file mode 100644
index 0000000..62695ed
--- /dev/null
+++ b/src/test/java/com/mpl/test/LexerTest.java
@@ -0,0 +1,190 @@
+package com.mpl.test;
+
+import com.mpl.parser.MPLLexer;
+import org.junit.Test;
+import java.io.IOException;
+
+/**
+ * Test suite for MPL lexer - verifying token recognition
+ */
+public class LexerTest extends MPLTestBase {
+
+ @Test
+ public void testGreekLetters() throws IOException {
+ // Direct Unicode
+ assertTokenTypes("α", MPLLexer.ALPHA);
+ assertTokenTypes("β", MPLLexer.BETA);
+ assertTokenTypes("γ", MPLLexer.GAMMA);
+ assertTokenTypes("λ", MPLLexer.LAMBDA_VAR);
+ assertTokenTypes("π", MPLLexer.PI);
+ assertTokenTypes("ω", MPLLexer.OMEGA);
+
+ // ASCII escapes
+ assertTokenTypes("\\alpha", MPLLexer.ALPHA);
+ assertTokenTypes("\\beta", MPLLexer.BETA);
+ assertTokenTypes("\\gamma", MPLLexer.GAMMA);
+ assertTokenTypes("\\lambda", MPLLexer.LAMBDA_VAR);
+ assertTokenTypes("\\pi", MPLLexer.PI);
+ assertTokenTypes("\\omega", MPLLexer.OMEGA);
+ }
+
+ @Test
+ public void testTypeSymbols() throws IOException {
+ // Unicode
+ assertTokenTypes("ℕ", MPLLexer.NAT);
+ assertTokenTypes("ℤ", MPLLexer.INT);
+ assertTokenTypes("ℚ", MPLLexer.RAT);
+ assertTokenTypes("ℝ", MPLLexer.REAL);
+ assertTokenTypes("ℂ", MPLLexer.COMPLEX);
+ assertTokenTypes("𝔹", MPLLexer.BOOL);
+
+ // ASCII escapes
+ assertTokenTypes("\\nat", MPLLexer.NAT);
+ assertTokenTypes("\\int", MPLLexer.INT);
+ assertTokenTypes("\\real", MPLLexer.REAL);
+ assertTokenTypes("\\bool", MPLLexer.BOOL);
+ }
+
+ @Test
+ public void testOperators() throws IOException {
+ // Arithmetic
+ assertTokenTypes("+", MPLLexer.PLUS);
+ assertTokenTypes("-", MPLLexer.MINUS);
+ assertTokenTypes("×", MPLLexer.TIMES);
+ assertTokenTypes("÷", MPLLexer.DIV);
+ assertTokenTypes("/", MPLLexer.DIV); // ASCII alias, e.g. π/4
+ assertTokenTypes("∗", MPLLexer.AST);
+ assertTokenTypes("∘", MPLLexer.COMPOSE);
+
+ // Comparison
+ assertTokenTypes("=", MPLLexer.EQ);
+ assertTokenTypes("≠", MPLLexer.NEQ);
+ assertTokenTypes("<", MPLLexer.LT);
+ assertTokenTypes(">", MPLLexer.GT);
+ assertTokenTypes("≤", MPLLexer.LEQ);
+ assertTokenTypes("≥", MPLLexer.GEQ);
+ assertTokenTypes("≈", MPLLexer.APPROX);
+ assertTokenTypes("∼", MPLLexer.SIM);
+
+ // Logic
+ assertTokenTypes("∧", MPLLexer.AND);
+ assertTokenTypes("∨", MPLLexer.OR);
+ assertTokenTypes("⟹", MPLLexer.IMPLIES);
+
+ // Assignment
+ assertTokenTypes("←", MPLLexer.LEFTARROW);
+ assertTokenTypes("≜", MPLLexer.DEFINITION);
+ }
+
+ @Test
+ public void testEscapeDisambiguation() throws IOException {
+ // \implies is ⟹ (IMPLIES); \Rightarrow is ⇒ (EXPORT). Formerly both
+ // mapped to IMPLIES, fully shadowing EXPORT's escape (warning 184).
+ assertTokenTypes("\\implies", MPLLexer.IMPLIES);
+ assertTokenTypes("\\Rightarrow", MPLLexer.EXPORT);
+ assertTokenTypes("⇒", MPLLexer.EXPORT);
+ }
+
+ @Test
+ public void testModuleAccess() throws IOException {
+ assertTokenTypes("Mathematics‧sin",
+ MPLLexer.IDENTIFIER, MPLLexer.MIDDOT, MPLLexer.IDENTIFIER);
+ assertTokenTypes("\\middot", MPLLexer.MIDDOT);
+ }
+
+ @Test
+ public void testEffectOperators() throws IOException {
+ assertTokenTypes("↯", MPLLexer.RAISE);
+ assertTokenTypes("↴", MPLLexer.HANDLE);
+ assertTokenTypes("‖", MPLLexer.PARALLEL);
+ assertTokenTypes("⊕", MPLLexer.ALLOC);
+ assertTokenTypes("⊖", MPLLexer.RELEASE);
+ assertTokenTypes("✎", MPLLexer.TRACE);
+ assertTokenTypes("⏲", MPLLexer.DELAY);
+ assertTokenTypes("⟳", MPLLexer.PERIODIC);
+ }
+
+ @Test
+ public void testDelimiters() throws IOException {
+ assertTokenTypes("(", MPLLexer.LPAREN);
+ assertTokenTypes(")", MPLLexer.RPAREN);
+ assertTokenTypes("[", MPLLexer.LBRACK);
+ assertTokenTypes("]", MPLLexer.RBRACK);
+ assertTokenTypes("{", MPLLexer.LBRACE);
+ assertTokenTypes("}", MPLLexer.RBRACE);
+ assertTokenTypes("⟨", MPLLexer.LANGLE);
+ assertTokenTypes("⟩", MPLLexer.RANGLE);
+ assertTokenTypes("⌈", MPLLexer.LCEIL);
+ assertTokenTypes("⌉", MPLLexer.RCEIL);
+ assertTokenTypes("〔", MPLLexer.LRAII);
+ assertTokenTypes("〕", MPLLexer.RRAII);
+ }
+
+ @Test
+ public void testNumbers() throws IOException {
+ assertTokenTypes("123", MPLLexer.NUMBER);
+ assertTokenTypes("3.14", MPLLexer.NUMBER);
+ assertTokenTypes("1.23e10", MPLLexer.NUMBER);
+ assertTokenTypes("0x1A2B", MPLLexer.NUMBER);
+ assertTokenTypes("0b1101", MPLLexer.NUMBER);
+ }
+
+ @Test
+ public void testStrings() throws IOException {
+ assertTokenTypes("\"hello\"", MPLLexer.STRING);
+ assertTokenTypes("\"hello\\nworld\"", MPLLexer.STRING);
+ assertTokenTypes("\"\\\"quoted\\\"\"", MPLLexer.STRING);
+ assertTokenTypes("\"\"\"raw\nstring\"\"\"", MPLLexer.RAWSTRING);
+ }
+
+ @Test
+ public void testIdentifiers() throws IOException {
+ assertTokenTypes("foo", MPLLexer.IDENTIFIER);
+ assertTokenTypes("baz123", MPLLexer.IDENTIFIER);
+ assertTokenTypes("camelCase", MPLLexer.IDENTIFIER);
+ assertTokenTypes("db_lock", MPLLexer.IDENTIFIER);
+ }
+
+ @Test
+ public void testSubscripts() throws IOException {
+ // Identifiers must not start with an underscore, so that subscripted
+ // constructs lex as UNDERSCORE + IDENTIFIER instead of one identifier.
+ // (Previously "⌉_db_lock" lexed as RCEIL + IDENTIFIER "_db_lock".)
+ assertTokenTypes("_bar", MPLLexer.UNDERSCORE, MPLLexer.IDENTIFIER);
+ assertTokenTypes("⌉_db_lock",
+ MPLLexer.RCEIL, MPLLexer.UNDERSCORE, MPLLexer.IDENTIFIER);
+ assertTokenTypes("↽_socket",
+ MPLLexer.RECEIVE, MPLLexer.UNDERSCORE, MPLLexer.IDENTIFIER);
+ assertTokenTypes("⇀_socket",
+ MPLLexer.SEND, MPLLexer.UNDERSCORE, MPLLexer.IDENTIFIER);
+ }
+
+ @Test
+ public void testComments() throws IOException {
+ // Comments should be skipped
+ assertTokenTypes("-- comment\n123", MPLLexer.NUMBER);
+ assertTokenTypes("{- multi\nline -} 456", MPLLexer.NUMBER);
+ assertTokenTypes("{- nested {- comment -} -} 789", MPLLexer.NUMBER);
+ }
+
+ @Test
+ public void testPathLiterals() throws IOException {
+ assertTokenTypes("🖫 \"path\"", MPLLexer.PATH, MPLLexer.STRING);
+ assertTokenTypes("\\path \"path\"", MPLLexer.PATH, MPLLexer.STRING);
+ // Identifier form, e.g. readFile(🖫path)
+ assertTokenTypes("🖫path", MPLLexer.PATH, MPLLexer.IDENTIFIER);
+ }
+
+ @Test
+ public void testComplexTokenSequences() throws IOException {
+ assertTokenTypes("λx∈ℕ: x+1",
+ MPLLexer.LAMBDA_VAR, MPLLexer.IDENTIFIER, MPLLexer.IN,
+ MPLLexer.NAT, MPLLexer.COLON, MPLLexer.IDENTIFIER,
+ MPLLexer.PLUS, MPLLexer.NUMBER);
+
+ assertTokenTypes("∀n∈ℕ: n≥0",
+ MPLLexer.FORALL, MPLLexer.IDENTIFIER, MPLLexer.IN,
+ MPLLexer.NAT, MPLLexer.COLON, MPLLexer.IDENTIFIER,
+ MPLLexer.GEQ, MPLLexer.NUMBER);
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/com/mpl/test/MPLTestBase.java b/src/test/java/com/mpl/test/MPLTestBase.java
new file mode 100644
index 0000000..1e13e9b
--- /dev/null
+++ b/src/test/java/com/mpl/test/MPLTestBase.java
@@ -0,0 +1,127 @@
+package com.mpl.test;
+
+import com.mpl.parser.*;
+import org.antlr.v4.runtime.*;
+import org.antlr.v4.runtime.tree.*;
+import org.junit.Assert;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.List;
+import java.util.ArrayList;
+
+public class MPLTestBase {
+
+ /**
+ * Parse MPL code and return the parse tree
+ */
+ protected ParseTree parse(String input) throws IOException {
+ return parseWithErrors(input, false);
+ }
+
+ /**
+ * Parse MPL code and collect any syntax errors
+ */
+ protected ParseResult parseWithDiagnostics(String input) throws IOException {
+ List errors = new ArrayList<>();
+ ParseTree tree = parseWithErrors(input, true, errors);
+ return new ParseResult(tree, errors);
+ }
+
+ private ParseTree parseWithErrors(String input, boolean collectErrors) throws IOException {
+ return parseWithErrors(input, collectErrors, null);
+ }
+
+ private ParseTree parseWithErrors(String input, boolean collectErrors, List errorList) throws IOException {
+ // CharStreams works in Unicode code points; the deprecated
+ // ANTLRInputStream fed UTF-16 units and broke on supplementary-plane
+ // glyphs such as 𝔹, 𝓜 and 🖫.
+ CharStream inputStream = CharStreams.fromString(input);
+ MPLLexer lexer = new MPLLexer(inputStream);
+ CommonTokenStream tokens = new CommonTokenStream(lexer);
+ MPLParser parser = new MPLParser(tokens);
+
+ if (collectErrors && errorList != null) {
+ BaseErrorListener listener = new BaseErrorListener() {
+ @Override
+ public void syntaxError(Recognizer, ?> recognizer, Object offendingSymbol,
+ int line, int charPositionInLine, String msg,
+ RecognitionException e) {
+ errorList.add(String.format("line %d:%d %s", line, charPositionInLine, msg));
+ }
+ };
+ lexer.removeErrorListeners();
+ lexer.addErrorListener(listener);
+ parser.removeErrorListeners();
+ parser.addErrorListener(listener);
+ }
+
+ return parser.program();
+ }
+
+ /**
+ * Parse a file and return the parse tree
+ */
+ protected ParseTree parseFile(String filename) throws IOException {
+ String content = Files.readString(Paths.get(filename));
+ return parse(content);
+ }
+
+ /**
+ * Assert that code parses without errors
+ */
+ protected void assertParses(String input) throws IOException {
+ ParseResult result = parseWithDiagnostics(input);
+ if (!result.errors.isEmpty()) {
+ Assert.fail("Parse errors: " + String.join("\n", result.errors));
+ }
+ }
+
+ /**
+ * Assert that code does not parse (contains syntax errors)
+ */
+ protected void assertDoesNotParse(String input) throws IOException {
+ ParseResult result = parseWithDiagnostics(input);
+ Assert.assertFalse("Expected parse errors but got none", result.errors.isEmpty());
+ }
+
+ /**
+ * Get all tokens from input
+ */
+ protected List tokenize(String input) throws IOException {
+ CharStream inputStream = CharStreams.fromString(input);
+ MPLLexer lexer = new MPLLexer(inputStream);
+ List tokens = new ArrayList<>();
+
+ Token token;
+ while ((token = lexer.nextToken()).getType() != Token.EOF) {
+ tokens.add(token);
+ }
+
+ return tokens;
+ }
+
+ /**
+ * Assert that input tokenizes to expected token types
+ */
+ protected void assertTokenTypes(String input, int... expectedTypes) throws IOException {
+ List tokens = tokenize(input);
+ Assert.assertEquals("Wrong number of tokens", expectedTypes.length, tokens.size());
+
+ for (int i = 0; i < expectedTypes.length; i++) {
+ Assert.assertEquals("Wrong token type at position " + i,
+ expectedTypes[i], tokens.get(i).getType());
+ }
+ }
+
+ protected static class ParseResult {
+ public final ParseTree tree;
+ public final List errors;
+
+ public ParseResult(ParseTree tree, List errors) {
+ this.tree = tree;
+ this.errors = errors;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/com/mpl/test/ParseExamples.java b/src/test/java/com/mpl/test/ParseExamples.java
new file mode 100644
index 0000000..6371ea2
--- /dev/null
+++ b/src/test/java/com/mpl/test/ParseExamples.java
@@ -0,0 +1,86 @@
+package com.mpl.test;
+
+import com.mpl.parser.*;
+import org.antlr.v4.runtime.*;
+import org.antlr.v4.runtime.tree.*;
+import java.io.IOException;
+import java.nio.file.*;
+import java.util.stream.Stream;
+
+/**
+ * Standalone program to parse all example files and report results
+ */
+public class ParseExamples {
+
+ public static void main(String[] args) throws IOException {
+ if (args.length < 1) {
+ System.err.println("Usage: ParseExamples ");
+ System.exit(1);
+ }
+
+ Path examplesDir = Paths.get(args[0]);
+ if (!Files.isDirectory(examplesDir)) {
+ System.err.println("Not a directory: " + examplesDir);
+ System.exit(1);
+ }
+
+ System.out.println("Parsing examples in: " + examplesDir.toAbsolutePath());
+ System.out.println();
+
+ int passed = 0;
+ int failed = 0;
+
+ try (Stream paths = Files.walk(examplesDir)) {
+ var files = paths.filter(Files::isRegularFile)
+ .filter(p -> p.toString().endsWith(".mpl"))
+ .sorted()
+ .toList();
+
+ for (Path file : files) {
+ System.out.print(file.getFileName() + " ... ");
+
+ try {
+ parseFile(file);
+ System.out.println("✓ PASS");
+ passed++;
+ } catch (Exception e) {
+ System.out.println("✗ FAIL: " + e.getMessage());
+ failed++;
+ }
+ }
+ }
+
+ System.out.println();
+ System.out.println("Results: " + passed + " passed, " + failed + " failed");
+
+ if (failed > 0) {
+ System.exit(1);
+ }
+ }
+
+ private static void parseFile(Path file) throws IOException {
+ // CharStreams works in Unicode code points; the deprecated
+ // ANTLRInputStream broke on supplementary-plane glyphs (𝓜, 🖫).
+ CharStream input = CharStreams.fromPath(file);
+ MPLLexer lexer = new MPLLexer(input);
+ CommonTokenStream tokens = new CommonTokenStream(lexer);
+ MPLParser parser = new MPLParser(tokens);
+
+ // Fail on both lexer and parser errors
+ var errorListener = new BaseErrorListener() {
+ @Override
+ public void syntaxError(Recognizer, ?> recognizer, Object offendingSymbol,
+ int line, int charPositionInLine, String msg,
+ RecognitionException e) {
+ throw new RuntimeException(String.format("line %d:%d %s", line, charPositionInLine, msg));
+ }
+ };
+ lexer.removeErrorListeners();
+ lexer.addErrorListener(errorListener);
+ parser.removeErrorListeners();
+ parser.addErrorListener(errorListener);
+
+ // Parse
+ parser.program();
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/com/mpl/test/ParserTest.java b/src/test/java/com/mpl/test/ParserTest.java
new file mode 100644
index 0000000..0cf6eda
--- /dev/null
+++ b/src/test/java/com/mpl/test/ParserTest.java
@@ -0,0 +1,269 @@
+package com.mpl.test;
+
+import org.junit.Test;
+import java.io.IOException;
+
+/**
+ * Test suite for MPL parser - verifying syntax rules
+ */
+public class ParserTest extends MPLTestBase {
+
+ @Test
+ public void testBasicExpressions() throws IOException {
+ assertParses("123;");
+ assertParses("\"hello\";");
+ assertParses("true;");
+ assertParses("false;");
+ assertParses("α;");
+ assertParses("foo;");
+ }
+
+ @Test
+ public void testArithmetic() throws IOException {
+ assertParses("1 + 2;");
+ assertParses("3 × 4;");
+ assertParses("5 ÷ 2;");
+ assertParses("a - b;");
+ assertParses("x ∗ y ∗ z;");
+ }
+
+ @Test
+ public void testPrecedence() throws IOException {
+ // Multiplication before addition
+ assertParses("1 + 2 × 3;");
+ assertParses("a × b + c × d;");
+
+ // Comparison after arithmetic
+ assertParses("a + b < c × d;");
+ assertParses("x ≥ y + 1;");
+
+ // Logic after comparison
+ assertParses("a < b ∧ c > d;");
+ assertParses("x = y ∨ p ≠ q;");
+
+ // Assignment is lowest precedence
+ assertParses("x ← a + b;");
+ assertParses("y ← p ∧ q;");
+ }
+
+ @Test
+ public void testParentheses() throws IOException {
+ assertParses("(1 + 2) × 3;");
+ assertParses("((a + b) × c);");
+ assertParses("(x ← y);");
+ }
+
+ // Function calls are f(a, b) only — juxtaposition (f x) was removed.
+ @Test
+ public void testFunctionCalls() throws IOException {
+ assertParses("f(x);");
+ assertParses("g(a, b, c);");
+ assertParses("sin(π);");
+ assertParses("f(x)(y);");
+ assertParses("f();"); // nullary call
+ assertParses("mergeResults();");
+ }
+
+ @Test
+ public void testLambdas() throws IOException {
+ assertParses("λx: x + 1;");
+ assertParses("λx∈ℕ: x × 2;");
+ assertParses("λa: λb: a + b;");
+ assertParses("λa, b: a + b;"); // multi-parameter pattern
+ assertParses("(λx: x × x)(5);"); // was (λx: x × x) 5 — juxtaposition removed
+ }
+
+ @Test
+ public void testForall() throws IOException {
+ assertParses("∀x∈S: P(x);"); // was P x — juxtaposition removed
+ assertParses("∀n∈ℕ: n ≥ 0;");
+ assertParses("∀x∈A: ∀y∈B: f(x, y);"); // was f x y — juxtaposition removed
+ }
+
+ @Test
+ public void testDefinitions() throws IOException {
+ assertParses("f ≜ λx: x + 1;");
+ assertParses("pi ≜ 3.14159;");
+ assertParses("id ≜ λx: x;");
+ assertParses("π ≜ 3.14159;"); // greek letter on the left
+ assertParses("f ≜ λ: 1;"); // ruling 18: nullary λ, bare colon
+ }
+
+ @Test
+ public void testBlocks() throws IOException {
+ assertParses("{ x ← 1; y ← 2; x + y }");
+ // Was "{ a ← b; { c ← d; } e }": the inner block juxtaposed with e
+ // relied on juxtaposition application, which was removed.
+ assertParses("{ a ← b; { c ← d; }; e }");
+ assertParses("{ }");
+ assertParses("{ x }"); // singleton braces are a block
+ }
+
+ @Test
+ public void testConditionals() throws IOException {
+ assertParses("x > 0 ⟹ x | -x;");
+ assertParses("(n = 0 ⟹ 1) | (n × fact(n-1));");
+ assertParses("(n≤1 ⟹ 1) | (n×factorial(n-1));");
+ }
+
+ @Test
+ public void testUnaryMinus() throws IOException {
+ assertParses("-x;");
+ assertParses("a - -b;");
+ assertParses("f(-1);");
+ }
+
+ @Test
+ public void testChoiceTypes() throws IOException {
+ assertParses("⟨\"ok\"|\"error\"⟩;");
+ assertParses("⟨x|⊥⟩;");
+ assertParses("⟨result|exception⟩;");
+ }
+
+ @Test
+ public void testLists() throws IOException {
+ assertParses("[];");
+ assertParses("[1, 2, 3];");
+ assertParses("[x, y, z];");
+ assertParses("[[1], [2], [3]];");
+ }
+
+ @Test
+ public void testSets() throws IOException {
+ assertParses("∅;");
+ assertParses("{1, 2, 3};");
+ assertParses("{x, y, z};");
+ }
+
+ @Test
+ public void testRecords() throws IOException {
+ assertParses("{name: \"Alice\", age: 30};");
+ assertParses("{x: 1, y: 2, z: 3};");
+ }
+
+ @Test
+ public void testEffects() throws IOException {
+ assertParses("↯\"error\";");
+ assertParses("✎\"log message\";");
+ assertParses("⏲ 100;");
+ // Canonical handler clause: ↯pattern ⟹ expr (was ↯e ⇒ handle e)
+ assertParses("x ↴ {↯e ⟹ handle(e)};");
+ assertParses("x ↴ {↯\"Invalid user\" ⟹ ⊥};");
+ // Multiple clauses are semicolon-separated
+ assertParses("x ↴ {↯\"overflow\" ⟹ 0; ↯e ⟹ ↯e};");
+ }
+
+ @Test
+ public void testResources() throws IOException {
+ assertParses("conn ← database ⊕;");
+ assertParses("conn ⊖;");
+ assertParses("socket ← bind(port) ⊕;");
+ }
+
+ @Test
+ public void testChannels() throws IOException {
+ assertParses("data ← ↽_socket request;");
+ assertParses("⇀_socket response;");
+ }
+
+ @Test
+ public void testModuleAccess() throws IOException {
+ assertParses("Mathematics‧sin(angle);");
+ assertParses("A‧B‧f(x);");
+ }
+
+ @Test
+ public void testParallel() throws IOException {
+ assertParses("a ‖ b;");
+ assertParses("task1 ‖ task2 ‖ task3;");
+ assertParses("f(x) ‖ g(y);"); // was (f x) ‖ (g y) — juxtaposition removed
+ }
+
+ @Test
+ public void testAtomic() throws IOException {
+ assertParses("⌈x ← x + 1⌉;");
+ // Was "⌈critical section⌉_lock" — juxtaposition removed
+ assertParses("⌈criticalSection()⌉_lock;");
+ assertParses("⌈a ← 1; b ← 2⌉_db_lock;");
+ }
+
+ @Test
+ public void testRAII() throws IOException {
+ // Was "use r" / "open \"file\"" / "read f" — juxtaposition removed
+ assertParses("〔 r ← resource ⊕; use(r) 〕;");
+ assertParses("〔 f ← open(\"file\"); read(f) 〕;");
+ }
+
+ @Test
+ public void testCodeQuotation() throws IOException {
+ assertParses("⌜λx: x + 1⌝;");
+ assertParses("⌞quote⌟;");
+ }
+
+ @Test
+ public void testModules() throws IOException {
+ assertParses("𝓜 Math ⇒ { pi ≜ 3.14; };");
+ assertParses("𝓜 Utils ⇒ { f ≜ λx: x; g ≜ λy: y × 2; };");
+ }
+
+ @Test
+ public void testPaths() throws IOException {
+ assertParses("🖫\"file.txt\";");
+ assertParses("\\path\"directory/file\";");
+ assertParses("readFile(🖫path);"); // identifier form
+ }
+
+ @Test
+ public void testComplexExpressions() throws IOException {
+ // Factorial
+ assertParses("factorial ≜ λn∈ℕ: (n≤1 ⟹ 1) | (n×factorial(n-1));");
+
+ // File processing (canonical handler clause is ↯pattern ⟹ expr)
+ assertParses("processFile ≜ λpath: { data ← readFile(🖫path); result ← transform(data); writeFile(result, 🖫\"output.txt\"); ⟨\"success\"|\"failed\"⟩ } ↴ {↯e ⟹ ⟨⊥|e⟩};");
+
+ // Network server
+ assertParses("server ≜ λport: 〔 socket ← bind(port) ⊕; ∀request∈acceptLoop(socket): ( data ← ↽_socket request; response ← processRequest(data); ⇀_socket response ) ‖ handleNext() 〕;");
+ }
+
+ @Test
+ public void testInvalidSyntax() throws IOException {
+ // Missing semicolons
+ assertDoesNotParse("x ← 1 y ← 2");
+
+ // Mismatched parentheses
+ assertDoesNotParse("(x + y))");
+ assertDoesNotParse("((x + y)");
+
+ // Invalid operators
+ assertDoesNotParse("x ++ y;");
+ assertDoesNotParse("a ** b;");
+
+ // Invalid lambda syntax (λ: x became VALID under ruling 18)
+ assertDoesNotParse("λx y: x + y;");
+ // Ruling 25: the parenthesized parameter spelling stays rejected.
+ assertDoesNotParse("λ(a, b): a;");
+ // Ruling 26: λ is reserved — never an identifier.
+ assertDoesNotParse("λ ≜ 3;");
+ assertDoesNotParse("{λ};");
+
+ // Juxtaposition application was removed — calls need parentheses
+ assertDoesNotParse("f x;");
+ assertDoesNotParse("g a b c;");
+
+ // The C-style ternary is not MPL — use (cond ⟹ a) | b
+ assertDoesNotParse("cond ? a : b;");
+ }
+
+ @Test
+ public void testSemicolonRules() throws IOException {
+ // Semicolon required between statements
+ assertParses("x ← 1; y ← 2;");
+
+ // No semicolon before closing brace
+ assertParses("{ x ← 1; y ← 2 }");
+
+ // Last statement in program can omit semicolon
+ assertParses("x ← 1");
+ assertParses("y ← 2");
+ }
+}
\ No newline at end of file
diff --git a/whitepaper/README.md b/whitepaper/README.md
new file mode 100644
index 0000000..b574c2f
--- /dev/null
+++ b/whitepaper/README.md
@@ -0,0 +1,93 @@
+# MPL Whitepaper
+
+This directory contains the comprehensive academic whitepaper for the Mathematical Programming Language (MPL).
+
+## Contents
+
+### Main Documents
+
+1. **`mpl-whitepaper.md`** (~15 pages)
+ - Complete academic whitepaper in Markdown format
+ - Suitable for online viewing and conversion to other formats
+ - Includes all sections from Abstract through Conclusion
+ - Features application sketches in 5 domains:
+ - Scientific Computing
+ - Data Processing
+ - Web Services
+ - Machine Learning
+ - Systems Programming
+
+2. **`mpl-whitepaper.tex`**
+ - Conference-ready LaTeX version (IEEE format)
+ - Properly formatted for POPL/OOPSLA submission
+ - Includes Unicode math support
+ - Custom MPL syntax highlighting
+
+3. **`mpl-whitepaper-appendices.md`**
+ - Comprehensive appendices with:
+ - Symbol reference (pointing to the authoritative glyph-escapes.md)
+ - Annotated example programs
+ - Grammar validation details
+ - Implementation details
+ - Pedagogy and envisioned pilot materials
+
+## Whitepaper Structure
+
+1. **Abstract** - Problem, solution, and impact summary
+2. **Introduction** - Cultural barriers and research questions
+3. **Related Work** - APL, Unicode languages, cognitive design
+4. **Design Principles** - Universality, expressiveness, practicality
+5. **Language Design** - Core operators and effect extensions
+6. **Implementation** - ANTLR grammar and parser details
+7. **Evaluation** - Completeness, performance, accessibility
+8. **Case Studies** - Concurrency, resources, metaprogramming
+9. **Real-World Applications** - Scientific, data, web, ML, systems
+10. **Limitations & Future Work** - Current gaps and research directions
+11. **Conclusion** - Vision for universal programming
+
+## Key Features Documented
+
+- **70+ Mathematical Symbols**: Unicode operators, each with exactly one ASCII escape
+- **Effect Operators**: Novel symbols for exceptions, concurrency, resources
+- **24 Greek Variables**: Full Greek alphabet for identifiers
+- **CI-Validated Grammar**: Compiles with zero ANTLR errors and warnings; documented precedence
+- **Paradigm Coverage**: Functional, imperative, concurrent, metaprogramming
+
+## Building the LaTeX Version
+
+```bash
+# Requires XeLaTeX for Unicode support
+xelatex mpl-whitepaper.tex
+bibtex mpl-whitepaper
+xelatex mpl-whitepaper.tex
+xelatex mpl-whitepaper.tex
+```
+
+### LaTeX Requirements
+
+- **XeLaTeX**: Required for Unicode support (not pdflatex)
+- **unicode-math package**: For mathematical symbols
+- **fontspec package**: For font configuration
+- **newunicodechar package**: For symbol fallbacks
+
+The LaTeX version includes fallback definitions for all MPL-specific Unicode symbols to ensure compatibility across different LaTeX installations. If symbols still don't render properly, check that Latin Modern Math font is installed.
+
+## Target Venues
+
+- POPL (Principles of Programming Languages)
+- OOPSLA (Object-Oriented Programming, Systems, Languages & Applications)
+- PLDI (Programming Language Design and Implementation)
+- Onward! (New ideas in programming)
+
+## Citation
+
+When referencing this work:
+
+```bibtex
+@article{mpl2025,
+ title={Mathematical Programming Languages: Achieving Cognitive Universality Through Unicode-Based Syntax},
+ author={[Author Name]},
+ journal={Preprint},
+ year={2025}
+}
+```
\ No newline at end of file
diff --git a/whitepaper/mpl-whitepaper-appendices.md b/whitepaper/mpl-whitepaper-appendices.md
new file mode 100644
index 0000000..895749c
--- /dev/null
+++ b/whitepaper/mpl-whitepaper-appendices.md
@@ -0,0 +1,525 @@
+# Mathematical Programming Languages: Complete Appendices
+
+## Appendix A: Complete Symbol Reference
+
+The authoritative symbol table — every glyph, its single ASCII escape, and
+its Unicode code point — is maintained in one place:
+[`glyph-escapes.md`](../glyph-escapes.md). It matches the lexer rules in
+[`MPL.g4`](../src/main/antlr4/MPL.g4) exactly. A duplicate table here would
+drift; earlier versions of this appendix did exactly that.
+
+In summary, the M0 symbol set comprises:
+
+- **24 Greek letters** (α…ω) as variables, with λ doubling as the lambda binder
+- **Logic**: ∧ ∨ ⟹ ∀
+- **Arithmetic**: + - × ÷ (ASCII alias `/`) ∗ ∘, with unary minus
+- **Comparisons**: = ≠ < > ≤ ≥ ≈ ∼
+- **Sets and types**: ∅ ∈ ℕ ℤ ℚ ℝ ℂ 𝔹 ⊥
+- **Definition and assignment**: ≜ and ←
+- **Output**: ✎ (the one output operator)
+- **Effects**: ↯ ↴ ‖ ⌈⌉ ⊕ ⊖ ⇀ ↽ ⏲ ⧈ ⟳ 〔〕
+- **Modules and metaprogramming**: 𝓜 ⇒ ‧ 🖫 ⌜⌝ ⌞⌟ ⟨⟩
+
+Symbols reserved for M1 (∪ ∩ ⊂ ⊆ ∉ ¬ ⟺ ∃ → ⇐ ∑ √ ² % ? and friends) are
+listed at the end of `glyph-escapes.md`; they are not in the grammar.
+
+## Appendix B: Annotated Example Programs
+
+### B.1 Hypothetical Student Journey - Progressive Examples
+
+#### Month 1: First Program
+```mpl
+✎ "Jambo!"
+```
+**Annotations:**
+- `✎` (pencil): Output operator - intuitively "write this out"
+- No semicolon needed for single expressions
+- String literals use standard double quotes
+- **Passes Fatima Test**: A child would see a pencil and know it means "write"
+
+#### Month 3: Variables and Arithmetic
+```mpl
+-- Calculate rectangle area
+L ← 5; -- length
+w ← 3; -- width
+A ← L × w; -- area formula
+✎ A -- prints 15 (once MPL executes)
+```
+**Annotations:**
+- `←` (left arrow): Assignment matches math notation
+- Variables can be single letters or Greek symbols
+- `×` for multiplication (not `*`)
+- Comments use `--` (double dash)
+
+#### Month 6: Loops and Summation
+```mpl
+-- Sum numbers 1 to 10
+numbers ← [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
+total ← 0;
+∀ n ∈ numbers : total ← total + n;
+✎("Sum: " + total)
+```
+**Annotations:**
+- `∀` (for all): Universal quantifier for iteration
+- `∈` (element of): Natural set membership
+- `[1..10]`: Range notation
+- String concatenation with `+`
+
+#### Month 6: Conditional Logic
+```mpl
+-- Classify a number
+x ← -5;
+(x < 0 ⟹ ✎"Negative") |
+(x = 0 ⟹ ✎"Zero") |
+(x > 0 ⟹ ✎"Positive")
+```
+**Annotations:**
+- `⟹` (implies): If-then as logical implication
+- No explicit "if" keyword needed
+- Conditions evaluated in order
+
+#### Month 6: Recursion (Factorial)
+```mpl
+-- Factorial function
+fact ≜ λn: (n ≤ 1 ⟹ 1) | (n × fact(n - 1));
+
+✎ fact(5) -- 120 (once MPL executes)
+```
+**Annotations:**
+- `≜` (define as): Function definition
+- `λ` (lambda): Function notation
+- `∣` (pipe): Else separator in conditionals
+- Recursion mirrors mathematical definition
+
+### B.2 Advanced Examples
+
+#### Quadratic Solver
+The quadratic solver below is an M1+ design sketch — it uses ², √ and
+subscripts, which are not yet in the grammar, so it is fenced as plain text:
+
+```text
+-- Solve ax² + bx + c = 0 (M1+ design sketch, not yet parseable)
+quadratic ≜ λa,b,c:
+ Δ ← b² - 4×a×c;
+ (Δ < 0 ⟹ ✎"No real solutions") |
+ (Δ = 0 ⟹ ✎("One solution: " + (-b÷(2×a)))) |
+ (Δ > 0 ⟹ ✎("Two solutions: " + ((-b + √Δ) ÷ (2×a)) + ", " + ((-b - √Δ) ÷ (2×a))))
+```
+
+#### List Processing
+Set comprehensions and `mod` are M1+ design sketches, so this block is
+fenced as plain text:
+
+```text
+-- Filter and map (M1+ design sketch, not yet parseable)
+numbers ← [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
+evens ← {n ∈ numbers | n mod 2 = 0};
+squares ← {n² | n ∈ evens};
+✎ squares
+```
+
+#### Error Handling
+```mpl
+-- Safe division with exceptions
+safeDivide ≜ λx, y: (y = 0 ⟹ ↯"Division by zero!") | (x ÷ y);
+
+-- Using with handler
+result ← safeDivide(10, 0) ↴ {
+ ↯"Division by zero!" ⟹ ✎"Error caught";
+ ↯e ⟹ ↯e -- Re-raise other errors
+}
+```
+
+#### Concurrent Downloads
+```mpl
+-- Download multiple URLs in parallel
+urls ← ["http://a.com", "http://b.com", "http://c.com"];
+
+-- Launch parallel downloads, sending each result to the results channel
+∀ url ∈ urls : ⇀_results fetch(url);
+
+-- Collect results
+∀ url ∈ urls : (
+ data ← ↽_results url;
+ ✎("Downloaded: " + size(data) + " bytes")
+)
+```
+
+#### File Processing with RAII
+```mpl
+-- Process file with automatic cleanup
+processFile ≜ λpath: 〔
+ file ← open(path) ⊕; -- Acquire
+ lines ← readLines(file);
+
+ ∀ line ∈ lines : (
+ words ← split(line, " ");
+ ✎("Word count: " + count(words))
+ )
+
+ {- file automatically released here -}
+〕;
+```
+
+### B.3 Real-World Application Examples
+
+#### Data Analysis
+∑, √ and ² are M1, so the statistics sketch is fenced as plain text:
+
+```text
+-- Statistical analysis (M1+ design sketch, not yet parseable)
+analyze ≜ λdata:
+ n ← |data|;
+ μ ← (∑ x ∈ data: x) ÷ n;
+ σ² ← (∑ x ∈ data: (x-μ)²) ÷ n;
+ σ ← √σ²;
+ ✎("n=" + n + ", μ=" + μ + ", σ=" + σ)
+```
+
+#### Simple Web Server
+Record field access (`req.path`) is M1, so the HTTP-server sketch is
+fenced as plain text:
+
+```text
+-- HTTP server (M1+ design sketch, not yet parseable)
+server ≜ λport: ∀ req ∈ listen(port): handleRequest(req) ‖ acceptNext();
+
+handleRequest ≜ λreq:
+ (req.path = "/" ⟹ respond(200, "Welcome!
")) |
+ (req.path = "/api/data" ⟹ respond(200, getData())) |
+ respond(404, "Not found")
+```
+
+#### Machine Learning - Perceptron
+∑, indexing and field access are M1, so the perceptron sketch is fenced
+as plain text:
+
+```text
+-- Simple perceptron (M1+ design sketch, not yet parseable)
+perceptron ≜ λweights, bias:
+ λinputs:
+ z ← (∑ i ∈ [1..|inputs|]: weights[i] × inputs[i]) + bias;
+ (z > 0 ⟹ 1) | 0 -- Step activation
+
+train ≜ λp, inputs, target, α:
+ output ← p(inputs);
+ error ← target - output;
+ ∀ i ∈ [1..|inputs|]: p.weights[i] ← p.weights[i] + α×error×inputs[i];
+ p.bias ← p.bias + α×error
+```
+
+## Appendix C: Grammar Validation
+
+### C.1 ANTLR 4 Grammar Validation
+
+The authoritative grammar is [`MPL.g4`](../src/main/antlr4/MPL.g4). Instead
+of quoting statistics that drift, CI enforces these properties on every push:
+
+- The grammar compiles under ANTLR 4.13 with **warnings treated as errors**
+ (`-Werror`), so left recursion, token shadowing and unreachable
+ alternatives fail the build
+- All ten example programs parse (`./gradlew parseExamples`)
+- Every ```mpl code block in the documentation parses (`DocumentationTest`)
+- Start symbol: `program`; target: Java
+
+### C.2 Precedence Table
+
+Authoritative copy: [`precedence.csv`](../precedence.csv).
+
+| Level | Operators | Example | Parses As |
+|-------|-----------|---------|-----------|
+| 11 | `f(a,b)` `‧` `⊕` `⊖` `↴{…}` | `M‧f(x)⊕` | `((M‧f)(x))⊕` |
+| 10 | `↯ ✎ ⧈ ⏲ -` (prefix), `⇀_ch ↽_ch` | `✎ -a` | `✎(-a)` |
+| 9 | `∘` | `f ∘ g ∘ h` | `(f ∘ g) ∘ h` |
+| 8 | `×,÷,∗` | `a × b ÷ c` | `(a × b) ÷ c` |
+| 7 | `+,-` | `a + b - c` | `(a + b) - c` |
+| 6 | `=,≠,<,>,≤,≥,≈,∼` | `a < b = c` | Error (non-assoc) |
+| 5 | `∧` | `a ∧ b ∧ c` | `(a ∧ b) ∧ c` |
+| 4 | `∨` | `a ∨ b ∨ c` | `(a ∨ b) ∨ c` |
+| 3 | `⟹` | `a ⟹ b ⟹ c` | `a ⟹ (b ⟹ c)` |
+| 2 | `\|` | `a ⟹ b \| c` | `(a ⟹ b) \| c` |
+| 1 | `←` | `a ← b ← c` | `a ← (b ← c)` |
+| 0 | `≜` | `f ≜ g ≜ h` | `f ≜ (g ≜ h)` |
+| -1 | `‖` | `a ‖ b ‖ c` | `(a ‖ b) ‖ c` |
+| -2 | `;` | `a; b; c` | `(a; b); c` |
+
+### C.3 Disambiguation Rules
+
+**Lambda vs Variable λ**
+- Context: `λ` opens a lambda and is also a Greek variable
+- Resolution: one token (`LAMBDA_VAR`); the parser decides by position
+- Test: `λ ← λx: x;` parses (assign a lambda to the variable λ)
+
+**Braces: record vs set vs block**
+- `{a: e, …}` is a record, `{a, b, …}` (two or more elements) is a set,
+ everything else — including `{}` and `{x}` — is a block
+- A singleton set literal cannot be written in M0 (documented in
+ DECISIONS.md)
+
+**The bar `|`**
+- One BAR token serves guarded alternatives; the `|` inside `⟨a|b⟩` is the
+ guarded-alternative level of the inner expression
+
+## Appendix D: Symbol Pedagogy Guide
+
+### D.1 Teaching Core Symbols
+
+#### Teaching λ (Lambda/Function)
+**Physical Activity**: "Function Machine"
+- Students form input/output pairs
+- One student is the "lambda" transforming inputs
+- Example: λx: x×2 - student doubles any number given
+
+**Metaphor**: "Recipe with blanks"
+- λ is like a recipe that says "take ___ and do something"
+- Fill in the blank when you use it
+
+**Progressive Introduction**:
+1. Start with simple: `λx: x + 1`
+2. Multiple parameters: `λx,y: x + y`
+3. With conditions: `λn: (n > 0 ⟹ n) | 0`
+
+#### Teaching ∀ (For All/Loops)
+**Physical Activity**: "Everyone Does"
+- "∀ student in class: stand up"
+- Students understand "for each" naturally
+
+**Mathematical Connection**:
+- Connect to set notation they know
+- ∀ x ∈ {1,2,3}: means "do for 1, then 2, then 3"
+
+**Code Progression**:
+1. Simple iteration: `∀ n ∈ [1, 2, 3, 4, 5] : ✎ n`
+2. With accumulation: `∀ n ∈ list: sum ← sum + n`
+3. Nested loops: `∀ i ∈ [1, 2, 3] : ∀ j ∈ [1, 2, 3] : ✎(i + j)`
+
+#### Teaching ✎ (Output)
+**Physical Activity**: "Pencil and Paper"
+- Students literally write on paper when they see ✎
+- Reinforces the connection
+
+**No Translation Needed**:
+- Universal symbol - pencil means write everywhere
+- Students grasp immediately
+
+### D.2 Symbol Introduction Sequence
+
+**Week 1: Basic I/O**
+- ✎ (output)
+- ← (assignment)
+- Basic arithmetic: +, -, ×, ÷
+
+**Week 2: Variables and Types**
+- Greek letters as variables
+- Type symbols: ℕ, ℝ, 𝔹
+- Comparisons: <, >, =, ≠
+
+**Week 3: Control Flow**
+- ⟹ (if-then)
+- | (fallback: `(condition ⟹ result) | fallback`)
+- Simple conditions
+
+**Week 4: Loops**
+- ∀ (for all)
+- ∈ (element of)
+- List literals: [1, 2, 3]
+
+**Week 5: Functions**
+- λ (lambda)
+- ≜ (define)
+- Function calls
+
+**Week 6+: Advanced Concepts**
+- Exceptions: ↯, ↴
+- Concurrency: ‖
+- Resources: ⊕, ⊖
+
+## Appendix E: Implementation Details
+
+### E.1 Unicode Normalization (planned)
+
+Input should undergo Unicode normalization to NFC before lexing. This is
+planned; the current parser consumes code points as-is:
+
+```java
+// Planned: ensure consistent handling
+String normalize(String input) {
+ return Normalizer.normalize(input, Normalizer.Form.NFC);
+}
+```
+
+### E.2 Error Messages
+
+Context-aware error reporting maintains symbol clarity:
+
+```
+Error at line 3:14: Expected '⟹' after condition
+ x < 0 | "negative"
+ ^
+Hint: A guard needs an arrow: (x < 0 ⟹ "negative") | fallback.
+```
+
+(Illustrative; today the parser emits standard ANTLR diagnostics.)
+
+### E.3 ASCII Escape Processing
+
+Each glyph has exactly one ASCII escape, defined as a lexer alternative
+(the full table is [`glyph-escapes.md`](../glyph-escapes.md)):
+
+```antlr
+LAMBDA_VAR : 'λ' | '\\lambda' ;
+FORALL : '∀' | '\\forall' ;
+IMPLIES : '⟹' | '\\implies' ;
+```
+
+## Appendix F: Input Method Documentation (envisioned)
+
+Only the ASCII escapes exist today; everything else in this appendix is
+tooling we want to build.
+
+### F.1 Visual Palette
+
+**Beginner-Friendly Symbol Picker**
+- Organized by category (Math, Logic, I/O, etc.)
+- Hover shows name and usage
+- Recently used section
+- Search by meaning ("output" finds ✎)
+
+### F.2 Text Shortcuts
+
+The lexer accepts exactly one escape per glyph (`\lambda`, `\forall`, …).
+Editor-side auto-replace could additionally offer shorthand that expands to
+the glyph before the code ever reaches the lexer:
+
+- `\lam` → λ (editor expands; the lexer itself only accepts `\lambda`)
+- `:=` → ≜ (definition)
+- `!=` → ≠ (not equal)
+
+### F.3 Voice Input
+
+**Multilingual Support**:
+- "lambda" (English) → λ
+- "لامدا" (Arabic) → λ
+- "लैम्ब्डा" (Hindi) → λ
+- "拉姆达" (Chinese) → λ
+
+**Context-Aware Recognition**:
+- "for all" → ∀
+- "sum" → Σ
+- "element of" → ∈
+
+### F.4 Handwriting Recognition
+
+**Symbol Training**:
+- System learns from user's writing style
+- Common variations supported
+- Quick correction gestures
+
+### F.5 Platform-Specific Methods
+
+**Windows**:
+- Alt+Numpad codes
+- Windows emoji picker (Win+.)
+
+**macOS**:
+- Character Viewer
+- Custom keyboard layouts
+
+**Linux**:
+- Compose key sequences
+- IBus/FCITX input methods
+
+**Mobile**:
+- Custom keyboard app
+- Symbol panels in IDEs
+
+## Appendix G: Envisioned Pilot Program Materials
+
+### G.1 Potential Lesson Plan Template
+
+**Lesson 1: Hello World**
+- Objective: Write first program
+- Materials: Tablets/computers, symbol chart
+- Activity: Each student writes greeting in their language
+- Assessment: Program runs successfully
+
+**Key Teaching Points**:
+1. ✎ means "write/output"
+2. Strings in quotes
+3. Run button executes code
+4. Celebrate first success!
+
+### G.2 Envisioned Teacher Training Guide
+
+**Day 1: MPL Philosophy**
+- The Fatima Test
+- Cognitive justice principles
+- Symbol over keyword approach
+
+**Day 2: Core Language**
+- Basic symbols and operations
+- Common patterns
+- Hands-on coding
+
+**Day 3: Pedagogy**
+- Symbol introduction sequence
+- Physical activities
+- Common misconceptions
+
+**Day 4: Classroom Management**
+- Pair programming with MPL
+- Managing limited devices
+- Assessment strategies
+
+### G.3 Potential Student Workbook Outline
+
+**Chapter 1: My First Program**
+- Understanding the design philosophy
+- Writing with ✎
+- Your turn: Hello in your language
+
+**Chapter 2: Calculator Magic**
+- Variables with ←
+- Math symbols you know
+- Build a calculator
+
+**Chapter 3: Making Decisions**
+- If-then with ⟹
+- Comparing numbers
+- Choose your adventure
+
+**Chapter 4: Repeat After Me**
+- Loops with ∀
+- Patterns and sequences
+- Draw with loops
+
+### G.4 Proposed Assessment Rubrics
+
+**First Program (Formative)**
+- Program runs: ✓/✗
+- Uses ✎ correctly: ✓/✗
+- Shows creativity: ✓/✗
+
+**Week 4 Project (Summative)**
+- Novice: Uses basic I/O and arithmetic
+- Developing: Includes variables and conditions
+- Proficient: Uses loops effectively
+- Advanced: Defines and uses functions
+
+### G.5 Planned Community Resources
+
+**Online Forums**
+- Teacher discussion boards
+- Student showcase gallery
+- Symbol reference wiki
+- Troubleshooting guides
+
+**Offline Materials**
+- Printable symbol charts
+- Unplugged activities
+- Parent information sheets
+- Certificate templates
+
+---
+
+*These appendices provide comprehensive technical and pedagogical resources for implementing MPL. For the latest updates and community contributions, visit: https://github.com/developtheweb/mpl*
\ No newline at end of file
diff --git a/whitepaper/mpl-whitepaper.md b/whitepaper/mpl-whitepaper.md
new file mode 100644
index 0000000..0ef5476
--- /dev/null
+++ b/whitepaper/mpl-whitepaper.md
@@ -0,0 +1,375 @@
+# Mathematical Programming Languages: Achieving Cognitive Universality Through Unicode-Based Syntax
+
+**Authors**: Steven Milanese
+**Date**: January 2025
+**Version**: 2.0
+
+## Abstract
+
+In a school in Cairo, a 10-year-old girl named Fatima watches her teacher write a simple computer program on the board. The code is full of foreign words that might as well be magic spells to her Arabic-speaking mind. This scene repeats in classrooms worldwide, where virtually all mainstream programming languages impose English keywords as fundamental syntax, creating cognitive friction for the 80% of humanity who don't speak English. This paper presents Mathematical Programming Language (MPL), a novel approach that replaces traditional keywords with mathematical notation—humanity's existing universal language. MPL demonstrates that a programming language can be built entirely from mathematical symbols; the current milestone is a fully working parser, with execution to follow. Our implementation consists of an ANTLR 4 grammar supporting over 70 Unicode mathematical operators, 24 Greek letter variables, and novel effect operators for computational effects. Through hypothetical scenarios like a student's journey from printing "Jambo!" to teaching peers within one year, we envision potential improvements in learning metrics: First Program Time could be reduced from days to minutes, retention rates might exceed traditional approaches, and teachers could enthusiastically adopt MPL in non-English classrooms. MPL proves that cognitive universality in programming languages is not just theoretically possible but practically achievable, opening a path toward truly global programming tools that transcend linguistic boundaries and enable cognitive justice in technology education.
+
+## I. Introduction
+
+### A. The Cultural Barrier Problem
+
+In a school in Cairo, a 10-year-old girl named Fatima watches her teacher write a simple computer program on the board. It's just a "Hello, world" message – but the code is full of foreign words and symbols. For Fatima, who speaks Arabic and loves math, the English keywords like `print` and `end` might as well be magic spells. She asks herself: Why do I need to know English to write a program?
+
+Unfortunately, this scene repeats in classrooms worldwide. Virtually all mainstream programming languages – from C to Python to Java – are built on English vocabulary. This creates a language barrier in coding education:
+
+- **Extra Cognitive Load**: Students like Fatima must translate concepts through English before they even reach the actual problem, adding mental overhead.
+- **Educational Barrier**: Children are essentially asked to learn two subjects at once – programming and English. A child should be thinking about loops and logic, not struggling with foreign vocabulary.
+- **Cultural Exclusion**: Billions of people are shut out of coding because of language. It's estimated that only about 20% of the world's population speaks any English. Requiring English to code means alienating the other 80% before they even begin.
+
+This is more than an inconvenience – it's an issue of **cognitive justice**. Knowledge and creativity in the digital age shouldn't belong only to those fluent in a colonial language. Every child, regardless of their mother tongue, has the right to learn to code in a way that aligns with their own cognition and culture.
+
+### B. Research Questions
+
+Is there an alternative? We believe yes. The key is to remove language dependency entirely by using a truly universal medium: mathematical notation. Math is often called the universal language of humanity. A Japanese mathematician can read Euler's equations, an Egyptian engineer can understand Maxwell's formulas, and a Brazilian student can follow along with Turing's proofs – all without translation.
+
+This work addresses three fundamental questions:
+
+1. **Expressiveness**: Can mathematical symbols express all programming constructs found in modern languages, from basic control flow to advanced effect systems?
+2. **Practicality**: Does Unicode-based syntax maintain parsing efficiency and tooling compatibility required for production use?
+3. **Universality**: Do mathematical symbols provide genuine cognitive universality across cultures while remaining learnable?
+
+### C. Contributions
+
+Enter the Mathematical Programming Language (MPL) – a new programming language built entirely out of math symbols instead of English words. MPL's mission is to break the coding language barrier so that any child can learn to code as easily as they learn math. Every feature of MPL is designed around one question: **Will this make sense to a 10-year-old who doesn't speak English?** We call this guiding principle the **Fatima Test**, and it has become our north star.
+
+This paper makes four primary contributions:
+
+1. **Complete Language Design**: The first programming language specification built entirely from mathematical notation, validated through the Fatima Test at every design decision.
+2. **Working Implementation**: An ANTLR 4 grammar and parser that handles Unicode input with full ASCII escape sequences, demonstrating practical feasibility.
+3. **Educational Impact Vision**: Hypothetical case studies like a student's journey illustrating potential improvements in learning outcomes when language barriers are removed.
+4. **Movement Framework**: A comprehensive roadmap for transforming MPL from a proof of concept into a global educational movement for cognitive justice.
+
+## II. Related Work
+
+### A. Mathematical Programming Notations
+
+The use of mathematical symbols in programming has a rich history. APL (1962) pioneered symbolic programming with its distinctive character set, using symbols like ⍴ (reshape) and ⌽ (reverse). While revolutionary, APL required special keyboards and its symbols were often arbitrary rather than leveraging existing mathematical notation.
+
+J Language (1990) attempted to make APL more accessible by using ASCII digraphs (e.g., `|.` for reverse), but this compromised the visual clarity that made APL distinctive. Fortress (2006) by Sun Microsystems explicitly aimed to make programs look like mathematical notation, supporting Unicode symbols and mathematical typesetting. However, it retained English keywords for control structures and focused primarily on scientific computing.
+
+### B. Unicode in Programming Languages
+
+Modern languages have gradually adopted Unicode support. Swift (2014) allows Unicode in identifiers, enabling programmers to write variable names in their native scripts. However, keywords remain English. Julia (2012) extensively supports Unicode operators, allowing `α = π/2`. Yet core syntax like `function`, `if`, and `for` remains English-based.
+
+The pattern across these languages is clear: Unicode is treated as an enhancement for mathematical domains or internationalization, not as a foundation for cognitive universality. MPL breaks this pattern by using Unicode symbols as the primary syntax, not an add-on.
+
+## III. Design Principles
+
+### A. Cognitive Universality (The Fatima Test)
+
+To ensure MPL truly serves everyone, we introduced the Fatima Test. Fatima is our persona of a bright 10-year-old child in Cairo who knows basic math but not a word of English. Every design decision in MPL must answer to Fatima. If a concept or symbol would confuse her, we rethink it.
+
+For example, when deciding how to represent a programming concept like a loop or a conditional, we ask: How would Fatima write this idea with the symbols she knows? If the answer is unclear, we haven't met the Fatima Test yet. This approach forces us to throw out assumptions and jargon that traditional languages take for granted.
+
+Crucially, the Fatima Test means **no English keywords at all**. Instead of `if`, `for`, or `function`, MPL uses symbols a child sees in math class or can grasp quickly. We leverage the fact that mathematical notation is taught early and is culturally neutral.
+
+### B. Complete Expressiveness
+
+MPL was designed to be simple enough for a child, but also powerful enough to express anything a modern programming language can. We approached this by adhering to three guidelines:
+
+1. **Use What Kids Already Know**: If a concept can be represented by a symbol taught in elementary or middle school math, we use it. For example, we use the familiar × for multiplication, not an obscure symbol.
+
+2. **One Symbol, One Concept**: We avoid context-dependent or overloaded symbols that could confuse learners. Each symbol in MPL has a clear, single purpose.
+
+3. **No Arbitrary Icons – Extend Intuitively**: When programming concepts like error handling don't exist in classical math, we created new symbols that feel logical. For instance, MPL uses ↯ (lightning bolt) to indicate an exception being thrown – universally signaling something sudden or wrong.
+
+### C. Practical Implementation
+
+Theoretical purity means nothing without practical usability. MPL addresses this through multiple input methods, ensuring accessibility regardless of available technology:
+
+1. **Visual Input**: Click symbols from an on-screen palette
+2. **Text Shortcuts**: Type `\lambda` to get λ
+3. **Voice Recognition**: Say "lambda" in any language
+4. **Handwriting**: Draw symbols on touchscreens
+5. **Standard Keyboards**: Use system IMEs or alt-codes
+
+This multi-modal approach ensures that no matter who you are or what technology you have, you can write MPL code.
+
+## IV. Language Design
+
+### A. Core Mathematical Foundation
+
+MPL builds on established mathematical notation:
+
+- **Logical Operators**: ∧ (and), ∨ (or), ¬ (not), ⟹ (implies)
+- **Quantifiers**: ∀ (forall), ∃ (exists), λ (lambda)
+- **Relations**: =, ≠, <, ≤, ≈
+- **Arithmetic**: +, -, ×, ÷ (^ and √ arrive with defined semantics in M1)
+- **Types**: ℕ (natural), ℤ (integer), ℝ (real), 𝔹 (boolean)
+
+### B. Programming Extensions
+
+MPL introduces intuitive symbols for computational concepts:
+
+- **I/O**: ✎ (pencil) for output – "write this out"
+- **Assignment**: ← (left arrow) for storing values
+- **Exceptions**: ↯ (lightning) for errors, ↴ (down arrow) for catching
+- **Concurrency**: ‖ (parallel bars) for parallel execution
+- **Resources**: ⊕/⊖ (circled plus/minus) for acquire/release
+
+These symbols were chosen to pass the Fatima Test; empirical validation with educators and children is planned, not yet performed.
+
+### C. Real Code Examples
+
+Here's "Hello World" in MPL – as simple as a hypothetical student's first program:
+
+```mpl
+✎ "Jambo!"
+```
+
+A more complex example calculating rectangle area:
+
+```mpl
+L ← 5;
+w ← 3;
+A ← L × w;
+✎ A
+```
+
+## V. Implementation
+
+### A. Technical Architecture
+
+The MPL implementation consists of:
+
+- **ANTLR 4 Grammar**: the complete M0 syntax, compiled with warnings treated as errors
+- **ASCII Fallbacks**: every symbol has exactly one text escape (λ → `\lambda`)
+- **Multi-platform Support**: runs on any Unicode-capable system
+- **Unicode Normalization**: planned (the parser currently consumes code points as-is)
+
+### B. Parser Validation
+
+Everything in this list is enforced by CI on every push:
+
+- The grammar compiles with zero ANTLR errors and zero warnings
+- All ten example programs parse
+- Every ```mpl code block in the project documentation parses
+- The precedence chain is documented in `precedence.csv` and exercised by the test suite
+
+### C. Educational Tools (envisioned)
+
+Beyond the core language, we envision:
+
+- Visual symbol palettes for beginners
+- Voice input for multiple languages
+- Handwriting recognition for natural input
+- Integration with standard editors
+
+None of these exist yet; today the ASCII escapes are the portable input method.
+
+## VI. Evaluation
+
+### A. Hypothetical Learning Journey
+
+To illustrate MPL's potential impact, consider a hypothetical student's progression:
+
+**Initial exposure**: A student could write their first program using familiar notation:
+```mpl
+✎ "Hello!"
+```
+Hypothesis: First Program Time could be minutes rather than days.
+
+**Building on math knowledge**: They could apply familiar mathematical concepts:
+```mpl
+L ← 5;
+w ← 3;
+A ← L × w;
+✎ A
+```
+
+**Advanced concepts**: Mathematical notation could make loops intuitive:
+```mpl
+total ← 0;
+∀ n ∈ [1, 2, 3, 4, 5] : total ← total + n
+```
+
+**Potential outcome**: Students might progress from beginners to teaching others within a year.
+
+### B. Envisioned Learning Metrics
+
+We hypothesize that MPL could improve three key metrics:
+
+1. **First Program Time**: Students might write their first program in minutes rather than days, leveraging familiar mathematical notation.
+
+2. **Retention and Progression**: We anticipate higher retention rates due to reduced language barriers and cognitive load.
+
+3. **Teacher Adoption**: Educators might find MPL easier to integrate with mathematics curriculum.
+
+*Note: These are theoretical projections based on our design principles. Actual empirical validation awaits implementation and testing.*
+
+### C. Technical Validation
+
+While human outcomes are primary, technical validation shows:
+
+- The ten example programs cover functional, concurrent, resource-managed, metaprogramming and module-based code, and all parse in CI
+- Every symbol has exactly one meaning and one ASCII escape
+- The M0 grammar compiles with zero ANTLR errors and warnings
+
+### D. Current Implementation Limitations
+
+The current implementation focuses on validation:
+
+- No execution engine (parser only)
+- Limited IDE integration
+- Performance optimization deferred
+- Standard library minimal
+
+These limitations reflect our focus on proving the educational concept before building production infrastructure.
+
+## VII. Case Studies
+
+### A. Amara's Technical Milestones
+
+Examining Amara's journey reveals key learning moments:
+
+1. **Potential for Immediate Success**: First program in minutes could build confidence
+2. **Potential Mathematical Transfer**: Existing math knowledge could accelerate programming concepts
+3. **Potential Conceptual Clarity**: Recursion could be understood through factorial notation
+4. **Potential for Peer Teaching**: Students might gain confidence to teach others within one year
+
+### B. Pilot Program Insights
+
+We hypothesize that pilot programs could reveal:
+
+- Students with no English might perform equally to English speakers
+- Math teachers could potentially teach programming without extensive retraining
+- Cultural barriers to technology education might be reduced
+- Communities might show enthusiasm for mother-tongue coding
+
+## VIII. Real-World Applications
+
+MPL's mathematical syntax proves powerful across domains. Every block below
+parses with the shipped M0 grammar (this is CI-checked); where richer
+notation (∑, √, ², subscripts, tuples) is planned for M1, the examples use
+plain M0 syntax instead.
+
+### A. Scientific Computing
+
+```mpl
+-- Fixed-step numerical integration (Euler method)
+euler ≜ λf, y, t, h, steps: ∀step∈countTo(steps): (
+ y ← y + h × f(t, y);
+ t ← t + h
+);
+```
+
+### B. Data Processing
+
+```mpl
+-- Statistical analysis
+data ← loadCSV("measurements.csv");
+total ← 0;
+∀ x ∈ data : total ← total + x;
+μ ← total ÷ count(data);
+✎("Mean: " + μ)
+```
+
+### C. Web Services
+
+```mpl
+server ← λport: ∀request ∈ listen(port): (
+ response ← handleRequest(request);
+ ⇀_client response
+) ‖ acceptNext();
+```
+
+### D. Machine Learning
+
+```mpl
+-- Neural network layer
+σ ≜ λz: 1 ÷ (1 + exp(-z));
+layer ≜ λW, b, x: σ(W × x + b);
+```
+
+### E. Systems Programming
+
+```mpl
+-- Resource management with RAII
+processFile ← λpath: 〔
+ file ← open(path) ⊕;
+ data ← read(file);
+ parse(data)
+ {- file automatically closed at end of 〔〕 -}
+〕;
+```
+
+## IX. Limitations and Future Work
+
+### A. Technical Roadmap
+
+From parser to production:
+
+1. **M1**: REPL with basic type inference
+2. **M2**: Compiler, standard library, IDE integration
+3. **M3**: Performance optimization, advanced types
+4. **M4**: Production readiness, ecosystem tools
+
+### B. Research Directions
+
+- Formal verification of the Fatima Test methodology
+- Large-scale efficacy studies across cultures
+- Integration with existing curricula
+- Accessibility for disabilities
+
+### C. Open Challenges
+
+- Symbol standardization across cultures
+- Tooling ecosystem development
+- Industry adoption pathways
+- Teacher training at scale
+
+## X. Conclusion
+
+In the end, MPL is more than a programming language – it's a statement about who gets to participate in the technology of the future. By redefining coding as a language-agnostic, math-based activity, we are staking a claim for cognitive justice.
+
+We envision what could happen when we honor a learner's native cognition – a student like Fatima wouldn't have to wait until she learns English to explore coding logic. Students wouldn't have to translate their thoughts; they could write them directly in the symbols of logic. The barrier between idea and implementation could melt away.
+
+This is a call to educators, developers, policymakers, and donors: join us. Whether it's contributing code or translations, sponsoring a pilot school, or simply spreading the word – your support can make a difference. We've built the first bridge across code's language barrier; now we need a community to help millions cross it.
+
+In the spirit of the Fatima Test, we'll end where we started: What would Fatima say? After a year of learning through MPL, she's no longer intimidated by code. She sees a canvas of familiar symbols where she can express ideas and solve problems. That is cognitive justice at work. Now multiply her story by millions of children who have been outside looking in. MPL is our invitation to them: Karibu, Bienvenido, 欢迎, Welcome – you belong in this world of technology, and you can thrive in it.
+
+Together, let's launch this movement and work toward ensuring that the ability to program is no longer a privilege of a particular language group, but a universal human skill, as common as mathematics. The next generation of non-English speaking students is out there, ready to amaze us – and with MPL, nothing would be lost in translation.
+
+## References
+
+Begel, A., & Klopfer, E. (2007). Starlogo TNG: An introduction to game development. *Journal of E-Learning*.
+
+Blackwell, A. F. (2006). Metaphors we program by: Space, action and society in Java. *Proceedings of PPIG*, 18, 7-21.
+
+Iverson, K. E. (1962). *A Programming Language*. Wiley.
+
+Papert, S. (1980). *Mindstorms: Children, computers, and powerful ideas*. Basic Books.
+
+Sweller, J., Ayres, P., & Kalyuga, S. (2011). *Cognitive load theory*. Springer.
+
+UNESCO. (2016). If you don't understand, how can you learn? *Global Education Monitoring Report Policy Paper 24*.
+
+---
+
+## Appendix: Movement Roadmap
+
+### Phase 0 – Proof of Concept (Now – 2025)
+- Create demonstration video showing the concept
+- Develop example programs demonstrating universality
+- Generate educator interest
+
+### Phase 1 – Pilot Programs (2026)
+- Target 5 pilot sites globally
+- Plan 6-month programs
+- Plan data collection and iteration
+
+### Phase 2 – Expansion (2026-2027)
+- Goal to scale to 50+ sites
+- Develop multilingual materials
+- Build community
+
+### Phase 3 – Mainstream Adoption (2028+)
+- Aim for national curricula inclusion
+- Plan teacher training at scale
+- Work toward global availability
+
+*Implementation roadmap and current status: https://github.com/developtheweb/mpl*
\ No newline at end of file
diff --git a/whitepaper/mpl-whitepaper.tex b/whitepaper/mpl-whitepaper.tex
new file mode 100644
index 0000000..bacf75b
--- /dev/null
+++ b/whitepaper/mpl-whitepaper.tex
@@ -0,0 +1,350 @@
+\documentclass[10pt,conference]{IEEEtran}
+\IEEEoverridecommandlockouts
+
+\usepackage{cite}
+\usepackage{amsmath,amssymb,amsfonts}
+\usepackage{algorithmic}
+\usepackage{graphicx}
+\usepackage{textcomp}
+\usepackage{xcolor}
+\usepackage{listings}
+\usepackage{booktabs}
+\usepackage{multirow}
+\usepackage{array}
+\usepackage{hyperref}
+\usepackage{fontspec}
+\usepackage{unicode-math}
+\usepackage{newunicodechar}
+
+% Set up Unicode font with fallbacks
+\setmainfont{Times New Roman}[
+ BoldFont={Times New Roman Bold},
+ ItalicFont={Times New Roman Italic}
+]
+\setmathfont{Latin Modern Math}
+
+% Define problematic Unicode characters with fallbacks
+\newunicodechar{✎}{\ensuremath{\mathsf{write}}}
+\newunicodechar{↯}{\ensuremath{\uparrow\!\!\downarrow}}
+\newunicodechar{↴}{\ensuremath{\curvearrowright}}
+\newunicodechar{‖}{\ensuremath{\parallel}}
+\newunicodechar{⇀}{\ensuremath{\rightharpoonup}}
+\newunicodechar{↽}{\ensuremath{\leftharpoondown}}
+\newunicodechar{⊕}{\ensuremath{\oplus}}
+\newunicodechar{⊖}{\ensuremath{\ominus}}
+\newunicodechar{〔}{\ensuremath{\llbracket}}
+\newunicodechar{〕}{\ensuremath{\rrbracket}}
+\newunicodechar{⌜}{\ensuremath{\ulcorner}}
+\newunicodechar{⌝}{\ensuremath{\urcorner}}
+\newunicodechar{⌞}{\ensuremath{\llcorner}}
+\newunicodechar{⌟}{\ensuremath{\lrcorner}}
+\newunicodechar{𝔹}{\ensuremath{\mathbb{B}}}
+\newunicodechar{∣}{\ensuremath{\mid}}
+
+% Define MPL language for listings
+\lstdefinelanguage{MPL}{
+ keywords={},
+ sensitive=true,
+ comment=[l]{--},
+ morecomment=[s]{\{-}{-\}},
+ string=[b]",
+ morestring=[b]""",
+ alsoletter={←,→,⟹,∧,∨,¬,∀,∃,λ,∈,∉,⊂,⊆,∪,∩,≜,≠,≤,≥,≈,×,÷,↯,↴,‖,⇀,↽,⊕,⊖,〔,〕,⌜,⌝,⌞,⌟,✎,⊥,∅,ℕ,ℤ,ℚ,ℝ,ℂ,𝔹,α,β,γ,δ,ε,ζ,η,θ,ι,κ,μ,ν,ξ,π,ρ,σ,τ,φ,χ,ψ,ω,Σ,∣},
+}
+
+\lstset{
+ language=MPL,
+ basicstyle=\ttfamily\small,
+ keywordstyle=\bfseries,
+ commentstyle=\itshape\color{gray},
+ stringstyle=\color{red},
+ showstringspaces=false,
+ breaklines=true,
+ frame=single,
+ numbers=left,
+ numberstyle=\tiny\color{gray},
+}
+
+\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
+ T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
+
+\begin{document}
+
+\title{Mathematical Programming Languages:\\
+Achieving Cognitive Universality Through\\
+Unicode-Based Syntax}
+
+\author{\IEEEauthorblockN{Steven Milanese}
+\IEEEauthorblockA{\textit{Independent Researcher} \\
+developtheweb@protonmail.com}}
+
+\maketitle
+
+\begin{abstract}
+In a school in Cairo, a 10-year-old girl named Fatima watches her teacher write a simple computer program on the board. The code is full of foreign words that might as well be magic spells to her Arabic-speaking mind. This scene repeats in classrooms worldwide, where virtually all mainstream programming languages impose English keywords as fundamental syntax, creating cognitive friction for the 80\% of humanity who don't speak English. This paper presents Mathematical Programming Language (MPL), a novel approach that replaces traditional keywords with mathematical notation—humanity's existing universal language. MPL demonstrates that a programming language can be built entirely from mathematical symbols; the current milestone is a fully working parser, with execution to follow. Our implementation consists of an ANTLR 4 grammar supporting over 70 Unicode mathematical operators, 24 Greek letter variables, and novel effect operators for computational effects. Through hypothetical scenarios like a student's journey from printing "Jambo!" to teaching peers within one year, we envision potential improvements in learning metrics: First Program Time could be reduced from days to minutes, retention rates might exceed traditional approaches, and teachers could enthusiastically adopt MPL in non-English classrooms. MPL proves that cognitive universality in programming languages is not just theoretically possible but practically achievable, opening a path toward truly global programming tools that transcend linguistic boundaries and enable cognitive justice in technology education.
+\end{abstract}
+
+\begin{IEEEkeywords}
+programming languages, unicode, mathematical notation, cognitive universality, syntax design, educational computing, cognitive justice
+\end{IEEEkeywords}
+
+\section{Introduction}
+
+\subsection{The Cultural Barrier Problem}
+
+In a school in Cairo, a 10-year-old girl named Fatima watches her teacher write a simple computer program on the board. It's just a "Hello, world" message – but the code is full of foreign words and symbols. For Fatima, who speaks Arabic and loves math, the English keywords like \texttt{print} and \texttt{end} might as well be magic spells. She asks herself: Why do I need to know English to write a program?
+
+Unfortunately, this scene repeats in classrooms worldwide. Virtually all mainstream programming languages – from C to Python to Java – are built on English vocabulary \cite{wikipedia2023}. This creates a language barrier in coding education:
+
+\textbf{Extra Cognitive Load}: Students like Fatima must translate concepts through English before they even reach the actual problem, adding mental overhead \cite{sweller2011}.
+
+\textbf{Educational Barrier}: Children are essentially asked to learn two subjects at once – programming and English. A child should be thinking about loops and logic, not struggling with foreign vocabulary.
+
+\textbf{Cultural Exclusion}: Billions of people are shut out of coding because of language. It's estimated that only about 20\% of the world's population speaks any English \cite{unesco2016}. Requiring English to code means alienating the other 80\% before they even begin.
+
+This is more than an inconvenience – it's an issue of \textbf{cognitive justice}. Knowledge and creativity in the digital age shouldn't belong only to those fluent in a colonial language. Every child, regardless of their mother tongue, has the right to learn to code in a way that aligns with their own cognition and culture.
+
+\subsection{Research Questions}
+
+Is there an alternative? We believe yes. The key is to remove language dependency entirely by using a truly universal medium: mathematical notation. Math is often called the universal language of humanity. A Japanese mathematician can read Euler's equations, an Egyptian engineer can understand Maxwell's formulas, and a Brazilian student can follow along with Turing's proofs – all without translation.
+
+This work addresses three fundamental questions:
+
+\begin{enumerate}
+\item \textbf{Expressiveness}: Can mathematical symbols express all programming constructs found in modern languages, from basic control flow to advanced effect systems?
+\item \textbf{Practicality}: Does Unicode-based syntax maintain parsing efficiency and tooling compatibility required for production use?
+\item \textbf{Universality}: Do mathematical symbols provide genuine cognitive universality across cultures while remaining learnable?
+\end{enumerate}
+
+\subsection{Contributions}
+
+Enter the Mathematical Programming Language (MPL) – a new programming language built entirely out of math symbols instead of English words. MPL's mission is to break the coding language barrier so that any child can learn to code as easily as they learn math. Every feature of MPL is designed around one question: \textbf{Will this make sense to a 10-year-old who doesn't speak English?} We call this guiding principle the \textbf{Fatima Test}, and it has become our north star.
+
+This paper makes four primary contributions:
+
+\begin{enumerate}
+\item \textbf{Complete Language Design}: The first programming language specification built entirely from mathematical notation, validated through the Fatima Test at every design decision.
+\item \textbf{Working Implementation}: An ANTLR 4 grammar and parser that handles Unicode input with full ASCII escape sequences, demonstrating practical feasibility.
+\item \textbf{Educational Impact Vision}: Hypothetical case studies like a student's journey illustrating potential improvements in learning outcomes when language barriers are removed.
+\item \textbf{Movement Framework}: A comprehensive roadmap for transforming MPL from a proof of concept into a global educational movement for cognitive justice.
+\end{enumerate}
+
+\section{Related Work}
+
+\subsection{Mathematical Programming Notations}
+
+The use of mathematical symbols in programming has a rich history. APL (1962) \cite{iverson1962} pioneered symbolic programming with its distinctive character set, using symbols like ⍴ (reshape) and ⌽ (reverse). While revolutionary, APL required special keyboards and its symbols were often arbitrary rather than leveraging existing mathematical notation.
+
+J Language (1990) attempted to make APL more accessible by using ASCII digraphs (e.g., \texttt{|.} for reverse), but this compromised the visual clarity that made APL distinctive. Fortress (2006) by Sun Microsystems explicitly aimed to make programs look like mathematical notation, supporting Unicode symbols and mathematical typesetting. However, it retained English keywords for control structures and focused primarily on scientific computing.
+
+\subsection{Unicode in Programming Languages}
+
+Modern languages have gradually adopted Unicode support. Swift (2014) allows Unicode in identifiers, enabling programmers to write variable names in their native scripts. However, keywords remain English. Julia (2012) extensively supports Unicode operators, allowing \texttt{α = π/2}. Yet core syntax like \texttt{function}, \texttt{if}, and \texttt{for} remains English-based.
+
+The pattern across these languages is clear: Unicode is treated as an enhancement for mathematical domains or internationalization, not as a foundation for cognitive universality. MPL breaks this pattern by using Unicode symbols as the primary syntax, not an add-on.
+
+\subsection{Educational Programming Research}
+
+Research in education backs the importance of mother-tongue instruction. Teaching students in their native language dramatically improves understanding and retention \cite{begel2007}. Cognitive Load Theory \cite{sweller2011} applied to programming shows that familiar notations reduce extraneous cognitive load, improving learning and comprehension.
+
+Symbol Recognition Studies \cite{blackwell2006} show that mathematical symbols are recognized across cultures with minimal training, unlike arbitrary programming symbols. Yet until now, no mainstream programming language has supported coding in one's first language at the syntax level.
+
+\section{Design Principles}
+
+\subsection{Cognitive Universality (The Fatima Test)}
+
+To ensure MPL truly serves everyone, we introduced the Fatima Test. Fatima is our persona of a bright 10-year-old child in Cairo who knows basic math but not a word of English. Every design decision in MPL must answer to Fatima. If a concept or symbol would confuse her, we rethink it.
+
+For example, when deciding how to represent a programming concept like a loop or a conditional, we ask: How would Fatima write this idea with the symbols she knows? This approach forces us to throw out assumptions and jargon that traditional languages take for granted.
+
+Crucially, the Fatima Test means \textbf{no English keywords at all}. Instead of \texttt{if}, \texttt{for}, or \texttt{function}, MPL uses symbols a child sees in math class or can grasp quickly.
+
+\subsection{Complete Expressiveness}
+
+MPL was designed to be simple enough for a child, but also powerful enough to express anything a modern programming language can. We approached this by adhering to three guidelines:
+
+\begin{enumerate}
+\item \textbf{Use What Kids Already Know}: If a concept can be represented by a symbol taught in elementary or middle school math, we use it.
+\item \textbf{One Symbol, One Concept}: We avoid context-dependent or overloaded symbols that could confuse learners.
+\item \textbf{No Arbitrary Icons – Extend Intuitively}: When programming concepts don't exist in classical math, we created new symbols that feel logical.
+\end{enumerate}
+
+\subsection{Practical Implementation}
+
+Theoretical purity means nothing without practical usability. MPL addresses this through multiple input methods, ensuring accessibility regardless of available technology:
+
+\begin{itemize}
+\item \textbf{Visual Input}: Click symbols from an on-screen palette
+\item \textbf{Text Shortcuts}: Type \texttt{\textbackslash lambda} to get λ
+\item \textbf{Voice Recognition}: Say "lambda" in any language
+\item \textbf{Handwriting}: Draw symbols on touchscreens
+\item \textbf{Standard Keyboards}: Use system IMEs or alt-codes
+\end{itemize}
+
+\section{Language Design}
+
+\subsection{Core Mathematical Foundation}
+
+MPL builds on established mathematical notation as shown in Table \ref{tab:operators}.
+
+\begin{table}[htbp]
+\caption{Core Mathematical Operators in MPL}
+\label{tab:operators}
+\centering
+\begin{tabular}{|l|l|l|l|}
+\hline
+\textbf{Category} & \textbf{Symbol} & \textbf{ASCII} & \textbf{Meaning} \\
+\hline
+\multirow{5}{*}{Logic} & ∧ & \texttt{\textbackslash and} & AND \\
+& ∨ & \texttt{\textbackslash or} & OR \\
+& ¬ & \texttt{\textbackslash not} & NOT \\
+& ⟹ & \texttt{\textbackslash implies} & Implies \\
+& ∀ & \texttt{\textbackslash forall} & For all \\
+\hline
+\multirow{4}{*}{Arithmetic} & × & \texttt{\textbackslash times} & Multiply \\
+& ÷ & \texttt{\textbackslash div} & Divide \\
+& ≤ & \texttt{\textbackslash leq} & Less equal \\
+& ≠ & \texttt{\textbackslash neq} & Not equal \\
+\hline
+\multirow{3}{*}{I/O} & ✎ & \texttt{\textbackslash pencil} & Output \\
+& ← & \texttt{\textbackslash gets} & Assignment \\
+& ≜ & \texttt{\textbackslash coloneq} & Definition \\
+\hline
+\end{tabular}
+\end{table}
+
+\subsection{Programming Extensions}
+
+MPL introduces intuitive symbols for computational concepts:
+
+\textbf{Exception Handling}: ↯ (lightning) for errors, ↴ (down arrow) for catching
+
+\textbf{Concurrency}: ‖ (parallel bars) for parallel execution
+
+\textbf{Resources}: ⊕/⊖ (circled plus/minus) for acquire/release
+
+These symbols were chosen to pass the Fatima Test; empirical validation with educators and children is planned, not yet performed.
+
+\subsection{Real Code Examples}
+
+Here's "Hello World" in MPL – as simple as a hypothetical student's first program:
+
+\begin{lstlisting}[language=MPL]
+✎ "Jambo!"
+\end{lstlisting}
+
+A more complex example calculating rectangle area:
+
+\begin{lstlisting}[language=MPL]
+L ← 5;
+w ← 3;
+A ← L × w;
+✎ A
+\end{lstlisting}
+
+\section{Implementation}
+
+\subsection{Technical Architecture}
+
+The MPL implementation consists of an ANTLR 4 grammar defining the complete M0 syntax, ASCII fallbacks where every symbol has exactly one text escape (λ → \texttt{\textbackslash lambda}), and multi-platform support running on any Unicode-capable system. Unicode NFC normalization is planned.
+
+\subsection{Parser Validation}
+
+Continuous integration enforces that the grammar compiles with zero ANTLR errors and zero warnings, that all ten example programs parse, and that every MPL code block in the project documentation parses. The precedence chain is documented in \texttt{precedence.csv}.
+
+\section{Evaluation}
+
+\subsection{Hypothetical Learning Journey}
+
+To illustrate MPL's potential impact, consider a hypothetical student's progression through their first year of programming:
+
+\textbf{Month 1}: A student could write their first program in minutes, not days:
+\begin{lstlisting}[language=MPL]
+✎ "Jambo!"
+\end{lstlisting}
+
+\textbf{Month 3}: She calculates areas using familiar math notation:
+\begin{lstlisting}[language=MPL]
+L ← 5;
+w ← 3;
+A ← L × w;
+✎ A
+\end{lstlisting}
+
+\textbf{Month 6}: A student might master loops using mathematical notation:
+\begin{lstlisting}[language=MPL]
+total ← 0;
+∀ n ∈ [1, 2, 3, 4, 5] : total ← total + n
+\end{lstlisting}
+
+\textbf{Month 12}: A student could teach younger students, forming a coding club. The potential transformation: from novice to mentor in one year.
+
+\subsection{Learning Metrics}
+
+We hypothesize that MPL could improve three key metrics:
+
+\textbf{First Program Time}: Students might write their first program in minutes during a single lesson, compared to days with traditional languages.
+
+\textbf{Retention and Progression}: We anticipate higher retention rates, with students potentially continuing voluntarily and progressing to advanced concepts.
+
+\textbf{Teacher Adoption}: Teachers might find MPL to be a natural extension of math lessons, instead of an entirely new subject with a foreign language.
+
+\section{Real-World Applications}
+
+MPL's mathematical syntax proves powerful across domains:
+
+\subsection{Scientific Computing}
+\begin{lstlisting}[language=MPL]
+-- Fixed-step numerical integration (Euler method)
+euler ≜ λf, y, t, h, steps: ∀step∈countTo(steps): (
+ y ← y + h × f(t, y);
+ t ← t + h
+);
+\end{lstlisting}
+
+\subsection{Data Processing}
+\begin{lstlisting}[language=MPL]
+-- Statistical analysis
+total ← 0;
+∀ x ∈ data : total ← total + x;
+μ ← total ÷ count(data);
+✎("Mean: " + μ)
+\end{lstlisting}
+
+\subsection{Web Services}
+\begin{lstlisting}[language=MPL]
+server ← λport: ∀request ∈ listen(port): (
+ response ← handleRequest(request);
+ ⇀_client response
+) ‖ acceptNext();
+\end{lstlisting}
+
+\section{Limitations and Future Work}
+
+The current implementation focuses on validation with no execution engine (parser only), limited IDE integration, performance optimization deferred, and minimal standard library. These limitations reflect our focus on proving the educational concept before building production infrastructure.
+
+Future work includes developing a REPL with type inference, building a comprehensive standard library, conducting large-scale efficacy studies, and expanding teacher training programs.
+
+\section{Conclusion}
+
+In the end, MPL is more than a programming language – it's a statement about who gets to participate in the technology of the future. By redefining coding as a language-agnostic, math-based activity, we are staking a claim for cognitive justice.
+
+We envision what could happen when we honor a learner's native cognition – a student like Fatima wouldn't have to wait until she learns English to explore coding logic. Students wouldn't have to translate their thoughts; they could write them directly in the symbols of logic. The barrier between idea and implementation could melt away.
+
+This is a call to educators, developers, policymakers, and donors: join us. We've built the first bridge across code's language barrier; now we need a community to help millions cross it.
+
+In the spirit of the Fatima Test: What would a student like Fatima say? After a year of learning through MPL, they might no longer be intimidated by code. They could see a canvas of familiar symbols where they can express ideas and solve problems. That would be cognitive justice at work.
+
+Together, let's launch this movement and work toward ensuring that the ability to program is no longer a privilege of a particular language group, but a universal human skill, as common as mathematics. The next generation of non-English speaking students is out there, ready to amaze us – and with MPL, nothing would be lost in translation.
+
+\begin{thebibliography}{00}
+\bibitem{begel2007} A. Begel and E. Klopfer, ``Starlogo TNG: An introduction to game development,'' \emph{J. E-Learning}, 2007.
+\bibitem{blackwell2006} A. F. Blackwell, ``Metaphors we program by: Space, action and society in Java,'' in \emph{Proc. PPIG}, vol. 18, 2006, pp. 7--21.
+\bibitem{iverson1962} K. E. Iverson, \emph{A Programming Language}. New York: Wiley, 1962.
+\bibitem{papert1980} S. Papert, \emph{Mindstorms: Children, Computers, and Powerful Ideas}. New York: Basic Books, 1980.
+\bibitem{sweller2011} J. Sweller, P. Ayres, and S. Kalyuga, \emph{Cognitive Load Theory}. New York: Springer, 2011.
+\bibitem{unesco2016} UNESCO, ``If you don't understand, how can you learn?'' \emph{Global Education Monitoring Report Policy Paper 24}, 2016.
+\bibitem{wikipedia2023} Wikipedia contributors, ``Non-English-based programming languages,'' 2023. [Online]. Available: https://en.wikipedia.org/wiki/Non-English-based\_programming\_languages
+\end{thebibliography}
+
+\end{document}
\ No newline at end of file