Mechanised Hypersafety Proofs about Structured Data: Extended Version

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Gladshtein, Vladimir, Zhao, Qiyuan, Ahrens, Willow, Amarasinghe, Saman, Sergey, Ilya
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866929307700428800
author Gladshtein, Vladimir
Zhao, Qiyuan
Ahrens, Willow
Amarasinghe, Saman
Sergey, Ilya
author_facet Gladshtein, Vladimir
Zhao, Qiyuan
Ahrens, Willow
Amarasinghe, Saman
Sergey, Ilya
contents Arrays are a fundamental abstraction to represent collections of data. It is often possible to exploit structural properties of the data stored in an array (e.g., repetition or sparsity) to develop a specialised representation optimised for space efficiency. Formally reasoning about correctness of manipulations with such structured data is challenging, as they are often composed of multiple loops with non-trivial invariants. In this work, we observe that specifications for structured data manipulations can be phrased as hypersafety properties, i.e., predicates that relate traces of $k$ programs. To turn this observation into an effective verification methodology, we developed the Logic for Graceful Tensor Manipulation (LGTM), a new Hoare-style relational separation logic for specifying and verifying computations over structured data. The key enabling idea of LGTM is that of parametrised hypersafety specifications that allow the number $k$ of the program components to depend on the program variables. We implemented LGTM as a foundational embedding into Coq, mechanising its rules, meta-theory, and the proof of soundness. Furthermore, we developed a library of domain-specific tactics that automate computer-aided hypersafety reasoning, resulting in pleasantly short proof scripts that enjoy a high degree of reuse. We argue for the effectiveness of relational reasoning about structured data in LGTM by specifying and mechanically proving correctness of 13 case studies including computations on compressed arrays and efficient operations over multiple kinds of sparse tensors.
format Preprint
id arxiv_https___arxiv_org_abs_2404_06477
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Mechanised Hypersafety Proofs about Structured Data: Extended Version
Gladshtein, Vladimir
Zhao, Qiyuan
Ahrens, Willow
Amarasinghe, Saman
Sergey, Ilya
Programming Languages
Logic in Computer Science
Arrays are a fundamental abstraction to represent collections of data. It is often possible to exploit structural properties of the data stored in an array (e.g., repetition or sparsity) to develop a specialised representation optimised for space efficiency. Formally reasoning about correctness of manipulations with such structured data is challenging, as they are often composed of multiple loops with non-trivial invariants. In this work, we observe that specifications for structured data manipulations can be phrased as hypersafety properties, i.e., predicates that relate traces of $k$ programs. To turn this observation into an effective verification methodology, we developed the Logic for Graceful Tensor Manipulation (LGTM), a new Hoare-style relational separation logic for specifying and verifying computations over structured data. The key enabling idea of LGTM is that of parametrised hypersafety specifications that allow the number $k$ of the program components to depend on the program variables. We implemented LGTM as a foundational embedding into Coq, mechanising its rules, meta-theory, and the proof of soundness. Furthermore, we developed a library of domain-specific tactics that automate computer-aided hypersafety reasoning, resulting in pleasantly short proof scripts that enjoy a high degree of reuse. We argue for the effectiveness of relational reasoning about structured data in LGTM by specifying and mechanically proving correctness of 13 case studies including computations on compressed arrays and efficient operations over multiple kinds of sparse tensors.
title Mechanised Hypersafety Proofs about Structured Data: Extended Version
topic Programming Languages
Logic in Computer Science
url https://arxiv.org/abs/2404.06477