Package word-bits-def: Definition of word to bit-list conversions
Information
name | word-bits-def |
version | 1.39 |
description | Definition of word to bit-list conversions |
author | Joe Hurd <joe@gilith.com> |
license | MIT |
provenance | HOL Light theory extracted on 2012-03-08 |
requires | bool list |
show | Data.Bool Data.List Data.Word Data.Word.Bits Number.Natural |
Files
- Package tarball word-bits-def-1.39.tgz
- Theory file word-bits-def.thy (included in the package tarball)
Defined Constants
- Data
- Word
- and
- bit
- not
- or
- shiftLeft
- shiftRight
- Bits
- compare
- fromWord
- normal
- toWord
- Word
Theorems
⊦ toWord [] = 0
⊦ ∀q. compare q [] [] ⇔ q
⊦ ∀l. normal l ⇔ length l = width
⊦ ∀w. not w = toWord (map (¬) (fromWord w))
⊦ ∀w. fromWord w = map (bit w) (interval 0 width)
⊦ ∀w n. bit w n ⇔ odd (toNatural (shiftRight w n))
⊦ ∀w1 w2. and w1 w2 = toWord (zipWith (∧) (fromWord w1) (fromWord w2))
⊦ ∀w1 w2. or w1 w2 = toWord (zipWith (∨) (fromWord w1) (fromWord w2))
⊦ ∀w n. shiftLeft w n = fromNatural (2 ^ n * toNatural w)
⊦ ∀w n. shiftRight w n = fromNatural (toNatural w div 2 ^ n)
⊦ ∀h t.
toWord (h :: t) =
if h then shiftLeft (toWord t) 1 + 1 else shiftLeft (toWord t) 1
⊦ ∀q h1 h2 t1 t2.
compare q (h1 :: t1) (h2 :: t2) ⇔
compare (¬h1 ∧ h2 ∨ ¬(h1 ∧ ¬h2) ∧ q) t1 t2
Input Type Operators
- →
- bool
- Data
- List
- list
- Word
- word
- List
- Number
- Natural
- natural
- Natural
Input Constants
- =
- select
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- ∨
- ¬
- cond
- ⊤
- List
- ::
- []
- head
- interval
- length
- map
- tail
- zipWith
- Word
- +
- fromNatural
- toNatural
- width
- Bool
- Number
- Natural
- *
- ^
- bit0
- bit1
- div
- odd
- zero
- Natural
Assumptions
⊦ ⊤
⊦ (∃) = λp. p ((select) p)
⊦ ∀t. (∀x. t) ⇔ t
⊦ (∀) = λp. p = λx. ⊤
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀h t. head (h :: t) = h
⊦ ∀h t. tail (h :: t) = t
⊦ (∧) = λ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)
⊦ ∀NIL' CONS'.
∃fn. fn [] = NIL' ∧ ∀a0 a1. fn (a0 :: a1) = CONS' a0 a1 (fn a1)