OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ForwardChainer.h
Go to the documentation of this file.
1 /*
2  * ForwardChainer.h
3  *
4  * Copyright (C) 2014,2015 Misgana Bayetta
5  *
6  * Author: Misgana Bayetta <misgana.bayetta@gmail.com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Affero General Public License v3 as
10  * published by the Free Software Foundation and including the exceptions
11  * at http://opencog.org/wiki/Licenses
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU Affero General Public License
19  * along with this program; if not, write to:
20  * Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23 
24 #ifndef FORWARDCHAINERX_H_
25 #define FORWARDCHAINERX_H_
26 
27 #include <opencog/util/Logger.h>
30 #include "FCMemory.h"
31 
32 class ForwardChainerUTest;
33 
34 namespace opencog
35 {
36 
39 private:
40  friend class ::ForwardChainerUTest;
41 
43  URECommons _rec; // utility class
44  Handle _rbs; // rule-based system
45 
47 
48 
49  FCMemory _fcmem; // stores history
50  Logger * _log;
51  int _iteration = 0;
52 
56  void init();
57  void add_to_source_list(Handle h);
58 
59  void do_pm();
60  void do_pm(const Handle& hsource, const UnorderedHandleSet& var_nodes,
62 protected:
65  };
66 public:
71  void do_chain(ForwardChainerCallBack& fcb, Handle hsource =
75 
76  void setLogger(Logger* log);
77  Logger* getLogger(void);
78 };
79 
80 } // ~namespace opencog
81 
82 #endif /* FORWARDCHAINERX_H_ */
void add_to_source_list(Handle h)
ForwardChainer(AtomSpace &as, Handle rbs)
std::vector< Handle > HandleSeq
a list of handles
Definition: Handle.h:246
UREConfigReader _configReader
static const Handle UNDEFINED
Definition: Handle.h:77
void setLogger(Logger *log)
Logger * getLogger(void)
std::unordered_set< Handle, handle_hash > UnorderedHandleSet
a hash that associates the handle to its unique identificator
Definition: Handle.h:250
HandleSeq get_chaining_result(void)
void do_step(ForwardChainerCallBack &fcb)
void do_chain(ForwardChainerCallBack &fcb, Handle hsource=Handle::UNDEFINED)