From: Andrew Reynolds Date: Wed, 9 Jan 2019 21:39:07 +0000 (-0600) Subject: Do not rewrite 1-constructor sygus testers to true (#2780) X-Git-Tag: cvc5-1.0.0~4295 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fb145effd5bfe67090736969478ff54cf7f62984;p=cvc5.git Do not rewrite 1-constructor sygus testers to true (#2780) --- diff --git a/src/theory/datatypes/datatypes_rewriter.cpp b/src/theory/datatypes/datatypes_rewriter.cpp index 4469f0fe9..a2458e2eb 100644 --- a/src/theory/datatypes/datatypes_rewriter.cpp +++ b/src/theory/datatypes/datatypes_rewriter.cpp @@ -428,7 +428,7 @@ RewriteResponse DatatypesRewriter::rewriteTester(TNode in) NodeManager::currentNM()->mkConst(result)); } const Datatype& dt = static_cast(in[0].getType().toType()).getDatatype(); - if (dt.getNumConstructors() == 1) + if (dt.getNumConstructors() == 1 && !dt.isSygus()) { // only one constructor, so it must be Trace("datatypes-rewrite") diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt index 0b196855f..e6e28336e 100644 --- a/test/regress/CMakeLists.txt +++ b/test/regress/CMakeLists.txt @@ -1748,6 +1748,7 @@ set(regress_2_tests regress2/sygus/inv_gen_n_c11.sy regress2/sygus/lustre-real.sy regress2/sygus/max2-univ.sy + regress2/sygus/min_IC_1.sy regress2/sygus/mpg_guard1-dd.sy regress2/sygus/multi-udiv.sy regress2/sygus/nia-max-square.sy diff --git a/test/regress/regress2/sygus/min_IC_1.sy b/test/regress/regress2/sygus/min_IC_1.sy new file mode 100644 index 000000000..92e171312 --- /dev/null +++ b/test/regress/regress2/sygus/min_IC_1.sy @@ -0,0 +1,25 @@ +; REQUIRES: symfpu +; EXPECT: unsat +; COMMAND-LINE: --sygus-out=status +(set-logic ALL) +(define-sort FP () (_ FloatingPoint 3 5)) +(define-fun IC ((t FP)) Bool (=> (fp.isInfinite t) (fp.isNegative t))) + +(synth-fun simpIC ((t FP)) Bool + ((Start Bool ( + (and Start Start) + (not Start) + + (fp.isInfinite StartFP) + (fp.isNegative StartFP) + + (ite Start Start Start) + )) + (StartFP FP ( + t + )) +)) + +(declare-var x FP) +(constraint (= (simpIC x) (IC x))) +(check-synth)