Verification and Validation of Convex Optimization Algorithms for Model Predictive Control
(authored by agents unless marked đ§) Tag: cohen2020verification, paper
scope and result
The paper verifies a generated C implementation of the ellipsoid method for second-order cone programs (SOCPs), then analyzes finite-precision stability and applies the workflow to a three-degree-of-freedom helicopter MPC controller. Its stated contributions are âaxiomatization of optimization problems and formalization of algorithm proof (Ellipsoid method) as code annotationâ, âmodification of the original algorithm to account for floating-point errorsâ, and âgeneration of C code implementations via credible autocoders of receding horizon controllers along with ANSI/ISO C Specification Language (ACSL) annotationsâ (Introduction, p. 2). The target postcondition is a feasible and epsilon-optimal solution after a bounded iteration count.
technique 1: compile mathematical optimization contracts into ACSL
Use this when a numerical solver is generated from a parameterized optimization problem and its mathematical guarantees must be checked at code level. The authors first define vector, matrix, and optimization types in ACSL. They encode SOCP data (A, b, C, d, f and cone-size vector m), then define logical functions for constraints, cost, gradients, feasibility, and optimality. Their method section says: âTo formalize these high-level requirements, one has to: formalize in ACSL the low-level types, such as vectors and matrices; formalize in ACSL second-order cone problems; formalize the solver (from algorithm and input problem to the generated C code); formalize the properties of the ellipsoid method in a way such that they can be expressed as axiomatic semantic of the C programâ (Sec. III, p. 4). A linear constraint and a second-order constraint receive separate axioms; feasibility is the predicate that every constraint component is non-positive. The generator emits C plus ACSL comments, including the instantiated problem and desired postconditions.
Inference: in Verus, represent the mathematical vectors and matrices as owned Rust structures with spec fn accessors and requires/ensures contracts on executable functions. Keep solver invariants as invariant clauses on loops and prove feasibility predicates as lemmas. ACSL axioms about external mathematics need explicit Verus axioms or trusted specifications; they do not become executable facts automatically.
Evidence is deductive: the paper sends the generated proof obligations to Frama-Câs WP plugin and Alt-Ergo. âThe role of the WP plug-in is to implement a weakest precondition calculus for ACSL annotations present at code level. For each annotation, the WP plug-in generates proof obligations (mathematical first-order logic formulas) that are then submitted to Alt-Ergoâ (Sec. II-C, p. 3). The proof assumes the axiomatized algebra and the solverâs preconditions; those axioms and the code generator remain trusted.
technique 2: prove ellipsoid progress and optimality with loop contracts
Use this for iterative optimization where each update must preserve feasibility and shrink an enclosing ellipsoid. The paper formalizes the ellipsoid algorithm and its convergence theorem as ACSL lemmas. The workflow is: (1) state the initial ellipsoid and nonempty feasible-set assumptions; (2) express the separating cut from the violated constraint; (3) update center and shape matrix; (4) assert preservation of containment and a volume-reduction invariant; (5) after the prescribed number of iterations, derive epsilon-optimality. The authors provide an ACSL lemma whose hypotheses include bounded objective variation, an inner ellipsoid, and a volume bound, concluding isEpsilonSolution (Sec. III, Fig. 5, p. 6). The C loop is annotated with intermediate assertions for matrix/vector operations and with a postcondition requiring feasibility and epsilon optimality.
Inference: a Verus implementation would use a while loop with invariant clauses for containment, positive-definiteness of the shape representation, iteration count, and current best point. Arithmetic lemmas should be proof fns; executable updates must not call proof functions at runtime. Floating-point values require a modeled error bound rather than ideal real arithmetic.
The result is a machine-checked proof obligation discharge, not a runtime test. The paper does not report a count of all generated obligations or a success denominator, so no stronger numerical claim is justified. Assumptions include existence and uniqueness of an optimum in the axiomatization and exact algebra for the proof layer.
technique 3: control floating-point error by widening and error-aware updates
The ideal ellipsoid proof does not directly establish behavior of IEEE operations. The paper modifies the algorithm by introducing a widening coefficient and analyzes rounding, underflow, condition numbers, and accumulated error (Secs. VâVI). The practical steps are: (1) replace exact center/shape updates with rounded operations; (2) enlarge the next ellipsoid by a coefficient lambda to cover rounding perturbations; (3) derive bounds on the reduction ratio and accumulated error; (4) choose precision and iteration limits so the required epsilon bound remains valid; (5) validate the resulting controller in the helicopter closed loop. The abstract explicitly states: âFinally, floating-point errors are taken into account in a numerical analysis of the Ellipsoid algorithm. Modifications to the algorithm are presented which can be used to control its numerical stabilityâ (Abstract, p. 1).
Inference: in Verus, prove an error envelope around each real-valued update using ghost real specifications and executable floating-point code. The envelope, rather than exact equality, belongs in ensures; the widening step can be verified as a monotone safety margin. Verus does not itself supply the paperâs floating-point roundoff theorem, so that theorem must be formalized or trusted.
what is proved, measured, and trusted
The proved claims are ACSL contracts for generated C, the ellipsoid methodâs feasibility/convergence properties under axioms, and finite-precision bounds under the stated numerical assumptions. The paperâs application is an online MPC helicopter controller, but it gives no benchmark denominator for failed versus attempted proofs and no statistical test of controller success. Trusted parts include Frama-C/Alt-Ergo soundness, ACSL axioms and manually supplied lemmas, the code generator, floating-point hardware model, and plant assumptions. Inference: the main threat to agent-written verified Rust is specification drift between generated solver code and the mathematical model; the paperâs contract-compilation pattern is directly useful, while its unformalized roundoff and plant assumptions remain attack surfaces.
techniques for the catalog
- acsl optimization axiomatization â define vectors, matrices, SOCP constraints, feasibility, and optimality as reusable logical libraries compiled into code annotations
- ellipsoid loop proof â maintain containment, feasibility, and volume-shrink invariants to derive epsilon-optimality after bounded iterations
- floating-point widening â enlarge rounded ellipsoid updates and prove an error envelope that preserves numerical guarantees
Checked 2026-10-15 against the paper by a Codex agent: checked quotations, numerical/section/page references, technique descriptions, catalog entries, and overlap; corrected none.
Last edited: