Skip to main content
QUICK REVIEW

[论文解读] A Calculus of Inheritance

Bo Yang|arXiv (Cornell University)|Feb 18, 2026
Logic, programming, and type systems被引用 0
一句话总结

Inheritance-calculus 是一种最小化的声明式编程模型,具有三个原语(记录、定义、继承),能够轻松嵌入 lambda 演算,为惰性 lambda 演算提供基于 Böhm 树等价性的完全抽象、集合论语义,并在仅使用 lambda 演算的表达能力之外展示更高的表达力。

ABSTRACT

Just as the $λ$-calculus uses three primitives (abstraction, application, variable) as the foundation of functional programming, inheritance-calculus uses three primitives (record, definition, inheritance) as the foundation of declarative programming. By unifying modules, classes, objects, methods, fields, and locals under a single record abstraction, the calculus models inheritance simply as set union. Consequently, composition is inherently commutative, idempotent, and associative, structurally eliminating the multiple-inheritance linearization problem. Its semantics is first-order~\cite{vanemden1976-predicate-logic-semantics, reynolds1972-definitional-interpreters, aczel1977-inductive-definitions}, denotational, and computable by tabling~\cite{tamaki1986-tabled-resolution}, even for cyclic inheritance hierarchies. These three properties extend to the $λ$-calculus, since Böhm tree equivalence~\cite{barendregt1984-lambda-calculus} is fully abstract for the first-iteration approximation of a sublanguage of inheritance-calculus. As a corollary, this establishes a convergence hierarchy $ ext{eager} \subsetneq ext{lazy} \subsetneq ext{fixpoint}$ among $λ$-calculi sharing the same $λ$-syntax. Inheritance-calculus is distilled from MIXINv2, a practical implementation in which the same code acts as different function colors~\cite{nystrom2015-function-color}; ordinary arithmetic yields the relational semantics of logic programming~\cite{vanemden1976-predicate-logic-semantics}; $\mathtt{this}$ resolves to multiple targets; and programs are immune to nonextensibility in the sense of the Expression Problem~\cite{wadler1998-expression-problem}. This makes inheritance-calculus strictly more expressive than the $λ$-calculus in both common sense and Felleisen's sense~\cite{felleisen1991-expressive-power}.

研究动机与目标

  • 通过借鉴 NixOS 与 MIXINv2 等实际系统,为声明式/配置语言提供一个最小化的计算模型。
  • 提供一个三原语语言(记录、定义、继承),在集合论语义下保持函数自由并具备递归能力。
  • 证明该演算嵌入 lambda 演算,并在 Felleisen 的意义上具备严格更高的表达力。
  • 给出用于惰性求值的、观测驱动语义,使用有限、终止的 mixin-tree 等式。
  • 通过 Nat 算术等案例研究,演示关系语义、开放扩展以及函数-颜色盲等实际现象。

提出的方法

  • 给出六个相互递归的集合同构方程,沿路径计算属性、supers、overrides、bases、resolve 与 this。
  • 将 mixin tree 形式化为可深度合并的、可交换、幂等、结合的结构,且不设任何化简规则或求值顺序。
  • 通过从 ANF 的五条规则翻译,将 lambda 演算嵌入 inheritance-calculus,且保持语义。
  • 证明充要性:一个闭合的 ANF lambda 项在其 translation 在 mixin-tree 语义中收敛时恰好具有头部规范形式。
  • 证明完全抽象性:lambda-contextual 等价性在翻译下等同于 Böhm-tree 相等性,而 inheritance-contexts 能区分更多项。
  • 提出观测性、集合论语义,避免传统的操作或领域理论机械。

实验结果

研究问题

  • RQ1 inheritance-calculus 是否可以作为最小、无函数的 declarative 编程基础,达到或超过 lambda 演算的表达力?
  • RQ2lambda 演算到 inheritance 演算的翻译是否能在 Böhm-tree 等价性方面达到完全抽象?
  • RQ3MIXINv2 中观察到的开放扩展与关系语义等特性是否将表达力扩展至超出 lambda 演算?
  • RQ4该演算是否能够在不使用不动点构造的情况下表示嵌套继承、自引用与表达式问题?
  • RQ5在纯集合论语义框架下,惰性求值与观测驱动计算有哪些潜在影响?

主要发现

  • 该演算仅使用三原语(记录、定义、继承),且不含函数或 let 绑定。
  • 继承本质上是交换、幂等、结合的,消除了多重继承的线性化问题。
  • lambda 演算嵌入到 inheritance 演算,且在 lambda 可定义上下文的 Böhm-tree 等价性方面具有完全抽象性。
  • 所导出的语义在朴素集合论内完全可计算,避免额外的领域理论机制。
  • 在 Open extension 与表达式问题等方面, inheritance-calculus 相较于惰性 lambda 演算在 Felleisen 的意义上具有更高的表达力。
  • 案例研究(如 Nat 算术)展示了关系语义及其他涌现特性,如函数-颜色盲以及对不可扩展性的免疫性。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。