Package stream-def: Definition of stream types
Information
name | stream-def |
version | 1.21 |
description | Definition of stream types |
author | Joe Leslie-Hurd <joe@gilith.com> |
license | MIT |
provenance | HOL Light theory extracted on 2012-08-11 |
requires | bool function list natural pair |
show | Data.Bool Data.List Data.Pair Data.Stream Function Number.Natural |
Files
- Package tarball stream-def-1.21.tgz
- Theory file stream-def.thy (included in the package tarball)
Defined Type Operator
- Data
- Stream
- stream
- Stream
Defined Constants
- Data
- Stream
- ::
- @
- drop
- fromFunction
- head
- interleave
- map
- nth
- split
- tail
- take
- unfold
- Stream
Theorems
⊦ ∀s. take s 0 = []
⊦ ∀s. fromFunction (nth s) = s
⊦ ∀f. nth (fromFunction f) = f
⊦ ∀s. head s = nth s 0
⊦ ∀s. tail s = drop s 1
⊦ ∀f s. map f s = fromFunction (f ∘ nth s)
⊦ ∀s n. drop s n = fromFunction (λm. nth s (m + n))
⊦ ∀s n. take s (suc n) = head s :: take (tail s) n
⊦ ∀f b. unfold f b = fromFunction (λn. fst (f (((snd ∘ f) ↑ n) b)))
⊦ ∀h t. h :: t = fromFunction (λn. if n = 0 then h else nth t (n - 1))
⊦ ∀l s.
l @ s =
fromFunction
(λn. if n < length l then nth l n else nth s (n - length l))
⊦ ∀s1 s2.
interleave s1 s2 =
fromFunction
(λn. if even n then nth s1 (n div 2) else nth s2 (n div 2))
⊦ ∀s.
split s =
(fromFunction (λn. nth s (2 * n)),
fromFunction (λn. nth s (2 * n + 1)))
Input Type Operators
- →
- bool
- Data
- List
- list
- Pair
- ×
- List
- Number
- Natural
- natural
- Natural
Input Constants
- =
- select
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- ∃!
- cond
- ⊤
- List
- ::
- []
- length
- nth
- Pair
- ,
- fst
- snd
- Bool
- Function
- ↑
- ∘
- Number
- Natural
- *
- +
- -
- <
- bit0
- bit1
- div
- even
- suc
- zero
- Natural
Assumptions
⊦ ⊤
⊦ (∃) = λp. p ((select) p)
⊦ ∀t. (∀x. t) ⇔ t
⊦ ∀t. (∃x. t) ⇔ t
⊦ (∀) = λp. p = λx. ⊤
⊦ ∀t. (⊤ ⇔ t) ⇔ t
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ (∧) = λp q. (λf. f p q) = λf. f ⊤ ⊤
⊦ (∃) = λp. ∀q. (∀x. p x ⇒ q) ⇒ q
⊦ ∀p. (∀x. ∃y. p x y) ⇔ ∃y. ∀x. p x (y x)
⊦ (∃!) = λp. (∃) p ∧ ∀x y. p x ∧ p y ⇒ x = y
⊦ ∀e f. ∃!fn. fn 0 = e ∧ ∀n. fn (suc n) = f (fn n) n