Skip to Main Content
By constructive proofs of the existence of the sorted version of the input list, we synthesize automatically five inductive sorting algorithms: Selection-Sort, Insertion-Sort, Quick-Sort, Merge-Sort, as well as a novel algorithm similar to Merge-Sort. Each algorithm uses certain auxiliary inductive functions, which are also automatically synthesized. The automatic proofs use natural style inferences like traditionally in the Theorema system (www.theorema.org). This case study reveals various novel proof techniques specific to the domain of lists, which are crucial for the automation of the proving process. These techniques include: goal oriented reasoning using meta-variables, several versions of induction on lists, and the use of partially unsolved goals. For increased efficiency we also use some special inference rules which are specific to certain predicates on lists, like for instance “is permutation of” (two lists have the same elements with the same number of occurrences), or “is Sorted” (a list is ordered).