public Atom Find(ClausePattern pattern) { foreach (var clause in Clauses) { if (pattern.Match(clause)) { return(clause); } } return(null); }
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); }
public MessagePattern(MessageKind kind, ClausePattern clausePattern) { Kind = kind; ClausePattern = clausePattern; }
// public MessagePattern(MessageKind kind) { Kind = kind; ClausePattern = new ClausePattern(); }