Exemple #1
0
 public Atom Find(ClausePattern pattern)
 {
     foreach (var clause in Clauses)
     {
         if (pattern.Match(clause))
         {
             return(clause);
         }
     }
     return(null);
 }
Exemple #2
0
        public bool Exists <T>(Atom subj, AtomType pred, T obj)
        {
            ClausePattern target = new ClausePattern(subj, pred, obj);

            foreach (var clause in Clauses)
            {
                if (clause.Predicate != pred)
                {
                    continue;
                }
                if (target.Match(clause))
                {
                    return(true);
                }
            }
            return(false);
        }
Exemple #3
0
 public MessagePattern(MessageKind kind, ClausePattern clausePattern)
 {
     Kind          = kind;
     ClausePattern = clausePattern;
 }
Exemple #4
0
 //
 public MessagePattern(MessageKind kind)
 {
     Kind          = kind;
     ClausePattern = new ClausePattern();
 }