Avoid calling rewriter from type checker (#3548)
authorAndres Noetzli <andres.noetzli@gmail.com>
Wed, 18 Dec 2019 08:27:18 +0000 (00:27 -0800)
committerGitHub <noreply@github.com>
Wed, 18 Dec 2019 08:27:18 +0000 (00:27 -0800)
commit9c2c0581e0a325aad8cef463cfcc72b1164f79f5
treec410dd85e4fcb64ee855ba75ffa6110c37969173
parente9499c41f405df8b42fd9ae10004b1b91a869106
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.
src/theory/builtin/theory_builtin_rewriter.h
src/theory/builtin/theory_builtin_type_rules.h
src/theory/fp/theory_fp.cpp
src/theory/fp/theory_fp_rewriter.cpp
src/theory/theory_rewriter.h
test/regress/CMakeLists.txt
test/regress/regress0/fp/issue3536.smt2 [new file with mode: 0644]