Skip to content

insertion sort and bubble sort implementations carrying proofs of correctness

Notifications You must be signed in to change notification settings

namanhd/idris2-proj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Idris 2 project

CMSC 22500 Spring 2022

Proofs of correctness: Insertion sort and Bubble sort

This repo contains proof-carrying implementations of insertion sort (InsSort.idr) and bubble sort (BubbleSort.idr). The proof terms carried throughout the algorithms in dependent pairs prove the correctness of each sorting algorithm alongside giving the actual sort result. This includes

  • A proof that the output list is sorted
  • A proof that the output list is a permutation of the original input list.

The proofs are largely by induction, utilizing the invariants characteristic to each sorting algorithm. The details are hairy, but the comments in the code should have enough detail to walk one through the proof.

Written and working in Idris 2 (version 0.5.1); parts of the setup of the proofs, including the definitions of sortedness and permutations, are adapted from https://github.com/davidfstr/idris-insertion-sort; the rest of the proofs are original.

About

insertion sort and bubble sort implementations carrying proofs of correctness

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages