Skip to content

Check if events may alias when deriving RA knowledge from witnesses (… #766

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

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ public BooleanFormula encode(EncodingContext context) {
return bmgr.and(enc);
}

// FIXME: the code to generate RA knowledge from a violation witness is extremely fragile.
// We should rewrite this code to extract knowledge about the hb relation (from which the
// witness was actually generated) rather than rf and co. Then, the extended relation
// analysis should propagate this knowledge top-down to reach the base relations.

private boolean graphEdgeImpliesHbEdge() {
return hasAttributed(PRODUCER.toString()) && getAttributed(PRODUCER.toString()).equals("Dartagnan");
}
Expand All @@ -150,8 +155,10 @@ public EventGraph getReadFromKnowledge(Program program, AliasAnalysis alias) {
// If a graph edge implies a hb-relation, inter-thread communication guarantees
// same address and thus rf.
if (last instanceof Store && current instanceof Load
&& ((graphEdgeImpliesHbEdge() && !last.getThread().equals(current.getThread()))
|| alias.mustAlias(last, current))) {
&& ((graphEdgeImpliesHbEdge()
&& !last.getThread().equals(current.getThread())
&& alias.mayAlias(last, current))
|| alias.mustAlias(last, current))) {
k.add(last, current);
}
last = current;
Expand All @@ -175,7 +182,8 @@ public EventGraph getCoherenceKnowledge(Program program, AliasAnalysis alias) {
.forEach(w2 -> k.add(w1, w2));
// Special case for cross-thread edges.
final Store immSucc = writes.get(i+1);
if(graphEdgeImpliesHbEdge() && !w1.getThread().equals(immSucc.getThread())) {
if(graphEdgeImpliesHbEdge() && !w1.getThread().equals(immSucc.getThread())
&& alias.mayAlias(w1, immSucc)) {
k.add(w1, immSucc);
}
}
Expand Down
2 changes: 2 additions & 0 deletions svcomp.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ encoding.integers=true
svcomp.step=5
svcomp.umax=27
witness=graphml
// We can get rid of the option below once #767 is fixed
wmm.analysis.extendedRelationAnalysis=false
Loading