Package list-last: The last list function
Information
name | list-last |
version | 1.53 |
description | The last list function |
author | Joe Leslie-Hurd <joe@gilith.com> |
license | MIT |
checksum | 02d5425ffbdd0eaee8eba7b447ec0cf692b94dbf |
requires | bool list-append list-def list-dest |
show | Data.Bool Data.List |
Files
- Package tarball list-last-1.53.tgz
- Theory source file list-last.thy (included in the package tarball)
Defined Constant
- Data
- List
- last
- List
Theorems
⊦ ∀x. last (x :: []) = x
⊦ ∀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
- →
- bool
- Data
- List
- list
- List
External Constants
- =
- select
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- ¬
- cond
- ⊥
- ⊤
- List
- ::
- @
- []
- null
- Bool
Assumptions
⊦ ⊤
⊦ null []
⊦ ⊥ ⇔ ∀p. p
⊦ (¬) = λp. p ⇒ ⊥
⊦ (∃) = λp. p ((select) p)
⊦ ∀t. (∀x. t) ⇔ t
⊦ (∀) = λp. p = λx. ⊤
⊦ ∀t. t ∧ ⊥ ⇔ ⊥
⊦ ∀l. [] @ l = l
⊦ ∀l. l @ [] = l
⊦ ∀h t. ¬null (h :: t)
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀t1 t2. (if ⊥ then t1 else t2) = t2
⊦ ∀t1 t2. (if ⊤ then t1 else t2) = t1
⊦ (∧) = λp q. (λf. f p q) = λf. f ⊤ ⊤
⊦ (∃) = λp. ∀q. (∀x. p x ⇒ q) ⇒ q
⊦ ∀l1 l2. null (l1 @ l2) ⇔ null l1 ∧ null l2
⊦ ∀l h t. (h :: t) @ l = h :: t @ l
⊦ ∀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)