27 #ifndef _OPENCOG_FIND_UTILS_H
28 #define _OPENCOG_FIND_UTILS_H
33 #include <opencog/util/functional.h>
161 for (
const Handle& oh : l->getOutgoingSet())
164 if (
NOPE != where) held =
true;
165 if (
IMM == where) imm =
true;
189 if (tree == atom)
return true;
191 if (NULL == ltree)
return false;
194 for (
const Handle h: ltree->getOutgoingSet()) {
208 if (tree == atom)
return false;
210 if (NULL == ltree)
return false;
212 if (tree->
getType() == QUOTE_LINK)
219 for (
const Handle& h: ltree->getOutgoingSet()) {
235 if (tree == atom)
return true;
237 if (NULL == ltree)
return false;
239 if (tree->
getType() == QUOTE_LINK)
return false;
242 for (
const Handle& h : ltree->getOutgoingSet()) {
253 const std::set<Handle>& atoms)
255 for (
const Handle& n: atoms)
270 const std::set<Handle>& atoms)
272 for (
const Handle& n: atoms)
287 const std::set<Handle>& atoms)
289 unsigned int count = 0;
290 for (
const Handle& n: atoms)
303 for (
const Handle& tree: trees)
318 for (
const Handle& tree: trees)
332 if (QUOTE_LINK == clause_type)
return false;
333 if (
classserver().isA(clause_type, atom_type))
return true;
336 if (not lc)
return false;
338 for (
const Handle& subclause: lc->getOutgoingSet())
347 #endif // _OPENCOG_FIND_UTILS_H
static bool contains_atomtype(const Handle &clause, Type atom_type)
std::set< Handle > varset
static bool is_atom_in_tree(const Handle &tree, const Handle &atom)
static bool any_atom_in_tree(const Handle &tree, const std::set< Handle > &atoms)
FindAtoms(Type ta, Type tb, bool subclass=false)
static bool is_quoted_in_tree(const Handle &tree, const Handle &atom)
std::set< Handle > holders
static unsigned int num_unquoted_in_tree(const Handle &tree, const std::set< Handle > &atoms)
std::set< Type > _target_types
unsigned long getChildrenRecursive(Type type, OutputIterator result)
static bool any_unquoted_in_tree(const Handle &tree, const std::set< Handle > &atoms)
std::shared_ptr< Link > LinkPtr
ClassServer & classserver(ClassServerFactory *=ClassServer::createInstance)
void search_set(const std::vector< Handle > &hlist)
std::set< Handle > _target_atoms
static const Handle UNDEFINED
std::set< Handle > least_holders
FindAtoms(const std::set< Handle > &selection)
static LinkPtr LinkCast(const Handle &h)
static bool is_unquoted_in_any_tree(const std::vector< Handle > &trees, const Handle &atom)
Loco find_rec(const Handle &h)
unsigned short Type
type of Atoms, represented as short integer (16 bits)
FindAtoms(Type t, bool subclass=false)
void search_set(const Handle &h)
static bool is_unquoted_in_tree(const Handle &tree, const Handle &atom)
static bool is_atom_in_any_tree(const std::vector< Handle > &trees, const Handle &atom)