OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
opencog Namespace Reference

Namespaces

 spatial
 

Classes

class  ExampleSCM
 
class  BindLink
 
class  DefineLink
 
class  LambdaLink
 
class  PatternLink
 
class  VariableList
 
class  FreeLink
 
class  PutLink
 
class  EvaluationLink
 
class  ExecSCM
 
class  ExecutionOutputLink
 
class  Instantiator
 
class  NumberNode
 
class  ArithmeticLink
 
class  AssignLink
 
class  InsertLink
 
class  RemoveLink
 
class  DeleteLink
 
class  FoldLink
 
class  FunctionLink
 
class  PlusLink
 
class  TimesLink
 
class  TypeNode
 
class  Atom
 
class  AtomSpace
 
class  AtomTable
 
class  AttentionBank
 
class  AttentionValue
 
class  BackingStore
 
class  ClassServer
 
class  CountTruthValue
 a TruthValue that stores a mean, a confidence and the number of observations More...
 
class  FixedIntegerIndex
 
class  FuzzyTruthValue
 a TruthValue that stores a mean and the number of observations (strength and confidence) More...
 
class  GenericTruthValue
 
class  Handle
 
class  HandlePredicate
 
class  AtomPredicate
 
class  AtomComparator
 
struct  handle_hash
 
struct  handle_less
 
struct  handle_seq_less
 
class  HandleSeqIndex
 
class  HandleSetIndex
 
class  ImportanceIndex
 
class  IncomingIndex
 
class  IndefiniteTruthValue
 
class  Link
 
class  LinkIndex
 
class  NameIndex
 
class  Node
 
class  NodeIndex
 
class  NullTruthValue
 a special type of TruthValue More...
 
class  ProbabilisticTruthValue
 a TruthValue that stores a mean, a confidence and the number of observations More...
 
class  SimpleTruthValue
 a TruthValue that stores a mean and the number of observations (strength and confidence) More...
 
class  StringIndex
 
class  TLB
 
class  TruthValue
 
class  TypeIndex
 
class  FindAtoms
 
class  FollowLink
 
class  PrivateUseOnlyChaseLink
 
class  HandleMapIterator
 
class  HandleMap
 red-black tree maps Handle keys to type T elements More...
 
class  Substitutor
 
class  AtomSpaceBenchmark
 
class  PythonThreadLocker
 
class  PythonEval
 
class  SchemeEval
 
class  FunctionWrap
 Wrapper class, to invoke misc extension code from guile. More...
 
class  ModuleWrap
 
class  PrimitiveEnviron
 
class  SchemePrimitive
 
class  SchemeSmob
 
class  PersistSCM
 
class  AtomspaceHTabler
 
class  AtomStorage
 
class  SQLBackingStore
 
class  SQLPersistSCM
 
class  ProtocolBufferSerializer
 
class  ZMQClient
 
class  ZMQServer
 
class  AttentionalFocusCB
 
class  DefaultImplicator
 
class  AFImplicator
 
class  DefaultPatternMatchCB
 
class  FuzzyPatternMatchCB
 
class  Implicator
 
class  InitiateSearchCB
 
struct  Variables
 
struct  Pattern
 
class  PatternMatch
 
class  PatternMatchCallback
 
class  PatternMatchEngine
 
class  PatternSCM
 
class  PatternTerm
 
class  Satisfier
 
class  SatisfyingSet
 
class  BackwardChainer
 
class  BackwardChainerPMCB
 
class  Target
 
class  TargetSet
 
class  UnifyPMCB
 
class  DefaultForwardChainerCB
 
struct  Inference
 
class  FCMemory
 
class  ForwardChainer
 
class  ForwardChainerCallBack
 
class  ForwardChainerPMCB
 
class  VarGroundingPMCB
 
class  InferenceSCM
 
class  Rule
 
class  URECommons
 
class  UREConfigReader
 
class  GenericEval
 

Typedefs

typedef std::shared_ptr< BindLinkBindLinkPtr
 
typedef std::shared_ptr
< DefineLink
DefineLinkPtr
 
typedef std::shared_ptr
< LambdaLink
LambdaLinkPtr
 
typedef std::shared_ptr
< PatternLink
PatternLinkPtr
 
typedef std::shared_ptr
< VariableList
VariableListPtr
 
typedef std::shared_ptr< FreeLinkFreeLinkPtr
 
typedef std::shared_ptr< PutLinkPutLinkPtr
 
typedef std::shared_ptr
< EvaluationLink
EvaluationLinkPtr
 
typedef std::shared_ptr
< ExecutionOutputLink
ExecutionOutputLinkPtr
 
typedef std::shared_ptr
< NumberNode
NumberNodePtr
 
