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 #445 11 : : * 12 : : */ 13 : : 14 : : #include <cvc5/cvc5.h> 15 : : 16 : : #include <cassert> 17 : : 18 : : using namespace cvc5; 19 : : 20 : 1 : int main(void) 21 : : { 22 : 1 : TermManager tm; 23 : 1 : Solver slv(tm); 24 : 1 : slv.setOption("strings-exp", "true"); 25 : 1 : slv.setOption("sygus-abort-size", "1"); 26 : 1 : Sort s1 = tm.mkUninterpretedSort("_u0"); 27 : 1 : Sort s5 = tm.mkUninterpretedSort("_u1"); 28 : 1 : Sort s6 = tm.mkUninterpretedSort("_u2"); 29 : 3 : Sort s7 = tm.mkFunctionSort({s1}, s6); 30 : 1 : Term t7 = tm.mkConst(s7, "_x8"); 31 : 1 : Term t13 = tm.mkConst(s5, "_x14"); 32 : 3 : Term t15 = tm.mkTerm(Kind::SEQ_UNIT, {t13}); 33 : 3 : Term t84 = tm.mkTerm(Kind::SEQ_REV, {t15}); 34 : 3 : Term t141 = tm.mkTerm(Kind::SEQ_UNIT, {t84}); 35 : 3 : Term t229 = tm.mkTerm(Kind::SEQ_UNIT, {t15}); 36 : 5 : Term t279 = tm.mkTerm(Kind::SEQ_REPLACE_ALL, {t141, t229, t141}); 37 : 4 : Term t289 = tm.mkTerm(Kind::SEQ_PREFIX, {t279, t229}); 38 : 1 : slv.assertFormula({t289}); 39 : : // should terminate with an exception indicating we are done enumerating 40 : : // rewrite rules. 41 : : try 42 : : { 43 : 1 : (void)slv.simplify(t7); 44 : : } 45 [ - - ]: 0 : catch (cvc5::CVC5ApiException& e) 46 : : { 47 : 0 : } 48 : 1 : }