                 return false if not _unify(n1[idx],v1,n2[idx],v2, changes)
     return true
 
-unify = (expr1,expr2,changes=[]) ->
-    success = true
-    expr1 = if expr1 instanceof Tin then expr1 else parse(expr1)
-    expr2 = if expr2 instanceof Tin then expr2 else parse(expr2)
-    success = _unify(expr1.node,expr1.varlist,expr2.node,expr2.varlist,changes)
-    if success == false
-        return null
-    else
-        return [expr1,expr2]
-
 rollback = (changes) ->
     for change in changes
         change()

    unparse: () ->
        unboxit @node

boxit = (elem,tinlist) ->
    if elem instanceof Variable
        tinlist?[elem.name] =  new Tin( elem.name, null, null )

 extern "unify", unify
 extern "variable", (name)->new Variable(name)
 extern "rollback", rollback
 extern "Tin", Tin
 extern "Box", Box
 extern "DICT_FLAG", DICT_FLAG
 extern "toJson", toJson
 extern "Variable", Variable
