6 #ifndef KNOWROB_BINDINGS_H_
7 #define KNOWROB_BINDINGS_H_
16 #include "knowrob/formulas/Formula.h"
18 #include "knowrob/Printable.h"
28 class Bindings :
public Printable {
33 using Map = std::map<std::string_view, std::pair<std::shared_ptr<Variable>,
TermPtr>>;
80 auto find(std::string_view varName)
const {
return mapping_.find(varName); }
107 std::shared_ptr<Atomic>
getAtomic(std::string_view varName)
const;
144 void write(std::ostream &os)
const override;
151 using BindingsPtr = std::shared_ptr<const Bindings>;
std::shared_ptr< Atomic > getAtomic(std::string_view varName) const
bool unifyWith(const Bindings &other)
void operator+=(const Bindings &other)
bool isConsistentWith(const Bindings &other) const
~Bindings() override=default
void write(std::ostream &os) const override
bool contains(std::string_view varName) const
void set(const std::shared_ptr< Variable > &var, const TermPtr &term)
static std::shared_ptr< const Bindings > emptyBindings()
bool operator==(const Bindings &other) const
const TermPtr & get(std::string_view varName) const
Bindings(const std::map< std::shared_ptr< Variable >, TermPtr > &mapping)
auto find(std::string_view varName) const
std::map< std::shared_ptr< Variable >, TermPtr > VarMap
std::map< std::string_view, std::pair< std::shared_ptr< Variable >, TermPtr > > Map
FunctionRule & function()
std::shared_ptr< const Bindings > BindingsPtr
std::shared_ptr< Term > TermPtr
std::shared_ptr< Formula > FormulaPtr
std::function< void(const BindingsPtr &)> BindingsHandler
FirstOrderLiteralPtr applyBindings(const FirstOrderLiteralPtr &lit, const Bindings &bindings)