private static void VisitOr(Disjunction or, GdlVisitor visitor) { visitor.VisitOr(or); var expressions = or.GetDisjuncts().ToList(); for (int i = 0; i < expressions.Count(); i++) VisitAll(expressions[i], visitor); }
private static Substitution Mgu(Disjunction dis1, Disjunction dis2) { List<Expression> contents1 = dis1.GetDisjuncts().ToList(); List<Expression> contents2 = dis2.GetDisjuncts().ToList(); if (contents1.Count != contents2.Count) return null; var subs = new Substitution(); return contents1.Where((t, i) => Mgu(t, contents2[i], subs) == false).Any() ? null : subs; }