public List<Symbol> getSymbolsIn(Sentence s) { if (s == null) {// empty knowledge bases == null fix this later return new List<Symbol>(); } return (List<Symbol>)s.accept(this, new List<Symbol>()); }
// // PRIVATE METHODS // private List<Sentence> processSubTerm(Sentence s, List<Sentence> soFar) { if (detector.containsEmbeddedAnd(s)) { return (List<Sentence>)s.accept(this, soFar); } else { soFar.Add(s); return soFar; } }
public List<Sentence> getClausesFrom(Sentence sentence) { List<Sentence> set = new List<Sentence>(); if (sentence is Symbol) { set.Add(sentence); } else if (sentence is UnarySentence) { set.Add(sentence); } else { set = (List<Sentence>)sentence.accept(this, set); } return set; }
public List<Symbol> getNegativeSymbolsIn(Sentence s) { return (List<Symbol>)s.accept(this, new List<Symbol>()); }
public bool containsEmbeddedAnd(Sentence s) { return (bool)s.accept(this, null); }
private Sentence step(Sentence s) { return (Sentence)s.accept(this, null); }
public List<Symbol> getPositiveSymbolsIn(Sentence sentence) { return (List<Symbol>)sentence.accept(this, new List<Symbol>()); }
public bool isUnknown(Sentence clause) { return null == clause.accept(this, null); }
public bool isFalse(Sentence clause) { return clause.accept(this, null).Equals(false); }
public bool isTrue(Sentence clause) { return clause.accept(this, null).Equals(true); }