Skip to content

Commit bc8e2c6

Browse files
committed
SMT2 parser: implement fp.isZero
This adds fp.isZero to the SMT-LIB2 parser.
1 parent d792a33 commit bc8e2c6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/solvers/smt2/smt2_parser.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,18 @@ void smt2_parsert::setup_expressions()
13051305
return isnormal_exprt(op[0]);
13061306
};
13071307

1308+
expressions["fp.isZero"] = [this] {
1309+
auto op = operands();
1310+
1311+
if(op.size() != 1)
1312+
throw error("fp.isZero takes one operand");
1313+
1314+
if(op[0].type().id() != ID_floatbv)
1315+
throw error("fp.isZero takes FloatingPoint operand");
1316+
1317+
return not_exprt(typecast_exprt(op[0], bool_typet()));
1318+
};
1319+
13081320
expressions["fp"] = [this] { return function_application_fp(operands()); };
13091321

13101322
expressions["fp.add"] = [this] {

0 commit comments

Comments
 (0)