Not official documentation. This is an unofficial explainer of John N. Shutt's vau calculus. It is not written, reviewed or endorsed by John N. Shutt, Dale Schumacher, Mitchell Wand, or any author of the cited sources. An AI model (Claude) drafted the text and the Lean, and no person has reviewed them. The text may contain errors; the Lean statements are the ground truth for what is proved, and the cited sources are the ground truth for the theory. The Lean covers the pure vau-x calculus (no delta-rules) and a model of vau-e (environments, $vau, derived $lambda) with this project's additions (encapsulation types, an actor model). It does not formalize Shutt's general framework; confluence is proved directly for these concrete rules only.Licence of this repository: MIT License. Cited works keep their own copyright; only short, attributed phrases are quoted.
Vau/Env/Actors.lean234 lines · 13 declarations on the siteview on GitHub ↗
import Vau.Env.Encapsulation
/-!
# An actor-style evaluator with concurrent operand evaluation
Dale Schumacher implements a Kernel-like language with actors in his language Humus ("Fexpr the
Ultimate Lambda" and "Semantic Extensibility with Vau", 2011). In his design:
* an expression is an actor that answers an `#eval` request: a pair evaluates its left part with a
new customer `k_comb`, and `k_comb` sends a `#comb` request with the right part to the combiner
that comes back;
* a combiner answers a `#comb` request; an applicative evaluates its operands with a `#map`
request, which uses a fork/join pair to evaluate the operands **concurrently**, then sends
`#comb` to its underlying combiner;
* an environment answers `#lookup`.
This file models that structure for the Lean vau-e and relates it to vau-e reduction.
**The model** (this project's). A configuration `Conf` is a tree. Its leaves are pending messages
(`evalM` for `#eval`, `combM` for `#comb`) and replies (`ret`); its inner nodes are customers that
wait for replies: `kComb` (Schumacher's `k_comb`), `kWrap` (waits for the combiner inside an
applicative that is being evaluated), `fork` (a fork/join pair), and `kArgs` (an applicative that
waits for its evaluated arguments). `Deliver c c'` delivers one message or reply. A message may be
delivered anywhere in the tree, so both branches of a fork run in any interleaving. A symbol lookup
is one delivery (Schumacher's environment actors forward `#lookup` to their parent; that chain is
not modeled step by step).
**Not modeled:** actor addresses, mailboxes, message order and fairness, actor state changes other
than the customers above, environment mutation (Schumacher's `&define!` and `#bind`; without
mutation there are no races), concurrent parameter matching (here `match` is one step), and Humus
itself. In Schumacher's posts an applicative evaluates to itself; here evaluating an applicative
follows Shutt's (9.7a), as in the rest of the Lean vau-e. The theorems are about this tree model, not about
Schumacher's code or a general actor semantics.
Results:
* `deliver_sound`, `actor_sound`: read a configuration back as a vau-e term (`readback`). Every
delivery is zero or one vau-e step, so every actor run is a vau-e reduction;
* `actor_eval_sound`: if the actor evaluator replies `v` to `[eval t e]`, then `[eval t e] ->* v`;
* `actor_determinate`: any two runs (any two interleavings) that reply primitive data reply the
same data;
* `actor_results_join`: any two replies can be reduced to a common term;
* `fork_interleave`: two deliveries in the two branches of a fork can be done in either order, and