paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Interactive programming in Agda – Objects and graphical user interfaces

Agda 中的交互式编程——对象与图形用户界面
JFP vol.272017匹配度 2/10 · 该论文属于依赖类型函数式编程、共归纳IO与对象验证,涉及证明工程和GUI,但未涉及静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析等核心方向,仅与形式化验证有较弱的间接关联。引用 15 inbox
ANDREAS ABEL, STEPHAN ADELSBERGER, ANTON SETZER
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:提出 Agda 中基于共归纳 IO 与 copattern 匹配的交互式对象编程方法,实现 ooAgda 库并支持 GUI 与对象验证。

论文研究如何在依赖类型函数式语言 Agda 中编写交互式、面向对象的程序。作者提出一套方法并在 ooAgda 库中实现:借助 copattern 匹配提供类似面向对象语言的语法;交互程序基于共归纳 IO monad,并采用 sized coinductive 类型以模块化方式编写核心递归程序。对象是服务端交互程序,分简单对象与 IO 对象,方法可纯或含交互,并支持接口与对象扩展。作者还引入状态依赖交互程序和对象以静态避免异常,例如空栈禁用 pop。最后用共归纳对象互模拟验证栈对象正确性并证明不同栈实现等价,并以绘图程序和按钮控制飞船的 GUI 示例作概念验证。

问题
如何在依赖类型函数式语言中支持交互式、面向对象风格的程序设计,包括 GUI、状态依赖接口,同时保持静态安全与可验证性。
方法
基于共归纳 IO monad 与 sized coinductive 类型建模交互,并用 copattern 匹配实现 ooAgda 库中的面向对象语法、简单/IO 对象、接口扩展与状态依赖方法;用共归纳对象互模拟进行验证。
评估
在 Agda 中机械验证栈对象的基本正确性及不同栈实现的等价;并通过绘图程序与按钮控制飞船的 GUI 示例作概念验证。
原文摘要(Abstract)

Abstract We develop a methodology for writing interactive and object-based programs (in the sense of Wegner) in dependently typed functional programming languages. The methodology is implemented in the ooAgda library. ooAgda provides a syntax similar to the one used in object-oriented programming languages, thanks to Agda's copattern matching facility. The library allows for the development of graphical user interfaces (GUIs), including the use of action listeners. Our notion of interactive programs is based on the IO monad defined by Hancock and Setzer, which is a coinductive data type. We use a sized coinductive type which allows us to write corecursive programs in a modular way. Objects are server-side interactive programs that respond to method calls by giving answers and changing their state. We introduce two kinds of objects: simple objects and IO objects. Methods in simple objects are pure, while method calls in IO objects allow for interactions before returning their result. Our approach also allows us to extend interfaces and objects by additional methods. We refine our approach to state-dependent interactive programs and objects through which we can avoid exceptions. For example, with a state-dependent stack object, we can statically disable the pop method for empty stacks. As an example, we develop the implementation of recursive functions using a safe stack. Using a coinductive notion of object bisimilarity, we verify basic correctness properties of stack objects and show the equivalence of different stack implementations. Finally, we give a proof of concept that our interaction model allows to write GUI programs in a natural way: we present a simple drawing program, and a program which allows the users to move a small spaceship using a button.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@article{AbelAS17,
  title = {Interactive programming in Agda – Objects and graphical user interfaces},
  author = {ANDREAS ABEL and STEPHAN ADELSBERGER and ANTON SETZER},
  journal = {Journal of Functional Programming},
  volume = {27},
  year = {2017},
  doi = {10.1017/s0956796816000319}
}