2022-01-28 08:56:27 -08:00
|
|
|
/******************************************************************************
|
|
|
|
|
* Top contributors (to current version):
|
2022-04-05 13:38:57 -07:00
|
|
|
* Andres Noetzli, Mathias Preiner
|
2022-01-28 08:56:27 -08:00
|
|
|
*
|
|
|
|
|
* This file is part of the cvc5 project.
|
|
|
|
|
*
|
2022-04-05 13:38:57 -07:00
|
|
|
* Copyright (c) 2009-2022 by the authors listed in the file AUTHORS
|
2022-01-28 08:56:27 -08:00
|
|
|
* in the top-level source directory and their institutional affiliations.
|
|
|
|
|
* All rights reserved. See the file COPYING in the top-level source
|
|
|
|
|
* directory for licensing information.
|
|
|
|
|
* ****************************************************************************
|
|
|
|
|
*
|
|
|
|
|
* Test for project issue #445
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2023-03-07 15:39:29 -08:00
|
|
|
#include <cvc5/cvc5.h>
|
2022-01-28 08:56:27 -08:00
|
|
|
|
2023-03-07 15:39:29 -08:00
|
|
|
#include <cassert>
|
2022-01-28 08:56:27 -08:00
|
|
|
|
2022-03-29 16:23:01 -07:00
|
|
|
using namespace cvc5;
|
2022-01-28 08:56:27 -08:00
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
|
{
|
|
|
|
|
Solver slv;
|
|
|
|
|
slv.setOption("sygus-rr-synth-input", "true");
|
2022-10-27 11:35:58 -05:00
|
|
|
slv.setOption("strings-exp", "true");
|
|
|
|
|
slv.setOption("sygus-abort-size", "1");
|
2022-01-28 08:56:27 -08:00
|
|
|
Sort s1 = slv.mkUninterpretedSort("_u0");
|
|
|
|
|
Sort s5 = slv.mkUninterpretedSort("_u1");
|
|
|
|
|
Sort s6 = slv.mkUninterpretedSort("_u2");
|
|
|
|
|
Sort s7 = slv.mkFunctionSort({s1}, s6);
|
|
|
|
|
Term t7 = slv.mkConst(s7, "_x8");
|
|
|
|
|
Term t13 = slv.mkConst(s5, "_x14");
|
|
|
|
|
Term t15 = slv.mkTerm(Kind::SEQ_UNIT, {t13});
|
|
|
|
|
Term t84 = slv.mkTerm(Kind::SEQ_REV, {t15});
|
|
|
|
|
Term t141 = slv.mkTerm(Kind::SEQ_UNIT, {t84});
|
|
|
|
|
Term t229 = slv.mkTerm(Kind::SEQ_UNIT, {t15});
|
|
|
|
|
Term t279 = slv.mkTerm(Kind::SEQ_REPLACE_ALL, {t141, t229, t141});
|
|
|
|
|
Term t289 = slv.mkTerm(Kind::SEQ_PREFIX, {t279, t229});
|
|
|
|
|
slv.assertFormula({t289});
|
2022-10-27 11:35:58 -05:00
|
|
|
// should terminate with an exception indicating we are done enumerating
|
|
|
|
|
// rewrite rules.
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
(void)slv.simplify(t7);
|
|
|
|
|
}
|
|
|
|
|
catch (cvc5::CVC5ApiException& e)
|
|
|
|
|
{
|
|
|
|
|
}
|
2022-01-28 08:56:27 -08:00
|
|
|
}
|