The space complexity of functional programs is not well understood. In particular, traditional implementation techniques are tailored to time efficiency, and space efficiency induces time inefficiencies, as it prefers re-computing to saving. Girard's geometry of interaction underlies an alternative approach based on the interaction abstract machine (IAM), claimed as space efficient in the literature. It has also been conjectured to provide a reasonable notion of space for the lambda-calculus, but such an important result seems to be elusive. In this paper we introduce a new intersection type system precisely measuring the space consumption of the IAM on the typed term. Intersection types have been repeatedly used to measure time, which they achieve by dropping idempotency, turning intersections into multisets. Here we show that the space consumption of the IAM is connected to a further structural modification, turning multisets into trees. Tree intersection types lead to a finer understanding of some space complexity results from the literature. They also shed new light on the conjecture about reasonable space: we show that the usual way of encoding Turing machines into the lambda calculus cannot be used to prove that the space of the IAM is a reasonable cost model.
翻译:功能程序的空间复杂性并没有得到很好理解。 特别是, 传统的实施技术是适应时间效率的, 并且空间效率导致时间效率低, 因为它更倾向于重新计算以节省。 Girard 的交互性几何测量是基于互动抽象机器(IM)的替代方法的基础, 文献中称其为空间效率。 人们还推测它能为羊羔- 计算法提供合理的空间概念, 但这样的重要结果似乎难以预料。 在本文中, 我们引入一个新的交叉类型系统, 精确测量IM在打字词上的空间消耗。 交叉类型被反复用于测量时间, 而它们通过丢弃光度来测量时间, 将交叉点变成多个设置。 我们在这里显示, IAM 的空间消耗与进一步的结构性修改相关, 将多个设置变成树木。 树木交叉类型导致对文献中某些空间复杂性结果有更精确的理解。 它们还给出关于合理空间的猜测: 我们显示, 通常将 Turing 机器编码成 am 模型的成本无法被合理使用。