typedef std::shared_ptr
< ArithmeticLink
ArithmeticLinkPtr
 
typedef std::shared_ptr
< AssignLink
AssignLinkPtr
 
typedef std::shared_ptr
< InsertLink
InsertLinkPtr
 
typedef std::shared_ptr
< RemoveLink
RemoveLinkPtr
 
typedef std::shared_ptr
< DeleteLink
DeleteLinkPtr
 
typedef std::shared_ptr< FoldLinkFoldLinkPtr
 
typedef std::shared_ptr
< FunctionLink
FunctionLinkPtr
 
typedef std::shared_ptr< PlusLinkPlusLinkPtr
 
typedef std::shared_ptr
< TimesLink
TimesLinkPtr
 
typedef std::shared_ptr< TypeNodeTypeNodePtr
 
typedef std::shared_ptr< LinkLinkPtr
 
typedef std::vector< LinkPtrIncomingSet
 
typedef std::weak_ptr< LinkWinkPtr
 
typedef std::set< WinkPtr,
std::owner_less< WinkPtr > > 
WincomingSet
 
typedef
boost::signals2::signal< void(AtomPtr,
LinkPtr)> 
AtomPairSignal
 
typedef std::set< AtomPtrAtomPtrSet
 
typedef
boost::signals2::signal< void(const
Handle &)> 
AtomSignal
 
typedef
boost::signals2::signal< void(const
AtomPtr &)> 
AtomPtrSignal
 
typedef
boost::signals2::signal< void(const
Handle &, const
AttentionValuePtr &, const
AttentionValuePtr &)> 
AVCHSigl
 
typedef
boost::signals2::signal< void(const
Handle &, const TruthValuePtr
&, const TruthValuePtr &)> 
TVCHSigl
 
typedef
boost::signals2::signal< void(const
Handle &, const
AttentionValuePtr &, const
AttentionValuePtr &)> 
AFCHSigl
 
typedef std::shared_ptr
< AttentionValue
AttentionValuePtr
 
typedef ClassServerClassServerFactory (void)
 
typedef
boost::signals2::signal< void(Type)> 
TypeSignal
 
typedef std::shared_ptr
< CountTruthValue
CountTruthValuePtr
 
typedef std::unordered_set
< Atom * > 
UnorderedAtomSet
 
typedef std::shared_ptr
< FuzzyTruthValue
FuzzyTruthValuePtr
 
typedef float strength_t
 
typedef float confidence_t
 
typedef double count_t
 
typedef double entropy_t
 
typedef std::shared_ptr
< GenericTruthValue
GenericTruthValuePtr
 
typedef unsigned long UUID
 UUID == Universally Unique Identifier. More...
 
typedef std::shared_ptr< AtomAtomPtr
 
typedef std::vector< HandleHandleSeq
 a list of handles More...
 
typedef std::vector< HandleSeqHandleSeqSeq
 a list of lists of handles More...
 
typedef std::unordered_set
< Handle, handle_hash
UnorderedHandleSet
 a hash that associates the handle to its unique identificator More...
 
typedef std::shared_ptr
< IndefiniteTruthValue
IndefiniteTruthValuePtr
 
typedef unsigned short Arity
 arity of Links, represented as short integer (16 bits) More...
 
typedef std::shared_ptr< NodeNodePtr
 
typedef std::shared_ptr
< ProbabilisticTruthValue
ProbabilisticTruthValuePtr
 
typedef std::shared_ptr
< SimpleTruthValue
SimpleTruthValuePtr
 
typedef std::shared_ptr
< TruthValue
TruthValuePtr
 
typedef unsigned short Type
 type of Atoms, represented as short integer (16 bits) More...
 
typedef boost::tuple< clock_t,
clock_t > 
timepair_t
 
typedef std::map< Handle,
const std::set< Type > > 
VariableTypeMap
 
typedef std::shared_ptr
< PatternTerm
PatternTermPtr
 
typedef std::vector
< PatternTermPtr
PatternTermSeq
 
typedef std::map< Handle,
UnorderedHandleSet
VarMultimap
 
typedef std::map< Handle, HandleVarMap
 

Enumerations

enum  TruthValueType {
  NULL_TRUTH_VALUE = 0, SIMPLE_TRUTH_VALUE = 1, COUNT_TRUTH_VALUE, INDEFINITE_TRUTH_VALUE,
  FUZZY_TRUTH_VALUE, PROBABILISTIC_TRUTH_VALUE, NUMBER_OF_TRUTH_VALUE_TYPES
}
 
enum  TVMergeStyle {
  USE_OLDER_TV_TYPE, USE_NEWER_TV_TYPE, USE_STRONGER_TV_TYPE, USE_WEAKER_TV_TYPE,
  DEFAULT
}
 
