Package list-last: The last list function
Information
name | list-last |
version | 1.54 |
description | The last list function |
author | Joe Leslie-Hurd <joe@gilith.com> |
license | MIT |
checksum | f8c7a22a66273bc3c7f2e471df1c6547ade21efd |
requires | bool list-append list-def list-dest list-reverse list-thm |
show | Data.Bool Data.List |
Files
- Package tarball list-last-1.54.tgz
- Theory source file list-last.thy (included in the package tarball)
Defined Constant
- Data
- List
- last
- List
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
- →
- bool
- Data
- List
- list
- List
External Constants
- =
- select
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- ∨
- ¬
- cond
- ⊥
- ⊤
- List
- ::
- @
- []
- head
- null
- reverse
- Bool
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)