Infer dependencies from function arguments and local bound functions