Coq: the world's best macro assembler? - Archive ouverte HAL Accéder directement au contenu
Communication Dans Un Congrès Année : 2013

Coq: the world's best macro assembler?

Résumé

We describe a Coq formalization of a subset of the x86 architecture. One emphasis of the model is brevity: using dependent types, type classes and notation we give the x86 semantics a makeover that counters its reputation for baroqueness. We model bits, bytes, and memory concretely using functions that can be computed inside Coq itself; concrete representations are mapped across to mathematical objects in the SSReflect library (naturals, and integers modulo 2n) to prove theorems. Finally, we use notation to support conventional assembly code syntax inside Coq, including lexically-scoped labels. Ordinary Coq definitions serve as a powerful "macro" feature for everything from simple conditionals and loops to stack-allocated local variables and procedures with parameters. Assembly code can be assembled within Coq, producing a sequence of hex bytes. The assembler enjoys a correctness theorem relating machine code in memory to a separation-logic formula suitable for program verification.
Fichier non déposé

Dates et versions

hal-01081548 , version 1 (09-11-2014)

Identifiants

Citer

Nick Benton, Andrew Kennedy, Jonas Jensen, Pierre-Évariste Dagand. Coq: the world's best macro assembler?. PPDP 2013: ACM Symposium on Principles and Practice of Declarative Programming, Sep 2013, Madrid, Spain. ⟨10.1145/2505879.2505897⟩. ⟨hal-01081548⟩
109 Consultations
0 Téléchargements

Altmetric

Partager

Gmail Facebook X LinkedIn More