Deriving an Applicative Heapsort Algorithm
This page contains information about the development of the Heapsort algorithm.
We have carried out a formal derivation of Heapsort using the program transformation system ULTRA.
To be able to reproduce the results, the version of ULTRA that we used for the derivation is available (only a few corrections have been made to the official version 2.2).
That file also contains the complete source code including the derivation protocols (see the directory heapsort).
Technical Report
The derivation of Heapsort is described in the technical report UIB-2002-02 (available as DVI.tar.gz, PS, PDF).
There is an extended version of the technical report that contains the derivation protocols (as DVI.tar.gz, PS, PDF).
See the section below for the derivation protocol files.
Appendix D: Source code
The source code, as referenced in Appendix D of the technical report, consists of the project file, 10 theory files, and one Haskell file that contains the result:
- project
- general.thy
- general-derived.thy
- bag.thy
- bag-derived.thy
- tree.thy
- tree-derived.thy
- tree-added.thy
- sort.thy
- sort-derived.thy
- sort-added.thy
- heapsort.hs
Appendix E: Derivation Protocols
The derivation protocols, as referenced in Appendix E of the technical report, consist of 30 text files generated by ULTRA:
- commutativity_transitivity.protocol
- composetree_recursive.protocol
- decomposetree_recursive.protocol
- equals_abstr_some_heap_equals_abstr.protocol
- equals_empty_nonempty.protocol
- equals_empty_union_abstr_abstr.protocol
- heap_composetree.protocol
- heap_equals_nonempty_abstr_abstr_insert.protocol
- heap_equals_union_abstr_abstr_abstr_remove.protocol
- heap_equals_union_union_abstr_abstr.protocol
- heap_equals_union_union_single_abstr.protocol
- heap_removemin.protocol
- heap_sorted_equals_elements_abstr.protocol
- insert_recursive.protocol
- introduce_composetree.protocol
- introduce_removemin.protocol
- main_development.protocol
- removemin_recursive.protocol
- some_heap_equals_empty_abstr.protocol
- some_heap_equals_nonempty_abstr.protocol
- some_heap_equals_union_abstr_abstr.protocol
- some_heap_equals_union_abstr_empty.protocol
- some_heap_equals_union_empty_abstr.protocol
- some_heap_insert_1.protocol
- some_heap_insert_2.protocol
- some_heap_remove_1.protocol
- some_heap_remove_2.protocol
- some_simplification_general.protocol
- some_sorted_equals_elements_empty.protocol
- union_union_single.protocol
Last changes 2002.12.10,
Walter Guttmann