summaryrefslogtreecommitdiff
path: root/src/preprocessing
diff options
context:
space:
mode:
authorGereon Kremer <gereon.kremer@cs.rwth-aachen.de>2020-08-31 21:59:39 +0200
committerGitHub <noreply@github.com>2020-08-31 14:59:39 -0500
commit52bab1414d41a4beb301f3c8a4165fa972f71a93 (patch)
treee6bd08cedfc0e73af9a046e3a91c8dad46b19251 /src/preprocessing
parent7b3b19f73ceb2168ced48d07a590c0f3be82a8d4 (diff)
Fix --ackermann in the presence on syntactically different but possibly equal selects (#4981)
The implementation of --ackermann mishandled selects in a subtle way: If select is applied to two syntactically different arrays (that may be semantically equal), the ackermann preprocessing failed to generate the "all arguments equal implies terms equal" lemmas. The problem is that we used the first argument (that is: the array) as lookup to identify terms that need to be considered for these lemmas. Instead we now use their operator (select) just like for uninterpreted function applications. Fixes #4957 . Also adds a regression.
Diffstat (limited to 'src/preprocessing')
-rw-r--r--src/preprocessing/passes/ackermann.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/preprocessing/passes/ackermann.cpp b/src/preprocessing/passes/ackermann.cpp
index 31c92a09f..ab9c2482b 100644
--- a/src/preprocessing/passes/ackermann.cpp
+++ b/src/preprocessing/passes/ackermann.cpp
@@ -70,11 +70,14 @@ void addLemmaForPair(TNode args1,
}
else
{
- Assert(args1.getKind() == kind::SELECT && args1[0] == func);
- Assert(args2.getKind() == kind::SELECT && args2[0] == func);
+ Assert(args1.getKind() == kind::SELECT && args1.getOperator() == func);
+ Assert(args2.getKind() == kind::SELECT && args2.getOperator() == func);
Assert(args1.getNumChildren() == 2);
Assert(args2.getNumChildren() == 2);
- args_eq = nm->mkNode(kind::EQUAL, args1[1], args2[1]);
+ args_eq = nm->mkNode(Kind::AND,
+ nm->mkNode(kind::EQUAL, args1[0], args2[0]),
+ nm->mkNode(kind::EQUAL, args1[1], args2[1])
+ );
}
Node func_eq = nm->mkNode(kind::EQUAL, args1, args2);
Node lemma = nm->mkNode(kind::IMPLIES, args_eq, func_eq);
@@ -153,7 +156,7 @@ void collectFunctionsAndLemmas(FunctionToArgsMap& fun_to_args,
if (seen.find(term) == seen.end())
{
TNode func;
- if (term.getKind() == kind::APPLY_UF)
+ if (term.getKind() == kind::APPLY_UF || term.getKind() == kind::SELECT)
{
storeFunctionAndAddLemmas(term.getOperator(),
term,
@@ -163,11 +166,6 @@ void collectFunctionsAndLemmas(FunctionToArgsMap& fun_to_args,
nm,
vec);
}
- else if (term.getKind() == kind::SELECT)
- {
- storeFunctionAndAddLemmas(
- term[0], term, fun_to_args, fun_to_skolem, assertions, nm, vec);
- }
else
{
AlwaysAssert(term.getKind() != kind::STORE)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback