public FunctionManager(FunctionCollection functionCollection) { Map<Pair<FunctionIdentifier, Integer>, IFunctionDescriptorFactory> functionsMap = new HashMap<>(); Map<FunctionIdentifier, IFunctionTypeInferer> typeInferersMap = new HashMap<>(); for (IFunctionDescriptorFactory descriptorFactory : functionCollection.getFunctionDescriptorFactories()) { FunctionIdentifier fid = descriptorFactory.createFunctionDescriptor().getIdentifier(); functionsMap.put(new Pair<>(fid, fid.getArity()), descriptorFactory); IFunctionTypeInferer typeInferer = descriptorFactory.createFunctionTypeInferer(); if (typeInferer != null) { typeInferersMap.put(fid, typeInferer); } } this.functions = functionsMap; this.typeInferers = typeInferersMap; }