use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.
the class SQRT method executeFunction.
@Override
public Object executeFunction() {
double res = this.getConcDoubleRetVal();
RealValue realExpression = this.getSymbRealArgument(0);
RealValue sqrtExpr;
if (realExpression.containsSymbolicVariable()) {
Operator op = Operator.SQRT;
sqrtExpr = new RealUnaryExpression(realExpression, op, res);
} else {
sqrtExpr = this.getSymbRealRetVal();
}
return sqrtExpr;
}
use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.
the class D_DoubleValue method executeFunction.
@Override
public Object executeFunction() {
ReferenceConstant symb_double = this.getSymbReceiver();
Double conc_double = (Double) this.getConcReceiver();
double conc_double_value = this.getConcDoubleRetVal();
RealValue symb_int_value = env.heap.getField(Types.JAVA_LANG_DOUBLE, SymbolicHeap.$DOUBLE_VALUE, conc_double, symb_double, conc_double_value);
return symb_int_value;
}
use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.
the class ArithmeticVM method FSUB.
/**
*/
@Override
public void FSUB() {
RealValue right = env.topFrame().operandStack.popFp32();
RealValue left = env.topFrame().operandStack.popFp32();
float left_concrete_value = ((Double) left.getConcreteValue()).floatValue();
float right_concrete_value = ((Double) right.getConcreteValue()).floatValue();
if (!left.containsSymbolicVariable()) {
left = ExpressionFactory.buildNewRealConstant(left_concrete_value);
}
if (!right.containsSymbolicVariable()) {
right = ExpressionFactory.buildNewRealConstant(right_concrete_value);
}
float con = left_concrete_value - right_concrete_value;
RealValue realExpr = new RealBinaryExpression(left, Operator.MINUS, right, (double) con);
env.topFrame().operandStack.pushFp32(realExpr);
}
use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.
the class ArithmeticVM method DDIV.
@Override
public void DDIV(double rhsValue) {
RealValue right = env.topFrame().operandStack.popFp64();
RealValue left = env.topFrame().operandStack.popFp64();
double left_concrete_value = ((Double) left.getConcreteValue()).doubleValue();
double right_concrete_value = ((Double) right.getConcreteValue()).doubleValue();
if (!left.containsSymbolicVariable()) {
left = ExpressionFactory.buildNewRealConstant(left_concrete_value);
}
if (!right.containsSymbolicVariable()) {
right = ExpressionFactory.buildNewRealConstant(right_concrete_value);
}
double con = left_concrete_value / right_concrete_value;
RealValue realExpr = ExpressionFactory.div(left, right, con);
env.topFrame().operandStack.pushFp64(realExpr);
}
use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.
the class ArithmeticVM method I2F.
/**
* http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.
* doc6.html#i2f
*/
@Override
public void I2F() {
IntegerValue integerExpr = env.topFrame().operandStack.popBv32();
int integerValue = ((Long) integerExpr.getConcreteValue()).intValue();
RealValue realExpr;
float concreteValue = (float) integerValue;
if (!integerExpr.containsSymbolicVariable()) {
realExpr = ExpressionFactory.buildNewRealConstant(concreteValue);
} else {
realExpr = new IntegerToRealCast(integerExpr, (double) concreteValue);
}
env.topFrame().operandStack.pushFp32(realExpr);
}
Aggregations