Summary: Computer Aided Formal Reasoning 2005 Martin Hofmann
Uebungsblatt 6 Sorting
The goal of this exercise is to specify and verify the insertion sort algorithm which intuitively
works as follows.
To insert an element into an already sorted list you just go along the list until you find the
position where the new element belongs.
To sort a list you start with the empty list (which is trivially sorted) and then successively
insert the elements of your input list.
If you have trouble understanding this think of a pile of exam papers you want to sort
lexicographically. You put them to your left and to your right you create a sorted pile by
moving the exam papers over one at a time and inserting them in the right position.
Your task is to prove all the theorems in the following PVS theory. You can use whatever
commands you wish. You do not need to do the proofs in order; you do not need to do all of
them though this will incur a reduction in marks.
insert : THEORY
t : TYPE
leq : [t,t->boolean]
leq_trans : AXIOM