Skip to content

Anonymize ghost variables in loop - #3729

Merged
Drodt merged 5 commits into
mainfrom
fix-ghost-in-loop
Feb 20, 2026
Merged

Drodt merged 5 commits into
mainfrom
fix-ghost-in-loop

Conversation

@Drodt

@Drodt Drodt commented Jan 30, 2026

Copy link
Copy Markdown
Member

Related Issue

This pull request resolves #3720.

Intended Change

(Ghost) set statements are now considered for the set of to-be-anonymized variables for loop scope rules.

Type of pull request

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

Ensuring quality

Additional information and contact(s)

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

@Drodt Drodt added this to the v3.0.0 milestone Jan 30, 2026
@Drodt
Drodt requested a review from WolframPfeifer January 30, 2026 14:30
@Drodt

Drodt commented Jan 30, 2026 •

Copy link
Copy Markdown
Member Author

Open questions for this PR:

  • Should I move the test file to a different folder?
  • Should I also create a .key file for the loop transform rule? (I tested it manually and both use the same method to get the written to variable, which are then anonymized)

@Drodt Drodt self-assigned this Jan 30, 2026
@FliegendeWurst

Copy link
Copy Markdown
Member

I have tested this change a bit and it seems to work well. 👍

@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.

Thanks, this indeed solves the problem also in the case study where it occurred.

For your questions:

  • Since the other tests also seem to read from that folder, I think we can keep it like that for now.
  • Since both loop rules use the same function here, I think it is not beneficial to have a second test. It might, however, be a good idea to do a more fine-grained test which only tests the method in MiscTools without loading the taclets, create the environment etc. (i.e. a proper unit test).

@WolframPfeifer

Copy link
Copy Markdown
Member

@Drodt I approved, but maybe you can check my comment regarding the unit test and merge depending on your opinion ...

@Drodt

Drodt commented Feb 5, 2026

Copy link
Copy Markdown
Member Author
* Since both loop rules use the same function here, I think it is not beneficial to have a second test. It might, however, be a good idea to do a more fine-grained test which only tests the method in MiscTools without loading the taclets, create the environment etc. (i.e. a proper unit test).

Good idea; I'll look into it next week (hopefully)

@Drodt
Drodt enabled auto-merge February 20, 2026 10:47
@Drodt
Drodt added this pull request to the merge queue Feb 20, 2026
Merged via the queue into main with commit d0e031e Feb 20, 2026
36 checks passed
@Drodt
Drodt deleted the fix-ghost-in-loop branch February 20, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ghost variable not properly handled in loop

3 participants