diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2019-12-18 00:27:18 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-18 00:27:18 -0800 |
commit | 9c2c0581e0a325aad8cef463cfcc72b1164f79f5 (patch) | |
tree | c410dd85e4fcb64ee855ba75ffa6110c37969173 /src/theory/theory_rewriter.h | |
parent | e9499c41f405df8b42fd9ae10004b1b91a869106 (diff) |
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.
Diffstat (limited to 'src/theory/theory_rewriter.h')
-rw-r--r-- | src/theory/theory_rewriter.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/theory/theory_rewriter.h b/src/theory/theory_rewriter.h index b0171813b..61f0fc27a 100644 --- a/src/theory/theory_rewriter.h +++ b/src/theory/theory_rewriter.h @@ -53,6 +53,13 @@ struct RewriteResponse } }; /* struct RewriteResponse */ +/** + * The interface that a theory rewriter has to implement. + * + * Note: A theory rewriter is expected to handle all kinds of a theory, even + * the ones that are removed by `Theory::expandDefinition()` since it may be + * called on terms before the definitions have been expanded. + */ class TheoryRewriter { public: |