Monorepo: golang-lean (TGC) + octive-lean (TOC) + tsm-lean (TSM) + common-lean (cross-language apex).
Find a file
Maximus Gorog 4b6fcec565 Add SymPy bridge and migrate DSL to brace-block syntax.
Symbolic computation via a persistent Python subprocess: new `.sym`
Value variant carries (srepr, pretty), `OctiveLean.SymPyBridge` owns
the subprocess and round-trips expressions, and `evalBinOp`/unary
negation route through SymPy when either operand is `.sym`.  Corpus
adds sym_basic, sym_solve_simplify, sym_calc; demos add Lorenz,
Van der Pol, gravity, SymToolboxDemo, Lab7Interp.

DSL surface changes from `octave! ... octave_end` to `octave! { ... }`.
RosettaStone rewritten against the new syntax; PlotDemo updated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 02:58:50 -06:00
.github/workflows Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
corpus Add SymPy bridge and migrate DSL to brace-block syntax. 2026-05-12 02:58:50 -06:00
docs Add SymPy bridge and migrate DSL to brace-block syntax. 2026-05-12 02:58:50 -06:00
OctiveLean Add SymPy bridge and migrate DSL to brace-block syntax. 2026-05-12 02:58:50 -06:00
widget/js Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
.editorconfig Add README, CONTRIBUTING, editorconfig, gitattributes, justfile 2026-04-29 09:44:24 -06:00
.gitattributes Add README, CONTRIBUTING, editorconfig, gitattributes, justfile 2026-04-29 09:44:24 -06:00
.gitignore Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
CONTRIBUTING.md Add README, CONTRIBUTING, editorconfig, gitattributes, justfile 2026-04-29 09:44:24 -06:00
CorpusCheck.lean Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
justfile Add README, CONTRIBUTING, editorconfig, gitattributes, justfile 2026-04-29 09:44:24 -06:00
Lab7Interp.m Add SymPy bridge and migrate DSL to brace-block syntax. 2026-05-12 02:58:50 -06:00
lake-manifest.json Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
lakefile.toml Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
lean-toolchain Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
Main.lean Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
NumericalTutorial.lean Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
OctiveLean.lean Prove preservation theorem for TOC big-step semantics. 2026-05-10 04:32:52 -06:00
PlotDemo.lean Add SymPy bridge and migrate DSL to brace-block syntax. 2026-05-12 02:58:50 -06:00
README.md Add README, CONTRIBUTING, editorconfig, gitattributes, justfile 2026-04-29 09:44:24 -06:00
RosettaStone.lean Add SymPy bridge and migrate DSL to brace-block syntax. 2026-05-12 02:58:50 -06:00
Sim_Gravity.m Add SymPy bridge and migrate DSL to brace-block syntax. 2026-05-12 02:58:50 -06:00
Sim_Lorenz.m Add SymPy bridge and migrate DSL to brace-block syntax. 2026-05-12 02:58:50 -06:00
Sim_VanDerPol.m Add SymPy bridge and migrate DSL to brace-block syntax. 2026-05-12 02:58:50 -06:00
SymToolboxDemo.m Add SymPy bridge and migrate DSL to brace-block syntax. 2026-05-12 02:58:50 -06:00
tutorial.m Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00

octive-lean

A Lean 4 reimplementation of GNU Octave — the MATLAB-compatible numerical language — aiming to be more versatile than upstream.

Build

lake build

Requires the Lean toolchain pinned in lean-toolchain. elan will pick it up automatically.

Run

# REPL
lake exe octive-lean

# Run an .m script
lake exe octive-lean path/to/script.m

# Verify the corpus against expected outputs
lake build corpus-check
lake exe corpus-check

Layout

Path What's there
OctiveLean/ Library: Lexer, Parser, AST, Eval, Builtins, REPL, BigStep, PlotSVG, …
Main.lean Entry point — REPL or file runner
CorpusCheck.lean Test driver for corpus/
corpus/ .m test cases paired with .expected outputs
NumericalTutorial.lean, RosettaStone.lean Lean-side tutorials and Octave⇄Lean translations
PlotDemo.lean, widget/ Plotting via ProofWidgets + SVG
octave-upstream/ Shallow clone of GNU Octave (gitignored, used as reference)

Status

Working interpreter: matrices, arithmetic, control flow, functions (incl. recursion, closures, anonymous @(x)), cell arrays, structs, printf-family, REPL, file execution. See corpus/ for what's covered.

Tests

lake build && lake exe corpus-check

Pass --update to regenerate .expected files after intentional behavior changes.