private ArithFunction GetArithFunction(Literal l) { ArithFunction af = null; if (curAg != null) { // try to find the function in agent register af = curAg.GetFunction(l.GetFunctor(), l.GetArity()); } if (af == null) { // try global function af = FunctionRegister.GetFunction(l.GetFunctor(), l.GetArity()); } return(af); }
public ArithFunction GetFunction(string function, int arity) { if (functions == null) { return(null); } ArithFunction af; functions.TryGetValue(function, out af); if (af == null || !af.CheckArity(arity)) { af = FunctionRegister.GetFunction(function, arity); } if (af != null && af.CheckArity(arity)) { return(af); } else { return(null); } }