Objective Bend
Mini's language: lazy open recursion over first-class, partial, composable specifications, after Faré's account of objects.
Mini supplies what the language does not: durable identity (objects), current authority, admission, funding and the laws that judge every write.
Core4
- Specification: a value of type
C → V → W. Given the final self and the inherited super, it produces a new value. - Composition:
mix(lower, upper) = λself. λsuper. upper self (lower self super);fix(spec, inherited)computes the fixpoint. - Laziness: call-by-name reference semantics, call-by-need machine.
{good = 7, bad = self.bad}.goodis7. - Activities:
performyields a typed Plan; the program resumes on a typed Response. The kernel runs activities on objects (a persisted checkpoint, answer slots, resume with the object's state in view, paid exhaustion, abandonment); each turn is a signed Host operation, run on scratch worlds. See Laws. - Types: the checker returns a typing derivation. Affine and linear quantities are checked as at most once.
Example
spec Base for Shop:
def price(n: Nat) -> Nat:
n * 3n
spec Billing for Shop:
def bill(n: Nat) -> Nat:
self.price(n) + 1n
spec Surcharge for Shop:
def price(n: Nat) -> Nat:
super.price(n) + 2n
Billing calls self.price, so it sees a layer added later.
bill(2) is 7 under Base and Billing, and 9 once
Surcharge is composed in. A gate re-runs every command in the
tutorial
and fails on any changed output.
Proved
In Theory/ObjectiveBend*.lean; every pinned axiom set is within
propext, Classical.choice, Quot.sound.
| Property | Statement |
|---|---|
| Soundness | If the bounded machine finishes a closed term, the reference semantics evaluates it to the machine's result (weak head). |
| Preservation | Every machine step preserves typing. |
| No refusal | A closed term the checker accepts never reaches a refusal, at any limits. It may still diverge, blackhole or suspend. |
| Completeness | A closed term that evaluates to an observable value finishes on the machine in finitely many steps, given large enough limits. No bound on those limits is proved. |
| Fast machine | Every compiled call runs a fast machine proved equal to the specified one; the compiler's substitution of it is trusted. |
| Front end | When the checker accepts the front end's output, that term is typed, the machine never refuses it, and a finished run is a deep evaluation of it. The checker's reading of the front end's packet is proved to be the elaborator's own term. |
Not proved, not deployed
- The default build does not re-check these proofs; a separate gate builds them
(
lake build ObjectiveProofs), with each axiom set pinned. - There is no surface semantics: no theorem says the core means what the source says. The front end is one Lean program, trusted; the receiver re-runs it at admission and admits only a core equal to its own output.
- The shell's
bendverb has the Host's front end lower a program, publishes it, and runs it as a kernel activity on an object. The next build carries it. Signed Objective invocations, activities, object records and seats have run on scratch worlds only; see Laws.
Language guide: every theorem, its hypotheses, and what Core4 lacks.