Pseudo could say what a procedure computes only up to INTEGER and FLOAT,
so it could not state what a Mojo or Python program with Int32, UInt8 or
Float32 values will compute, and it had no words for rounding itself.
- lang/parse: INT8..INT64, UINT8..UINT64, FLOAT32, FLOAT64 as types
(INTEGER or FLOAT with a width, so every "whole number" rule accepts
them); conversions written as Mojo writes them, INT32(X), FLOAT32(X);
1_000_000, 0xFF and 0b1010 literals; a type name as an argument
(MAX_VALUE(INT8)); the USE line (USE IEEE now, library modules next).
- check: widths and precisions never mix silently (mixed-width,
mixed-precision); a literal takes the type of the sized value beside
it, as in Mojo, and one that does not fit is an error before any run
(literal-range); typing for every new built-in.
- interp: a sized result, store, parameter, RETURN or conversion that
does not fit stops the run (kind overflow), WRAP(X, T) wraps on
purpose; FLOAT32 results are rounded to single precision; USE IEEE
lets NaN and infinities flow.
- numeric.js: exact helpers: FMA rounded once, EXACT(X) with every digit
a FLOAT holds, ULP and NEXT_AFTER for both precisions, bit operations
in two's complement.
- Built-ins: ASIN ACOS ATAN SINH COSH TANH HYPOT POW CBRT EXPM1 LOG1P E
TRUNC SIGN COPYSIGN CLAMP FMA IS_NAN IS_INF IS_FINITE INF NAN ULP
NEXT_AFTER IS_CLOSE EXACT MAX_VALUE MIN_VALUE EPSILON GCD LCM BIT_AND
BIT_OR BIT_XOR BIT_NOT SHIFT_LEFT SHIFT_RIGHT WRAP. They stay usable
as names (a variable E, a FUNCTION GCD): the program's own wins.
- vcgen: an overflow obligation on every sized result, then the range
as a fact (also for sized parameters and loop-cut variables); FLOAT32
arithmetic as its own uninterpreted functions, constants rounded
exactly, TOFLOAT32(v) otherwise; argument obligations for SQRT, the
logarithms, ASIN/ACOS, LOG1P, CLAMP and the shifts; nothing proved
under USE IEEE.
- testing: the fuzzer tries the edges of a sized type and generates
FLOAT32 values.
- pseudo-to-mojo: Int8..Float32, conversions, the new built-ins through
std.math (each name in the harvested index), a note where Mojo wraps.
- Tests: numeric.test.mjs; corpus 49-52; prover fixtures int8-overflow,
float32-store, ieee-nan; the reference documents every new form.
Gate: 324 pass (core). New Mojo uses std.math names the interpreter has
not been verified on (listed in sync-mojo's KNOWN_GAPS); they need
pixi run mojo-verify on the network before the interpreter runs them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FgvbRdoEheAHqsRmr2WuKZ
The way out of a FOR EACH loop includes the case of no pass at all, but the
checker added "X is in the collection" to the loop's head state and then used
that same state as the way out. After a loop over an empty list the fact is
FALSE, so the checker held a contradiction and proved anything after the
loop, ASSERT 1 == 2 included (tests/prover/foreach-empty.pseudo). The fact is
now assumed only for the body of a pass.
The soundness test gains a canary: after every program that runs to its end
without input, ASSERT 1 == 2 is appended and must not be proved, since a
proof there means a contradiction on a path every run takes. A one-off scan
with the canary after every top-level statement of every program (476
points) found nothing else.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FgvbRdoEheAHqsRmr2WuKZ
The prover reasons about a FLOAT as a number: Y == Y holds, and X < Z or
X >= Z. The interpreter let 1.0E308 * 10.0 become infinity and X - X become
NaN and carried on, so a run broke claims the prover had proved
(tests/prover/float-overflow.pseudo proved ASSERT Y == Y with Y NaN).
The notation already stops on a FLOAT division by zero and on a whole number
past 2^53 - 1. It now also stops, with an 'overflow' error, when an
arithmetic result, a built-in's result or a literal is not a finite number
(finiteCheck in interp.js). Every run then stays inside what a proof covers.
Regression programs whose fix was to the language rather than to a rule now
say where the run must stop, with a RUN-STOPS header the soundness test
checks.
A unit that does FLOAT arithmetic now carries a 'float-model' note: FLOAT is
treated as a finite number, rounding is opaque, and the lab stops past about
1.8e308, while the generated Mojo goes on with inf or nan (stated for a
division by zero, the case probes/float-special has verified).
New probe mojo/probes/float-overflow.mojo asks the compiler what a Float64
product past the largest double gives; it is unverified and needs
pixi run mojo-verify-item 'probes/float-overflow' (network).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FgvbRdoEheAHqsRmr2WuKZ
The prover could mark an obligation proved that a run of the same program
breaks. Two rules did it, both found with programs now in tests/prover/:
- Invariant inference (vcgen.js infer) stopped after four rounds and assumed
the candidates left even when the last round had still been dropping some.
A non-inductive guess became a fact, and a false ASSERT was proved
(houdini-cap.pseudo). Inference now runs up to eight rounds and keeps its
guesses only when a whole round leaves them unchanged.
- RAND(X) assumed 0 <= R < X for every X. For X <= 0 that fact is false
(RAND(0.0) is 0.0, RAND(-1.0) is in (-1, 0]), so the checker held a
contradiction and proved anything, even ASSERT 1 == 2 (rand-zero,
rand-negative). The fact now covers all three signs of X.
FILL and RANDINT assumed facts about their arguments that the interpreter
enforces by stopping the program, without asking whether the arguments are
allowed. A crashing call was reported as fully proved. They now raise an
obligation of a new kind, 'argument' ("Argument allowed"), mapped to the
runtime 'value' error, and their facts are guarded.
tests/prover-soundness.test.mjs is the gate: each regression program's
MUST-NOT-PROVE obligation stays unproved and is really broken by a run, and
across every exercise, corpus program, lesson solution and example, nothing
marked proved is broken by the fuzzer (kind, line, column) or by running the
program (kind, line).
In the app, a proved obligation that a generated input breaks at the same
place is now shown as broken rather than proved.
Proofs over INTEGER are about whole numbers of any size; a unit that does
integer arithmetic now carries an 'int-model' note saying so, with the lab's
2^53 - 1 limit and Mojo Int's wraparound past 2^63 - 1 (from the stored
godbolt answer for probes/int-overflow-int).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FgvbRdoEheAHqsRmr2WuKZ