arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.15936cs.PL
收藏

一个带效应的对象演算

An effectful object calculus

Francesco Dagnino, Paola Giannini, Elena Zucca

AI总结:

本文在面向对象演算中融入任意单子的效应引发、组合与处理机制,并借助继承与泛型实现效应多态,通过一步归约关系证明类型与效应系统的可靠性。

摘要:

我们展示了如何将构造(用于在任意单子中引发、组合和处理效应)平滑地融入面向对象范式。底层纯演算旨在代表最新一代面向对象语言,而带效应的扩展对普通程序员而言足够易于管理;值得注意的是,用于引发效应的构造只是特殊方法。我们为该演算配备了一个富有表现力的类型与效应系统,该系统再次依赖于继承和泛型类型等标准特性,支持一种简单的效应多态性。类型与效应系统的可靠性通过一种近期引入的技术来表达和证明,其中语义通过从语言表达式到单子表达式的一步归约关系形式化,因此只需在该关系上证明进展和主题归约性质即可。

英文摘要:

We show how to smoothly incorporate in the object-oriented paradigm constructs to raise, compose, and handle effects in an arbitrary monad. The underlying pure calculus is meant to be a representative of the last generation of OO languages, and the effectful extension is manageable enough for ordinary programmers; notably, constructs to raise effects are just special methods. We equip the calculus with an expressive type-and-effect system, which, again by relying on standard features such as inheritance and generic types, allows a simple form of effect polymorphism. The soundness of the type-and-effect system is expressed and proved by a recently introduced technique, where the semantics is formalized by a one-step reduction relation from language expressions into monadic ones, so that it is enough to prove progress and subject reduction properties on this relation.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