name | word-bits-def |
version | 1.0 |
description | word-bits-def |
author | Joe Hurd <joe@gilith.com> |
license | MIT |
provenance | HOL Light theory extracted on 2011-03-15 |
show | Data.Bool |
⊦ ∀l. Data.Word.Bits.normal l ⇔ Data.List.length l = Data.Word.width
⊦ ∀w.
Data.Word.not w =
Data.Word.Bits.toWord (Data.List.map (¬) (Data.Word.Bits.fromWord w))
⊦ ∀w.
Data.Word.Bits.fromWord w =
Data.List.map (Data.Word.bit w)
(Data.List.interval Number.Numeral.zero Data.Word.width)
⊦ ∀w n.
Data.Word.bit w n ⇔
Number.Natural.odd (Data.Word.toNatural (Data.Word.shiftRight w n))
⊦ ∀w1 w2.
Data.Word.and w1 w2 =
Data.Word.Bits.toWord
(Data.List.zipWith (∧) (Data.Word.Bits.fromWord w1)
(Data.Word.Bits.fromWord w2))
⊦ ∀w1 w2.
Data.Word.or w1 w2 =
Data.Word.Bits.toWord
(Data.List.zipWith (∨) (Data.Word.Bits.fromWord w1)
(Data.Word.Bits.fromWord w2))
⊦ ∀w n.
Data.Word.shiftLeft w n =
Data.Word.fromNatural
(Number.Natural.*
(Number.Natural.exp
(Number.Numeral.bit0 (Number.Numeral.bit1 Number.Numeral.zero))
n) (Data.Word.toNatural w))
⊦ ∀w n.
Data.Word.shiftRight w n =
Data.Word.fromNatural
(Number.Natural.div (Data.Word.toNatural w)
(Number.Natural.exp
(Number.Numeral.bit0 (Number.Numeral.bit1 Number.Numeral.zero))
n))
⊦ Data.Word.Bits.toWord Data.List.[] =
Data.Word.fromNatural Number.Numeral.zero ∧
∀h t.
Data.Word.Bits.toWord (Data.List.:: h t) =
if h then
Data.Word.+
(Data.Word.shiftLeft (Data.Word.Bits.toWord t)
(Number.Numeral.bit1 Number.Numeral.zero))
(Data.Word.fromNatural (Number.Numeral.bit1 Number.Numeral.zero))
else
Data.Word.shiftLeft (Data.Word.Bits.toWord t)
(Number.Numeral.bit1 Number.Numeral.zero)
⊦ (∀q. Data.Word.Bits.compare q Data.List.[] Data.List.[] ⇔ q) ∧
∀q h1 h2 t1 t2.
Data.Word.Bits.compare q (Data.List.:: h1 t1) (Data.List.:: h2 t2) ⇔
Data.Word.Bits.compare (¬h1 ∧ h2 ∨ ¬(h1 ∧ ¬h2) ∧ q) t1 t2
⊦ T
⊦ (∃) = λP. P ((select) P)
⊦ ∀t. (∀x. t) ⇔ t
⊦ (∀) = λP. P = λx. T
⊦ ∀x. x = x ⇔ T
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀h t. Data.List.tail (Data.List.:: h t) = t
⊦ ∀t h. Data.List.head (Data.List.:: h t) = h
⊦ (∧) = λp q. (λf. f p q) = λf. f T T
⊦ (∃) = λP. ∀q. (∀x. P x ⇒ q) ⇒ q
⊦ ∀NIL' CONS'.
∃fn.
fn Data.List.[] = NIL' ∧
∀a0 a1. fn (Data.List.:: a0 a1) = CONS' a0 a1 (fn a1)
⊦ ∀t. (T ∧ t ⇔ t) ∧ (t ∧ T ⇔ t) ∧ (F ∧ t ⇔ F) ∧ (t ∧ F ⇔ F) ∧ (t ∧ t ⇔ t)