diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2021-04-21 21:42:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-22 02:42:08 +0000 |
commit | 89620a0d73e7134437a39d742e91de11a08a4962 (patch) | |
tree | 46b37970a7d3f74317f8e255b6aefa9cfae127b1 /src/theory/theory_rewriter.h | |
parent | 90cde45ee963b994054f96f97111684cce808d82 (diff) |
Move expand definition from Theory to TheoryRewriter (#6408)
This is work towards eliminating global calls to getCurrentSmtEngine()->expandDefinition.
The next step will be to add Rewriter::expandDefinition.
Diffstat (limited to 'src/theory/theory_rewriter.h')
-rw-r--r-- | src/theory/theory_rewriter.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/theory/theory_rewriter.h b/src/theory/theory_rewriter.h index 2477de51e..031e32db4 100644 --- a/src/theory/theory_rewriter.h +++ b/src/theory/theory_rewriter.h @@ -138,6 +138,30 @@ class TheoryRewriter * node if no rewrites are applied. */ virtual TrustNode rewriteEqualityExtWithProof(Node node); + + /** + * Expand definitions in the term node. This returns a term that is + * equivalent to node. It wraps this term in a TrustNode of kind + * TrustNodeKind::REWRITE. If node is unchanged by this method, the + * null TrustNode may be returned. This is an optimization to avoid + * constructing the trivial equality (= node node) internally within + * TrustNode. + * + * The purpose of this method is typically to eliminate the operators in node + * that are syntax sugar that cannot otherwise be eliminated during rewriting. + * For example, division relies on the introduction of an uninterpreted + * function for the divide-by-zero case, which we do not introduce with + * the standard rewrite methods. + * + * Some theories have kinds that are effectively definitions and should be + * expanded before they are handled. Definitions allow a much wider range of + * actions than the normal forms given by the rewriter. However no + * assumptions can be made about subterms having been expanded or rewritten. + * Where possible rewrite rules should be used, definitions should only be + * used when rewrites are not possible, for example in handling + * under-specified operations using partially defined functions. + */ + virtual TrustNode expandDefinition(Node node); }; } // namespace theory |