You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Equivalence oracle runs IBM's default TRUNC(STD) as TRUNC(BIN) on both sides #4102
What. IBM Enterprise COBOL's default TRUNC(STD) is running as TRUNC(BIN) on both sides of every proof, so the proofs agree with each other and differ from IBM in the same way.
Evidence (2026-10-02, gitgalaxy-gnucobol:3, GnuCOBOL 3.1.2), with PIC S9(4) COMP:
flags
MOVE 99999 (via a zoned item)
ADD 1 to 9999
COMPUTE = 12345
-std=ibm (what the harness passes for STD)
-31073 (bytes wrapped)
+10000, no SIZE ERROR
+12345
-std=ibm -fnotrunc (TRUNC(BIN))
-31073
+10000
+12345
-std=ibm -fbinary-truncate
+09999
SIZE ERROR
+02345
-fbinary-truncate gives IBM's TRUNC(STD) results.
Where.
tests/tools/equivalence_common.COBC_OPTIONS maps ("TRUNC", "STD") to "" (no flag), on the belief that STD is GnuCOBOL's own behaviour under -std=ibm.
The det runtime's Cobol.setTruncBinary defaults to off (BIN).
gitgalaxy.core.compiler_options.DEFAULTS["TRUNC"] is "STD".
Who asks for STD.
CBSA: every program starts PROCESS CICS,NODYNAM,NSYMBOL(NATIONAL),TRUNC(STD). The proven cases cbsa-updcust and cbsa-abndproc are among them.
CardDemo: the compile PARMs (samples/proc/BUILDBAT.prc, BUILDONL.prc) name no TRUNC, which means the installation default (STD as shipped).
Reach. Only where a binary item receives more digits than its PICTURE. Not yet measured for the proven programs.
Plan.
Map TRUNC(STD) to -fbinary-truncate.
The det translator calls Cobol.setTruncBinary(true) when the program's effective TRUNC is STD. The model-port tickets state the rule.
Re-prove every case (det_port.py run --all-cases, plus the model ports) and report which proofs move.
Update entry C1 of docs/language_status/oracle_assumptions.md.
Found while writing the oracle-assumptions register (#4051, epic #4055).
Activity
Oracle assumptions register, det_port.py check, and the det-port skill (
TRUNC(STD), IBM's default, on both sides of every proof (fixes #4102) (…