enum  source_selection_mode { TV_FITNESS_BASED, STI_BASED }
 

Functions

static BindLinkPtr BindLinkCast (const Handle &h)
 
static BindLinkPtr BindLinkCast (AtomPtr a)
 
static DefineLinkPtr DefineLinkCast (const Handle &h)
 
static DefineLinkPtr DefineLinkCast (AtomPtr a)
 
static LambdaLinkPtr LambdaLinkCast (const Handle &h)
 
static LambdaLinkPtr LambdaLinkCast (AtomPtr a)
 
static PatternLinkPtr PatternLinkCast (const Handle &h)
 
static PatternLinkPtr PatternLinkCast (AtomPtr a)
 
bool remove_constants (const std::set< Handle > &vars, std::vector< Handle > &clauses)
 
void get_connected_components (const std::set< Handle > &vars, const HandleSeq &clauses, std::vector< HandleSeq > &components, std::vector< std::set< Handle >> &component_vars)
 
HandleSeq get_free_vars_in_tree (const Handle &tree)
 
static VariableListPtr VariableListCast (const Handle &h)
 
static VariableListPtr VariableListCast (AtomPtr a)
 
static FreeLinkPtr FreeLinkCast (const Handle &h)
 
static FreeLinkPtr FreeLinkCast (AtomPtr a)
 
static PutLinkPtr PutLinkCast (const Handle &h)
 
static PutLinkPtr PutLinkCast (AtomPtr a)
 
static EvaluationLinkPtr EvaluationLinkCast (const Handle &h)
 
static EvaluationLinkPtr EvaluationLinkCast (AtomPtr a)
 
static ExecutionOutputLinkPtr ExecutionOutputLinkCast (const Handle &h)
 
static ExecutionOutputLinkPtr ExecutionOutputLinkCast (AtomPtr a)
 
static NumberNodePtr NumberNodeCast (const Handle &h)
 
static NumberNodePtr NumberNodeCast (AtomPtr a)
 
static ArithmeticLinkPtr ArithmeticLinkCast (const Handle &h)
 
static ArithmeticLinkPtr ArithmeticLinkCast (AtomPtr a)
 
static AssignLinkPtr AssignLinkCast (const Handle &h)
 
static AssignLinkPtr AssignLinkCast (AtomPtr a)
 
static InsertLinkPtr InsertLinkCast (const Handle &h)
 
static InsertLinkPtr InsertLinkCast (AtomPtr a)
 
static RemoveLinkPtr RemoveLinkCast (const Handle &h)
 
static RemoveLinkPtr RemoveLinkCast (AtomPtr a)
 
static DeleteLinkPtr DeleteLinkCast (const Handle &h)
 
static DeleteLinkPtr DeleteLinkCast (AtomPtr a)
 
static FoldLinkPtr FoldLinkCast (const Handle &h)
 
static FoldLinkPtr FoldLinkCast (AtomPtr a)
 
static FunctionLinkPtr FunctionLinkCast (const Handle &h)
 
static FunctionLinkPtr FunctionLinkCast (AtomPtr a)
 
static PlusLinkPtr PlusLinkCast (const Handle &h)
 
static PlusLinkPtr PlusLinkCast (AtomPtr a)
 
static TimesLinkPtr TimesLinkCast (const Handle &h)
 
static TimesLinkPtr TimesLinkCast (AtomPtr a)
 
static TypeNodePtr TypeNodeCast (const Handle &h)
 
static TypeNodePtr TypeNodeCast (AtomPtr a)
 
ClassServerclassserver (ClassServerFactory *=ClassServer::createInstance)
 
static bool operator== (std::nullptr_t, const Handle &rhs) noexcept
 
static bool operator!= (std::nullptr_t, const Handle &rhs) noexcept
 
std::size_t hash_value (Handle const &h)
 Boost needs this function to be called by exactly this name. More...
 
static std::string operator+ (const char *lhs, Handle h)
 append string representation of the Hash to the string More...
 
static std::string operator+ (const std::string &lhs, Handle h)
 append string representation of the Hash to the string More...
 
static IndefiniteTruthValuePtr IndefiniteTVCast (TruthValuePtr tv)
 
static LinkPtr LinkCast (const Handle &h)
 
static LinkPtr LinkCast (const AtomPtr &a)
 
static NodePtr NodeCast (const Handle &h)
 
static NodePtr NodeCast (const AtomPtr &a)
 
Handle add_prefixed_node (AtomSpace &as, Type t, const std::string &prefix)
 
bool remove_hypergraph (AtomSpace &as, Handle h)
 
HandleSeq get_all_nodes (Handle h)
 
