![]() |
Connect++ 0.4.0
A fast, readable connection prover for first-order logic.
|
General representation of a substitution. More...
#include <Substitution.hpp>
Public Member Functions | |
Substitution () | |
Trivial constructor. | |
size_t | size () const |
Trivial get method. | |
void | push_back (Variable *, Term *) |
Add a pair to a substitution. | |
void | clear () |
Clear a substitution. | |
void | apply () const |
Apply a substitution everywhere. | |
void | backtrack () const |
Remove a substitution everywhere. | |
string | to_string (bool=false) const |
Make a string representation. | |
string | make_LaTeX (bool=false) const |
Make a useable LaTeX representation. | |
vector< SubPair >::iterator | begin () |
Iteration is just iteration over the vector of pairs. | |
vector< SubPair >::iterator | end () |
Iteration is just iteration over the vector of pairs. | |
vector< SubPair >::const_iterator | cbegin () |
Iteration is just iteration over the vector of pairs. | |
vector< SubPair >::const_iterator | cend () |
Iteration is just iteration over the vector of pairs. | |
Private Attributes | |
vector< SubPair > | sub |
A single substitution is just a pointer to the Variable being sustituted, and a pointer to the Term to use. The Substitution is just a vector of those. | |
Friends | |
ostream & | operator<< (ostream &, const Substitution &) |
General representation of a substitution.
This is just a vector of individual substitutions, each a pair of pointers, one to the Variable and one to the Term.
Only very minimal methods are needed, essentially for applying and removing the substitutions.
Definition at line 57 of file Substitution.hpp.
|
inline |
Trivial constructor.
Definition at line 70 of file Substitution.hpp.
void Substitution::apply | ( | ) | const |
Apply a substitution everywhere.
Because of the way terms are represented this is easy, and involves updating a single pointer for each variable.
Definition at line 56 of file Substitution.cpp.
void Substitution::backtrack | ( | ) | const |
Remove a substitution everywhere.
Because of the way terms are represented this is easy, and involves updating a single pointer for each variable.
Definition at line 62 of file Substitution.cpp.
|
inline |
Iteration is just iteration over the vector of pairs.
Definition at line 117 of file Substitution.hpp.
|
inline |
Iteration is just iteration over the vector of pairs.
Definition at line 125 of file Substitution.hpp.
|
inline |
Iteration is just iteration over the vector of pairs.
Definition at line 129 of file Substitution.hpp.
|
inline |
|
inline |
Iteration is just iteration over the vector of pairs.
Definition at line 121 of file Substitution.hpp.
string Substitution::make_LaTeX | ( | bool | subbed = false | ) | const |
Make a useable LaTeX representation.
Assumes you're in Math Mode.
subbed | Implement substitutions if true. |
Definition at line 39 of file Substitution.cpp.
Add a pair to a substitution.
Definition at line 52 of file Substitution.cpp.
|
inline |
string Substitution::to_string | ( | bool | subbed = false | ) | const |
Make a string representation.
subbed | Implement substitutions if true. |
Definition at line 28 of file Substitution.cpp.
|
friend |
Definition at line 68 of file Substitution.cpp.
|
private |
A single substitution is just a pointer to the Variable being sustituted, and a pointer to the Term to use. The Substitution is just a vector of those.
Definition at line 65 of file Substitution.hpp.