32#include "Substitution.hpp"
45using UPair = pair<Term* ,Term*>;
50enum class UnificationOutcome {Succeed, ConflictFail, OccursFail};
55ostream& operator<<(ostream&,
const UnificationOutcome&);
138 UnificationOutcome
operator()(
const vector<Term*>&,
139 const vector<Term*>&);
168 friend ostream& operator<<(ostream&,
const Unifier&);
Basic representation of literals, bundling together (pointers to) a Predicate, a collection of argume...
General representation of a substitution.
string to_string(bool=false) const
Make a string representation.
General representation of terms.
Wrap up various applications of unificiation into a single class: all the unification you need to do ...
void backtrack()
Apply the backtracking process to the substitution that has been constructed.
string to_string(bool subbed=false) const
Make a nice string representation.
Substitution get_substitution() const
Trivial get methods for the result.
UnificationOutcome operator()(Term *, Term *)
Implementation of unification for a pair of Terms.
Unifier()
There isn't really much to initialize.
Unifier(const Unifier &)=delete
You really only need one Unifier!
UnificationOutcome complete_unification()
Implementation of unification: all the real work happens here.
deque< UPair > to_do
Queue used by complete_unification method.
Substitution s
Build the resulting substitution here.