{-# OPTIONS --cubical-compatible #-}
open import Padova2025.ProgrammingBasics.Lists
open import Padova2025.ProvingBasics.Connectives.Disjunction
module Padova2025.VerifiedAlgorithms.InsertionSort.Implementation
(A : Set) (_≤_ : A → A → Set) (cmp? : (x y : A) → x ≤ y ⊎ y ≤ x) where
Implementation#
Explanation
Contract: “insert x ys” is ascendingly ordered, if “ys” is ascendingly ordered.
Exercise 1
insertinsert : A → List A → List A
insert = {!!}
Your solution
Exercise 2
sortsort : List A → List A
sort = {!!}
Your solution