Status 2026–11–04, branch bobot/congruence_proved. Required Why3: commit c3793205d (MR 1394), which fixes module StdA : A_intf (anomaly: Not_found for an interface that uses StdQ). Local image: why3-fix-c3793205d, pinned in misc/CI/Dockerfile_static.
| module | file | implemented by | notes | |—|—|—|—| | Q_intf | q.mlw | StdQ : Q_intf (stdq.mlw) | canonical (equal_is_eq) | | A_intf | stda.mlw | StdA : A_intf (stda.mlw) | uses StdQ as Q | | Real | q.mlw | | logic on reals: Real.div_e, Real.mod_e, Real.is_integer, Real.int_of... |
The extras of an implementation (round_down_to_small, pow, sign...) are in StdQ'impl / StdA'impl, the implementation view that Why3 gives to a refined module; the extraction is colibrilib__stdq__StdQ'impl.ml.
StdA uses the interface StdQ, not StdQ'impl: with c3793205d, an interface and its implementation must see the same view of StdQ (otherwise Cannot instantiate a defined symbol rational). So Q_intf gives what StdA needs of the representation:
num, den: the fraction in lowest terms, logic functions without axioms; their facts are in the val ghost num_den, so they enter a goal only when it is called;to_zarith, of_zarith: the same number in zarith.Q (the identity in OCaml), for flint.CA and the extras of StdQ'impl, which stay on zarith.Q.QModel implements num, den and num_den, not the two conversions.
All the clients use use colibrilib.stdq.StdQ as Q / use colibrilib.stda.StdA as A (union.mlw uses StdA as Q). The old interfaces q.Intf, q.IntfSqrt, qa.QDiv, qa.A and the checks stdq.Check, stda.Check are deleted. Rules:
1. One name per notion, no program operator: Q.add a b, equal, le, lt, neg; compare returns Ord.t. The operators of the logic on real are unchanged. 2. A.t is not canonical: the equality of the numbers is A.equal, the logical = is the representation. Q is canonical (Q.equal_is_eq). 3. Logic on reals: Real.div_e, Real.mod_e, Real.is_integer, Real.int_of. 4. Terms of A.t in specs: only A.add, A.sub, A.mul, A.mod_e (and the Q ones) are logic functions. 5. real is a coercion of A_intf (not of Q_intf): write Q.real q; for A, write A.real only where Why3 does not insert it (ghost arguments in code, polymorphic =).
Every module is extracted once, with --modular, and there are no OCaml functors (see agents/skills/why3proof.md, "Extraction"). StdQ, StdA and their Export modules are in colibrilib (colibrilib__stdq__StdQ'impl.ml, colibrilib__stda__StdA'impl.ml, ...); the other extracted modules call them by these names, with no driver line for the numbers. Flint is used directly (flint.drv –> common/flint_ca.ml, the context of colibri2).
zarith.mlw and flint.mlw (the specifications of the OCaml functions: Z/Q operations, the Flint exact reals: exact, algebraic, to_q recognizes the rationals; flint_ca.ml passes the context), the driver lines of zarith.Zbit (the bit operations and trailing_zeros of Zarith; the axioms are proved consistent by zbit_model.ZbitModel), and two driver lines: polynome.Lin.nz, product.Prod.nz (none_zero, inline in the drivers). product.APow.positive_pow, the power of the reals (real.PowerReal), is proved (2026–11–03) from A_intf.positive_pow, whose specification only uses real.PowerInt (r >= 0 and r^d = a^n for a fraction n/d = e): PowerReal stays out of the goals of the clients of StdA. irr's invariant (forall q. Q.real q <> CA.real ca) is proved from the to_q assumption in normalize.