Skip to content

Make new name creation only dependent on goal namespaces not on global counter#3848

Merged
WolframPfeifer merged 1 commit into
mainfrom
fix3834
Jun 19, 2026
Merged

Make new name creation only dependent on goal namespaces not on global counter#3848
WolframPfeifer merged 1 commit into
mainfrom
fix3834

Conversation

@unp1

@unp1 unp1 commented Jun 19, 2026

Copy link
Copy Markdown
Member

Related Issue

This pull request resolves #3834, #3847 hopefully
.

Intended Change

New names are allocated only based on the goals namespace and the already reserbed names
(the varcond creates more than one name, so we have to consider them to not cause a clash).

This makes it independent of double checking (which caused before this PR a global counter variable to be modifed, and hence the breaking side-effect)

Type of pull request

  • Bug fix (non-breaking change which fixes an issue)
  • There are changes to the (Java) code

Ensuring quality

  • I made sure that introduced/changed code is well documented (javadoc and inline comments).
  • I added new test case(s) for new functionality.

Additional information and contact(s)

The contributions within this pull request are licensed under GPLv2 (only) for inclusion in KeY.

@unp1 unp1 self-assigned this Jun 19, 2026
@unp1 unp1 added the 🐞 Bug label Jun 19, 2026
@WolframPfeifer WolframPfeifer added the keyext.slicing Module: keyext.slicing label Jun 19, 2026

@FliegendeWurst FliegendeWurst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks good to me.

Though I could not come up with an example where the freeName counter logic is applied. I tried naming a variable k_before and nesting two loops which assign the same variable. In both cases the baseName is used as is.

@WolframPfeifer WolframPfeifer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it a bit in the GUI, and it really looks like it fixes the bug. Also, the test case is a good idea. Thank you!

@WolframPfeifer WolframPfeifer added this pull request to the merge queue Jun 19, 2026
Merged via the queue into main with commit 8fc436c Jun 19, 2026
36 checks passed
@WolframPfeifer WolframPfeifer deleted the fix3834 branch June 19, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

keyext.slicing Module: keyext.slicing 🐞 Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Loop rule creates different variable name in replay (breaking slicing)

4 participants