use of edu.stanford.CVC4.FloatingPointConvertSort in project java-smt by sosy-lab.
the class CVC4FloatingPointFormulaManager method castToImpl.
@Override
protected Expr castToImpl(Expr pNumber, FormulaType<?> pTargetType, Expr pRoundingMode) {
if (pTargetType.isFloatingPointType()) {
FloatingPointType targetType = (FloatingPointType) pTargetType;
FloatingPointConvertSort fpConvertSort = new FloatingPointConvertSort(getFPSize(targetType));
Expr op = exprManager.mkConst(new FloatingPointToFPFloatingPoint(fpConvertSort));
return exprManager.mkExpr(op, pRoundingMode, pNumber);
} else if (pTargetType.isBitvectorType()) {
BitvectorType targetType = (BitvectorType) pTargetType;
Expr op = exprManager.mkConst(new FloatingPointToSBV(targetType.getSize()));
return exprManager.mkExpr(op, pRoundingMode, pNumber);
} else if (pTargetType.isRationalType()) {
return exprManager.mkExpr(Kind.FLOATINGPOINT_TO_REAL, pNumber);
} else {
return genericCast(pNumber, pTargetType);
}
}
Aggregations