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

#include <UnifyPMCB.h>

+ Inheritance diagram for opencog::UnifyPMCB:
+ Collaboration diagram for opencog::UnifyPMCB:

Public Member Functions

 UnifyPMCB (AtomSpace *, VariableListPtr, VariableListPtr)
 
virtual ~UnifyPMCB ()
 
virtual bool variable_match (const Handle &, const Handle &)
 
virtual bool grounding (const std::map< Handle, Handle > &var_soln, const std::map< Handle, Handle > &pred_soln)
 
- Public Member Functions inherited from opencog::BackwardChainerPMCB
 BackwardChainerPMCB (AtomSpace *, VariableListPtr)
 
virtual ~BackwardChainerPMCB ()
 
virtual void set_pattern (const Variables &vars, const Pattern &pat)
 
std::vector< std::map< Handle,
Handle > > 
get_var_list ()
 
std::vector< std::map< Handle,
Handle > > 
get_pred_list ()
 
- Public Member Functions inherited from opencog::InitiateSearchCB
 InitiateSearchCB (AtomSpace *)
 
virtual bool initiate_search (PatternMatchEngine *)
 
- 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::DefaultPatternMatchCB
 DefaultPatternMatchCB (AtomSpace *)
 
virtual bool node_match (const Handle &, const Handle &)
 
virtual bool link_match (const LinkPtr &, const LinkPtr &)
 
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

VariableListPtr _ext_vars
 

Additional Inherited Members

- 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::BackwardChainerPMCB
AtomSpace_as
 
VariableListPtr _int_vars
 
std::vector< std::map< Handle,
Handle > > 
var_solns_
 
std::vector< std::map< Handle,
Handle > > 
pred_solns_
 
- 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 32 of file UnifyPMCB.h.

Constructor & Destructor Documentation

UnifyPMCB::UnifyPMCB ( AtomSpace as,
VariableListPtr  int_vars,
VariableListPtr  ext_vars 
)

Constructor for the Unify PMCB.

Parameters
asthe AtomSpace pointer
ext_varsa VariableList of external variables that typed variables can map to

Definition at line 34 of file UnifyPMCB.cc.

UnifyPMCB::~UnifyPMCB ( )
virtual

Definition at line 40 of file UnifyPMCB.cc.

Member Function Documentation

bool UnifyPMCB::grounding ( const std::map< Handle, Handle > &  var_soln,
const std::map< Handle, Handle > &  term_soln 
)
virtual

Called when a complete grounding for all clauses is found. Should return false to search for more solutions; or return true to terminate search. (Just as in all the other callbacks, a return value of true means that the proposed grounding is acceptable. The engine is designed to halt once an acceptable solution has been found; thus, in order to force it to search for more, a return value of false is needed.)

Note that the callback may be called many times reporting the same result.

Reimplemented from opencog::BackwardChainerPMCB.

Definition at line 69 of file UnifyPMCB.cc.

References opencog::BackwardChainerPMCB::_int_vars, opencog::DefaultPatternMatchCB::_type_restrictions, opencog::BackwardChainerPMCB::pred_solns_, and opencog::BackwardChainerPMCB::var_solns_.

bool UnifyPMCB::variable_match ( const Handle npat_h,
const Handle nsoln_h 
)
virtual

Called when a variable in the template pattern needs to be compared to a possible grounding node in the atomspace. The first argument is a variable from the pattern, and the second is a possible grounding node from the atomspace. Return true if the nodes match, else return false.

Reimplemented from opencog::DefaultPatternMatchCB.

Definition at line 45 of file UnifyPMCB.cc.

References _ext_vars, opencog::BackwardChainerPMCB::_int_vars, opencog::Atom::getType(), and opencog::DefaultPatternMatchCB::variable_match().

Member Data Documentation

VariableListPtr opencog::UnifyPMCB::_ext_vars
private

Definition at line 43 of file UnifyPMCB.h.


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