final Func f = x.fun;
final int n = f.count();
final Object candidate = n==0 ? cacheForConstants.get(f) : null;
if (candidate!=null) return candidate;
final Expr body = f.getBody();
if (body.type().arity()<0 || body.type().arity()!=f.returnDecl.type().arity()) throw new ErrorType(body.span(), "Function return value not fully resolved.");
for(Func ff:current_function) if (ff==f) throw new ErrorSyntax(x.span(), ""+f+" cannot call itself recursively!");
Env<ExprVar,Object> newenv = new Env<ExprVar,Object>();
List<SimTupleset> list = new ArrayList<SimTupleset>(x.args.size());
for(int i=0; i<n; i++) { SimTupleset ts = cset(x.args.get(i)); newenv.put(f.get(i), ts); list.add(ts); }
final SimCallback cb = callbacks.get(f);