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

#include <Pattern.h>

Public Attributes

HandleSeq varseq
 
std::set< Handlevarset
 
VariableTypeMap typemap
 
std::map< Handle, unsigned int > index
 

Detailed Description

The Variables struct defines a list of variables in a way that makes it easier and faster to work with in C++. It implements the data that is shared between the VariableList link atom and the pattern matcher.

Definition at line 50 of file Pattern.h.

Member Data Documentation

std::map<Handle, unsigned int> opencog::Variables::index

Definition at line 67 of file Pattern.h.

VariableTypeMap opencog::Variables::typemap

Definition at line 66 of file Pattern.h.

HandleSeq opencog::Variables::varseq

Unbundled variables and types for them. _typemap is the (possibly empty) list of restrictions on the variable types. The _varset contains exactly the same atoms as the _varseq; it is used for fast lookup; (i.e. is some some variable a part of this set?) whereas the _varseq list preserves the original order of the variables. Yes, the fast lookup really is needed!

The _index is a reversed index into _varseq: given a variable, it returns the ordinal of that variable in the _varseq. It is used to implement the variable substitution (aka beta-reducation aka "PutLink") method.

Definition at line 64 of file Pattern.h.

std::set<Handle> opencog::Variables::varset

Definition at line 65 of file Pattern.h.


The documentation for this struct was generated from the following file: