public bool isFalse(Symbol symbol) { Object status = h[symbol.getValue()]; if (status != null) { return !((bool) status); } return false; }
public bool isTrue(Symbol symbol) { Object status = h[symbol.getValue()]; if (status != null) { return ((Boolean) status); } return false; }
public bool getStatus(Symbol symbol) { Object status = h[symbol.getValue()]; if (status != null) { return (bool) status; } return false;//TODO: is this right? it was null in the java source }
public override Object visitSymbol(Symbol s, Object arg) { Hashtable symbolsCollectedSoFar = (Hashtable)arg; symbolsCollectedSoFar.Add(new Symbol(s.getValue()),null); return symbolsCollectedSoFar; }
public virtual Object visitSymbol(Symbol s, Object arg) { return arg; }
public Model extend(Symbol symbol, bool b) { Model m = new Model(); return extend(symbol.getValue(),b); }
private bool isUnknown(Symbol s) { Object o = h[s.getValue()]; return (o == null); }
public Hashtable getAssignedSymbols() { Hashtable _set= new Hashtable(); //Iterator i = this.h.keySet().iterator(); //while (i.hasNext()) foreach (string i in this.h.Keys) { Symbol key = new Symbol(i); if (!(isUnknown(key))) { _set.Add(key,null); } } return _set; }
// VISITOR METHODS public Object visitSymbol(Symbol s, Object arg) { return getStatus(s); }
public Model flip(Symbol s) { if (isTrue(s)) { return extend(s, false); } if (isFalse(s)) { return extend(s, true); } return this; }