Handcrafted Inversions Made Operational on Operational Semantics

  • Jean-François Monin
  • Xiaomu Shi
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7998)


When reasoning on formulas involving large-size inductively defined relations, such as the semantics of a real programming language, many steps require the inversion of a hypothesis. The built-in “inversion” tactic of Coq can then be used, but it suffers from severe controllability, maintenance and efficiency issues, which makes it unusable in practice in large applications.

To circumvent this issue, we propose a proof technique based on the combination of an antidiagonal argument and the impredicative encoding of inductive data-structures. We can then encode suitable helper tactics in LTac, yielding scripts which are much shorter (as well as corresponding proof terms) and, more importantly, much more robust against changes in version changes in the background software. This is illustrated on correctness proofs of non-trivial C programs according to the operational semantics of C defined in CompCert.


Operational Semantic Memory State Dependent Type Proof Assistant Inductive Type 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    ARM. ARM Architecture Reference Manual DDI 0100I. ARM (2005)Google Scholar
  2. 2.
    Bertot, Y., Castéran, P.: Interactive Theorem Proving and Program Development. Coq’Art: The Calculus of Inductive Constructions. Texts in Theoretical Computer Science. Springer (2004)Google Scholar
  3. 3.
    Blanqui, F., Helmstetter, C., Joloboff, V., Monin, J.-F., Shi, X.: Designing a CPU model: from a pseudo-formal document to fast code. In: Proceedings of the 3rd Workshop on Rapid Simulation and Performance Evaluation: Methods and Tools, Heraklion, Greece (January 2011)Google Scholar
  4. 4.
    Chlipala, A.: Certified Programming with Dependent Types (2012),
  5. 5.
    Cornes, C., Terrasse, D.: Automating inversion of inductive predicates in coq. In: Berardi, S., Coppo, M. (eds.) TYPES 1995. LNCS, vol. 1158, pp. 85–104. Springer, Heidelberg (1996)CrossRefGoogle Scholar
  6. 6.
    Leroy, X.: Formal verification of a realistic compiler. Communications of the ACM 52(7), 107–115 (2009)CrossRefGoogle Scholar
  7. 7.
    McBride, C.: Inverting Inductively Defined Relations in LEGO. In: Giménez, E., Paulin-Mohring, C. (eds.) TYPES 1996. LNCS, vol. 1512, pp. 236–253. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  8. 8.
    McBride, C.: Elimination with a Motive. In: Callaghan, P., Luo, Z., McKinna, J., Pollack, R. (eds.) TYPES 2000. LNCS, vol. 2277, pp. 197–216. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  9. 9.
    Monin, J.-F.: Proof Trick: Small Inversions. In: Bertot, Y. (ed.) Second Coq Workshop, Royaume-Uni Edinburgh. Yves Bertot (July 2010)Google Scholar
  10. 10.
    Monin, J.-F., Shi, X.: Coq Examples for Handcrafted Inversions (2013),
  11. 11.
    Nielson, H.R., Nielson, F.: Semantics with applications: A formal introduction. John Wiley & Sons, Inc., New York (1992)zbMATHGoogle Scholar
  12. 12.
    Pierce, B.C., Casinghino, C., Greenberg, M.: Software Foundations (2009),
  13. 13.
    Ricciotti, W.: Theoretical and Implementation Aspects in the Mechanization of the Metatheory of Programming Languages. PhD thesis, Università di Bologna (2011)Google Scholar
  14. 14.
    Shi, X., Monin, J.-F., Tuong, F., Blanqui, F.: First Steps Towards the Certification of an ARM Simulator Using Compcert. In: Jouannaud, J.-P., Shao, Z. (eds.) CPP 2011. LNCS, vol. 7086, pp. 346–361. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  15. 15.
    The Coq Development Team. The Coq Proof Assistant Reference Manual – Version V8.3 (2010),

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Jean-François Monin
    • 1
    • 2
  • Xiaomu Shi
    • 1
  1. 1.Université de Grenoble 1 - VERIMAGFrance
  2. 2.CNRS - LIAMAFrance

Personalised recommendations