Mechanical settlement of one good and nominal cash. Assents are input marks here; the Run layer computes them from both first eligible native acts. The mechanism checks capacity and funds and never sees the reference order.
noncomputable def
MindFormal.AstraTrade.run
{N : ℕ}
(book : List (Ticket N))
(s : Ledger N)
:
Ledger N
Equations
- MindFormal.AstraTrade.run book s = List.foldl (fun (s : MindFormal.AstraTrade.Ledger N) (o : MindFormal.AstraTrade.Ticket N) => o.settle s) s book
Instances For
A certificate is checked at each actual entering ledger, including all earlier payments in this list; it is not a condition on an initial budget.
Equations
- MindFormal.AstraTrade.Improving [] x✝ = True
- MindFormal.AstraTrade.Improving (o :: os) x✝ = ((o.Executes x✝ → o.seller < o.buyer) ∧ MindFormal.AstraTrade.Improving os (o.settle x✝))
Instances For
theorem
MindFormal.AstraTrade.run_quiet
{N : ℕ}
{book : List (Ticket N)}
{s : Ledger N}
(hi : Improving book s)
(he : rankSum (run book s).owners = rankSum s.owners)
:
Equal endpoint potential forces every settlement to be the identity. This is the no-trade-sweep step, proved rather than supplied as progress.