private static Fact CleanParentheses(Fact sentence) { if (sentence.Arity == 0) return sentence; Term[] cleanedBody = sentence.GetTerms().Select(CleanParentheses).ToArray(); if (!cleanedBody.Any()) return new GroundFact(sentence.RelationName); return new VariableFact(true, sentence.RelationName, cleanedBody); }
private static void VisitRelation(Fact relation, GdlVisitor visitor) { visitor.VisitRelation(relation); VisitTerms(relation.GetTerms(), visitor); }
public SimpleSentenceForm(Fact sentence) : this(sentence.RelationName, sentence.Arity, sentence.GetTerms()) { }