From 9c2c0581e0a325aad8cef463cfcc72b1164f79f5 Mon Sep 17 00:00:00 2001 From: Andres Noetzli Date: Wed, 18 Dec 2019 00:27:18 -0800 Subject: Avoid calling rewriter from type checker (#3548) Fixes #3536. The type checker for the chain operator was calling the rewriter. However, the floating-point rewriter was expecting `TheoryFp::expandDefinition()` to be applied before rewriting. If the chain operator had subterms that were supposed to be removed by `TheoryFp::expandDefinition()`, the FP rewriter was throwing an exception. This commit fixes the issue by not calling the full rewriter in the type checker but by just expanding the chain operator. This is a bit less efficient than before because the rewriter does not cache the result of expanding the chain operator anymore but assuming that there are no long chains, the performance impact should be negligible. It also seemed like a reasonable assumption that the rewriter can expect to run after `expandDefinition()` because otherwise the rewriter has to expand definitions, which may be too restrictive. --- test/regress/CMakeLists.txt | 1 + test/regress/regress0/fp/issue3536.smt2 | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 test/regress/regress0/fp/issue3536.smt2 (limited to 'test/regress') diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt index b05393258..7bd626ff0 100644 --- a/test/regress/CMakeLists.txt +++ b/test/regress/CMakeLists.txt @@ -470,6 +470,7 @@ set(regress_0_tests regress0/fp/abs-unsound2.smt2 regress0/fp/down-cast-RNA.smt2 regress0/fp/ext-rew-test.smt2 + regress0/fp/issue3536.smt2 regress0/fp/rti_3_5_bug.smt2 regress0/fp/rti_3_5_bug_report.smt2 regress0/fp/simple.smt2 diff --git a/test/regress/regress0/fp/issue3536.smt2 b/test/regress/regress0/fp/issue3536.smt2 new file mode 100644 index 000000000..4293cbdee --- /dev/null +++ b/test/regress/regress0/fp/issue3536.smt2 @@ -0,0 +1,6 @@ +; REQUIRES: symfpu +(set-logic QF_FP) +(declare-const x (_ FloatingPoint 11 53)) +(assert (= true (fp.eq x ((_ to_fp 11 53) (_ bv13831004815617530266 64))) true)) +(set-info :status sat) +(check-sat) -- cgit v1.2.3