A formal semantic substrate for Luna-Flow symbolic computation, with binding, substitution, rewriting, evaluation strategies, and lambda/type-theoretic cores.
moon add Luna-Flow/type_theory@0.4.0test "capture-avoiding substitution" {
let x = @core.Name::new("x")
let y = @core.Name::new("y")
let term : @syntax.Term[Int] = Bind(y, Apply(Variable(x), [Variable(y)]))
let result = @substitution.Substitution::singleton(x, @syntax.Term::Variable(y))
.apply(term)
let y1 = @core.Name::new("y_1")
let expected : @syntax.Term[Int] = Bind(y1, Apply(Variable(y), [Variable(y1)]))
assert_eq(result, expected)
}import {
"Luna-Flow/type_theory/core",
"Luna-Flow/type_theory/syntax",
"Luna-Flow/type_theory/substitution",
}| Package | Contents |
|---|---|
| core | names, fresh names, contexts, telescopes, finite renamings |
| syntax | generic named Term[T], free variables, alpha-equivalence, the open BindingSyntax trait |
| substitution | simultaneous capture-avoiding substitution for Term[T] and any BindingSyntax AST |
| rewrite | structured single-step rewriting with rule names and paths, bounded normalization, traces |
| eval | normal-order, applicative-order and weak-head strategies |
| debruijn | De Bruijn terms, conversion, scope checking, shifting, nameless beta reduction |
| utlc/lambda | untyped lambda calculus: beta, eta, normal-order normalization |
| utlc/nbe | fuel-bounded untyped normalization by evaluation |
| stlc | simply typed lambda calculus: bidirectional type checking, eta-long typed NbE |
| adapter | contract tests for downstream BindingSyntax implementations |
moon fmt
moon check --target all
./run_test.sh
moon infoInstall
Download zipA formal semantic substrate for Luna-Flow symbolic computation, with binding, substitution, rewriting, evaluation strategies, and lambda/type-theoretic cores.