Deductive Synthesis of Bubble–Sort Using Multisets

Isabela Drămnesc, Tudor Jebelean · 2020

We demonstrate the possibility of automated synthesis of the Bubble–Sort algorithm as a rewrite program, a functional program, and an iterative program, starting from the specification. First a rewrite set of clauses for the algorithm Max–Sort is generated from the automatic proof of the synthesis conjecture, representing the main algorithm as well as the necessary auxiliary functions. This is then transformed into a tail recursive Bubble–Sort and by logical analysis the possibility of adding a flag for avoiding unnecessary recursions is identified. This new, more efficient algorithm is then transformed into a functional program, and finally into an imperative program. The practical experiments are performed using the Theorema system.

Read the paper · More papers on PaperTik