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 : : * Arrays skolem cache. 11 : : */ 12 : : 13 : : #include "theory/arrays/skolem_cache.h" 14 : : 15 : : #include "expr/bound_var_manager.h" 16 : : #include "expr/skolem_manager.h" 17 : : #include "expr/type_node.h" 18 : : 19 : : using namespace cvc5::internal::kind; 20 : : 21 : : namespace cvc5::internal { 22 : : namespace theory { 23 : : namespace arrays { 24 : : 25 : 0 : SkolemCache::SkolemCache() {} 26 : : 27 : 4012 : Node SkolemCache::getExtIndexSkolem(NodeManager* nm, Node deq) 28 : : { 29 : 4012 : Assert(deq.getKind() == Kind::NOT && deq[0].getKind() == Kind::EQUAL); 30 : 4012 : Node a = deq[0][0]; 31 : 4012 : Node b = deq[0][1]; 32 [ - + ][ - + ]: 4012 : Assert(a.getType().isArray()); [ - - ] 33 [ - + ][ - + ]: 12036 : AssertEqual(b.getType(), a.getType()); [ - - ] 34 : : 35 : : // make the skolem, which is deterministic for a,b. 36 : 4012 : SkolemManager* sm = nm->getSkolemManager(); 37 [ + + ][ - - ]: 16048 : return sm->mkSkolemFunction(SkolemId::ARRAY_DEQ_DIFF, {a, b}); 38 : 4012 : } 39 : : 40 : 43 : Node SkolemCache::getEqRangeVar(NodeManager* nm, TNode eqr) 41 : : { 42 [ - + ][ - + ]: 43 : Assert(eqr.getKind() == Kind::EQ_RANGE); [ - - ] 43 : 43 : BoundVarManager* bvm = nm->getBoundVarManager(); 44 : 43 : return bvm->mkBoundVar(BoundVarId::ARRAYS_EQ_RANGE, eqr, eqr[2].getType()); 45 : : } 46 : : 47 : : } // namespace arrays 48 : : } // namespace theory 49 : : } // namespace cvc5::internal