Package list-last: The last list function

Information

namelist-last
version1.54
descriptionThe last list function
authorJoe Leslie-Hurd <joe@gilith.com>
licenseMIT
checksumf8c7a22a66273bc3c7f2e471df1c6547ade21efd
requiresbool
list-append
list-def
list-dest
list-reverse
list-thm
showData.Bool
Data.List

Files

Defined Constant

Theorems

x. last (x :: []) = x

l. ¬(l = []) head (reverse l) = last l

l. ¬(l = []) last (reverse l) = head l

h t. last (h :: t) = if null t then h else last t

l1 l2. last (l1 @ l2) = if null l2 then last l1 else last l2

x1 x2 l. last (x1 :: x2 :: l) = last (x2 :: l)

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

External Type Operators

External Constants

Assumptions

null []

¬

¬

reverse [] = []

p. p

t. t ¬t

(¬) = λp. p

() = λp. p ((select) p)

t. (x. t) t

t. (λx. t x) = t

() = λp. p = λx.

t. ¬¬t t

t. ( t) t

t. t

t. t t

t. t

t. t t

t. t

t. t t

t. t

t. t t

t. t

t. t t

t. t

l. reverse (reverse l) = l

l. [] @ l = l

l. l @ [] = l

t. ( t) ¬t

t. t ¬t

h t. ¬null (h :: t)

() = λp q. p q p

t. (t ) (t )

t1 t2. (if then t1 else t2) = t2

t1 t2. (if then t1 else t2) = t1

h t. ¬(h :: t = [])

h t. head (h :: t) = h

l. reverse l = [] l = []

t1 t2. t1 t2 t2 t1

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

p. ¬(x. p x) x. ¬p x

() = λp. q. (x. p x q) q

l1 l2. null (l1 @ l2) null l1 null l2

() = λp q. r. (p r) (q r) r

h t. reverse (h :: t) = reverse t @ h :: []

t1 t2 t3. (t1 t2) t3 t1 t2 t3

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

p q. (x. p x q x) (x. p x) x. q x

p. p [] (h t. p t p (h :: t)) l. p l

b f. fn. fn [] = b h t. fn (h :: t) = f h t (fn t)