6 #include "knowrob/semweb/GraphBuiltin.h"
7 #include "knowrob/integration/python/utils.h"
8 #include "knowrob/terms/Numeric.h"
13 if (a->isNumeric() && b->isNumeric()) {
14 auto a_numeric = std::static_pointer_cast<Numeric>(a);
15 auto b_numeric = std::static_pointer_cast<Numeric>(b);
16 return a_numeric->asDouble() < b_numeric->asDouble();
22 if (a->isNumeric() && b->isNumeric()) {
23 auto a_numeric = std::static_pointer_cast<Numeric>(a);
24 auto b_numeric = std::static_pointer_cast<Numeric>(b);
25 return a_numeric->asDouble() > b_numeric->asDouble();
34 bindings->set(
bindVar(), valueTerm);
40 if (a->isGround() && b->isGround()) {
41 if (isSmaller(a, b)) {
52 if (a->isGround() && b->isGround()) {
53 if (isGreater(a, b)) {
64 return isSmaller(a, b);
69 return isSmaller(a, b) || (*a == *b);
74 return isGreater(a, b);
79 return isGreater(a, b) || (*a == *b);
100 class_<GraphBuiltin, bases<GraphTerm, Function>, std::shared_ptr<GraphBuiltin>, boost::noncopyable>
101 (
"GraphBuiltin", no_init)
const std::vector< TermPtr > arguments_
void setOptional(bool isOptional)
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)
static BuiltinPtr bind(const VariablePtr &var, const TermPtr &val)
bool apply(const std::shared_ptr< Bindings > &bindings) const
static BuiltinPtr greater(const TermPtr &a, const TermPtr &b)
static BuiltinPtr min(const VariablePtr &var, const TermPtr &a, const TermPtr &b)
void createType< GraphBuiltin >()
std::shared_ptr< Term > TermPtr
FirstOrderLiteralPtr applyBindings(const FirstOrderLiteralPtr &lit, const Bindings &bindings)