public bool isEqual(LogicalArgument argument) { // Tests if every aspect of the parameter argument matches // its counterpart in this object, recursively testing all the // way down to variables and constants if (argument.GetType() != GetType()) { return(false); } else { Disjunction castArgument = (Disjunction)argument; if (arguments.Count != castArgument.arguments.Count) { return(false); } for (int i = 0; i < arguments.Count; i++) { if (arguments[i].isEqual(castArgument.arguments[i]) == false) { return(false); } } return(true); } }
public bool isEqual(LogicalArgument argument) { // Tests if every aspect of the parameter argument matches // its counterpart in this object, recursively testing all the // way down to variables and constants if (argument.GetType() != GetType()) { return(false); } else { Inequality castArgument = (Inequality)argument; if (firstArgument.isEqual(castArgument.firstArgument) == false) { return(false); } else if (secondArgument.isEqual(castArgument.secondArgument) == false) { return(false); } else { return(true); } } }
public bool isEqual(LogicalArgument argument) { // Tests if the parameter argument is of the same type and // contains the same value if (argument.GetType() != GetType()) { return(false); } else { Constant castArgument = (Constant)argument; foreach (string value in castArgument.valueSet) { if (valueSet.Contains(value) == false) { return(false); } } return(true); } }
public bool isEqual(LogicalArgument argument) { // Tests if the parameter argument is of the same type // and has the same name if (argument.GetType() != GetType()) { return(false); } else { Variable castArgument = (Variable)argument; if (name == castArgument.name) { return(true); } else { return(false); } } }
public Inequality(LogicalArgument firstArgument, LogicalArgument secondArgument) { this.firstArgument = firstArgument; this.secondArgument = secondArgument; }