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.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
hi@scite.ai
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.