skip to main content
10.1145/1900008.1900056acmconferencesArticle/Chapter ViewAbstractPublication Pagesacm-seConference Proceedingsconference-collections
research-article

Formally certified stable marriages

Published: 15 April 2010 Publication History

Abstract

We present an implementation of the Gale-Shapley stable matching algorithm in the Coq proof assistant. The resulting program is guaranteed to terminate and provides a proof of the stability of the matchings that it produces. While proofs of the algorithm's termination and correctness exist on paper, our purpose was to investigate the process of developing a completely formalized proof for an executable implementation. The stages of our development are presented as a series of refinements to an initial version of the program. We suggest that the incremental approach we demonstrate is a reasonable model to follow in developing formalized correctness proofs for complex algorithms.

References

[1]
Y. Bertot and P. Casteran. Interactive Theorem Proving and Program Development: Coq'Art: The Calculus of Inductive Constructions. Springer Verlag, 2004.
[2]
Y. Bertot, N. Magaud, and P. Zimmermann. A proof of GMP square root. J. Autom. Reason., 29(3--4):225--252, 2002.
[3]
S. Conchon and J.-C. Filliâtre. A persistent union-find data structure. In ML '07: Proceedings of the 2007 workshop on Workshop on ML, pages 37--46, New York, NY, USA, 2007. ACM.
[4]
S. Coupet-Grimal and L. Jakubiec. Certifying circuits in type theory. Form. Asp. Comput., 16(4):352--373, 2004.
[5]
J.-C. Filliâtre. Formal proof of a program: Find. Sci. Comput. Program., 64(3):332--340, 2007.
[6]
J.-C. Filliâtre and N. Magaud. Certification of sorting algorithms in the system Coq. In Theorem Proving in Higher Order Logics: Emerging Trends, 1999.
[7]
J.-C. Filliâtre and C. Marché. The why/krakatoa/caduceus platform for deductive program verification. In Proceedings of Computer Aided Verification, volume 4590 of LNCS, pages 173--177. Springer Berlin, 2007.
[8]
D. Gale and L. S. Shapley. College admissions and the stability of marriage. The American Mathematical Monthly, 69(1):9--15, 1962.
[9]
C. A. R. Hoare. An axiomatic basis for computer programming. Commun. ACM, 12(10):576--580, 1969.
[10]
C. A. R. Hoare. Proof of a program: FIND. Commun. ACM, 14(1):39--45, 1971.
[11]
J. Kleinberg and E. Tardos. Algorithm Design. Addison-Wesley, Boston, MA, USA, 2005.
[12]
T. Leighton and R. Rubinfeld. 6.042 lecture notes: Graph theory II. http://www.cs.princeton.edu/courses/archive/fall06/cos341/handouts/graph2.pdf, accessed January 2010.
[13]
X. Leroy. Formal verification of a realistic compiler. Commun. ACM, 52(7):107--115, 2009.
[14]
C. Marché, C. Paulin-Mohring, and X. Urbain. The krakatoa tool for certification of java/javacard programs annotated in jml. Journal of Logic and Algebraic Programming, 58(1--2):89--106, 2004.
[15]
G. C. Necula. Proof-carrying code. In POPL '97: Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 106--119, New York, NY, USA, 1997. ACM.
[16]
C. Paulin-Mohring. Inductive definitions in the system Coq---rules and properties. In M. Bezem and J. Groote, editors, Proceedings TLCA, volume 664 of LNCS. Springer Berlin, 1993.
[17]
M. Sozeau. Program-ing finger trees in Coq. In ICFP '07: Proceedings of the 12th ACM SIGPLAN international conference on Functional programming, pages 13--24, New York, NY, USA, 2007. ACM.
[18]
The Coq Development Team. The Coq proof assistant reference manual. Version 8.2, 2009.
[19]
D. Yu, N. A. Hamid, and Z. Shao. Building certified libraries for PCC: dynamic storage allocation. Sci. Comput. Program., 50(1--3):101--127, 2004.

Cited By

View all

Index Terms

  1. Formally certified stable marriages

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM Conferences
      ACMSE '10: Proceedings of the 48th annual ACM Southeast Conference
      April 2010
      488 pages
      ISBN:9781450300643
      DOI:10.1145/1900008
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Sponsors

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 15 April 2010

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. Coq proof assistant
      2. formal methods
      3. stable matching

      Qualifiers

      • Research-article

      Conference

      ACM SE '10
      Sponsor:
      ACM SE '10: ACM Southeast Regional Conference
      April 15 - 17, 2010
      Mississippi, Oxford

      Acceptance Rates

      ACMSE '10 Paper Acceptance Rate 48 of 94 submissions, 51%;
      Overall Acceptance Rate 402 of 779 submissions, 52%

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)7
      • Downloads (Last 6 weeks)0
      Reflects downloads up to 15 Feb 2025

      Other Metrics

      Citations

      Cited By

      View all

      View Options

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Figures

      Tables

      Media

      Share

      Share

      Share this Publication link

      Share on social media