public bool lessThan(Functor1 functor) { // Do the equal check first since it is faster. if (!_name.Equals(functor._name)) { return(_name.lessThan(functor._name)); } return(YP.termLessThan(_arg1, functor._arg1)); }
public bool lessThan(Functor functor) { // Do the equal check first since it is faster. if (!_name.Equals(functor._name)) { return(_name.lessThan(functor._name)); } if (_args.Length != functor._args.Length) { return(_args.Length < functor._args.Length); } for (int i = 0; i < _args.Length; ++i) { if (!YP.termEqual(_args[i], functor._args[i])) { return(YP.termLessThan(_args[i], functor._args[i])); } } return(false); }