Repository navigation
equivalence oracle: a pointer numeric view's zero test lowers to the NULL test (Part of #7434) - #7600
Merged
Merged
Conversation
…ointer's NULL test (Part of #7434) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
|
No description provided. |
Contributor
|
No description provided. |
This was referenced Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #7434 (tool slice).
What
equivalence_cics_pointer.lowernow accepts the NULL test of a POINTER's numeric view, the one idiom the det port already translates (view_zero_relation, X47).view [IS] [NOT] = | EQUAL [TO] 0 | +0 | 0.0 | ZERO | ZEROS | ZEROES(zero on either side, a leadingNOT) becomesptr [NOT] = NULL. The view's bytes are never read as a number. No case data.Class
A numeric view (
REDEFINESa POINTER,PIC S9(n) COMP) tested against zero, in every spelling the det port accepts. Tests cover the whole input class:=,NOT =,EQUAL,IS NOT EQUAL TO, ZERO/ZEROS/ZEROES,+0,0.0, zero left of the view,NOT view = 0, AND/OR with several views, a sentence-ending period beside anADDon a later line.Sibling gaps (still refused by name, as in the det port)
>,<)= 5,= 0.5), SPACES, another view or an itemlowerworks per line)Checklist
Checklist: partial [c:3a093f88] -- the oracle can now lower the CAGMZ-style
IF view = 0; the per-case scenarios and re-run are not in this tool slice.Evidence
pytest tests/cobol_mainframe/test_cics_pointer_lowering_6839.py test_pointer_lane_4771.py: 112 passed (system python3, notranslatorextra, so det tests may skip; no JDK run).cobcis not installed here, soptr NOT = NULLwas not compiled by GnuCOBOL; it is standard GnuCOBOL syntax.pr_gates --fastwas not run: no venv with the worker extras was found on this box ($PRIMARY/../venvsis absent); the pinned ruff 0.17.2formatis clean on both files.Cross-repo
None.
Lessons for agents
IF NOT view = 0lowers toNOT ptr = NULL, which is correct COBOL; it needs no refusal.$PRIMARY/../venvswas absent in this worktree;python3 -m pytestworked for these tests.