6 #include "knowrob/reasoner/GoalDrivenReasoner.h"
7 #include "knowrob/integration/python/utils.h"
8 #include "knowrob/integration/python/gil.h"
9 #include "knowrob/reasoner/RDFGoalReasoner.h"
14 return (
features_ &
static_cast<int>(feature)) != 0;
30 KB_DEBUG(
"Defining relation {} with arity {} in reasoner {}",
36 KB_DEBUG(
"Defining relation {} with arity 2 in reasoner {}",
42 KB_DEBUG(
"Undefining relation {} with arity {} in reasoner {}",
48 KB_DEBUG(
"Defining class {} in reasoner {}",
54 KB_DEBUG(
"Undefining class {} in reasoner {}",
72 void ReasonerRunner::run_() {
74 KB_WARN(
"Reasoner {} produced 'false' in query evaluation for query: {}",
82 struct GoalDrivenReasonerWrap :
public GoalDrivenReasoner, boost::python::wrapper<GoalDrivenReasoner> {
85 bool initializeReasoner(
const PropertyTree &config)
override {
86 return call_method<bool>(
self,
"initializeReasoner", config);
89 bool evaluate(
GoalPtr query)
override {
90 return call_method<bool>(
self,
"evaluate", query);
105 enum_<GoalDrivenReasonerFeature>(
"GoalDrivenReasonerFeature")
110 class_<GoalDrivenReasoner, std::shared_ptr<GoalDrivenReasonerWrap>, bases<Reasoner>, boost::noncopyable>
111 (
"GoalDrivenReasoner", init<>())
122 .def(
"evaluate", &GoalDrivenReasonerWrap::evaluate);
bool isRelationDefined(const PredicateIndicator &indicator)
void undefineRelation(const PredicateIndicator &indicator)
void undefineClass(const IRIAtomPtr &iri)
std::set< PredicateIndicator > definedRelations_
void enableFeature(GoalDrivenReasonerFeature feature)
bool isClassDefined(const std::string_view &iri)
bool hasFeature(GoalDrivenReasonerFeature feature) const
std::set< PredicateIndicator > definedClasses_
void defineClass(const IRIAtomPtr &iri)
void defineRelation(const PredicateIndicator &indicator)
auto & reasonerName() const
std::shared_ptr< GoalDrivenReasoner > reasoner
std::shared_ptr< Goal > query
void createType< GoalDrivenReasoner >()
void createType< RDFGoalReasoner >()
void createType< Goal >()
IRIAtomPtr iri(std::string_view ns, std::string_view name)
std::shared_ptr< IRIAtom > IRIAtomPtr
GoalDrivenReasonerFeature
@ SupportsSimpleConjunctions
@ SupportsExtensionalGrounding
std::shared_ptr< Goal > GoalPtr