6 #ifndef KNOWROB_GRAPH_BUILTIN_H
7 #define KNOWROB_GRAPH_BUILTIN_H
12 #include "knowrob/semweb/GraphTerm.h"
13 #include "knowrob/terms/Variable.h"
14 #include "knowrob/terms/Atomic.h"
15 #include "knowrob/terms/Function.h"
16 #include "knowrob/terms/Bindings.h"
34 namespace graph::builtins {
84 class GraphBuiltin :
public GraphTerm,
public Function {
119 bool apply(
const std::shared_ptr<Bindings> &bindings)
const;
128 return std::make_shared<GraphBuiltin>(
131 std::vector<TermPtr>{val},
143 return std::make_shared<GraphBuiltin>(
146 std::vector<TermPtr>{a, b},
158 return std::make_shared<GraphBuiltin>(
161 std::vector<TermPtr>{a, b},
172 return std::make_shared<GraphBuiltin>(
175 std::vector<TermPtr>{a, b});
185 return std::make_shared<GraphBuiltin>(
188 std::vector<TermPtr>{a, b});
198 return std::make_shared<GraphBuiltin>(
201 std::vector<TermPtr>{a, b});
211 return std::make_shared<GraphBuiltin>(
214 std::vector<TermPtr>{a, b});
224 return std::make_shared<GraphBuiltin>(
227 std::vector<TermPtr>{a, b});
237 return std::make_shared<GraphBuiltin>(
240 std::vector<TermPtr>{a, b});
static std::shared_ptr< knowrob::Atom > Tabled(std::string_view stringForm)
void write(std::ostream &os) const override
bool apply(const std::shared_ptr< Bindings > &bindings) const
void setOptional(bool isOptional)
GraphBuiltin(GraphBuiltinType builtinType, const AtomPtr &functor, const std::vector< TermPtr > &arguments, VariablePtr bindVar=nullptr)
std::shared_ptr< GraphBuiltin > BuiltinPtr
static BuiltinPtr greaterOrEqual(const TermPtr &a, const TermPtr &b)
static BuiltinPtr max(const VariablePtr &var, const TermPtr &a, const TermPtr &b)
static BuiltinPtr lessOrEqual(const TermPtr &a, const TermPtr &b)
static BuiltinPtr equal(const TermPtr &a, const TermPtr &b)
static BuiltinPtr notEqual(const TermPtr &a, const TermPtr &b)
static BuiltinPtr less(const TermPtr &a, const TermPtr &b)
GraphBuiltinType builtinType_
static BuiltinPtr bind(const VariablePtr &var, const TermPtr &val)
static BuiltinPtr greater(const TermPtr &a, const TermPtr &b)
void write(std::ostream &os) const override
static BuiltinPtr min(const VariablePtr &var, const TermPtr &a, const TermPtr &b)
const AtomPtr bindFunctor
const AtomPtr greaterFunctor
const AtomPtr notEqualFunctor
const AtomPtr lessFunctor
const AtomPtr greaterOrEqualFunctor
const AtomPtr lessOrEqualFunctor
const AtomPtr equalFunctor
std::shared_ptr< Term > TermPtr
std::shared_ptr< Atom > AtomPtr
std::shared_ptr< Variable > VariablePtr