An Efficient Coq Tactic for Deciding Kleene Algebras

  • Thomas Braibant
  • Damien Pous
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6172)


We present a reflexive tactic for deciding the equational theory of Kleene algebras in the Coq proof assistant. This tactic relies on a careful implementation of efficient finite automata algorithms, so that it solves casual equations almost instantaneously. The corresponding decision procedure was proved correct and complete; correctness is established w.r.t. any model (including binary relations), by formalising Kozen’s initiality theorem.


Binary Relation Decision Procedure Regular Expression Regular Language Correctness Proof 
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.
    Aho, A.V., Hopcroft, J.E., Ullman, J.D.: The Design and Analysis of Computer Algorithms. Addison-Wesley, Reading (1974)zbMATHGoogle Scholar
  2. 2.
    Allen, S.F., Constable, R.L., Howe, D.J., Aitken, W.E.: The semantics of reflected proof. In: LICS, pp. 95–105. IEEE Computer Society, Los Alamitos (1990)Google Scholar
  3. 3.
    Bertot, Y., Gonthier, G., Ould Biha, S., Pasca, I.: Canonical big operators. In: Mohamed, O.A., Muñoz, C., Tahar, S. (eds.) TPHOLs 2008. LNCS, vol. 5170, pp. 86–101. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  4. 4.
    Blanqui, F., Coupet-Grimal, S., Delobel, W., Koprowski, A.: CoLoR: a Coq library on rewriting and termination (2006)Google Scholar
  5. 5.
    Braibant, T., Pous, D.: Coq library: ATBR, algebraic tools for working with binary relations (May 2009),
  6. 6.
    Briais, S.: Coq development: Finite automata theory (July 2008),
  7. 7.
    Brüggemann-Klein, A.: Regular expressions into finite automata. TCS 120(2), 197–213 (1993)zbMATHCrossRefGoogle Scholar
  8. 8.
    Cohen, E., Kozen, D., Smith, F.: The complexity of Kleene algebra with tests, TR96-1598, CS Dpt., Cornell University (July 1996)Google Scholar
  9. 9.
    Conchon, S., Filliâtre, J.-C.: A Persistent Union-Find Data Structure. In: ACM SIGPLAN Workshop on ML, Freiburg, Germany, October 2007, pp. 37–45 (2007)Google Scholar
  10. 10.
    Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 2nd edn. MIT Press, Cambridge (2001)zbMATHGoogle Scholar
  11. 11.
    Doornbos, H., Backhouse, R., van der Woude, J.: A calculational approach to mathematical induction. TCS 179(1-2), 103–135 (1997)zbMATHCrossRefGoogle Scholar
  12. 12.
    Garillot, F., Gonthier, G., Mahboubi, A., Rideau, L.: Packaging mathematical structures. In: Urban, C. (ed.) TPHOLs 2009. LNCS, vol. 5674, pp. 327–342. Springer, Heidelberg (2009)Google Scholar
  13. 13.
    Gonthier, G., Mahboubi, A., Rideau, L., Tassi, E., Théry, L.: A modular formalisation of finite group theory. In: Schneider, K., Brandt, J. (eds.) TPHOLs 2007. LNCS, vol. 4732, pp. 86–101. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  14. 14.
    Grégoire, B., Mahboubi, A.: Proving equalities in a commutative ring done right in Coq. In: Hurd, J., Melham, T. (eds.) TPHOLs 2005. LNCS, vol. 3603, pp. 98–113. Springer, Heidelberg (2005)Google Scholar
  15. 15.
    Höfner, P., Struth, G.: Automated reasoning in Kleene algebra. In: Pfenning, F. (ed.) CADE 2007. LNCS (LNAI), vol. 4603, pp. 279–294. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  16. 16.
    Höfner, P., Struth, G.: On automating the calculus of relations. In: Armando, A., Baumgartner, P., Dowek, G. (eds.) IJCAR 2008. LNCS (LNAI), vol. 5195, pp. 50–66. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  17. 17.
    Ilie, L., Yu, S.: Follow automata. Inf. and Comp. 186(1), 140–162 (2003)zbMATHCrossRefMathSciNetGoogle Scholar
  18. 18.
    Kahl, W.: Calculational relation-algebraic proofs in Isabelle/Isar. In: Berghammer, R., Möller, B., Struth, G. (eds.) RelMiCS 2003. LNCS, vol. 3051, pp. 178–190. Springer, Heidelberg (2004)Google Scholar
  19. 19.
    Kleene, S.C.: Representation of events in nerve nets and finite automata. In: Automata Studies, pp. 3–41. Princeton University Press, Princeton (1956)Google Scholar
  20. 20.
    Kozen, D.: A completeness theorem for Kleene algebras and the algebra of regular events. Inf. and Comp. 110(2), 366–390 (1994)zbMATHCrossRefMathSciNetGoogle Scholar
  21. 21.
    Kozen, D.: Typed Kleene algebra, TR98-1669, CS Dpt. Cornell University (1998)Google Scholar
  22. 22.
    Kozen, D.: On Hoare logic and Kleene algebra with tests. ACM Trans. Comput. Log. 1(1), 60–76 (2000)CrossRefMathSciNetGoogle Scholar
  23. 23.
    Kozen, D., Smith, F.: Kleene algebra with tests: Completeness and decidability. In: van Dalen, D., Bezem, M. (eds.) CSL 1996. LNCS, vol. 1258, pp. 244–259. Springer, Heidelberg (1997)Google Scholar
  24. 24.
    Krob, D.: Complete systems of B-rational identities. TCS 89(2), 207–343 (1991)zbMATHCrossRefMathSciNetGoogle Scholar
  25. 25.
    Leroy, X.: A formally verified compiler back-end. JAR 43(4), 363–446 (2009)zbMATHCrossRefGoogle Scholar
  26. 26.
    Meyer, A.R., Stockmeyer, L.J.: Word problems requiring exponential time. In: Proc. STOC, pp. 1–9. ACM, New York (1973)Google Scholar
  27. 27.
    Narboux, J.: Formalisation et automatisation du raisonnement géométrique en Coq. PhD thesis, Université Paris Sud (September 2006)Google Scholar
  28. 28.
    Pous, D.: Untyping typed algebraic structures and colouring proof nets of cyclic linear logic. Technical Report RR-7176, INRIA Rhône-Alpes (January 2010)Google Scholar
  29. 29.
    Rabin, M.O., Scott, D.: Finite automata and their decision problems. IBM Journal of Research and Development 3(2), 114–125 (1959)CrossRefMathSciNetGoogle Scholar
  30. 30.
    Sozeau, M., Oury, N.: First-class type classes. In: Mohamed, O.A., Muñoz, C., Tahar, S. (eds.) TPHOLs 2008. LNCS, vol. 5170, pp. 278–293. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  31. 31.
    Struth, G.: Calculating Church-Rosser proofs in Kleene algebra. In: de Swart, H. (ed.) RelMiCS 2001. LNCS, vol. 2561, pp. 276–290. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  32. 32.
    Tarski, A., Givant, S.: A Formalization of Set Theory without Variables, AMS, Providence, Rhode Island, vol. 41. Colloquium Publications (1987)Google Scholar
  33. 33.
    Thompson, K.: Regular expression search algorithm. ACM C. 11, 419–422 (1968)zbMATHCrossRefGoogle Scholar
  34. 34.
    von Oheimb, D., Gritzner, T.F.: RALL: Machine-supported proofs for relation algebra. In: McCune, W. (ed.) CADE 1997. LNCS, vol. 1249, pp. 380–394. Springer, Heidelberg (1997)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Thomas Braibant
    • 1
  • Damien Pous
    • 1
  1. 1.LIG, UMR 5217, CNRS – INRIA 

Personalised recommendations