예제 #1
0
        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);
        }
예제 #2
0
 private static void VisitRelation(Fact relation, GdlVisitor visitor)
 {
     visitor.VisitRelation(relation);
     VisitTerms(relation.GetTerms(), visitor);
 }
예제 #3
0
 public SimpleSentenceForm(Fact sentence)
     : this(sentence.RelationName, sentence.Arity, sentence.GetTerms())
 {
 }