Abstract
This article describes introducing students to formal methods using the interactive proof assistant Coq. The course is taught to fourth-year undergraduate students. Formal methods are mathematically based languages, techniques and tools for specification, development and verification of software and hardware systems. Their importance grows with the complexity of systems that are being developed. Formal methods are widely used in applications where the price of error is very high. The goals of the course include sharpening students’ skills in writing rigorous mathematical proofs, as well as demonstrating practical applications of the previous course in mathematical logic. Towards this purpose Coq is used for specification, implementation and verification of algorithms. The first part is devoted to working with topics that are familiar to students, such as arithmetic and proofs by induction; however, this is done in a much more rigorous way. The last three or four weeks are devoted to working on a group project, which consists of developing a complete specification and verification of an algorithm, such as finding maximum in a one- or two-dimensional array, checking if a number is prime or finding an integer root of an equation. Since the course length is limited due to the need to work on bachelor's thesis, the course tries to minimize nontrivial aspects of Coq. The use of complex inductive types and predicates is avoided. Arrays are modeled using functions from natural numbers rather than lists. The Curry-Howard correspondence, which is the theoretical foundation of Coq, can be described as time permits. This comparative simplicity, which is appropriate for the first introduction to formal methods, distinguishes the course from its analogs.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.