论文标题
危险:一种可逆的功能编程语言
Jeopardy: An Invertible Functional Programming Language
论文作者
论文摘要
算法是将问题映射到解决方案的方式。当该映射是配件时,算法是可逆的,因此可以从其解决方案中唯一推断出初始问题。 虽然可以用通用语言描述可逆算法,但通常无法通过此类语言对可逆性进行保证,因此确保可逆性需要额外的(通常是非平凡)的证据。另一方面,尽管可逆的编程语言可以通过将允许的操作限制为当地可逆的操作来确保其程序可逆,但以可逆样式编写程序可能会很麻烦,并且即使实现的算法实际上是可逆的,即使实现的算法也可能与常规实现有很大差异。 在本文中,我们介绍了一种功能性编程语言Jeopardy,可以保证程序的可逆性而不会施加本地可逆性。特别是,危险允许有限使用不可避免的 - 甚至不确定性! - 操作,只要使用它们以可以静态确定的可逆的方式使用。为此,我们概述了一个\ emph {隐式可用的参数分析},另外三种方法可以为保证可逆性的(通常很困难的)问题提供部分静态保证。
Algorithms are ways of mapping problems to solutions. An algorithm is invertible precisely when this mapping is injective, such that the initial problem can be uniquely inferred from its solution. While invertible algorithms can be described in general-purpose languages, no guarantees are generally made by such languages as regards invertibility, so ensuring invertibility requires additional (and often non-trivial) proof. On the other hand, while reversible programming languages guarantee that their programs are invertible by restricting the permissible operations to those which are locally invertible, writing programs in the reversible style can be cumbersome, and may differ significantly from conventional implementations even when the implemented algorithm is, in fact, invertible. In this paper we introduce Jeopardy, a functional programming language that guarantees program invertibility without imposing local reversibility. In particular, Jeopardy allows the limited use of uninvertible -- and even nondeterministic! -- operations, provided that they are used in a way that can be statically determined to be invertible. To this end, we outline an \emph{implicitly available arguments analysis} and three further approaches that can give a partial static guarantee to the (generally difficult) problem of guaranteeing invertibility.