Trace-Based Coinductive Operational Semantics for While

Big-Step and Small-Step, Relational and Functional Styles
  • Keiko Nakata
  • Tarmo Uustalu
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5674)


We present four coinductive operational semantics for the While language accounting for both terminating and non-terminating program runs: big-step and small-step relational semantics and big-step and small-step functional semantics. The semantics employ traces (possibly infinite sequences of states) to record the states that program runs go through. The relational semantics relate statement-state pairs to traces, whereas the functional semantics return traces for statement-state pairs. All four semantics are equivalent. We formalize the semantics and their equivalence proofs in the constructive setting of Coq.


Induction Hypothesis Relational Semantic Operational Semantic Loop Body Constructive Setting 
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.
    Bertot, Y., Castéran, P.: Coq’Art: Interactive Theorem Proving and Program Development. Springer, Heidelberg (2004)CrossRefzbMATHGoogle Scholar
  2. 2.
    Bertot, Y.: Filters on coinductive streams, an application to Eratosthenes’ sieve. In: Urzyczyn, P. (ed.) TLCA 2005. LNCS, vol. 3461, pp. 102–115. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  3. 3.
    Bertot, Y.: A survey of programming language semantics styles. Coq development (2007),
  4. 4.
    Capretta, V.: General recursion via coinductive types. Logical Methods in Computer Science 1(2), 1–18 (2005)MathSciNetCrossRefzbMATHGoogle Scholar
  5. 5.
    Cousot, P., Cousot, R.: Inductive definitions, semantics and abstract interpretation. In: Conf. Record of 19th ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL 1992, Albuquerque, NM, pp. 83–94. ACM Press, New York (1992)Google Scholar
  6. 6.
    Cousot, P., Cousot, R.: Bi-inductive structural semantics. Inform. and Comput. 207(2), 258–283 (2009)MathSciNetCrossRefzbMATHGoogle Scholar
  7. 7.
    Giménez, E.: Codifying guarded definitions with recursive schemes. In: Smith, J., Dybjer, P., Nordström, B. (eds.) TYPES 1994. LNCS, vol. 996, pp. 39–59. Springer, Heidelberg (1995)CrossRefGoogle Scholar
  8. 8.
    Giménez, E.: Structural recursive definitions in type theory. In: Larsen, K.G., Skyum, S., Winskel, G. (eds.) ICALP 1998. LNCS, vol. 1443, pp. 397–408. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  9. 9.
    Glesner, S.: A proof calculus for natural semantics based on greatest fixed point semantics. In: Knoop, J., Necula, G.C., Zimmermann, W. (eds.) Proc. of 3rd Int. Wksh. on Compiler Optimization Meets Compiler Verification, COCV 2004, Barcelona. Electron. Notes in Theor. Comput. Sci., vol. 132(1), pp. 73–93. Elsevier, Amsterdam (2005)Google Scholar
  10. 10.
    Glesner, S., Leitner, J., Blech, J.O.: Coinductive verification of program optimizations using similarity relations. In: Knoop, J., Necula, G.C., Zimmermann, W. (eds.) Proc. of 5th Int. Wksh. on Compiler Optimization Meets Compiler Verification, COCV 2006, Vienna. Electron. Notes in Theor. Comput. Sci., vol. 176(3), pp. 61–77. Elsevier, Amsterdam (2007)Google Scholar
  11. 11.
    Gonthier, G., Mahboubi, A.: A small scale reflection extension for the Coq system. Technical Report RR-6455, INRIA (2008)Google Scholar
  12. 12.
    Hasuo, I., Jacobs, B., Sokolova, A.: Generic trace semantics via coinduction. Logical Methods in Comput. Sci. 3(4), article 11(2007)Google Scholar
  13. 13.
    Leroy, X.: The Compcert verified compiler. Commented Coq development (2008),
  14. 14.
    Leroy, X., Grall, H.: Coinductive big-step operational semantics. Inform. and Comput. 207(2), 285–305 (2009)MathSciNetCrossRefzbMATHGoogle Scholar
  15. 15.
    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
  16. 16.
    Nestra, H.: Fractional semantic. In: Johnson, M., Vene, V. (eds.) AMAST 2006. LNCS, vol. 4019, pp. 278–292. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  17. 17.
    Nestra, H.: Transfinite semantics in the form of greatest fixpoint. J. of Logic and Algebr. Program (to appear)Google Scholar
  18. 18.
    Rutten, J.: A note on coinduction and weak bisimilarity for While programs. Theor. Inform. and Appl. 33(4–5), 393–400 (1999)MathSciNetCrossRefzbMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2009

Authors and Affiliations

  • Keiko Nakata
    • 1
  • Tarmo Uustalu
    • 1
  1. 1.Institute of Cybernetics at Tallinn University of TechnologyTallinnEstonia

Personalised recommendations