25#include "Substitution.hpp"
30 for (SubPair s :
sub) {
31 result += s.first->to_string();
33 result += s.second->to_string(subbed);
42 for (SubPair s :
sub) {
44 result += s.first->to_prolog_string(
false);
46 result += s.second->to_prolog_string(subbed);
56 for (SubPair s :
sub) {
57 result += s.first->make_LaTeX();
58 result +=
" \\leftarrow ";
59 result += s.second->make_LaTeX(subbed);
69 for (SubPair s :
sub) {
70 result += s.first->make_Graphviz();
72 result += unicode_symbols::LogSym::subbed;
74 result += s.second->make_Graphviz(subbed);
82 sub.push_back(SubPair(v, t));
86 for (SubPair s :
sub) {
87 s.first->substitute(s.second);
92 for (SubPair s :
sub) {
93 s.first->remove_substitution();
97ostream& operator<<(ostream& out,
const Substitution& s) {
99 for (SubPair sp : s.
sub) {
100 out << cs(
"(").orange() << sp.first->to_string();
101 out << cs(
" -> ").orange();
102 out << sp.second->to_string() << cs(
") ").orange();
General representation of a substitution.
string make_LaTeX(bool=false) const
Make a useable LaTeX representation.
void backtrack() const
Remove a substitution everywhere.
void push_back(Variable *, Term *)
Add a pair to a substitution.
vector< SubPair > sub
A single substitution is just a pointer to the Variable being sustituted, and a pointer to the Term t...
string to_tptp_string(bool=false) const
Make a string representation in the TPTP format.
string make_Graphviz(bool=false) const
Make a useable Graphviz representation.
void apply() const
Apply a substitution everywhere.
string to_string(bool=false) const
Make a string representation.
General representation of terms.
Basic representation of variables.
Simple addition of colour to strings and ostreams.
Simple function object for putting commas in lists.