crosslang/GolangLean
Maximus Gorog 3174918193 Add executable evaluator (Phase A) and type system + soundness infra (Phase B).
Phase A — GolangLean/Core/Eval.lean:
  def eval : Nat -> Heap -> Env -> Term -> Option (Value x Heap)
  Fuel-bounded recursive evaluator, total over the fuel.
  theorem eval_sound: eval succeeds => BigStep holds.
  Bridges executable computation to inductive specification.

Phase B — GolangLean/Core/Types.lean:
  inductive Ty {unit, int, bool, arrow, ref}
  TyEnv := List (String x Ty); BinOp.typeOf
  inductive HasType : TyEnv -> Term -> Ty -> Prop
  Standard simply-typed lambda calculus + ML-style references.

Phase B — GolangLean/Core/TypeSoundness.lean:
  abbrev HeapTy := Array Ty
  mutual inductive HasTypeV / HasTypeEnv  (value & env typing under heap-typing)
  def HasTypeH                            (heap conforms to heap-typing)
  def HeapTy.extends                       (prefix-extension of heap-typings)
  thm HeapTy.extends_refl, extends_trans
  thm HasTypeV.weaken, HasTypeEnv.weaken   (mutual; under heap-typing extension)
  thm HasTypeEnv.lookup_correspondence    (well-typed env yields well-typed values)

The preservation theorem itself
  HasType /\ HasTypeH /\ HasTypeEnv /\ BigStep
    ==> ∃ ht', extends /\ HasTypeH' /\ HasTypeV' /\ HasTypeEnv'
is the next deliverable; the infrastructure here is what its proof
case-analysis depends on.

Zero sorries / axioms / admits across the project. Full lake build clean.
2026-05-10 03:51:14 -06:00
..
Core Add executable evaluator (Phase A) and type system + soundness infra (Phase B). 2026-05-10 03:51:14 -06:00
AST.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
BigStep.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
Builtins.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
Env.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
Error.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
Eval.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
Parser.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
PureEval.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
REPL.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
Scanner.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
Token.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
Value.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
ValueEquiv.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00