GolangLean/Core/ holds a small calculus that surface Go is intended to
desugar into. Three files:
Syntax.lean - Term, BinOp; thirteen syntactic forms covering
let-binding, lambda, application, references
(Go's & / *), conditionals, sequencing.
Semantics.lean - Value, EnvList, Heap, BinOp.apply, BigStep relation.
Heap is Array Value; references are indices.
Closures capture EnvList lexically, as in Go.
Fourteen big-step constructors, one per syntactic form
(with ifte split into ifTR / ifFR).
Determinism.lean - theorem BigStep.deterministic:
BigStep h env e v1 h1 -> BigStep h env e v2 h2 ->
v1 = v2 /\ h1 = h2
Proof by induction on the first derivation, case
analysis on the second. The ifTR/ifFR cross-cases
close by contradiction via Bool.noConfusion.
No sorries, no axioms, no admits. The kernel is small enough to extend
compositionally: each new syntactic form adds one constructor and one
case to each proof. Type system and concurrency layer come later.
Strategic note: this kernel is shaped so the same construction will
work for any sequential calculus. When octive-lean grows a parallel
Tiny Octave Core, the determinism proof's structure will line up
case-for-case where the languages share constructors. That alignment
is the seed of the cross-language layer.
16 lines
420 B
Text
16 lines
420 B
Text
import GolangLean.Error
|
|
import GolangLean.Token
|
|
import GolangLean.AST
|
|
import GolangLean.Value
|
|
import GolangLean.Env
|
|
import GolangLean.Scanner
|
|
import GolangLean.Parser
|
|
import GolangLean.Eval
|
|
import GolangLean.Builtins
|
|
import GolangLean.REPL
|
|
import GolangLean.PureEval
|
|
import GolangLean.BigStep
|
|
import GolangLean.ValueEquiv
|
|
import GolangLean.Core.Syntax
|
|
import GolangLean.Core.Semantics
|
|
import GolangLean.Core.Determinism
|