Skip to content

Equivalence oracle runs IBM's default TRUNC(STD) as TRUNC(BIN) on both sides #4102

Closed

Description

@squid-protocol

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.

  1. Map TRUNC(STD) to -fbinary-truncate.
  2. The det translator calls Cobol.setTruncBinary(true) when the program's effective TRUNC is STD. The model-port tickets state the rule.
  3. Re-prove every case (det_port.py run --all-cases, plus the model ports) and report which proofs move.
  4. Update entry C1 of docs/language_status/oracle_assumptions.md.

Found while writing the oracle-assumptions register (#4051, epic #4055).

🤖 Generated with Claude Code

https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ

Activity

  1. added a commit that references this issue on Oct 2, 2026
    67154cb
  2. added
    scope:coreBlocks a burned-estate program's next evidence rung, or the 4th-estate one-shot trial
    era:2Era CICS/MVS-ESA, COBOL II/85: RESP, SQL, DPL (~1988-96) (era_tags.py)
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    era:2Era CICS/MVS-ESA, COBOL II/85: RESP, SQL, DPL (~1988-96) (era_tags.py)scope:coreBlocks a burned-estate program's next evidence rung, or the 4th-estate one-shot trial

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions