CoqMatrix: Formal matrix library with multiple models in Coq

ZhengPu Shi,GuoJun Xie,Gang Chen
DOI: https://doi.org/10.1016/j.sysarc.2023.102986
IF: 5.836
2023-10-01
Journal of Systems Architecture
Abstract:Matrix theory is an important branch of mathematics with a wide range of applications. Matrix formalization in proof assistants can provide strong support for verifying system behaviors related to matrix operations. The Coq community has proposed at least five formal matrix libraries, although the Coq Standard Library has not implemented them. However, these libraries still fail to meet certain requirements: for one thing, they all implemented relatively limited matrix theories, but none of the libraries has achieved absolute dominance, making it difficult for developers to choose with confidence; and for another, due to the different definitions of the underlying matrix models, the software interfaces in these libraries are also completely different, making it difficult for developers to switch between the libraries. To address these problems, herein we undertake the following. Firstly, we analyze various implementation schemes and provide technical evaluations based on experiments and our experience. This analysis aims to assist developers in making appropriate choices. Secondly, we propose a set of unified hierarchical interfaces for the matrix elements and matrix theory, and implement an open-source multi-model formal matrix library called CoqMatrix that adheres to these interfaces. This implementation helps to decouple the strong connection between the underlying library and the upper-layer application. Moreover, we have constructed bijective conversion functions between different models, establishing connections among these models. In , our work offers a novel and effective solution to the challenges of multi-model and multi-application adaptability of formalized matrix theory in Coq.
computer science, software engineering, hardware & architecture
What problem does this paper attempt to address?