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

Fix pruning bugs related to trigger #449

Merged
merged 5 commits into from
Nov 11, 2021

Conversation

keyboardDrummer
Copy link
Collaborator

@keyboardDrummer keyboardDrummer commented Nov 9, 2021

Related Dafny issue: dafny-lang/dafny#1585

Changes

  • Fix bug in the I1 testcase in Prune.bpl, which prevented the test from failing when pruning wasn't working
  • Fix several bugs in pruning related to triggers

@keyboardDrummer keyboardDrummer marked this pull request as ready for review November 9, 2021 15:14
@keyboardDrummer keyboardDrummer changed the title Fix merge nodes bug Fix pruning bugs related to trigger Nov 9, 2021
Source/Graph/Graph.cs Show resolved Hide resolved
@@ -25,7 +25,7 @@ public class DependencyEvaluator : ReadOnlyVisitor
public List<Declaration[]> incomingSets = new();
public HashSet<Type> types = new();

private static bool ExcludeDep(Declaration declaration)
public static bool ExcludeDep(Declaration declaration)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does it fix that private became public here? I suggest you add a comment to the function about why it needs to be public of it is not testable (e.g. for APIs), in case someone later wants to revert it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, if you don't intend to merge this PR first since you are including it in #450, which makesuse of ExcludeDep, you can ignore my comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

Pretty sure it can be private in #450 as well.

@@ -20,7 +20,7 @@ axiom (forall x: int ::

procedure I1(x : int) returns (y: int)
requires R(x);
ensures Q(f1(y)); // this post-condition doesn't prove because f1 is attributed as exclude_dep and
ensures Q(f1(x)); // this post-condition doesn't prove because f1 is attributed as exclude_dep and
// is thus removed from the outgoing set of I1.
// This makes the axiom on line 23 unreachable from I1, which is thus pruned away.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// This makes the axiom on line 23 unreachable from I1, which is thus pruned away.
// This makes the axiom on line 33 unreachable from I1, which is thus pruned away.

Copy link
Contributor

Choose a reason for hiding this comment

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

I might be misunderstanding the wording here, but don't see an axiom in L23.

@keyboardDrummer keyboardDrummer merged commit 306ee64 into boogie-org:master Nov 11, 2021
@keyboardDrummer keyboardDrummer deleted the fixMergeNodesBug branch November 11, 2021 16:48
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.

4 participants