Skip to content

det: CALL identifier over the names the source fixes; DSNTIAC refused by name (Part of #4736) - #4750

Merged
squid-protocol merged 2 commits into
mainfrom
feat/4736-dynamic-call
Oct 9, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
feat/4736-dynamic-call

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #4736 (and #4270). DBB MortgageApplication epscsmrt now translates whole; COTRTLIC's CALL DSNTIAC is refused by name, so it stays one statement short.

Dynamic CALL identifier

  • det (det/dyncall.py, Gen.dynamic_call): the names the identifier can hold when the CALL runs are found from the source. (1) A MOVE of a literal, or of an item whose bytes VALUE clauses fix and nothing writes (through a REDEFINES table, literal subscripts: epscsmrt's MOVE CALLED-PROGRAM-NAME(1) TO WS-CALLED-PROGRAM), earlier in the CALL's paragraph on its own path with nothing between that may write the item; else (2) an item with a VALUE whose every write in the program is such a MOVE (its VALUE and each MOVEd value). One name is one call; several are a switch on the content (trailing blanks trimmed), a case per name.
  • Refused by name: an item with no VALUE; any write the analysis cannot read (READ INTO, STRING, group MOVE, a REDEFINES alias, the item in a CALL's USING, a MOVE from COMMAREA data, a computed subscript); a reaching name no estate service answers to, a blank name, a mixed-case or over-8-character name (PGMNAME(COMPAT)); ON EXCEPTION / OVERFLOW phrases.
  • Engine (galaxy_ir.dynamic_call_targets): a MOVE from an element of a VALUE table names the table's programs, so EPSMPMT's service gets its handleCall (mortgage program calls 18/19 -> 19/19, PINNED updated).
  • IBM reference: Enterprise COBOL 6.4 Language Reference, CALL statement (new register entry C15). The page does not state case, trailing-blank or length rules, nor what ends the run unit without ON EXCEPTION, so the port models only uppercase names up to 8 characters and never reaches the not-found case.

DSNTIAC / DSNTIAR

Refused by name ("DSNTIAC: Db2's message text is not modelled"), whether written CALL 'DSNTIAC' or through an item (COTRTLIC's CALL LIT-DSNTIAC). Db2's message catalogue is not documented byte for byte and the oracle (ggsql.c / Db2 for Linux) cannot produce z/OS's text. Register Q5 stays REFUSED, reworded.

Census (cics_census.py blockers --all-programs, baseline 5abdf0c vs this branch)

  • translated whole 103 / 179 -> 104 / 179 (non-burned 11 / 52 -> 11 / 52; burned +1: epscsmrt)
  • gap class dynamic CALL (2 only-gap, 6 touched) is gone; it became DSNTIAC: Db2's message text is not modelled (COTRTLIC, 1 only-gap) and three <name>: no program of that name with a CALL entry in the estate / ZUIDSTCK rows in programs that have other gaps.
  • COTRTLIC is not whole (its one remaining statement is the refused DSNTIAC).

Evidence

  • tests/cobol_mainframe/test_det_dynamic_call_4736.py: 5 shapes (VALUE only, MOVE literal, VALUE table via REDEFINES as epscsmrt, two values -> switch, trailing blanks) run under GnuCOBOL (callees as cobc -m modules) and as the port, DISPLAY output equal (EQUIVALENCE_E2E=1); 12 refusals asserted by name.
  • det_port.py check vs origin/main: 77/79 ports unchanged; changed: mortgage-mpmt (gains handleCall, still KNOWN_UNPROVEN: COMP-1, C6) and carddemo-cotrtlic. proof_sweep.py --det-only --cases mortgage-mpmt,carddemo-cotrtlic (Db2 local): carddemo-cotrtlic PROVED on 27 scenarios (56/59 paragraphs, 165/230 branches), mortgage-mpmt NOT PROVEN, "sweep: as expected".
  • No equivalence case for EPSCSMRT: its callee EPSMPMT is refused (float), every call reaches that hole.
  • pr_gates.py --fast 5/5; --ratchets all pass after the completeness pin (golden masters not run locally; CI does).

🤖 Generated with Claude Code

https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D

squid-protocol and others added 2 commits October 9, 2026 00:15
… by name (Part of #4736)

A CALL whose program is a data item is dispatched over the names the item can
hold (a VALUE, a VALUE table through a REDEFINES, MOVEs of literals), and
refused by name when a reaching value is not statically known. The engine's
dynamic_call_targets now follows a MOVE from an element of a VALUE table, so
EPSMPMT gets its handleCall. DSNTIAC / DSNTIAR are refused by name (Q5).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D
@squid-protocol squid-protocol added enhancement New feature, sensor, or structural signature legacy-modernization COBOL refractor, dead-code extraction, and JCL forging labels Oct 9, 2026
def targets(gen, s: S.Stmt) -> list[str]:
"""`values`, each checked to be a program the port can call: an unknown value, a name no estate service or
library routine answers to, or one the port does not match (blank, mixed case, over 8 characters) is refused by name."""
from gitgalaxy.tools.cobol_to_java.det.gen import LIBRARY, Untranslatable
out += [f"{ind} case {jstr(n)}: {{", *one(n, ind + " "), f"{ind} break;", f"{ind} }}"]
why = f"CALL {s.data['dynamic'].name}: the program name is none of {', '.join(names)}"
out += [f"{ind} default: throw new Hole({jstr(why)});", f"{ind}}}"]
return out
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol marked this pull request as ready for review October 9, 2026 05:09
@squid-protocol
squid-protocol merged commit f6cda2c into main Oct 9, 2026
41 checks passed
@squid-protocol
squid-protocol deleted the feat/4736-dynamic-call branch October 9, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, sensor, or structural signature legacy-modernization COBOL refractor, dead-code extraction, and JCL forging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants