Extending Liquid Types to Arrays

A liquid type is an ordinary Hindley-Milner type annotated with a logical predicate that states the properties satisfied by the elements of that type. Liquid types are a powerful tool for program verification, as programmers can use them to specify pre- and post conditions of their programs, whereas...

Full description

Saved in:
Bibliographic Details
Published inACM transactions on computational logic Vol. 21; no. 2; pp. 1 - 41
Main Authors Montenegro, Manuel, Nieva, Susana, Peña, Ricardo, Segura, Clara
Format Journal Article
LanguageEnglish
Published Association for Computing Machinery 30.04.2020
Online AccessGet more information

Cover

Loading…
More Information
Summary:A liquid type is an ordinary Hindley-Milner type annotated with a logical predicate that states the properties satisfied by the elements of that type. Liquid types are a powerful tool for program verification, as programmers can use them to specify pre- and post conditions of their programs, whereas the predicates of intermediate variables and auxiliary functions are inferred automatically. Type inference is feasible in this context, as the logical predicates within liquid types are constrained to a quantifier-free logic to maintain decidability. In this article, we extend liquid types by allowing them to contain quantified properties on arrays so that they can be used to infer invariants on array-related programs (e.g., implementations of sorting algorithms). Although quantified logic is, in general, undecidable, we restrict properties on arrays to a decidable subset introduced by Bradley et al. We describe in detail the extended type system, the verification condition generator, and the iterative weakening algorithm for inferring invariants. After proving the correctness and completeness of these two algorithms, we apply them to find invariants on a set of algorithms involving array manipulations.
ISSN:1529-3785
1557-945X
1557-945X
DOI:10.1145/3362740