13 #include "../sort/Sort.h"
21 #include <unordered_map>
28 class UFInstanceManager;
75 const std::vector<UTerm>&
args()
const {
104 auto argA =
mArgs.begin();
105 auto argB = ufic.
args().begin();
106 while (argA !=
mArgs.end()) {
107 assert(argB != ufic.
args().end());
127 struct hash<
carl::UFInstanceContent> {
181 assert(ufi.
id() != 0);
191 assert(ufi.
id() != 0);
203 auto result = std::make_unique<UFInstanceContent>(uf, std::move(args));
215 auto result = std::make_unique<UFInstanceContent>(uf, args);
carl is the main namespace for the library.
UFInstance newUFInstance(const UninterpretedFunction &uf, std::vector< UTerm > &&args)
Gets the uninterpreted function instance with the given name, domain, arguments and codomain.
std::size_t hash_all(Args &&... args)
Hashes an arbitrary number of values.
std::unordered_map< const T1 *, T2, pointerHash< T1 >, pointerEqual< T1 > > FastPointerMap
Base class that implements a singleton.
static UFInstanceManager & getInstance()
Returns the single instance of this class by reference.
Implements an uninterpreted function instance.
The actual content of an uninterpreted function instance.
UFInstanceContent(const UninterpretedFunction &uf, const std::vector< UTerm > &args)
Constructs the content of an uninterpreted function instance.
bool operator==(const UFInstanceContent &ufic) const
bool operator<(const UFInstanceContent &ufic) const
const std::vector< UTerm > & args() const
std::vector< UTerm > mArgs
The uninterpreted function instance's arguments.
UFInstanceContent(UFInstanceContent &&)=delete
UFInstanceContent(const UFInstanceContent &)=delete
UninterpretedFunction mUninterpretedFunction
The underlying uninterpreted function of theinstance.
UFInstanceContent()=delete
UFInstanceContent(const UninterpretedFunction &uf, std::vector< UTerm > &&args)
Constructs the content of an uninterpreted function instance.
const UninterpretedFunction & uninterpretedFunction() const
std::size_t operator()(const carl::UFInstanceContent &ufun) const
Implements a manager for uninterpreted function instances, containing their actual contents and alloc...
static bool argsCorrect(const UFInstanceContent &ufic)
UFInstance newUFInstance(const UninterpretedFunction &uf, const std::vector< UTerm > &args)
Gets the uninterpreted function instance with the given name, domain, arguments and codomain.
~UFInstanceManager() override
UFInstance newUFInstance(const UninterpretedFunction &uf, std::vector< UTerm > &&args)
Gets the uninterpreted function instance with the given name, domain, arguments and codomain.
UFInstance newUFInstance(std::unique_ptr< UFInstanceContent > &&ufic)
Tries to add the given uninterpreted function instance's content to the so far stored uninterpreted f...
std::vector< std::unique_ptr< UFInstanceContent > > mUFInstances
Maps the unique ids to the instantiated uninterpreted function instance's content.
FastPointerMap< UFInstanceContent, std::size_t > mUFInstanceIdMap
Stores all instantiated uninterpreted function instance's contents and maps them to their unique id.
const std::vector< UTerm > & getArgs(const UFInstance &ufi) const
const UninterpretedFunction & getUninterpretedFunction(const UFInstance &ufi) const
UFInstanceManager()
Constructs an uninterpreted function instances manager.
Implements an uninterpreted function.