Prof. Dr. A. Poetzsch-Heffter Dipl.-Inf. P. Michel
Dipl.-Inf. C. Feller
University of Kaiserslautern
Department of Computer Science Software Technology Group
Exercise Sheet 7: Specification and Verification with Higher-Order Logic (Summer Term 2010)
Date: 09.06.2010
Exercise 1 Case Study: Quicksort
Download the “Quicksort.thy” theory from our website. It contains all the definitions and properties seen in the lecture.
Complete the following proofs:
• qsplit_length: In the lecture, this lemma was split into numerous specialized versions. You can of course state additional auxiliary lemmas like these if you want/need to.
• termination qsort(shown in the lecture)
• counts_app(lemma 2 from the blackboard)
• qsplit_counts(lemma 1 from the blackboard)
• qsort_counts(shown in the lecture)
• sorted_prop: You have seen this lemma at the end of the lecture. It will help with proving the main theorem in the lecture.
Exercise 2 Case Study: Mergesort
In this exercise we take a look at another sorting algorithm, namelymergesort. We are thereby changing the model, but keep the properties we already specified and validated for quicksort.
Download the “Mergesort.thy” theory from our website, which contains all the necessary definitions and properties.
Complete all the missing proofs like you did for quicksort. For mergesort you will of course need a different lemma capturing the basic idea of the algorithm.