Skip to content

SMT2 back-end and solver: it's fp.isInfinite, not fp.isInf #6960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion regression/cbmc/Float-no-simp4/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE broken-smt-backend
CORE
main.c
--floatbv --no-simplify
^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Float4/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE broken-smt-backend
CORE
main.c
--floatbv
^EXIT=0$
Expand Down
8 changes: 8 additions & 0 deletions regression/cbmc/Float8/smt.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE smt-backend
main.c
--smt2 --fpa
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
2 changes: 1 addition & 1 deletion regression/cbmc/pragma_cprover_enable_all/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE broken-smt-backend
CORE
main.c
--object-bits 8 --bounds-check --pointer-check --pointer-primitive-check --div-by-zero-check --enum-range-check --unsigned-overflow-check --signed-overflow-check --pointer-overflow-check --float-overflow-check --conversion-check --undefined-shift-check --nan-check --pointer-primitive-check
^\[main\.pointer_primitives\.\d+\] line 77 pointer invalid in R_OK\(q, \(unsigned (long (long )?)?int\)1\): FAILURE$
Expand Down
2 changes: 1 addition & 1 deletion src/solvers/smt2/smt2_conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1859,7 +1859,7 @@ void smt2_convt::convert_expr(const exprt &expr)
convert_expr(isfinite_expr.op());
out << "))";

out << "(not (fp.isInf ";
out << "(not (fp.isInfinite ";
convert_expr(isfinite_expr.op());
out << "))";

Expand Down
6 changes: 3 additions & 3 deletions src/solvers/smt2/smt2_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1245,14 +1245,14 @@ void smt2_parsert::setup_expressions()
return unary_predicate_exprt(ID_isnan, op[0]);
};

expressions["fp.isInf"] = [this] {
expressions["fp.isInfinite"] = [this] {
auto op = operands();

if(op.size() != 1)
throw error("fp.isInf takes one operand");
throw error("fp.isInfinite takes one operand");

if(op[0].type().id() != ID_floatbv)
throw error("fp.isInf takes FloatingPoint operand");
throw error("fp.isInfinite takes FloatingPoint operand");

return unary_predicate_exprt(ID_isinf, op[0]);
};
Expand Down