Package word-bits-def: word-bits-def

Information

nameword-bits-def
version1.0
descriptionword-bits-def
authorJoe Hurd <joe@gilith.com>
licenseMIT
provenanceHOL Light theory extracted on 2011-03-15
showData.Bool

Files

Defined Constants

Theorems

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

Input Type Operators

Input Constants

Assumptions

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)