public Dictionary<Variable, Term> unify(List<FOLNode> x,
List<FOLNode> y, Dictionary<Variable, Term> theta)
{
if (theta == null)
{
return null;
}
else if (x.Count != y.Count)
{
return null;
}
else if (x.Count == 0 && y.Count == 0)
{
return theta;
}
else if (x.Count == 1 && y.Count == 1)
{
return unify(x[0], y[0], theta);
}
else
{
return unify(x.Skip(1).ToList<FOLNode>(), y.Skip(1).ToList<FOLNode>(), unify(
x[0], y[0], theta));
}
}