Skip to content

det: SEARCH / SEARCH ALL, OS/VS alphabets, LABEL RECORD ARE, EXHIBIT NAMED; missing period refused by name (#4462) - #4554

Merged
squid-protocol merged 5 commits into
mainfrom
fix/4462-det-grammar-slice3
Oct 6, 2026
Merged

squid-protocol merged 5 commits into
mainfrom
fix/4462-det-grammar-slice3

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #4462 (slice 3): the remaining translator-refuses-grammar ledger entries (6) are read or refused by name; the cause is now empty and gone from the ledger.

What changed (det translator)

  • SEARCH / SEARCH ALL (CardDemo COPAUS1C). OCCURS now keeps its ASCENDING / DESCENDING KEYs and its INDEXED BY names. Each index name is an item that holds the occurrence number (initially 1, as in GnuCOBOL). The statement builder opens a SEARCH frame for AT END and the WHENs. A SEARCH ALL takes one WHEN; the next WHEN belongs to the enclosing EVALUATE. END-SEARCH or the period closes the frame.
    • Serial SEARCH walks the table starting from the index's current value.
    • SEARCH ALL uses GnuCOBOL's binary search (head 0, tail size+1, mid = (head+tail)/2) and steers on the first unequal key in KEY order. Its WHEN is limited to key = value or a key's condition-name, for the leading keys, subscripted by the first index and joined by AND. Anything else becomes a hole, refused by name.
    • SEARCH VARYING a counter is refused by name: IBM steps the counter, while GnuCOBOL sets it to the index's value.
    • DEPENDING ON tables (size 0 included) are supported.
  • OS/VS alphabet without ALPHABET (DSF PLUKKFR / PLUKKFRN). source.alphabet_keywords adds the keyword for the grammar and for program.alphabets. That is the parsed alphabet model det translator: PROGRAM COLLATING SEQUENCE ignored in alphanumeric relation conditions (silent) #4539 reads; its logic is untouched here.
  • LABEL RECORD ARE / LABEL RECORDS IS (DSF FO04D1X1). The optional word is dropped (source.label_records).
  • EXHIBIT NAMED (DSF R001BYDL). It translates to one DISPLAY line in GnuCOBOL's spelling, NAME = value with literals shown as their value. Qualified or subscripted names and EXHIBIT CHANGED (which GnuCOBOL does not implement) are refused by name.
  • A missing period (GenApp polloo2.cpy). The program is refused by name as a source defect, under the new ledger cause translator-refuses-source-defect (definitional).

Evidence

  • GnuCOBOL equivalence in all 3 modes (bytes / typed / groups): test_det_programs SRCHALL (16 SEARCH ALL probes plus serial SEARCH) and EXHIBIT.
  • 21 new unit tests in test_det_source_4462.py.
  • test_det_* and test_fact_crosscheck with EQUIVALENCE_E2E=1: 359 passed, none skipped.
  • Fact cross-check: COPAUS1C, PLUKKFR and PLUKKFRN read with no new disagreements. R001BYDL has one self-GO TO (engine-drops-self-transfer), and FO04D1X1 has VALUE 001 vs 1 (numeric-value-spelling). The ledger was updated with update and assign.
  • Ratchets (pr_gates --ratchets): all 6 pass. Det sweep (--det-only --skip-db2): "as expected".
  • Full pr_gates: all gates pass. Golden first failed on bootstrap.rtl.css under load (not det code), and passed on rerun.

Remaining refusals in #4462 that are policy refusals by name: national/DBCS text and DECIMAL-POINT IS COMMA (translator-refuses-national-text, tracked in #4462/#4272), IDMS (#4532), PAYMAIN's COPY collision (#4486), and polloo2's source defect (here). This PR therefore leaves #4462 open.

🤖 Generated with Claude Code

https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR

squid-protocol and others added 5 commits October 6, 2026 03:32
…NAMED; a missing period refused by name (#4462)

- OCCURS keeps its ASCENDING / DESCENDING KEYs and INDEXED BY names; each index name is an item holding the
  occurrence number. SEARCH opens a frame for AT END and its WHENs (SEARCH ALL: one), closed by END-SEARCH or the
  period. Serial SEARCH walks from the index; SEARCH ALL is GnuCOBOL's binary search, its WHEN restricted to
  key = value / key condition-names for the leading keys, AND-joined (else a hole by name). SEARCH VARYING a
  counter is refused by name (IBM steps it, GnuCOBOL sets it). Proven against GnuCOBOL (test_det_programs SRCHALL).
- An alphabet clause without ALPHABET (DSF PLUKKFR / PLUKKFRN) gets the keyword for the grammar and
  program.alphabets; LABEL RECORD ARE / RECORDS IS read (FO04D1X1).
- EXHIBIT NAMED translates as one DISPLAY line `NAME = value` (GnuCOBOL-proven); qualified / subscripted names and
  EXHIBIT CHANGED are holes by name (R001BYDL).
- A data entry with no period before the next level number is refused as a source defect (GenApp polloo2.cpy).
- Ledger: translator-refuses-grammar is empty and gone; polloo2 -> translator-refuses-source-defect (definitional);
  the newly read programs' disagreements are engine-drops-self-transfer / numeric-value-spelling.

Part of #4462

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
@squid-protocol squid-protocol added bug Unintended behavior or logic failure in the engine legacy-modernization COBOL refractor, dead-code extraction, and JCL forging priority: high Core feature broken, but workarounds exist labels Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 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 6, 2026 09:01
@squid-protocol
squid-protocol merged commit acc351a into main Oct 6, 2026
37 of 38 checks passed
@squid-protocol
squid-protocol deleted the fix/4462-det-grammar-slice3 branch October 6, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unintended behavior or logic failure in the engine legacy-modernization COBOL refractor, dead-code extraction, and JCL forging priority: high Core feature broken, but workarounds exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant