Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Civl] bug fix for noninterference checking for pending asyncs #773

Merged
merged 2 commits into from
Aug 15, 2023

Conversation

shazqadeer
Copy link
Contributor

@shazqadeer shazqadeer commented Aug 13, 2023

For a particular layer number, those pending asyncs must be collected for which noninterference checking against yield invariants must be performed. The collection of pending asyncs was not sound earlier. This PR makes a fix to make it sound.

@shazqadeer shazqadeer requested a review from bkragl August 13, 2023 00:14
@shazqadeer shazqadeer merged commit 1d3f399 into master Aug 15, 2023
Comment on lines -759 to +761
var pendingAsyncsToCheck = new HashSet<Action>(
civlTypeChecker.MoverActions
.Where(a => a.LayerRange.Contains(layerNum) && a.HasPendingAsyncs)
.SelectMany(a => a.PendingAsyncs).Select(a => civlTypeChecker.Action(a)));
var pendingAsyncsToCheck =
new HashSet<Action>(civlTypeChecker.MoverActions.Where(a =>
a.LayerRange.Contains(layerNum) && a.ActionDecl.MaybePendingAsync));
Copy link
Member

Choose a reason for hiding this comment

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

Just to confirm my understanding: We previously made the mistake of only checking noninterference against PAs that were created by actions. However, in your test case below it is procedure Foo that creates a PA at layer 2. We don't have a dedicated declaration of PAs created by procedures. Instead, we take the actions declared with async (which sets MaybePendingAsync?) and check noninterference at all their layers, irrespective of whether there are actually PAs created or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants