Type-and-effect systems are a widely-used approach to program verification, verifying the result of a computation using types, and the behavior using effects. This paper extends an effect system for verifying temporal, value-dependent properties on event sequences yielded by programs to the delimited control operators shift0/reset0. While these delimited control operators enable useful and powerful programming techniques, they hinder reasoning about the behavior of programs because of their ability to suspend, resume, discard, and duplicate delimited continuations. This problem is more serious in effect systems for temporal properties because these systems must be capable of identifying what event sequences are yielded by captured continuations. Our key observation for achieving effective reasoning in the presence of the delimited control operators is that their use modifies answer effects, which are temporal effects of the continuations. Based on this observation, we extend an effect system for temporal verification to accommodate answer-effect modification. Allowing answer-effect modification enables easily reasoning about traces that captured continuations yield. Another novel feature of our effect system is the support for dependently-typed continuations, which allows us to reason about programs more precisely. We prove soundness of the effect system for finite event sequences via type safety and that for infinite event sequences using a logical relation.
翻译:类型和效果系统是一种广泛使用的程序核查方法, 核查使用类型计算的结果, 以及使用效果的行为 。 本文扩展了一个效果系统, 用以核查程序对受限制的控制操作器 转移0/ resets0 产生的事件序列的时间、 价值属性。 虽然这些受限制的控制操作器允许使用有用和强大的编程技术, 但由于它们能够中止、 恢复、 丢弃和重复的定界延续, 因而妨碍对程序行为进行推理。 这个问题在时间属性系统中更为严重, 因为这些系统必须能够确定所捕捉的连续序列产生什么事件序列。 在有受限制的控制操作器的情况下, 我们为了实现有效推理而观察到的关键观察是, 它们使用调整的回答效果, 即是连续操作的时间效应。 基于此观察, 我们扩展了时间验证系统的效果系统, 以适应应答效果的修改。 允许回答效果修改可以方便对捕捉持续结果的痕迹进行推理。 我们效应系统的另一个新颖的特征是支持依附式的延续序列, 使我们能够更准确地解释程序。 我们证明, 通过安全类型和无限序列的逻辑序列, 的逻辑序列关系。