Search in sources :

Example 56 with SmtExpr

use of org.evosuite.symbolic.solver.smt.SmtExpr in project evosuite by EvoSuite.

the class RegExpToCVC4Visitor method visitCharRange.

@Override
public SmtExpr visitCharRange(char from, char to) {
    String fromStr = String.valueOf(from);
    SmtStringConstant fromConstant = SmtExprBuilder.mkStringConstant(fromStr);
    String toStr = String.valueOf(to);
    SmtStringConstant toConstant = SmtExprBuilder.mkStringConstant(toStr);
    SmtExpr rangeExpr = SmtExprBuilder.mkRegExpRange(fromConstant, toConstant);
    return rangeExpr;
}
Also used : SmtExpr(org.evosuite.symbolic.solver.smt.SmtExpr) SmtStringConstant(org.evosuite.symbolic.solver.smt.SmtStringConstant)

Example 57 with SmtExpr

use of org.evosuite.symbolic.solver.smt.SmtExpr in project evosuite by EvoSuite.

the class RegExpToCVC4Visitor method visitChar.

@Override
public SmtExpr visitChar(char c) {
    String str = String.valueOf(c);
    SmtStringConstant strConstant = SmtExprBuilder.mkStringConstant(str);
    SmtExpr expr = SmtExprBuilder.mkStrToRegExp(strConstant);
    return expr;
}
Also used : SmtExpr(org.evosuite.symbolic.solver.smt.SmtExpr) SmtStringConstant(org.evosuite.symbolic.solver.smt.SmtStringConstant)

Example 58 with SmtExpr

use of org.evosuite.symbolic.solver.smt.SmtExpr in project evosuite by EvoSuite.

the class RegExpToCVC4Visitor method visitConcatenation.

@Override
public SmtExpr visitConcatenation(RegExp left, RegExp right) {
    SmtExpr leftExpr = this.visitRegExp(left);
    SmtExpr rightExpr = this.visitRegExp(right);
    if (leftExpr == null || rightExpr == null) {
        return null;
    }
    SmtExpr concat = SmtExprBuilder.mkRegExpConcat(leftExpr, rightExpr);
    return concat;
}
Also used : SmtExpr(org.evosuite.symbolic.solver.smt.SmtExpr)

Example 59 with SmtExpr

use of org.evosuite.symbolic.solver.smt.SmtExpr in project evosuite by EvoSuite.

the class RegExpToCVC4Visitor method visitString.

@Override
public SmtExpr visitString(String s) {
    SmtStringConstant strConstant = SmtExprBuilder.mkStringConstant(s);
    SmtExpr strToRegExpr = SmtExprBuilder.mkStrToRegExp(strConstant);
    return strToRegExpr;
}
Also used : SmtExpr(org.evosuite.symbolic.solver.smt.SmtExpr) SmtStringConstant(org.evosuite.symbolic.solver.smt.SmtStringConstant)

Example 60 with SmtExpr

use of org.evosuite.symbolic.solver.smt.SmtExpr in project evosuite by EvoSuite.

the class ConstraintToZ3Visitor method visit.

@Override
public SmtExpr visit(IntegerConstraint c, Void arg) {
    ExprToZ3Visitor v = new ExprToZ3Visitor();
    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);
}
Also used : SmtExpr(org.evosuite.symbolic.solver.smt.SmtExpr) Comparator(org.evosuite.symbolic.expr.Comparator)

Aggregations

SmtExpr (org.evosuite.symbolic.solver.smt.SmtExpr)60 Operator (org.evosuite.symbolic.expr.Operator)14 LinkedList (java.util.LinkedList)8 Comparator (org.evosuite.symbolic.expr.Comparator)6 SmtAssertion (org.evosuite.symbolic.solver.smt.SmtAssertion)6 SmtIntConstant (org.evosuite.symbolic.solver.smt.SmtIntConstant)6 SmtConstantDeclaration (org.evosuite.symbolic.solver.smt.SmtConstantDeclaration)5 Expression (org.evosuite.symbolic.expr.Expression)4 IntegerBinaryExpression (org.evosuite.symbolic.expr.bv.IntegerBinaryExpression)4 IntegerUnaryExpression (org.evosuite.symbolic.expr.bv.IntegerUnaryExpression)4 RealUnaryToIntegerExpression (org.evosuite.symbolic.expr.bv.RealUnaryToIntegerExpression)4 StringBinaryToIntegerExpression (org.evosuite.symbolic.expr.bv.StringBinaryToIntegerExpression)4 StringMultipleToIntegerExpression (org.evosuite.symbolic.expr.bv.StringMultipleToIntegerExpression)4 StringUnaryToIntegerExpression (org.evosuite.symbolic.expr.bv.StringUnaryToIntegerExpression)4 RealBinaryExpression (org.evosuite.symbolic.expr.fp.RealBinaryExpression)4 RealUnaryExpression (org.evosuite.symbolic.expr.fp.RealUnaryExpression)4 GetFieldExpression (org.evosuite.symbolic.expr.ref.GetFieldExpression)4 StringBinaryExpression (org.evosuite.symbolic.expr.str.StringBinaryExpression)4 StringMultipleExpression (org.evosuite.symbolic.expr.str.StringMultipleExpression)4 StringUnaryExpression (org.evosuite.symbolic.expr.str.StringUnaryExpression)4