aboutsummaryrefslogtreecommitdiffstats
path: root/src/unify.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/unify.cpp')
-rw-r--r--src/unify.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/unify.cpp b/src/unify.cpp
index a7f7822..48ae1dd 100644
--- a/src/unify.cpp
+++ b/src/unify.cpp
@@ -85,6 +85,16 @@ substitute(const AST* in, const AST* from, const AST* to)
return ret.head;
}
+void
+Subst::augment(const Subst& subst)
+{
+ for (Subst::const_iterator s = subst.begin(); s != subst.end(); ++s) {
+ if (!contains(s->first)) {
+ add(s->first, s->second);
+ }
+ }
+}
+
/// Compose two substitutions (TAPL 22.1.1)
Subst
Subst::compose(const Subst& delta, const Subst& gamma)