diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2021-03-15 13:46:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-15 18:46:31 +0000 |
commit | 2ecd897cc1db7153aa63b5caffc0123fc79c8059 (patch) | |
tree | 421e4829b2505fe0de48ae064c44b8d666f4c67c /src/printer/let_binding.h | |
parent | 6d060743830ab21dc970444688fe1dc2ad34494f (diff) |
Letify quantifier bodies independently (#6112)
This fixes a subtle bug with how quantifier bodies are letified.
It makes our letification more conservative so that let symbols are never pushed inside quantifier bodies, instead quantifier bodies are letified independently of the context.
Diffstat (limited to 'src/printer/let_binding.h')
-rw-r--r-- | src/printer/let_binding.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/printer/let_binding.h b/src/printer/let_binding.h index e14740b61..83f3183ca 100644 --- a/src/printer/let_binding.h +++ b/src/printer/let_binding.h @@ -69,6 +69,19 @@ namespace CVC4 { * d_letList[i] does not contain subterm d_letList[j] for j>i. * It is intended that d_letList contains only unique nodes. Each node * in d_letList is mapped to a unique identifier in d_letMap. + * + * Notice that this class will *not* use introduced let symbols when converting + * the bodies of quantified formulas. Consider the formula: + * (let ((Q (forall ((x Int)) (= x (+ a a))))) (and (= (+ a a) (+ a a)) Q Q)) + * where "let" above is from the user. When this is letified by this class, + * note that (+ a a) occurs as a subterm of Q, however it is not seen until + * after we have seen Q twice, since we traverse in reverse topological order. + * Since we do not traverse underneath quantified formulas, this means that Q + * may be marked as a term-to-letify before (+ a a), which leads to violation + * of the above invariant concerning containment. Thus, when converting, if + * a let symbol is introduced for (+ a a), we will not replace the occurence + * of (+ a a) within Q. Instead, the user of this class is responsible for + * letifying the bodies of quantified formulas independently. */ class LetBinding { |