Package list-reverse: The list reverse function

Information

namelist-reverse
version1.22
descriptionThe list reverse function
authorJoe Hurd <joe@gilith.com>
licenseMIT
requiresbool
natural
set
list-def
list-length
list-set
list-append
showData.Bool
Data.List
Number.Natural
Set

Files

Defined Constant

Theorems

reverse [] = []

l. reverse (reverse l) = l

l. length (reverse l) = length l

l. toSet (reverse l) = toSet l

l m. reverse (l @ m) = reverse m @ reverse l

x l. reverse (x :: l) = reverse l @ x :: []

Input Type Operators

Input Constants

Assumptions

T

length [] = 0

toSet [] =

() = λP. P ((select) P)

t. (x. t) t

() = λp. p = λx. T

m. m + 0 = m

l. [] @ l = l

l. l @ [] = l

() = λp q. p q p

s t. s t = t s

h t. length (h :: t) = suc (length t)

() = λp q. (λf. f p q) = λf. f T T

h t. toSet (h :: t) = insert h (toSet t)

x s. insert x s = insert x s

m n. m + suc n = suc (m + n)

l m. length (l @ m) = length l + length m

l1 l2. toSet (l1 @ l2) = toSet l1 toSet l2

l h t. (h :: t) @ l = h :: t @ l

l m n. l @ m @ n = (l @ m) @ n

P. P [] (a0 a1. P a1 P (a0 :: a1)) x. P x

NIL' CONS'.
    fn. fn [] = NIL' a0 a1. fn (a0 :: a1) = CONS' a0 a1 (fn a1)