26 #include <boost/uuid/uuid_io.hpp>
27 #include <boost/uuid/uuid_generators.hpp>
35 using namespace opencog;
39 if (!rule->
isType(MEMBER_LINK,
true))
40 throw InvalidParamException(TRACE_INFO,
41 "Rule '%s' is expected to be a MemberLink",
45 rbs_h =
LinkCast(rule)->getOutgoingAtom(1);
134 if (t == AND_LINK or t == OR_LINK)
135 hs =
LinkCast(implicant)->getOutgoingSet();
137 hs.push_back(implicant);
171 std::queue<Handle> pre_output;
175 if (implicand->
getType() == LIST_LINK)
182 pre_output.push(implicand);
186 while (not pre_output.empty())
188 Handle hfront = pre_output.front();
191 if (hfront->
getType() == EXECUTION_OUTPUT_LINK)
203 final_output.push_back(hfront);
224 std::map<Handle, Handle> dict;
247 for (
auto ho : old_outgoing)
254 if (h->
getType() != VARIABLE_NODE)
258 if (dict.count(h) == 1)
261 std::stringstream ss;
Rule gen_standardize_apart(AtomSpace *as)
Handle standardize_helper(AtomSpace *as, Handle, std::map< Handle, Handle > &)
HandleSeq get_implicant_seq()
std::vector< Handle > HandleSeq
a list of handles
void set_category(const string &name)
static BindLinkPtr BindLinkCast(const Handle &h)
virtual std::string toString(std::string indent="")=0
bool isType(Type t, bool subclass) const
static NodePtr NodeCast(const Handle &h)
static const Handle UNDEFINED
HandleSeq get_implicand_seq()
static LinkPtr LinkCast(const Handle &h)
Handle get_definition(void)
void set_name(const string &name)
TruthValuePtr getTruthValue()
unsigned short Type
type of Atoms, represented as short integer (16 bits)
void set_handle(Handle h)
Handle add_atom(AtomPtr atom, bool async=false)