UnorderedHandleSet get_all_unique_nodes (Handle h)
 
HandleSeq get_all_atoms (Handle h)
 
UnorderedHandleSet get_all_unique_atoms (Handle h)
 
HandleSeq get_neighbors (const Handle &h, bool fanin, bool fanout, Type desiredLinkType, bool subClasses)
 
UnorderedHandleSet get_outgoing_nodes (const Handle &hinput, const std::vector< Type > &types)
 
static void get_distant_neighbors_rec (const Handle &h, UnorderedHandleSet &res, int dist)
 
UnorderedHandleSet get_distant_neighbors (const Handle &h, int dist)
 
HandleSeq get_predicates (const Handle &target, Type predicateType, bool subClasses)
 
HandleSeq get_predicates_for (const Handle &target, const Handle &predicate)
 
static bool is_atom_in_tree (const Handle &tree, const Handle &atom)
 
static bool is_quoted_in_tree (const Handle &tree, const Handle &atom)
 
static bool is_unquoted_in_tree (const Handle &tree, const Handle &atom)
 
static bool any_atom_in_tree (const Handle &tree, const std::set< Handle > &atoms)
 
static bool any_unquoted_in_tree (const Handle &tree, const std::set< Handle > &atoms)
 
static unsigned int num_unquoted_in_tree (const Handle &tree, const std::set< Handle > &atoms)
 
static bool is_atom_in_any_tree (const std::vector< Handle > &trees, const Handle &atom)
 
static bool is_unquoted_in_any_tree (const std::vector< Handle > &trees, const Handle &atom)
 
static bool contains_atomtype (const Handle &clause, Type atom_type)
 
template<typename T >
bool foreach_binary_link (const Handle &h, Type ltype, bool(T::*cb)(const Handle &), T *data)
 
template<typename T >
bool foreach_binary_link (const Handle &h, Type ltype, bool(T::*cb)(const Handle &, const Handle &), T *data)
 
template<typename T >
bool foreach_reverse_binary_link (const Handle &h, Type ltype, bool(T::*cb)(const Handle &), T *data)
 
template<typename T >
bool foreach_reverse_binary_link (const Handle &h, Type ltype, bool(T::*cb)(const Handle &, const Handle &), T *data)
 
template<typename T >
bool foreach_link (const Handle &h, Type ltype, int from, int to, bool(T::*cb)(const Handle &), T *data)
 
template<typename T >
bool foreach_link (const Handle &h, Type ltype, int from, int to, bool(T::*cb)(const Handle &, const Handle &), T *data)
 
template<typename T >
bool foreach_unordered_binary_link (const Handle &h, Type ltype, bool(T::*cb)(const Handle &), T *data)
 
template<typename T >
bool foreach_unordered_binary_link (const Handle &h, Type ltype, bool(T::*cb)(const Handle &, const Handle &), T *data)
 
template<class T >
bool foreach_atom_pair (const std::vector< Handle > &va, const std::vector< Handle > &vb, bool(T::*cb)(const Handle &, const Handle &), T *data)
 
Handle stub_bindlink (AtomSpace *, Handle)
 
Handle do_execute (AtomSpace *, Handle)
 
std::string eval_scheme (AtomSpace &as, const std::string &s)
 
Handle eval_scheme_h (AtomSpace &as, const std::string &s)
 
void initialize_opencog (AtomSpace *atomSpace, const char *configFile=NULL)
 
void finalize_opencog ()
 
void configuration_load (const char *configFile)
 
void global_python_initialize ()
 
void global_python_finalize ()
 
int load_scm_file (AtomSpace &as, const std::string &filename)
 
int load_scm_file_relative (AtomSpace &as, const std::string &filename, std::vector< std::string > search_paths)
 
