Repository logo
 

Transfinite step-indexing for termination

Published version
Peer-reviewed

Type

Article

Change log

Authors

Spies, S 
Dreyer, D 

Abstract

jats:p 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 jats:italichigher-order state</jats:italic> , 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 jats:italicsafety</jats:italic> properties like “well-typed programs don’t go wrong”. There has consequently been very little work on using step-indexing to establish jats:italicliveness</jats:italic> properties, in particular termination. </jats:p> jats:p 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 jats:italictransfinite step-indexing</jats:italic> , 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. </jats:p>

Description

Keywords

termination, transfinite step-indexing, higher-order state, linear types, ordinals, channels, asynchronous computation, asynchronous programming, logical relations

Journal Title

Proceedings of the ACM on Programming Languages

Conference Name

Journal ISSN

2475-1421
2475-1421

Volume Title

5

Publisher

Association for Computing Machinery (ACM)