Branch data Line data Source code
1 : : /****************************************************************************** 2 : : * Top contributors (to current version): 3 : : * Aina Niemetz, Andrew Reynolds, Mathias Preiner 4 : : * 5 : : * This file is part of the cvc5 project. 6 : : * 7 : : * Copyright (c) 2009-2025 by the authors listed in the file AUTHORS 8 : : * in the top-level source directory and their institutional affiliations. 9 : : * All rights reserved. See the file COPYING in the top-level source 10 : : * directory for licensing information. 11 : : * **************************************************************************** 12 : : * 13 : : * Test for project issue #381. 14 : : */ 15 : : #include <cvc5/cvc5.h> 16 : : 17 : : #include <cassert> 18 : : 19 : : using namespace cvc5; 20 : : 21 : 1 : int main(void) 22 : : { 23 : 1 : TermManager tm; 24 : 1 : Solver solver(tm); 25 : : 26 : 1 : Sort s1 = tm.getBooleanSort(); 27 : 1 : Sort psort = tm.mkParamSort("_x9"); 28 : 3 : DatatypeDecl dtdecl = tm.mkDatatypeDecl("_x8", {psort}); 29 : 2 : DatatypeConstructorDecl ctor = tm.mkDatatypeConstructorDecl("_x22"); 30 : 1 : ctor.addSelector("_x19", s1); 31 : 1 : dtdecl.addConstructor(ctor); 32 : 1 : Sort s3 = tm.mkDatatypeSort(dtdecl); 33 : 3 : Sort s6 = s3.instantiate({s1}); 34 : 1 : Term t26 = tm.mkConst(s6, "_x63"); 35 : 1 : Term t5 = tm.mkTrue(); 36 : 3 : Term t187 = tm.mkTerm(Kind::APPLY_UPDATER, 37 : 1 : {t26.getSort() 38 : 2 : .getDatatype() 39 : 2 : .getConstructor("_x22") 40 : 2 : .getSelector("_x19") 41 : : .getUpdaterTerm(), 42 : : t26, 43 : 3 : t5}); 44 : 1 : (void)solver.simplify(t187); 45 : 1 : }