public override bool Equals(Object o) { if (this == o) { return(true); } if ((o == null) || (this.GetType() != o.GetType())) { return(false); } BinarySentence bs = (BinarySentence)o; return((bs.getOperator().Equals(getOperator())) && (bs.getFirst().Equals(first)) && (bs.getSecond() .Equals(second))); }
public virtual Object visitBinarySentence(BinarySentence bs, Object arg) { Hashtable s =(Hashtable)arg; Hashtable termunion = new SetOps().union((Hashtable)bs.getFirst().accept(this,arg),(Hashtable)bs.getSecond().accept(this,arg)); return new SetOps().union(s,termunion); }
public Object visitBinarySentence(BinarySentence bs, Object arg) { Object firstValue = bs.getFirst().accept(this,null); Object secondValue = bs.getSecond().accept(this,null); if ((firstValue == null) || (secondValue == null)) { //strictly not // true for or/and // -FIX later return null; } else { string oper = bs.getOperator(); if (oper.Equals("AND")) { return evaluateAnd((bool) firstValue, (bool) secondValue); } if (oper.Equals("OR")) { return evaluateOr((bool) firstValue, (bool) secondValue); } if (oper.Equals("=>")) { return evaluateImplied((bool) firstValue, (bool) secondValue); } if (oper.Equals("<=>")) { return evaluateBiConditional((bool) firstValue, (bool) secondValue); } return null; } }