Package list-reverse: The list reverse function
Information
name | list-reverse |
version | 1.25 |
description | The list reverse function |
author | Joe Hurd <joe@gilith.com> |
license | MIT |
requires | bool natural set list-def list-length list-set list-append |
show | Data.Bool Data.List Number.Natural Set |
Files
- Package tarball list-reverse-1.25.tgz
- Theory file list-reverse.thy (included in the package tarball)
Defined Constant
- Data
- List
- reverse
- List
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
- →
- bool
- Data
- List
- list
- List
- Number
- Natural
- natural
- Natural
- Set
- set
Input Constants
- =
- select
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- T
- List
- ::
- @
- []
- length
- toSet
- Bool
- Number
- Natural
- +
- suc
- zero
- Natural
- Set
- ∅
- insert
- ∪
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. (∀x. ∃y. p x y) ⇔ ∃y. ∀x. p x (y x)
⊦ ∀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)