Search in sources :

Example 6 with RealValue

use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.

the class SymbolicHeap method getField.

/**
 * @param className
 * @param fieldName
 * @param conc_receiver
 * @param symb_receiver
 * @param conc_value
 * @return
 */
public RealValue getField(String className, String fieldName, Object conc_receiver, ReferenceExpression symb_receiver, double conc_value) {
    Map<ReferenceExpression, Expression<?>> symb_field = getOrCreateSymbolicField(className, fieldName);
    RealValue symb_value = (RealValue) symb_field.get(symb_receiver);
    if (symb_value == null || ((Double) symb_value.getConcreteValue()).doubleValue() != conc_value) {
        symb_value = ExpressionFactory.buildNewRealConstant(conc_value);
        symb_field.remove(symb_receiver);
    }
    return symb_value;
}
Also used : RealValue(org.evosuite.symbolic.expr.fp.RealValue) Expression(org.evosuite.symbolic.expr.Expression) ReferenceExpression(org.evosuite.symbolic.expr.ref.ReferenceExpression) ReferenceExpression(org.evosuite.symbolic.expr.ref.ReferenceExpression)

Example 7 with RealValue

use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.

the class SymbolicFunctionVM method CALLER_STACK_PARAM.

@Override
public void CALLER_STACK_PARAM(int nr, int calleeLocalsIndex, double conc_arg) {
    if (functionUnderExecution != null) {
        RealValue symb_arg = getRealExprFromStack(nr);
        functionUnderExecution.setParam(nr, conc_arg, symb_arg);
        beforeExecuteFunction(nr);
    }
}
Also used : RealValue(org.evosuite.symbolic.expr.fp.RealValue)

Example 8 with RealValue

use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.

the class SINH method executeFunction.

@Override
public Object executeFunction() {
    double res = this.getConcDoubleRetVal();
    RealValue realExpression = this.getSymbRealArgument(0);
    RealValue sinhExpr;
    if (realExpression.containsSymbolicVariable()) {
        Operator op = Operator.SINH;
        sinhExpr = new RealUnaryExpression(realExpression, op, res);
    } else {
        sinhExpr = this.getSymbRealRetVal();
    }
    return sinhExpr;
}
Also used : RealValue(org.evosuite.symbolic.expr.fp.RealValue) Operator(org.evosuite.symbolic.expr.Operator) RealUnaryExpression(org.evosuite.symbolic.expr.fp.RealUnaryExpression)

Example 9 with RealValue

use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.

the class TAN method executeFunction.

@Override
public Object executeFunction() {
    double res = this.getConcDoubleRetVal();
    RealValue realExpression = this.getSymbRealArgument(0);
    RealValue tanExpr;
    if (realExpression.containsSymbolicVariable()) {
        Operator op = Operator.TAN;
        tanExpr = new RealUnaryExpression(realExpression, op, res);
    } else {
        tanExpr = this.getSymbRealRetVal();
    }
    return tanExpr;
}
Also used : RealValue(org.evosuite.symbolic.expr.fp.RealValue) Operator(org.evosuite.symbolic.expr.Operator) RealUnaryExpression(org.evosuite.symbolic.expr.fp.RealUnaryExpression)

Example 10 with RealValue

use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.

the class ToDegrees method executeFunction.

@Override
public Object executeFunction() {
    double res = this.getConcDoubleRetVal();
    RealValue realExpression = this.getSymbRealArgument(0);
    RealValue toDegreesExpr;
    if (realExpression.containsSymbolicVariable()) {
        Operator op = Operator.TODEGREES;
        toDegreesExpr = new RealUnaryExpression(realExpression, op, res);
    } else {
        toDegreesExpr = this.getSymbRealRetVal();
    }
    return toDegreesExpr;
}
Also used : RealValue(org.evosuite.symbolic.expr.fp.RealValue) Operator(org.evosuite.symbolic.expr.Operator) RealUnaryExpression(org.evosuite.symbolic.expr.fp.RealUnaryExpression)

Aggregations

RealValue (org.evosuite.symbolic.expr.fp.RealValue)81 Operator (org.evosuite.symbolic.expr.Operator)25 RealUnaryExpression (org.evosuite.symbolic.expr.fp.RealUnaryExpression)23 IntegerValue (org.evosuite.symbolic.expr.bv.IntegerValue)22 ReferenceExpression (org.evosuite.symbolic.expr.ref.ReferenceExpression)13 IntegerConstraint (org.evosuite.symbolic.expr.IntegerConstraint)12 ReferenceConstant (org.evosuite.symbolic.expr.ref.ReferenceConstant)11 Expression (org.evosuite.symbolic.expr.Expression)6 RealToIntegerCast (org.evosuite.symbolic.expr.bv.RealToIntegerCast)6 IntegerToRealCast (org.evosuite.symbolic.expr.fp.IntegerToRealCast)6 RealBinaryExpression (org.evosuite.symbolic.expr.fp.RealBinaryExpression)6 StringValue (org.evosuite.symbolic.expr.str.StringValue)4 PrimitiveExpression (org.evosuite.testcase.statements.PrimitiveExpression)4 Type (org.objectweb.asm.Type)4 CodeUnderTestException (org.evosuite.testcase.execution.CodeUnderTestException)3 Field (java.lang.reflect.Field)2 RealComparison (org.evosuite.symbolic.expr.bv.RealComparison)2 EvosuiteError (org.evosuite.testcase.execution.EvosuiteError)2 VariableReference (org.evosuite.testcase.variable.VariableReference)2 SmtExpr (org.evosuite.symbolic.solver.smt.SmtExpr)1