Created
January 9, 2016 23:47
-
-
Save tangentstorm/c23f572bf7ed9771b667 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
theory QSort | |
imports Main | |
begin | |
fun qsort :: "'a::ord list ⇒ 'a list" where | |
"qsort [] = []" | |
| "qsort (x#xs) = (qsort (filter (λy. y≤x) xs)) | |
@ x#(qsort (filter (λy. y>x) xs))" | |
fun sorted :: "'a::ord list ⇒ bool" where | |
"sorted [] = True" | |
| "sorted [x] = True" | |
| "sorted (x#y#zs) = ((x ≤ y) ∧ sorted (y#zs))" | |
theorem "∀xs::('a::ord list). sorted (qsort xs)" | |
sorry | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment