6 #ifndef PREDICATE_FACT_HPP_
7 #define PREDICATE_FACT_HPP_
11 #include "factpp/Kernel.hpp"
20 bool operator()(
const ClassifiableEntry*)
const {
return true;}
26 bool operator()(
const ClassifiableEntry* ce)
const {
27 const TConcept* c =
reinterpret_cast<const TConcept*
>(ce);
28 return Instance == c->isSingleton();
36 Super_sub(
const TDLConceptExpression* ce, ReasoningKernel& kernel)
37 : ce_(ce), kernel_(kernel) {}
39 bool operator()(
const ClassifiableEntry* ce)
const {
40 TExpressionManager& em = *kernel_.getExpressionManager();
41 const TDLConceptExpression* c = em.Concept(ce->getName());
43 kernel_.isSubsumedBy(ce_, c) :
44 kernel_.isSubsumedBy(c, ce_);
51 const TDLConceptExpression* ce_;
52 ReasoningKernel& kernel_;
59 Equivalent(
const TDLConceptExpression* ce, ReasoningKernel& kernel)
60 : ce_(ce), kernel_(kernel) {}
62 bool operator()(
const ClassifiableEntry* ce)
const {
63 TExpressionManager& em = *kernel_.getExpressionManager();
64 const TDLConceptExpression* c = em.Concept(ce->getName());
65 return kernel_.isEquivalent(c, ce_);
69 const TDLConceptExpression* ce_;
70 ReasoningKernel& kernel_;
78 Is_name(
const std::string& name) : name_(name) {}
80 bool operator() (
const ClassifiableEntry* ce)
const {
81 return IS == (name_ == ce->getName());
84 const std::string name_;
93 bool operator() (
const ClassifiableEntry* ce)
const {
94 const std::string sname(ce->getName());
96 ( sname.size() >= str_.size() ) &&
97 ( sname.compare(0, str_.size(), str_) == 0 );
101 const std::string str_;
112 const TDLObjectRoleExpression* property,
113 const TDLConceptExpression* c,
114 ReasoningKernel& kernel
118 const std::string& property,
119 const std::string& c,
121 ReasoningKernel& kernel
126 return ! kernel_.isDisjoint(restriction_, x);
131 ReasoningKernel& kernel_;
132 const TDLConceptExpression* restriction_;