33#include "LaTeXUtilities.hpp"
34#include "Function.hpp"
71 Variable() : id(0), name(), substitution(
nullptr) {}
72 Variable(ID new_id) : id(new_id), name(), substitution(
nullptr) {}
73 Variable(ID new_id,
const string& new_name)
74 : id(new_id), name(new_name), substitution(
nullptr) {}
92 inline ID
get_id()
const {
return id; }
99 inline string get_name()
const {
return name; }
106 string to_string(
bool =
false)
const;
111 inline bool is_subbed()
const {
return (substitution !=
nullptr); }
Basic representation of functions.
Definition Function.hpp:54
General representation of terms.
Definition Term.hpp:62
Basic representation of variables.
Definition Variable.hpp:58
Variable * subbed_variable() const
If the variable is unsubbed then return "this"; otherwise a pointer to the variable at the end of a c...
Definition Term.cpp:292
Term * skip_leading_variables() const
It may be that there is a chain of substitutions attached to this variable: skip the leading ones.
Definition Term.cpp:326
bool contains_variable(Variable *) const
Does the substitution turn the variable into something that includes the variable passed?
Definition Term.cpp:301
friend ostream & operator<<(ostream &, const Variable &)
Some methods are in Term.cpp to make the dependencies work.
Definition Variable.cpp:36
bool subbed_is_variable() const
Is the variable still in fact a variable, taking substitution into account?
Definition Term.cpp:285
void substitute(Term *t)
Self-explanatory, but be careful!
Definition Variable.hpp:142
ID get_id() const
Self-explanatory access function.
Definition Variable.hpp:92
bool is_subbed() const
Self-explanatory.
Definition Variable.hpp:111
Variable(const Variable &)=delete
Explicitly disallow copying as this is a very bad idea.
Arity get_subbed_arity() const
If there is a chain of substitutions ending in a function, find that function's arity.
Definition Term.cpp:317
Function * get_subbed_f() const
If there is a chain of substitutions ending in a function, find that function.
Definition Term.cpp:308
void remove_substitution()
Self-explanatory, but be careful!
Definition Variable.hpp:128
bool subbed_is_function() const
Is the variable now a function, taking substitution into account?
Definition Term.cpp:278
string get_name() const
Self-explanatory access function.
Definition Variable.hpp:99
string make_LaTeX(bool=false) const
Convert the Variable to a useable LaTeX representation.
Definition Term.cpp:267
Term * get_subbed_term() const
Self-explanatory.
Definition Variable.hpp:116
Storage of named variables, and management of new, anonymous variables.
Definition VariableIndex.hpp:61