While的基于共归纳迹的大步语义的霍尔逻辑
A Hoare logic for the coinductive trace-based big-step semantics of While
摘要:
在寻找一个基本的框架,推理可观察到的行为的程序,可能不会终止,我们以前设计了一个基于跟踪的大步骤的语义虽然。在这种语义中,轨迹和评估(将程序运行的初始状态与它们产生的轨迹相关联)都是共归纳定义的。在终止运行时,这种语义与标准的基于归纳状态的语义一致。在这里,我们提出了一个霍尔逻辑对应我们的共归纳基于迹的语义,并证明它的声音和完整的。我们的逻辑包括标准的部分正确性状态为基础的霍尔逻辑以及总正确性的变化:他们是可嵌入的。在相反的方向上,投影可以被构造:在我们的基于迹的逻辑中的霍尔三元组的推导可以被转换为在基于状态的逻辑中的转换的、较弱的霍尔三元组的推导。由于我们使用的是建设性的底层逻辑,因此我们可以推理的程序属性范围具有良好的结构;特别是,我们可以区分终止性和非发散性,例如,无界经典全搜索不能终止,但仍然是无发散的。我们的元理论也是完全建设性的,我们已经在Coq中将其形式化了。
英文摘要:
In search for a foundational framework for reasoning about observable behavior of programs that may not terminate, we have previously devised a trace-based big-step semantics for While. In this semantics, both traces and evaluation (relating initial states of program runs to traces they produce) are defined coinductively. On terminating runs, this semantics agrees with the standard inductive state-based semantics. Here we present a Hoare logic counterpart of our coinductive trace-based semantics and prove it sound and complete. Our logic subsumes the standard partial-correctness state-based Hoare logic as well as the total-correctness variation: they are embeddable. In the converse direction, projections can be constructed: a derivation of a Hoare triple in our trace-based logic can be translated into a derivation in the state-based logic of a translated, weaker Hoare triple. Since we work with a constructive underlying logic, the range of program properties we can reason about has a fine structure; in particular, we can distinguish between termination and nondivergence, e.g., unbounded classically total search fails to be terminating, but is nonetheless nondivergent. Our meta-theory is entirely constructive as well, and we have formalized it in Coq.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。