use of org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Integer in project java-smt by sosy-lab.
the class CVC4FormulaCreator method convertValue.
@Override
public Object convertValue(Expr expForType, Expr value) {
final Type type = expForType.getType();
final Type valueType = value.getType();
if (value.getKind() == Kind.BOUND_VARIABLE) {
// CVC4 does not allow model values for bound vars
return value.toString();
} else if (valueType.isBoolean()) {
return value.getConstBoolean();
} else if (valueType.isInteger() && type.isInteger()) {
return new BigInteger(value.getConstRational().toString());
} else if (valueType.isReal() && type.isReal()) {
Rational rat = value.getConstRational();
return org.sosy_lab.common.rationals.Rational.of(new BigInteger(rat.getNumerator().toString()), new BigInteger(rat.getDenominator().toString()));
} else if (valueType.isBitVector()) {
Integer bv = value.getConstBitVector().getValue();
if (bv.fitsSignedLong()) {
return BigInteger.valueOf(bv.getUnsignedLong());
} else {
// default
return value.toString();
}
} else if (valueType.isFloatingPoint()) {
return parseFloatingPoint(value);
} else if (valueType.isString()) {
return value.getConstString().toString();
} else {
// String serialization for unknown terms.
return value.toString();
}
}
Aggregations