Affiliation:
1. MPI-SWS, Germany / University of Cambridge, UK
2. University of Cambridge, UK
3. MPI-SWS, Germany
Abstract
Step-indexed logical relations are an extremely useful technique for building operational-semantics-based models and program logics for realistic, richly-typed programming languages. They have proven to be indispensable for modeling features like
higher-order state
, which many languages support but which were difficult to accommodate using traditional denotational models. However, the conventional wisdom is that, because they only support reasoning about finite traces of computation, (unary) step-indexed models are only good for proving
safety
properties like “well-typed programs don’t go wrong”. There has consequently been very little work on using step-indexing to establish
liveness
properties, in particular termination.
In this paper, we show that step-indexing can in fact be used to prove termination of well-typed programs—even in the presence of dynamically-allocated, shared, mutable, higher-order state—so long as one’s type system enforces disciplined use of such state. Specifically, we consider a language with asynchronous channels, inspired by promises in JavaScript, in which higher-order state is used to implement communication, and linearity is used to ensure termination. The key to our approach is to generalize from natural number step-indexing to
transfinite step-indexing
, which enables us to compute termination bounds for program expressions in a compositional way. Although transfinite step-indexing has been proposed previously, we are the first to apply this technique to reasoning about termination in the presence of higher-order state.
Funder
Horizon 2020 Framework Programme
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Cited by
4 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Almost-Sure Termination by Guarded Refinement;Proceedings of the ACM on Programming Languages;2024-08-15
2. Bialgebraic Reasoning on Higher-order Program Equivalence;Proceedings of the 39th Annual ACM/IEEE Symposium on Logic in Computer Science;2024-07-08
3. Transfinite Iris: resolving an existential dilemma of step-indexed separation logic;Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation;2021-06-18
4. Temporal Refinements for Guarded Recursive Types;Programming Languages and Systems;2021