Page actions
instrument / verified-clean
Primality Tester
The current ledger marks this instrument verified clean within the source-bound verification corpus.
Inspectable records
Ledger state
The current ledger marks this instrument verified clean within the source-bound verification corpus.
- Area
- Computing & Information
- Tranche
- tranche-4
- Evidence ID
- t4-124
- Ledger rows
- 1
No ledger note is attached.
Review findings
The core mathematical claims are standard, but the instrument is not fully verifiable as specified. Define exact Miller-Rabin bases or rounds, confidence semantics, integer-square-root behavior, n < 2 handling, and factor-list semantics before release.
Formula and scope findings
- Trial division through floor(sqrt(n)) is correct for integers n >= 2, but the specification must explicitly define the divisor sequence and the handling of n < 2. Testing only odd divisors after 2 is an equivalent optimization.
- Miller-Rabin is correctly identified as a probabilistic primality test, but the specification omits the number of rounds, selected bases, random-base generation, and the exact confidence calculation.
- For supported bounded ranges, Miller-Rabin can be deterministic with a prescribed base set; without such a base set, a reported confidence must not be presented as a proof of primality.
- The factor-list formula is unspecified: it does not define whether to return the first factor, distinct factors, repeated factors with multiplicity, or only factors found during a separate bounded scan.
Unit assumptions
- The input is a mathematical integer represented exactly as a BigInt; no floating-point conversion is permitted.
- sqrt(n) means the exact integer floor square root, floor(sqrt(n)); floating-point square-root results must not determine correctness for large BigInt values.
- Primality is defined only for n >= 2. Zero, one, and negative integers are neither prime nor composite.
- The confidence value is not meaningful for deterministic trial division; for Miller-Rabin it depends on independent random bases or a declared deterministic base set and must be explicitly defined.
Boundary hardening
BREAK_CLAIMED · SELF_FLAGGED
The mathematical checks have clear expected behavior, but the specification leaves the Miller-Rabin/trial-division cutover and negative-integer convention unspecified. An implementation could route boundary-sized values inconsistently, return an undefined result for negative inputs, or silently test the absolute value of a negative input.
Errata and corrections
No applied erratum is attached to this unique-name record.
Inspectable example
4 review vectors are recorded. One source-bound sample is shown below.
{
"inputs": {
"n": "29",
"method": "trial_division"
},
"expected_outputs": {
"verdict": "prime",
"confidence": "exact (100%)",
"small_factors": []
},
"working": "floor(sqrt(29)) = 5 because 5^2 = 25 and 6^2 = 36. Test divisors 2, 3, and 5: 29 mod 2 = 1, 29 mod 3 = 2, and 29 mod 5 = 4. No divisor is found through 5, so 29 is prime. Factor list = []."
}Related workflows
Sources and evidence
These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.
VERIFIED_LEDGER.json · VERIFIED_CLEANevidence-tranche4/tranche4-results.jsonBOUNDARY_HAZARD_CATALOG.json