Skip to content

Commit 878d282

Browse files
Require the existence of violation node when validate violation witness (#754)
Signed-off-by: Hernan Ponce de Leon <[email protected]> Co-authored-by: Hernan Ponce de Leon <[email protected]>
1 parent c3aa592 commit 878d282

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dartagnan/src/main/java/com/dat3m/dartagnan/witness/graphml/WitnessGraph.java

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.dat3m.dartagnan.wmm.utils.graph.EventGraph;
1111
import com.dat3m.dartagnan.wmm.utils.graph.mutable.MapEventGraph;
1212
import com.dat3m.dartagnan.wmm.utils.graph.mutable.MutableEventGraph;
13+
import com.google.common.base.Preconditions;
1314
import com.google.common.collect.Lists;
1415
import org.sosy_lab.java_smt.api.BooleanFormula;
1516
import org.sosy_lab.java_smt.api.BooleanFormulaManager;
@@ -113,6 +114,9 @@ private List<MemoryCoreEvent> getEventsFromEdge(Program program, Edge edge) {
113114
}
114115

115116
public BooleanFormula encode(EncodingContext context) {
117+
// If there is something to encode (i.e., edges is not empty),
118+
// then there must be a violation node.
119+
Preconditions.checkState(edges.isEmpty() || !getPathToViolation().isEmpty());
116120
Program program = context.getTask().getProgram();
117121
BooleanFormulaManager bmgr = context.getBooleanFormulaManager();
118122
List<BooleanFormula> enc = new ArrayList<>();

0 commit comments

Comments
 (0)