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 issue #6111 11 : : * 12 : : */ 13 : : #include <cvc5/cvc5.h> 14 : : 15 : : #include <iostream> 16 : : #include <vector> 17 : : 18 : : using namespace cvc5; 19 : : using namespace std; 20 : : 21 : 1 : int main() 22 : : { 23 : 1 : TermManager tm; 24 : 1 : Solver solver(tm); 25 : 1 : solver.setLogic("QF_BV"); 26 : 1 : Sort bvsort12979 = tm.mkBitVectorSort(12979); 27 : 1 : Term input2_1 = tm.mkConst(bvsort12979, "intpu2_1"); 28 : 2 : Term zero = tm.mkBitVector(bvsort12979.getBitVectorSize(), "0", 10); 29 : : 30 : 1 : vector<Term> args1; 31 : 1 : args1.push_back(zero); 32 : 1 : args1.push_back(input2_1); 33 : 1 : Term bvult_res = tm.mkTerm(Kind::BITVECTOR_ULT, {args1}); 34 : 1 : solver.assertFormula(bvult_res); 35 : : 36 : 1 : Sort bvsort4 = tm.mkBitVectorSort(4); 37 : 1 : Term concat_result_42 = tm.mkConst(bvsort4, "concat_result_42"); 38 : 1 : Sort bvsort8 = tm.mkBitVectorSort(8); 39 : 1 : Term concat_result_43 = tm.mkConst(bvsort8, "concat_result_43"); 40 : : 41 : 1 : vector<Term> args2; 42 : 1 : args2.push_back(concat_result_42); 43 : 1 : args2.push_back( 44 : 3 : tm.mkTerm(tm.mkOp(Kind::BITVECTOR_EXTRACT, {7, 4}), {concat_result_43})); 45 : 1 : solver.assertFormula(tm.mkTerm(Kind::EQUAL, {args2})); 46 : : 47 : 1 : vector<Term> args3; 48 : 1 : args3.push_back(concat_result_42); 49 : 1 : args3.push_back( 50 : 3 : tm.mkTerm(tm.mkOp(Kind::BITVECTOR_EXTRACT, {3, 0}), {concat_result_43})); 51 : 1 : solver.assertFormula(tm.mkTerm(Kind::EQUAL, {args3})); 52 : : 53 : 1 : cout << solver.checkSat() << endl; 54 : : 55 : 1 : return 0; 56 : 1 : }