void load_scm_files_from_config (AtomSpace &atomSpace, std::vector< std::string > search_paths)
 
 DECLARE_DECLARE_3 (const std::string &, const std::string &, const std::string &, const std::string &) DECLARE_DECLARE_3(void
 
Handle bindlink (AtomSpace *, const Handle &)
 
Handle single_bindlink (AtomSpace *, const Handle &)
 
Handle af_bindlink (AtomSpace *, const Handle &)
 
TruthValuePtr satisfaction_link (AtomSpace *, const Handle &)
 
Handle satisfying_set (AtomSpace *, const Handle &)
 
Handle find_approximate_match (AtomSpace *, const Handle &, Type rtn_type=0, const HandleSeq &excl_list={})
 
static Handle do_imply (AtomSpace *as, const Handle &hbindlink, Implicator &impl, bool do_conn_check=false)
 

Variables

const bool NO_SUBCLASSES = false
 
tuple __path__ = extend_path(__path__, __name__)
 

Detailed Description

PatternUtils.h

Utilities for mangling graphs

Copyright (C) 2009, 2014 Linas Vepstas linas.nosp@m.veps.nosp@m.tas@g.nosp@m.mail.nosp@m..com All Rights Reserved

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3 as published by the Free Software Foundation and including the exceptions at http://opencog.org/wiki/Licenses

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program; if not, write to: Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Created by Linas Vepstas February 2008

class Instantiator – create grounded expressions from ungrounded ones. Given an ungrounded expression (i.e. an expression containing variables) and a map between variables and ground terms, it will create a new expression, with the ground terms substituted for the variables.

This also implements generic execution: any executable links are executed as the variable substitution is performed. In particular, execution is implemented as instantiation, with an empty variable map.

basic type definitions.

FindUtils.h

Utilities for finding atoms in trees.

Copyright (C) 2009, 2014, 2015 Linas Vepstas linas.nosp@m.veps.nosp@m.tas@g.nosp@m.mail.nosp@m..com All Rights Reserved

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3 as published by the Free Software Foundation and including the exceptions at http://opencog.org/wiki/Licenses

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program; if not, write to: Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Created by Linas Vepstas February 2008

FollowLink.h

Follow a link. Given an atom and a link type, follow the link and and return another atom in the link. It is assumed that there is only one link of the given type that is attached to the given atom; the methods here return the first match found. If multiple-link support is needed, use the ForeachChaseLink<T> class.

This method includes two utility routines, meant to follow binary links (i.e. links with only two members).

Copyright (c) 2008 Linas Vepstas linas.nosp@m.@lin.nosp@m.as.or.nosp@m.g

ForeachChaseLink.h

This file implements a number of link-chasing routines. By "link-chasing", it is meant: given an input atom, find all links of some given link-type that contain it, and then, call a callback on each of the other elements in that link.

Thus, for example, given the hypergraph

SomeLink FirstAtom SecondAtom

then, given a handle to "FirstAtom", and the link type "SomeLink", the "foreach_binary_link" will call the callback on "SecondAtom".

The link-chasing is order dependent; if, instead, one has "SecondAtom" and one wants "FirstAtom", then use the "foreach_reverse_binary_link" routine.

The "foreach_unordered_binary_link" is not order-dependent; given either atom in the link, it will return the other.

The "foreach_link" routine provides the analogous service for N-ary links.

To summarize: foreach_binary_link – follow an ordered, binary link. foreach_reverse_binary_link - follow binary link in reverse. foreach_link – follow an ordered N-ary link. foreach_unordered_binary_link - chase link from one to other atom.

Copyright (c) 2008 Linas Vepstas linas.nosp@m.@lin.nosp@m.as.or.nosp@m.g

ForeachZip.h

Basic pattern-matching iterator constructs.

Copyright (c) 2008,2011 Linas Vepstas linas.nosp@m.@lin.nosp@m.as.or.nosp@m.g

The GenericEval class implements a very simple API for language evaluators. Currently, its sole purpose in life is to make the abstraction of the GenericShell class possible.

Typedef Documentation

typedef std::shared_ptr<Atom> opencog::AtomPtr

Definition at line 48 of file Handle.h.

typedef float opencog::confidence_t

Definition at line 36 of file GenericTruthValue.h.

typedef double opencog::count_t

Definition at line 37 of file GenericTruthValue.h.

typedef double opencog::entropy_t

Definition at line 38 of file GenericTruthValue.h.

Definition at line 40 of file GenericTruthValue.h.

typedef std::vector<Handle> opencog::HandleSeq

a list of handles

Definition at line 246 of file Handle.h.

typedef std::vector<HandleSeq> opencog::HandleSeqSeq

a list of lists of handles

Definition at line 248 of file Handle.h.

typedef std::shared_ptr<PatternTerm> opencog::PatternTermPtr

Definition at line 35 of file PatternTerm.h.

Definition at line 37 of file PatternTerm.h.

typedef float opencog::strength_t

Definition at line 35 of file GenericTruthValue.h.

typedef boost::tuple<clock_t,clock_t> opencog::timepair_t

Definition at line 19 of file AtomSpaceBenchmark.h.

typedef std::shared_ptr<TruthValue> opencog::TruthValuePtr

Definition at line 85 of file TruthValue.h.

typedef std::unordered_set<Handle, handle_hash> opencog::UnorderedHandleSet

a hash that associates the handle to its unique identificator

Definition at line 250 of file Handle.h.

typedef unsigned long opencog::UUID

UUID == Universally Unique Identifier.

Definition at line 46 of file Handle.h.

typedef std::map< Handle, Handle > opencog::VarMap

Definition at line 39 of file BackwardChainer.h.

Definition at line 38 of file BackwardChainer.h.

Enumeration Type Documentation

Enumerator
TV_FITNESS_BASED 
STI_BASED 

Definition at line 32 of file ForwardChainerCallBack.h.

TruthValue types XXX TODO This should probably be removed. The truth-value types are currently used in only two places; The guile interpreter, and the SQL peristance layer. Both of these layers should almost surely use their own private system for serializing/deserializing truth value types, instead of using this. This is unstable, and should be removed ...

Enumerator
NULL_TRUTH_VALUE 
SIMPLE_TRUTH_VALUE 
COUNT_TRUTH_VALUE 
INDEFINITE_TRUTH_VALUE 
FUZZY_TRUTH_VALUE 
PROBABILISTIC_TRUTH_VALUE 
NUMBER_OF_TRUTH_VALUE_TYPES 

Definition at line 63 of file TruthValue.h.

Enumerator
USE_OLDER_TV_TYPE 
USE_NEWER_TV_TYPE 
USE_STRONGER_TV_TYPE 
USE_WEAKER_TV_TYPE 
DEFAULT 

Definition at line 76 of file TruthValue.h.

Function Documentation

Handle opencog::af_bindlink ( AtomSpace as,
const Handle hbindlink 
)

Attentional Focus specific PatternMatchCallback implementation

Definition at line 182 of file Implicator.cc.

References do_imply().

+ Here is the caller graph for this function:

static bool opencog::any_atom_in_tree ( const Handle &  tree,
const std::set< Handle > &  atoms 
)
inlinestatic

Return true if any of the indicated atoms occur somewhere in the tree (that is, in the tree spanned by the outgoing set.)

Definition at line 252 of file FindUtils.h.

References is_atom_in_tree().

static bool opencog::any_unquoted_in_tree ( const Handle &  tree,
const std::set< Handle > &  atoms 
)
inlinestatic

Return true if any of the indicated atoms occur somewhere in the tree (that is, in the tree spanned by the outgoing set.) But ONLY if they are not quoted! This is intended to be used to search for variables; but when a variable is quoted, it is no longer a variable.

Definition at line 269 of file FindUtils.h.

References is_unquoted_in_tree().

+ Here is the caller graph for this function:

Handle opencog::bindlink ( AtomSpace as,
const Handle hbindlink 
)

Evaluate a pattern and rewrite rule embedded in a BindLink

Use the default implicator to find pattern-matches. Associated truth values are completely ignored during pattern matching; if a set of atoms that could be a ground are found in the atomspace, then they will be reported.

See the do_bindlink function documentation for details.

Definition at line 156 of file Implicator.cc.

References do_imply().

+ Here is the caller graph for this function:

void opencog::configuration_load ( const char *  configFile)

Definition at line 64 of file Utilities.cc.

static bool opencog::contains_atomtype ( const Handle &  clause,
Type  atom_type 
)
inlinestatic

Returns true if the clause contains an atom of type atom_type. ... but only if it is not quoted. Quoted terms are constants (literals).

Definition at line 329 of file FindUtils.h.

References classserver(), opencog::Atom::getType(), and LinkCast().

+ Here is the caller graph for this function:

Handle opencog::do_execute ( AtomSpace atomspace,
Handle  handle 
)
static Handle opencog::do_imply ( AtomSpace as,
const Handle hbindlink,
Implicator impl,
bool  do_conn_check = false 
)
static

Simplified utility

The do_conn_check flag stands for "do connectivity check"; if the flag is set, and the pattern is disconnected, then an error will be thrown. The URE explicitly allows disconnected graphs.

Set the default to always allow disconnected graphs. This will get naive users into trouble, but there are legit uses, not just in the URE, for doing disconnected searches.

Definition at line 99 of file Implicator.cc.

References opencog::AtomSpace::add_link(), BindLinkCast(), createBindLink, opencog::Implicator::get_result_list(), opencog::Implicator::implicand, opencog::Implicator::insert_result(), opencog::Implicator::inst, opencog::Instantiator::instantiate(), LinkCast(), opencog::Pattern::mandatory, opencog::Pattern::optionals, and opencog::DefaultPatternMatchCB::optionals_present().

+ Here is the caller graph for this function:

std::string opencog::eval_scheme ( AtomSpace as,
const std::string &  s 
)

For easier wrapping by Cython

Definition at line 48 of file PyScheme.cc.

References check_err(), opencog::SchemeEval::eval(), and opencog::SchemeEval::get_evaluator().

Handle opencog::eval_scheme_h ( AtomSpace as,
const std::string &  s 
)
void opencog::finalize_opencog ( )
Handle opencog::find_approximate_match ( AtomSpace as,
const Handle hp,
Type  rtn_type = 0,
const HandleSeq excl_list = {} 
)

Implement the "cog-fuzzy-match" scheme primitive. It uses the Pattern Matcher to find hypergraphs in the atomspace that are similar to the query hypergraph, and returns the most similar ones.

Parameters
asThe atomspace that we are using
hpThe query hypergraph
rtn_typeThe type of atoms that we want
excl_listA list of atoms that we don't want any of them to exist in the results
Returns
One or more similar hypergraphs

Definition at line 45 of file FuzzyPatternMatch.cc.

References opencog::AtomSpace::add_link(), createPatternLink, opencog::FuzzyPatternMatchCB::solns, opencog::Atom::toShortString(), and opencog::Handle::UNDEFINED.

+ Here is the caller graph for this function:

void opencog::get_connected_components ( const std::set< Handle > &  vars,
const HandleSeq clauses,
std::vector< HandleSeq > &  components,
std::vector< std::set< Handle >> &  component_vars 
)

Given an input set of clauses, partition this set into its connected components, returning a list of the connected components, and a matching list of the variables that appear in each component. The input set of clauses are assumed to be in conjunctive normal form; i.e. they do NOT contain any OrLinks. If they do, then you must used the get_disjoined_components() function, below.

Two clauses are "connected" if they both contain a common variable. A connected component is the set of all clauses that are connected to one-another, in some way.

This method serves two different purposes. First, if the pattern does not contain any "virtual" links, then the pattern matcher works correctly only if there is one single, connected component (this is by design, since we don't want to deal with the combinatoric explosion of grounding multuple distinct components). If the pattern does contain "virtual" links, then the connected components should be grounded first, and the results then combined by exploring the combinatoric possibilites presented by the virtual link(s).

A side effect of the algorithm is that it sorts the clauses into connected order. That is, given the vector of connected clauses, each element in the vector is connected to some clause that came before it (in the vector). This is handy, because it guarantees that the next clause must be connected to the previous ones. This speeds up the discovery of the next ungrounded clause: it is trivially just the very next clause in the connected set. Of course, users will typically never specify clauses in such order.

Definition at line 109 of file PatternUtils.cc.

References any_unquoted_in_tree(), opencog::FindAtoms::search_set(), and opencog::FindAtoms::varset.

+ Here is the caller graph for this function:

static void opencog::get_distant_neighbors_rec ( const Handle &  h,
UnorderedHandleSet &  res,
int  dist 
)
static

Definition at line 191 of file AtomUtils.cc.

References opencog::Atom::getHandle(), opencog::Atom::getIncomingSet(), and LinkCast().

+ Here is the caller graph for this function:

HandleSeq opencog::get_free_vars_in_tree ( const Handle tree)

Search for free VariableNode in a tree.

Currently assume any variables within a LambdaLink (and its subtype) are bound, since some subtype does implicit binding.

Treat $A in something like (AndLink $A (LambdaLink $A ...)) as free.

XXX TODO when implicit binding is gone, this method should be changed

Definition at line 186 of file PatternUtils.cc.

References classserver(), LinkCast(), and python.undocumented.blocksworld::t.

+ Here is the caller graph for this function:

void opencog::global_python_finalize ( )

Finalize Python. Call to cleanup memory used by Python interpreters.

Definition at line 329 of file PythonEval.cc.

References already_initialized, and initialized_outside_opencog.

+ Here is the caller graph for this function:

void opencog::global_python_initialize ( )

Initialize Python. Must be called before any Python dependent modules are loaded.

Definition at line 263 of file PythonEval.cc.

References already_initialized, get_module_paths(), initialized_outside_opencog, NO_SIGNAL_HANDLERS, and try_to_load_modules().

+ Here is the caller graph for this function:

std::size_t opencog::hash_value ( Handle const &  h)
inline

Boost needs this function to be called by exactly this name.

Definition at line 230 of file Handle.h.

References opencog::Handle::value().

void opencog::initialize_opencog ( AtomSpace atomSpace,
const char *  configFile = NULL 
)
static bool opencog::is_atom_in_any_tree ( const std::vector< Handle > &  trees,
const Handle &  atom 
)
inlinestatic

Return true if the indicated atom occurs somewhere in any of the trees.

Definition at line 300 of file FindUtils.h.

References is_atom_in_tree().

static bool opencog::is_atom_in_tree ( const Handle &  tree,
const Handle &  atom 
)
inlinestatic

Return true if the indicated atom occurs somewhere in the tree (viz, the tree recursively spanned by the outgoing set of the handle)

Definition at line 186 of file FindUtils.h.

References LinkCast(), and opencog::Handle::UNDEFINED.

+ Here is the caller graph for this function:

static bool opencog::is_quoted_in_tree ( const Handle &  tree,
const Handle &  atom 
)
inlinestatic

Return true if the indicated atom occurs quoted somewhere in the tree. That is, it returns true only if the atom is inside a QuoteLink.

Definition at line 205 of file FindUtils.h.

References opencog::Atom::getType(), is_atom_in_tree(), LinkCast(), and opencog::Handle::UNDEFINED.

+ Here is the caller graph for this function:

static bool opencog::is_unquoted_in_any_tree ( const std::vector< Handle > &  trees,
const Handle &  atom 
)
inlinestatic

Return true if the indicated atom occurs somewhere in any of the trees, but only if it is not quoted. This is intended to be used to search for variables, which cease to be variable when they are quoted.

Definition at line 315 of file FindUtils.h.

References is_unquoted_in_tree().

+ Here is the caller graph for this function:

static bool opencog::is_unquoted_in_tree ( const Handle &  tree,
const Handle &  atom 
)
inlinestatic

Return true if the indicated atom occurs unquoted somewhere in the tree (viz, the tree recursively spanned by the outgoing set of the handle) but ONLY if it is not quoted! This is meant to be be used to search for variables, but only those variables that have not been quoted, as the quoted variables are constants (literals).

Definition at line 232 of file FindUtils.h.

References opencog::Atom::getType(), LinkCast(), and opencog::Handle::UNDEFINED.

+ Here is the caller graph for this function:

static unsigned int opencog::num_unquoted_in_tree ( const Handle &  tree,
const std::set< Handle > &  atoms 
)
inlinestatic

Return how many of the indicated atoms occur somewhere in the tree (that is, in the tree spanned by the outgoing set.) But ONLY if they are not quoted! This is intended to be used to search for variables; but when a variable is quoted, it is no longer a variable.

Definition at line 286 of file FindUtils.h.

References is_unquoted_in_tree().

+ Here is the caller graph for this function:

static bool opencog::operator!= ( std::nullptr_t  ,
const Handle &  rhs 
)
inlinestaticnoexcept

Definition at line 198 of file Handle.h.

static std::string opencog::operator+ ( const char *  lhs,
Handle  h 
)
inlinestatic

append string representation of the Hash to the string

Definition at line 269 of file Handle.h.

References opencog::Handle::value().

static std::string opencog::operator+ ( const std::string &  lhs,
Handle  h 
)
inlinestatic

append string representation of the Hash to the string

Definition at line 278 of file Handle.h.

References opencog::Handle::value().

static bool opencog::operator== ( std::nullptr_t  ,
const Handle &  rhs 
)
inlinestaticnoexcept

Definition at line 195 of file Handle.h.

bool opencog::remove_constants ( const std::set< Handle > &  vars,
std::vector< Handle > &  clauses 
)

Remove constant clauses from the list of clauses.

Make sure that every clause contains at least one variable; if not, remove the clause from the list of clauses.

The core idea is that pattern matching against a constant expression "doesn't make sense" – the constant expression will always match to itself and is thus "trivial". In principle, the programmer should never include constants in the list of clauses ... but, due to programmer error, this can happen, and will lead to failures during pattern matching. Thus, the routine below can be used to validate the input.

Terms that contain GroundedSchema or GroundedPrecdicate nodes can have side-effects, and are thus not really constants. They must be evaluated during the pattern search.

Returns true if the list of clauses was modified, else returns false.

Definition at line 51 of file PatternUtils.cc.

References any_unquoted_in_tree(), and contains_atomtype().

+ Here is the caller graph for this function:

TruthValuePtr opencog::satisfaction_link ( AtomSpace as,
const Handle hlink 
)

Definition at line 67 of file Satisfier.cc.

References opencog::Satisfier::_result, classserver(), createPatternLink, opencog::Atom::getType(), LinkCast(), and PatternLinkCast().

+ Here is the caller graph for this function:

Handle opencog::satisfying_set ( AtomSpace as,
const Handle hlink 
)
Handle opencog::single_bindlink ( AtomSpace as,
const Handle hbindlink 
)

Evaluate an pattern and rewrite rule embedded in a BindLink

Returns the first match only. Otherwise, the behavior is identical to PatternMatch::bindlink above.

See the do_bindlink function documentation for details.

Definition at line 171 of file Implicator.cc.

References do_imply(), and opencog::Implicator::max_results.

+ Here is the caller graph for this function:

Handle opencog::stub_bindlink ( AtomSpace atomspace,
Handle  handle 
)

Definition at line 11 of file BindlinkStub.cc.

+ Here is the caller graph for this function:

Variable Documentation

tuple opencog.__path__ = extend_path(__path__, __name__)

Definition at line 2 of file __init__.py.