public Hashtable getSymbolsIn(Sentence s) { if (s == null) {//empty knowledge bases == null fix this later return new Hashtable(); } object o = s.accept(this,new Hashtable()); Hashtable h = (Hashtable)o; return (Hashtable)s.accept(this, new Hashtable()); }
// public void print() // { // Iterator i = h.keySet().iterator(); // while (i.hasNext()) // { // Object key = i.next(); // Object value = h.get(key); // System.out.print(key + " = " + value + " "); // //System.out.print (key +" = " +((Boolean)value).booleanValue()); // } // System.out.println(); // } public bool isTrue(Sentence clause) { Object result = clause.accept(this,null); return (result == null) ? false : ((bool) result)==true; }
public bool isFalse(Sentence clause) { Object o = clause.accept(this,null); return (o != null) ? ((bool) o)==false : false; }
public bool isUnknown(Sentence clause) { //TODO TEST WELL Object o = clause.accept(this,null); return (o == null) ; }