use of com.dat3m.dartagnan.solver.caat4wmm.coreReasoning.ExecLiteral in project Dat3M by hernanponcedeleon.
the class Refiner method permuteAndConvert.
// Changes a reasoning <literal> based on a given permutation <perm> and translates the result
// into a BooleanFormula for Refinement.
private BooleanFormula permuteAndConvert(CoreLiteral literal, Function<Event, Event> perm, SolverContext context) {
BooleanFormulaManager bmgr = context.getFormulaManager().getBooleanFormulaManager();
BooleanFormula enc;
if (literal instanceof ExecLiteral) {
ExecLiteral lit = (ExecLiteral) literal;
enc = perm.apply(lit.getData()).exec();
} else if (literal instanceof AddressLiteral) {
AddressLiteral loc = (AddressLiteral) literal;
MemEvent e1 = (MemEvent) perm.apply(loc.getFirst());
MemEvent e2 = (MemEvent) perm.apply(loc.getSecond());
enc = generalEqual(e1.getMemAddressExpr(), e2.getMemAddressExpr(), context);
} else if (literal instanceof RelLiteral) {
RelLiteral lit = (RelLiteral) literal;
Relation rel = task.getMemoryModel().getRelationRepository().getRelation(lit.getName());
enc = rel.getSMTVar(perm.apply(lit.getData().getFirst()), perm.apply(lit.getData().getSecond()), context);
} else {
throw new IllegalArgumentException("CoreLiteral " + literal.toString() + " is not supported");
}
return literal.isNegative() ? bmgr.not(enc) : enc;
}
Aggregations