Connect++ 0.1
A fast, readable connection prover for first-order logic.
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
Substitution Class Reference

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.
 

Friends

ostream & operator<< (ostream &, const Substitution &)
 

Detailed Description

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.

Member Function Documentation

◆ apply()

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.

◆ backtrack()

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.

◆ make_LaTeX()

string Substitution::make_LaTeX ( bool  subbed = false) const

Make a useable LaTeX representation.

Assumes you're in Math Mode.

Parameters
subbedImplement substitutions if true.

◆ push_back()

void Substitution::push_back ( Variable v,
Term t 
)

Add a pair to a substitution.

Parameters
vPointer to the Variable.
tPointer to the Term.

◆ to_string()

string Substitution::to_string ( bool  subbed = false) const

Make a string representation.

Parameters
subbedImplement substitutions if true.

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