-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
If I have the following simple test, which checks whether a load returns a previous store, the test fails (a satisfiable solution is found).
NEWWG
NEWSG
NEWTHREAD
st.sc0 c = 1
ld.sc0 c = 2
NOSOLUTION consistent[X] && #dr=0
Looking at the counterexample generated, the issue appears to be that Alloy happily puts a reads-from relation between the two instructions, despite 2 not being the value written previously. When putting ld.sc0 c = 0, the test passes, because a constraint of the form E1 in X.RFINIT is correctly generated. The issue exists for both atomic/non-atomic instructions.
I don't think the problem is with the model, it looks like adding a not in constraint to rf fixes the problem, which can be done in litmus.cpp by adding the following code to lines 534-547:
} else if (instState.loadStore[i].var == instState.loadStore[j].var &&
instState.isWrite(i) && instState.isRead(j) &&
instState.getWriteValue(i) != instState.getReadValue(j)) {
o << " (E" << i << "->E" << j << ") not in X.rf\n";
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels