程序中涉及异常的证明
Certified proofs in programs involving exceptions
摘要:
异常处理由大多数现代程序设计语言提供。它允许处理需要特殊处理的异常或异常事件。在计算机代数中,异常处理是实现动态求值范式的有效方法:例如,在线性代数中,动态求值可以用于将为域中系数矩阵编写的程序应用于环中系数矩阵。因此,一个计算机代数的证明系统应该包括一个例外的声明,它必须依赖于一个仔细的描述异常的语义。monad的范畴概念可以用来形式化异常的产生:这是由Moggi提出并在Haskell中实现的。在本文中,我们提供了一个证明系统的异常,其中包括提高和处理,通过扩展Moggi的方法。此外,这个证明系统的核心部分与命令式语言中的副作用证明系统是对偶的,后者依赖于comonad的范畴概念。这两个证明系统都在Coq证明助手中实现。
英文摘要:
Exception handling is provided by most modern programming languages. It allows to deal with anomalous or exceptional events which require special processing. In computer algebra, exception handling is an efficient way to implement the dynamic evaluation paradigm: for instance, in linear algebra, dynamic evaluation can be used for applying programs which have been written for matrices with coefficients in a field to matrices with coefficients in a ring. Thus, a proof system for computer algebra should include a treatement of exceptions, which must rely on a careful description of a semantics of exceptions. The categorical notion of monad can be used for formalizing the raising of exceptions: this has been proposed by Moggi and implemented in Haskell. In this paper, we provide a proof system for exceptions which involves both raising and handling, by extending Moggi's approach. Moreover, the core part of this proof system is dual to a proof system for side effects in imperative languages, which relies on the categorical notion of comonad. Both proof systems are implemented in the Coq proof assistant.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。