OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Instantiator.h
Go to the documentation of this file.
1 /*
2  * Instantiator.h
3  *
4  * Copyright (C) 2009, 2014 Linas Vepstas
5  *
6  * Author: Linas Vepstas <linasvepstas@gmail.com> January 2009
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 _OPENCOG_INSTANTIATOR_H
25 #define _OPENCOG_INSTANTIATOR_H
26 
28 
40 namespace opencog {
41 
43 {
44 private:
46  const std::map<Handle, Handle> *_vmap;
47  bool _halt = false;
48 
64  Handle walk_tree(const Handle& tree);
65 
66  public:
67  Instantiator(AtomSpace* as) : _as(as) {}
68 
69  Handle instantiate(const Handle& expr, const std::map<Handle, Handle> &vars);
70  Handle execute(const Handle& expr)
71  {
72  return instantiate(expr, std::map<Handle, Handle>());
73  }
74 };
75 
76 } // namespace opencog
77 
78 #endif // _OPENCOG_INSTANTIATOR_H
79 
const std::map< Handle, Handle > * _vmap
Definition: Instantiator.h:46
Instantiator(AtomSpace *as)
Definition: Instantiator.h:67
Handle instantiate(const Handle &expr, const std::map< Handle, Handle > &vars)
Handle execute(const Handle &expr)
Definition: Instantiator.h:70
Handle walk_tree(const Handle &tree)
Definition: Instantiator.cc:33