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 #381. 11 : : */ 12 : : #include <cvc5/cvc5.h> 13 : : 14 : : #include <cassert> 15 : : 16 : : using namespace cvc5; 17 : : 18 : 1 : int main(void) 19 : : { 20 : 1 : TermManager tm; 21 : 1 : Solver solver(tm); 22 : : 23 : 1 : Sort s1 = tm.getBooleanSort(); 24 : 1 : Sort psort = tm.mkParamSort("_x9"); 25 : 3 : DatatypeDecl dtdecl = tm.mkDatatypeDecl("_x8", {psort}); 26 : 2 : DatatypeConstructorDecl ctor = tm.mkDatatypeConstructorDecl("_x22"); 27 : 1 : ctor.addSelector("_x19", s1); 28 : 1 : dtdecl.addConstructor(ctor); 29 : 1 : Sort s3 = tm.mkDatatypeSort(dtdecl); 30 : 3 : Sort s6 = s3.instantiate({s1}); 31 : 1 : Term t26 = tm.mkConst(s6, "_x63"); 32 : 1 : Term t5 = tm.mkTrue(); 33 : 3 : Term t187 = tm.mkTerm(Kind::APPLY_UPDATER, 34 : 1 : {t26.getSort() 35 : 2 : .getDatatype() 36 : 2 : .getConstructor("_x22") 37 : 2 : .getSelector("_x19") 38 : : .getUpdaterTerm(), 39 : : t26, 40 : 3 : t5}); 41 : 1 : (void)solver.simplify(t187); 42 : 1 : }