Repository navigation
Keep a symbol free when a state reads it before any assignment - #2712
Merged
tbennun merged 6 commits intoOct 20, 2026
Merged
Conversation
A state that reads k before any interstate edge assigns it never recorded k as used before assignment, so a later k = ... marked k defined and dropped it from free_symbols.
A ConditionalBlock now reports the symbols only some paths assign as tentative: a later read of one counts as a use before assignment, while a symbol assigned in one branch and never read stays out of the signature. Branches start from the entry definitions instead of their siblings'. Adds tests for a loop body read, a one-branch assignment, an assignment on every path and a C++ local listed in ignored_symbols.
tbennun
approved these changes
Oct 20, 2026
ThrudPrimrose
added a commit
that referenced
this pull request
Oct 20, 2026
…read before assignment Extended already carries #2706 as a port (41640a3, f1747c3) and its own free_symbols walk, so each conflict keeps extended's side; from main it takes the program-callable modulo spellings (PyMod, FtnMod, FtnModulo through operators.MODULO_CALLS and binop_tasklet_code) and main's tests. Two of main's modulo tests are adapted to extended's documented semantics: a CMod of operands not proven integer prints as c_mod, and sign facts of a dace.symbol live in the symbol registry, so the CMod->Mod fold is checked on SymPy symbols with assumptions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A symbol read before any interstate edge assigns it, or after a join where only some branches assigned it, now stays in
free_symbols, so callers are asked for it. Branches start from the entry definitions and track maybe-assigned symbols as tentative; five tests intests/sdfg/free_symbols_test.pycover state, loop, branch, all-paths and C++-local cases.Motivating example:
kis a free symbol because it is not unconditionally assigned, this would makeka non-free symbol: