From 7c0b92c30688d8c7830bf3611213e96026ecf1f5 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Wed, 20 May 2020 21:22:25 -0500 Subject: [PATCH] Fix missing check for cardinality one in unconstrained simplifier (#4504) Fixes #4482. --- src/preprocessing/passes/unconstrained_simplifier.cpp | 4 ++++ test/regress/CMakeLists.txt | 1 + test/regress/regress0/datatypes/4482-unc-simp-one.smt2 | 5 +++++ 3 files changed, 10 insertions(+) create mode 100644 test/regress/regress0/datatypes/4482-unc-simp-one.smt2 diff --git a/src/preprocessing/passes/unconstrained_simplifier.cpp b/src/preprocessing/passes/unconstrained_simplifier.cpp index 7cf6a79bd..5d544ae57 100644 --- a/src/preprocessing/passes/unconstrained_simplifier.cpp +++ b/src/preprocessing/passes/unconstrained_simplifier.cpp @@ -236,6 +236,10 @@ void UnconstrainedSimplifier::processUnconstrained() break; } } + if (parent[0].getType().getCardinality().isOne()) + { + break; + } if (parent[0].getType().isDatatype()) { TypeNode tn = parent[0].getType(); diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt index ea98cf819..506857479 100644 --- a/test/regress/CMakeLists.txt +++ b/test/regress/CMakeLists.txt @@ -375,6 +375,7 @@ set(regress_0_tests regress0/cvc3.userdoc.05.cvc regress0/cvc3.userdoc.06.cvc regress0/cvc-rerror-print.cvc + regress0/datatypes/4482-unc-simp-one.smt2 regress0/datatypes/Test1-tup-mp.cvc regress0/datatypes/boolean-equality.cvc regress0/datatypes/boolean-terms-datatype.cvc diff --git a/test/regress/regress0/datatypes/4482-unc-simp-one.smt2 b/test/regress/regress0/datatypes/4482-unc-simp-one.smt2 new file mode 100644 index 000000000..265aeef23 --- /dev/null +++ b/test/regress/regress0/datatypes/4482-unc-simp-one.smt2 @@ -0,0 +1,5 @@ +(set-logic ALL) +(set-info :status unsat) +(declare-fun a () Tuple) +(assert (distinct a mkTuple)) +(check-sat) -- 2.30.2