private void cascadeSubstitution(Dictionary<Variable, Term> theta, Variable var,
Term x)
{
theta.Add(var, x);
List<Variable> thetaKeys = theta.Keys.ToList<Variable>();
foreach (Variable v in thetaKeys)
{
Term t = theta[v];
if (theta.ContainsKey(v))
{
theta[v] = _substVisitor.subst(theta, t);
}
else
{
theta.Add(v, _substVisitor.subst(theta, t));
}
}
}
}