Branch data Line data Source code
1 : : /******************************************************************************
2 : : * This file is part of the cvc5 project.
3 : : *
4 : : * Copyright (c) 2009-2026 by the authors listed in the file AUTHORS
5 : : * in the top-level source directory and their institutional affiliations.
6 : : * All rights reserved. See the file COPYING in the top-level source
7 : : * directory for licensing information.
8 : : * ****************************************************************************
9 : : *
10 : : * Test for project issue #652
11 : : *
12 : : */
13 : : #include <cvc5/cvc5.h>
14 : :
15 : : using namespace cvc5;
16 : 1 : int main(void)
17 : : {
18 : 1 : TermManager tm;
19 : 1 : Solver solver(tm);
20 : 1 : solver.setOption("incremental", "false");
21 : 1 : solver.setOption("sep-pre-skolem-emp", "true");
22 : 1 : Sort s0 = tm.getIntegerSort();
23 : 1 : Term t1 = tm.mkConst(s0, "_x1");
24 : 1 : Term t2 = tm.mkConst(s0, "_x8");
25 : 1 : Term t3 = tm.mkConst(s0, "_x10");
26 : 3 : Term t4 = tm.mkTerm(Kind::SEQ_UNIT, {t1});
27 : 1 : Sort s5 = t4.getSort();
28 : 1 : Term t6 = tm.mkVar(s5, "_f13_0");
29 : 5 : Term t7 = tm.mkTerm(Kind::SEQ_REPLACE_ALL, {t4, t4, t6});
30 : 4 : Term t8 = tm.mkTerm(Kind::SEQ_AT, {t4, t1});
31 : 5 : Term t9 = tm.mkTerm(Kind::SEQ_UPDATE, {t8, t1, t8});
32 : 5 : Term t10 = tm.mkTerm(Kind::SEQ_EXTRACT, {t4, t1, t2});
33 : 5 : Term t11 = tm.mkTerm(Kind::SEQ_REPLACE, {t10, t9, t7});
34 : 3 : Sort s12 = tm.mkFunctionSort({s5}, s5);
35 : 3 : Term t13 = solver.defineFun("_f13", {t6}, s5, t11, true);
36 : 1 : Op o14 = tm.mkOp(Kind::APPLY_UF);
37 : 4 : Term t15 = tm.mkTerm(o14, {t13, t4});
38 : 4 : Term t16 = tm.mkTerm(Kind::APPLY_UF, {t13, t15});
39 : 1 : Op o17 = tm.mkOp(Kind::SEQ_EXTRACT);
40 : 5 : Term t18 = tm.mkTerm(o17, {t16, t3, t1});
41 : 1 : Op o19 = tm.mkOp(Kind::SEQ_PREFIX);
42 : 4 : Term t20 = tm.mkTerm(o19, {t18, t4});
43 : 1 : Sort s21 = t20.getSort();
44 : 1 : Term t22 = t20.impTerm(t20);
45 : 1 : solver.assertFormula(t22);
46 : 1 : solver.checkSat();
47 : :
48 : 1 : return 0;
49 : 1 : }
|