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

#include <LambdaLink.h>

+ Inheritance diagram for opencog::LambdaLink:
+ Collaboration diagram for opencog::LambdaLink:

Public Member Functions

 LambdaLink (const HandleSeq &, TruthValuePtr tv=TruthValue::DEFAULT_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
 
 LambdaLink (const Handle &varcdecls, const Handle &body, TruthValuePtr tv=TruthValue::DEFAULT_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
 
 LambdaLink (Link &l)
 
Handle substitute (const HandleSeq &vals) const
 
- Public Member Functions inherited from opencog::VariableList
 VariableList (const HandleSeq &vardecls, TruthValuePtr tv=TruthValue::DEFAULT_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
 
 VariableList (Link &)
 
const Variablesget_variables (void) const
 
bool is_type (const Handle &) const
 
bool is_type (const HandleSeq &) const
 
Handle substitute (const Handle &tree, const HandleSeq &vals) const
 
- Public Member Functions inherited from opencog::Atom
virtual ~Atom ()
 
Type getType () const
 
bool isType (Type t, bool subclass) const
 
Handle getHandle ()
 
AttentionValuePtr getAttentionValue ()
 
void setAttentionValue (AttentionValuePtr)
 Sets the AttentionValue object of the atom. More...
 
AttentionValue::sti_t getSTI ()
 Handy-dandy convenience getters for attention values. More...
 
AttentionValue::lti_t getLTI ()
 
AttentionValue::vlti_t getVLTI ()
 
void setSTI (AttentionValue::sti_t stiValue)
 
void setLTI (AttentionValue::lti_t ltiValue)
 
void incVLTI ()
 
void decVLTI ()
 
TruthValuePtr getTruthValue ()
 
void setTruthValue (TruthValuePtr)
 Sets the TruthValue object of the atom. More...
 
void merge (TruthValuePtr)
 
Handle tvmerge (TruthValuePtr tv)
 
size_t getIncomingSetSize ()
 Get the size of the incoming set. More...
 
IncomingSet getIncomingSet ()
 
template<typename OutputIterator >
OutputIterator getIncomingSet (OutputIterator result)
 
template<class T >
bool foreach_incoming (bool(T::*cb)(const Handle &), T *data)
 
template<typename OutputIterator >
OutputIterator getIncomingSetByType (OutputIterator result, Type type, bool subclass=false)
 
IncomingSet getIncomingSetByType (Type type, bool subclass=false)
 

Protected Member Functions

 LambdaLink (Type, const HandleSeq &, TruthValuePtr tv=TruthValue::DEFAULT_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
 
void init (const HandleSeq &)
 
- Protected Member Functions inherited from opencog::VariableList
void get_vartype (const Handle &)
 
void validate_vardecl (const Handle &)
 
void validate_vardecl (const HandleSeq &)
 
 VariableList (Type, const HandleSeq &, TruthValuePtr tv=TruthValue::DEFAULT_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
 
void build_index (void)
 
Handle substitute_nocheck (const Handle &, const HandleSeq &) const
 
- Protected Member Functions inherited from opencog::Atom
 Atom (Type t, TruthValuePtr tv=TruthValue::DEFAULT_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
 
void keep_incoming_set ()
 
void drop_incoming_set ()
 
void insert_atom (LinkPtr)
 Add an atom to the incoming set. More...
 
void remove_atom (LinkPtr)
 Remove an atom from the incoming set. More...
 

Static Protected Member Functions

static void prt (const Handle &h)
 

Protected Attributes

Handle _body
 Handle of the body of the expression. More...
 
- Protected Attributes inherited from opencog::VariableList
Variables _varlist
 Unbundled variables and types for them. More...
 
- Protected Attributes inherited from opencog::Atom
UUID _uuid
 
AtomTable_atomTable
 
Type _type
 
char _flags
 
TruthValuePtr _truthValue
 
AttentionValuePtr _attentionValue
 
std::mutex _mtx
 
InSetPtr _incoming_set
 

Additional Inherited Members

- Protected Types inherited from opencog::Atom
typedef std::shared_ptr< InSetInSetPtr
 

Detailed Description

The LambdaLink consitsts of two parts: An optional variable declaration, follwed by an expression body. If a variable declaration is present, then it must conform to current variable declaration standards: i.e. it must be either a single VariableNode, a single TypedVariableLink, or a VariableList. This is then followed by a body, of any arbitrary form. This class does little other than to check for the above-described format, and unpacke the variable decalrations, if present; it will throw an error if an ill-formed LambdaLink is inserted into the atomspace. (As usual, the point of unpacked variables is to act as a memo or cache, speeding up later calculations.)

Definition at line 47 of file LambdaLink.h.

Constructor & Destructor Documentation

LambdaLink::LambdaLink ( Type  t,
const HandleSeq oset,
TruthValuePtr  tv = TruthValue::DEFAULT_TV(),
AttentionValuePtr  av = AttentionValue::DEFAULT_AV() 
)
protected

Definition at line 58 of file LambdaLink.cc.

References init().

LambdaLink::LambdaLink ( const HandleSeq oset,
TruthValuePtr  tv = TruthValue::DEFAULT_TV(),
AttentionValuePtr  av = AttentionValue::DEFAULT_AV() 
)

Definition at line 44 of file LambdaLink.cc.

References init().

LambdaLink::LambdaLink ( const Handle varcdecls,
const Handle body,
TruthValuePtr  tv = TruthValue::DEFAULT_TV(),
AttentionValuePtr  av = AttentionValue::DEFAULT_AV() 
)

Definition at line 51 of file LambdaLink.cc.

Member Function Documentation

void LambdaLink::init ( const HandleSeq oset)
protected

Definition at line 33 of file LambdaLink.cc.

References _body, and opencog::VariableList::validate_vardecl().

+ Here is the caller graph for this function:

static void opencog::LambdaLink::prt ( const Handle h)
inlinestaticprotected

Definition at line 60 of file LambdaLink.h.

References opencog::Atom::toShortString().

Handle opencog::LambdaLink::substitute ( const HandleSeq vals) const
inline

Definition at line 78 of file LambdaLink.h.

References _body, and opencog::VariableList::substitute().

Member Data Documentation

Handle opencog::LambdaLink::_body
protected

Handle of the body of the expression.

Definition at line 51 of file LambdaLink.h.


The documentation for this class was generated from the following files: