23 #include <opencog/atomspace/atom_types.h>
27 using namespace opencog;
32 :
Link(FREE_LINK, oset, tv, av)
40 :
Link(FREE_LINK, a, tv, av)
48 :
Link(t, oset, tv, av)
51 throw InvalidParamException(TRACE_INFO,
"Expecting a FreeLink");
54 if (FREE_LINK != t)
return;
64 throw InvalidParamException(TRACE_INFO,
"Expecting a FreeLink");
67 if (FREE_LINK != t)
return;
74 :
Link(t, a, b, tv, av)
77 throw InvalidParamException(TRACE_INFO,
"Expecting a FreeLink");
80 if (FREE_LINK != t)
return;
89 throw InvalidParamException(TRACE_INFO,
"Expecting a FreeLink");
92 if (FREE_LINK != tscope)
return;
105 for (
const Handle& h : oset)
107 Type t = h->getType();
108 if (QUOTE_LINK == t)
continue;
109 if (VARIABLE_NODE == t and
110 0 == varset.count(h))
116 if (NULL == lll)
continue;
118 find_vars(varset, lll->getOutgoingSet());
131 if (0 <
_index.size())
return;
133 for (
size_t i=0; i<sz; i++)
134 _index.insert(std::pair<Handle, unsigned int>(
_varseq[i], i));
141 std::set<Handle> varset;
148 throw RuntimeException(TRACE_INFO,
"Not reducible!");
std::vector< Handle > HandleSeq
a list of handles
virtual Handle reduce(void)
std::shared_ptr< TruthValue > TruthValuePtr
std::shared_ptr< AttentionValue > AttentionValuePtr
std::map< Handle, unsigned int > _index
std::shared_ptr< Link > LinkPtr
ClassServer & classserver(ClassServerFactory *=ClassServer::createInstance)
FreeLink(Type, const HandleSeq &oset, TruthValuePtr tv=TruthValue::NULL_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
static LinkPtr LinkCast(const Handle &h)
unsigned short Type
type of Atoms, represented as short integer (16 bits)
void find_vars(std::set< Handle > &, const HandleSeq &)