The Spirit of Ghost Code - Archive ouverte HAL Access content directly
Conference Papers Year : 2014

The Spirit of Ghost Code


In the context of deductive program verification, ghost code is part of the program that is added for the purpose of specification. Ghost code must not interfere with regular code, in the sense that it can be erased without any observable difference in the program outcome. In particular, ghost data cannot participate in regular computations and ghost code cannot mutate regular data or diverge. The idea exists in the folklore since the early notion of auxiliary variables and is implemented in many state-of-the-art program verification tools. However, a rigorous definition and treatment of ghost code is surprisingly subtle and few formalizations exist. In this article, we describe a simple ML-style programming language with mutable state and ghost code. Non-interference is ensured by a type system with effects, which allows, notably, the same data types and functions to be used in both regular and ghost code. We define the proce- dure of ghost code erasure and we prove its safety using bisimulation. A similar type system, with numerous extensions which we briefly discuss, is implemented in the program verification environment Why3.
Fichier principal
Vignette du fichier
main.pdf (243.64 Ko) Télécharger le fichier
Origin : Files produced by the author(s)

Dates and versions

hal-00873187 , version 1 (16-10-2013)
hal-00873187 , version 2 (13-02-2014)
hal-00873187 , version 3 (14-05-2014)


  • HAL Id : hal-00873187 , version 3


Jean-Christophe Filliâtre, Léon Gondelman, Andrei Paskevich. The Spirit of Ghost Code. CAV 2014, Computer Aided Verification - 26th International Conference, Jul 2014, Vienna Summer Logic 2014, Austria. ⟨hal-00873187v3⟩
1076 View
5048 Download


Gmail Facebook X LinkedIn More