M6: Theorems A and B at Level M #
The machine program: initWS once (with K_B in local kb), then opS op for each operation.
An operation's arguments are put in locals by opS; an order query leaves its answer in local r.
init_reach: initialization reaches a state holding Level F's initial state with the invariant.step_reach: from such a state, each valid operation returns the specification's answer and reaches such a state again, in at mostopB K_Bmachine steps.theoremAB_M: for every valid operation sequence, the machine returnsSpec.run's answers, and every operation takes at mostopB K_Bsteps.opB K_Bdepends onK_Balone: not onN, the number of live elements, or the history.
The machine code of one operation, its arguments as literals.
Equations
- One or more equations did not get rendered due to their size.
- OrderMaintenance.Impl.opS OrderMaintenance.Spec.Op.insertFirst = ("hx" ::= OrderMaintenance.Machine.Expr.lit 0;; OrderMaintenance.Impl.insertWS)
- OrderMaintenance.Impl.opS (OrderMaintenance.Spec.Op.delete x_1) = ("x" ::= OrderMaintenance.Machine.Expr.lit x_1;; OrderMaintenance.Impl.deleteWS)
- OrderMaintenance.Impl.opS (OrderMaintenance.Spec.Op.order x_1 y) = ("x" ::= OrderMaintenance.Machine.Expr.lit x_1;; "y" ::= OrderMaintenance.Machine.Expr.lit y;; OrderMaintenance.Impl.orderWS)
Instances For
The answer of an operation, read from the machine state after it.
Equations
- OrderMaintenance.Impl.ansOf OrderMaintenance.Spec.Op.insertFirst x✝ = OrderMaintenance.Spec.Ans.inserted
- OrderMaintenance.Impl.ansOf (OrderMaintenance.Spec.Op.insertAfter x_2) x✝ = OrderMaintenance.Spec.Ans.inserted
- OrderMaintenance.Impl.ansOf (OrderMaintenance.Spec.Op.delete x_2) x✝ = OrderMaintenance.Spec.Ans.deleted
- OrderMaintenance.Impl.ansOf (OrderMaintenance.Spec.Op.order x_2 y) x✝ = OrderMaintenance.Spec.Ans.bool (decide (x✝.loc "r" ≠ 0))
Instances For
The bound on one operation's machine steps.
Equations
Instances For
A machine state holding a wrapper state with the Level M invariant for Sp, and K_B.
Equations
- OrderMaintenance.Impl.Reach KB m Sp = ∃ (om : OrderMaintenance.Model.OrderMaintenance) (p : ℕ), OrderMaintenance.Impl.WEnc om m p ∧ OrderMaintenance.Impl.MInv om Sp ∧ om.KB = KB
Instances For
Initialization.
One operation: the specification's answer, the invariant again, at most opB K_B steps.
The machine run over a sequence of operations: the answers and the cost of each operation
(none if an operation fails or reaches an error).
Equations
Instances For
Theorems A and B at Level M. For K_B ≥ 4 (in local kb) and every valid operation
sequence, the machine program returns exactly the specification's answers; initialization takes
at most initB steps and each operation at most opB K_B steps.
The constants #
The constant of Theorem B for the proof parameters' K_B = 4.