Branch data Line data Source code
1 : : /****************************************************************************** 2 : : * Top contributors (to current version): 3 : : * Mudathir Mohamed, Andres Noetzli, 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 : : * Implementation of bags term registry object. 14 : : */ 15 : : 16 : : #include "theory/bags/term_registry.h" 17 : : 18 : : #include "expr/emptyset.h" 19 : : #include "theory/bags/inference_manager.h" 20 : : #include "theory/bags/solver_state.h" 21 : : 22 : : using namespace std; 23 : : using namespace cvc5::internal::kind; 24 : : 25 : : namespace cvc5::internal { 26 : : namespace theory { 27 : : namespace bags { 28 : : 29 : 49907 : TermRegistry::TermRegistry(Env& env) 30 : 49907 : : EnvObj(env), d_proxy(userContext()), d_proxy_to_term(userContext()) 31 : : { 32 : 49907 : } 33 : : 34 : 0 : Node TermRegistry::getEmptyBag(TypeNode tn) 35 : : { 36 : 0 : std::map<TypeNode, Node>::iterator it = d_emptybag.find(tn); 37 [ - - ]: 0 : if (it != d_emptybag.end()) 38 : : { 39 : 0 : return it->second; 40 : : } 41 : 0 : Node n = nodeManager()->mkConst(EmptySet(tn)); 42 : 0 : d_emptybag[tn] = n; 43 : 0 : return n; 44 : 0 : } 45 : : 46 : : } // namespace bags 47 : : } // namespace theory 48 : : } // namespace cvc5::internal