Skip to content

Anonymize ghost variables in loop#3729

Open
Drodt wants to merge 3 commits intomainfrom
fix-ghost-in-loop
Open

Anonymize ghost variables in loop#3729
Drodt wants to merge 3 commits intomainfrom
fix-ghost-in-loop

Conversation

@Drodt
Copy link
Member

@Drodt Drodt commented Jan 30, 2026

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
Copy link
Member Author

Drodt commented Jan 30, 2026

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
Member

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

Copy link
Member

@WolframPfeifer WolframPfeifer left a comment

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
Member

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

@Drodt
Copy link
Member Author

Drodt commented Feb 5, 2026

* 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)

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