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 #431. 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 : solver.setOption("produce-abducts", "true"); 24 : 1 : Sort s2 = tm.mkBitVectorSort(22); 25 : 1 : Sort s4 = tm.mkSetSort(s2); 26 : 1 : Sort s5 = tm.getBooleanSort(); 27 : 1 : Sort s6 = tm.getRealSort(); 28 : 3 : Sort s7 = tm.mkFunctionSort({s6}, s5); 29 : 2 : DatatypeDecl _dt46 = tm.mkDatatypeDecl("_dt46", {}); 30 : 2 : DatatypeConstructorDecl _cons64 = tm.mkDatatypeConstructorDecl("_cons64"); 31 : 1 : _cons64.addSelector("_sel62", s6); 32 : 1 : _cons64.addSelector("_sel63", s4); 33 : 1 : _dt46.addConstructor(_cons64); 34 : 3 : Sort s14 = tm.mkDatatypeSorts({_dt46})[0]; 35 : 1 : Term t31 = tm.mkConst(s7, "_x100"); 36 : 1 : Term t47 = tm.mkConst(s14, "_x112"); 37 : 1 : Term sel = t47.getSort() 38 : 2 : .getDatatype() 39 : 2 : .getConstructor("_cons64") 40 : 2 : .getSelector("_sel62") 41 : 1 : .getTerm(); 42 : 4 : Term t274 = tm.mkTerm(Kind::APPLY_SELECTOR, {sel, t47}); 43 : 4 : Term t488 = tm.mkTerm(Kind::APPLY_UF, {t31, t274}); 44 : 1 : solver.assertFormula({t488}); 45 : 1 : Term abduct; 46 : 1 : abduct = solver.getAbduct(t488); 47 : 1 : }