use of org.evosuite.symbolic.expr.Comparator in project evosuite by EvoSuite.
the class ConstraintToZ3Str2Visitor method visit.
@Override
public SmtExpr visit(RealConstraint c, Void arg) {
ExprToZ3Str2Visitor v = new ExprToZ3Str2Visitor();
SmtExpr left = c.getLeftOperand().accept(v, null);
SmtExpr right = c.getRightOperand().accept(v, null);
if (left == null || right == null) {
return null;
}
Comparator cmp = c.getComparator();
return mkComparison(left, cmp, right);
}
use of org.evosuite.symbolic.expr.Comparator in project evosuite by EvoSuite.
the class ConstraintNormalizer method createRealConstraint.
private static Constraint<?> createRealConstraint(IntegerConstraint c) {
if (c.getLeftOperand() instanceof RealComparison) {
RealComparison cmp = (RealComparison) c.getLeftOperand();
int value = ((Number) c.getRightOperand().getConcreteValue()).intValue();
Comparator op = c.getComparator();
Expression<Double> cmp_left = cmp.getLeftOperant();
Expression<Double> cmp_right = cmp.getRightOperant();
return createRealConstraint(cmp_left, op, cmp_right, value);
} else {
assert (c.getRightOperand() instanceof RealComparison);
RealComparison cmp = (RealComparison) c.getRightOperand();
Comparator op = c.getComparator();
Comparator swap_op = op.swap();
int value = ((Number) c.getLeftOperand().getConcreteValue()).intValue();
int swap_value = -value;
Expression<Double> cmp_left = cmp.getLeftOperant();
Expression<Double> cmp_right = cmp.getRightOperant();
return createRealConstraint(cmp_left, swap_op, cmp_right, swap_value);
}
}
use of org.evosuite.symbolic.expr.Comparator in project evosuite by EvoSuite.
the class ConstraintToCVC4Visitor method visit.
@Override
public SmtExpr visit(IntegerConstraint c, Void arg) {
Expression<?> leftOperand = c.getLeftOperand();
Expression<?> rightOperand = c.getRightOperand();
Comparator cmp = c.getComparator();
return visit(leftOperand, cmp, rightOperand);
}
use of org.evosuite.symbolic.expr.Comparator in project evosuite by EvoSuite.
the class ConstraintToCVC4Visitor method visit.
@Override
public SmtExpr visit(StringConstraint c, Void arg) {
Expression<?> leftOperand = c.getLeftOperand();
Expression<?> rightOperand = c.getRightOperand();
Comparator cmp = c.getComparator();
return visit(leftOperand, cmp, rightOperand);
}
use of org.evosuite.symbolic.expr.Comparator in project evosuite by EvoSuite.
the class ConstraintToCVC4Visitor method visit.
@Override
public SmtExpr visit(RealConstraint c, Void arg) {
Expression<?> leftOperand = c.getLeftOperand();
Expression<?> rightOperand = c.getRightOperand();
Comparator cmp = c.getComparator();
return visit(leftOperand, cmp, rightOperand);
}
Aggregations