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

#include <ForwardChainerPMCB.h>

+ Inheritance diagram for opencog::ForwardChainerPMCB:
+ Collaboration diagram for opencog::ForwardChainerPMCB:

Public Member Functions

 ForwardChainerPMCB (AtomSpace *as)
 
virtual ~ForwardChainerPMCB ()
 
virtual void set_pattern (const Variables &vars, const Pattern &pat)
 
HandleSeq get_products (void)
 
void set_fcmem (FCMemory *fcmem)
 
virtual bool node_match (const Handle &node1, const Handle &node2)
 
virtual bool link_match (const LinkPtr &lpat, const LinkPtr &lsoln)
 
virtual bool grounding (const std::map< Handle, Handle > &var_soln, const std::map< Handle, Handle > &pred_soln)
 
- Public Member Functions inherited from opencog::Implicator
 Implicator (AtomSpace *as)
 
virtual void insert_result (const Handle &)
 
virtual UnorderedHandleSet get_result_set ()
 
virtual HandleSeq get_result_list ()
 
- Public Member Functions inherited from opencog::PatternMatchCallback
virtual ~PatternMatchCallback ()
 
virtual bool fuzzy_match (const Handle &ph, const Handle &gh)
 
virtual IncomingSet get_incoming_set (const Handle &h)
 
virtual void push (void)
 
virtual void pop (void)
 
- Public Member Functions inherited from opencog::InitiateSearchCB
 InitiateSearchCB (AtomSpace *)
 
virtual bool initiate_search (PatternMatchEngine *)
 
- Public Member Functions inherited from opencog::DefaultPatternMatchCB
 DefaultPatternMatchCB (AtomSpace *)
 
virtual bool variable_match (const Handle &, const Handle &)
 
virtual bool post_link_match (const LinkPtr &, const LinkPtr &)
 
virtual bool clause_match (const Handle &, const Handle &)
 
virtual bool optional_clause_match (const Handle &pattrn, const Handle &grnd)
 
virtual bool evaluate_sentence (const Handle &pat, const std::map< Handle, Handle > &gnds)
 
virtual const std::set< Type > & get_connectives (void)
 
bool optionals_present (void)
 

Private Attributes

AtomSpace_as
 
FCMemory_fcmem
 

Additional Inherited Members

- Public Attributes inherited from opencog::Implicator
Instantiator inst
 
Handle implicand
 
size_t max_results
 
- Protected Member Functions inherited from opencog::InitiateSearchCB
virtual Handle find_starter (const Handle &, size_t &, Handle &, size_t &)
 
virtual Handle find_thinnest (const HandleSeq &, const std::set< Handle > &, Handle &, size_t &)
 
virtual void find_rarest (const Handle &, Handle &, size_t &)
 
virtual bool neighbor_search (PatternMatchEngine *)
 
virtual bool link_type_search (PatternMatchEngine *)
 
virtual bool variable_search (PatternMatchEngine *)
 
virtual bool no_search (PatternMatchEngine *)
 
- Protected Member Functions inherited from opencog::DefaultPatternMatchCB
bool eval_term (const Handle &pat, const std::map< Handle, Handle > &gnds)
 
bool eval_sentence (const Handle &pat, const std::map< Handle, Handle > &gnds)
 
- Protected Attributes inherited from opencog::Implicator
UnorderedHandleSet _result_set
 
HandleSeq _result_list
 
bool _result_changed
 
- Protected Attributes inherited from opencog::InitiateSearchCB
ClassServer_classserver
 
const Variables_variables
 
const Pattern_pattern
 
const VariableTypeMap_type_restrictions
 
const std::set< Handle > * _dynamic
 
Handle _root
 
Handle _starter_term
 
bool _search_fail
 
AtomSpace_as
 
- Protected Attributes inherited from opencog::DefaultPatternMatchCB
ClassServer_classserver
 
const VariableTypeMap_type_restrictions = NULL
 
const std::set< Handle > * _dynamic = NULL
 
bool _have_evaluatables = false
 
AtomSpace _temp_aspace
 
Instantiator _instor
 
std::set< Type_connectives
 
bool _optionals_present = false
 
AtomSpace_as
 

Detailed Description

Definition at line 36 of file ForwardChainerPMCB.h.

Constructor & Destructor Documentation

ForwardChainerPMCB::ForwardChainerPMCB ( AtomSpace as)

Definition at line 30 of file ForwardChainerPMCB.cc.

References _fcmem.

ForwardChainerPMCB::~ForwardChainerPMCB ( )
virtual

Definition at line 37 of file ForwardChainerPMCB.cc.

Member Function Documentation

HandleSeq ForwardChainerPMCB::get_products ( void  )

Definition at line 83 of file ForwardChainerPMCB.cc.

References opencog::Implicator::_result_list, opencog::Implicator::_result_set, and opencog::Implicator::get_result_list().

+ Here is the caller graph for this function:

bool ForwardChainerPMCB::grounding ( const std::map< Handle, Handle > &  var_soln,
const std::map< Handle, Handle > &  pred_soln 
)
virtual

A callback handler of the Pattern matcher used to store references to new conclusion the source list

Reimplemented from opencog::Implicator.

Definition at line 63 of file ForwardChainerPMCB.cc.

References _fcmem, opencog::FCMemory::get_cur_source(), opencog::Implicator::implicand, opencog::Implicator::insert_result(), opencog::Implicator::inst, and opencog::Instantiator::instantiate().

bool ForwardChainerPMCB::link_match ( const LinkPtr lpat,
const LinkPtr lsoln 
)
virtual

Called when a link in the template pattern needs to be compared to a possibly matching link in the atomspace. The first argument is a link from the pattern, and the second is a possible solution link from the atomspace. Return true if the links should be compared, else return false.

By default, the search continues if the link arity and the link types match.

Reimplemented from opencog::DefaultPatternMatchCB.

Definition at line 52 of file ForwardChainerPMCB.cc.

References opencog::DefaultPatternMatchCB::link_match().

bool ForwardChainerPMCB::node_match ( const Handle npat_h,
const Handle nsoln_h 
)
virtual

Called when a node in the template pattern needs to be compared to a possibly matching node in the atomspace. The first argument is a node from the pattern, and the second is a possible solution (grounding) node from the atomspace.

Return true if the nodes match, else return false. By default, the nodes must be identical.

Reimplemented from opencog::DefaultPatternMatchCB.

Definition at line 41 of file ForwardChainerPMCB.cc.

References opencog::DefaultPatternMatchCB::node_match().

void ForwardChainerPMCB::set_fcmem ( FCMemory fcmem)

Definition at line 78 of file ForwardChainerPMCB.cc.

References _fcmem.

+ Here is the caller graph for this function:

virtual void opencog::ForwardChainerPMCB::set_pattern ( const Variables vars,
const Pattern pat 
)
inlinevirtual

Called before search initiation, to indicate the pattern that will be searched for, and the variables to be grounded during the search.

Reimplemented from opencog::DefaultPatternMatchCB.

Definition at line 47 of file ForwardChainerPMCB.h.

References opencog::InitiateSearchCB::set_pattern(), and opencog::DefaultPatternMatchCB::set_pattern().

Member Data Documentation

AtomSpace* opencog::ForwardChainerPMCB::_as
private

Definition at line 41 of file ForwardChainerPMCB.h.

FCMemory* opencog::ForwardChainerPMCB::_fcmem
private

Definition at line 42 of file ForwardChainerPMCB.h.


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