Package map-reduce-bit3x3: Correctness proof for the map reduce 3x3 bit matrix example

Information

namemap-reduce-bit3x3
version1.1
descriptionCorrectness proof for the map reduce 3x3 bit matrix example
authorJoe Hurd <joe@gilith.com>
licenseMIT
requiresbase
showData.Bool
Data.List
Data.Pair

Files

Defined Constants

Theorems

Bit3x3.product = foldl Bit3x3.* Bit3x3.identity

a b. Bit.* a b a b

a b. Bit.+ a b ¬(a b)

l1 l2.
    Bit3x3.product (l1 @ l2) =
    Bit3x3.* (Bit3x3.product l1) (Bit3x3.product l2)

Bit3x3.identity = ((, , ), (, , ), , , )

a1 a2 a3 b1 b2 b3.
    Bit3.dot (a1, a2, a3) (b1, b2, b3)
    Bit.+ (Bit.* a1 b1) (Bit.+ (Bit.* a2 b2) (Bit.* a3 b3))

a.
    a11 a12 a13 a21 a22 a23 a31 a32 a33.
      a = ((a11, a12, a13), (a21, a22, a23), a31, a32, a33)

a11 a12 a13 a21 a22 a23 a31 a32 a33 b11 b12 b13 b21 b22 b23 b31 b32 b33.
    Bit3x3.* ((a11, a12, a13), (a21, a22, a23), a31, a32, a33)
      ((b11, b12, b13), (b21, b22, b23), b31, b32, b33) =
    ((Bit3.dot (a11, a12, a13) (b11, b21, b31),
      Bit3.dot (a11, a12, a13) (b12, b22, b32),
      Bit3.dot (a11, a12, a13) (b13, b23, b33)),
     (Bit3.dot (a21, a22, a23) (b11, b21, b31),
      Bit3.dot (a21, a22, a23) (b12, b22, b32),
      Bit3.dot (a21, a22, a23) (b13, b23, b33)),
     Bit3.dot (a31, a32, a33) (b11, b21, b31),
     Bit3.dot (a31, a32, a33) (b12, b22, b32),
     Bit3.dot (a31, a32, a33) (b13, b23, b33))

Input Type Operators

Input Constants

Assumptions

¬

¬

t. t t

a. x. x = a

() = λp. p = λx.

t. ¬¬t t

t. ( t) t

t. t

t. t t

t. t

t. t t

t. t

t. t t

t. t

t. t t

t. t

t. ( t) ¬t

t. (t ) ¬t

t. t ¬t

() = λp q. p q p

t. (t ) (t )

x y. fst (x, y) = x

x y. snd (x, y) = y

p. x y. p = (x, y)

x y. x = y y = x

t1 t2. t1 t2 t2 t1

() = λp q. (λf. f p q) = λf. f

() = λp. q. (x. p x q) q

p a. (x. a = x p x) p a

() = λp q. r. (p r) (q r) r

p q. (x. p x) q x. p x q

t1 t2 t3. (t1 t2) t3 t1 t2 t3

x y a b. (x, y) = (a, b) x = a y = b

g f b l1 l2.
    (s. g s b = s) (s1 s2 x. g s1 (f s2 x) = f (g s1 s2) x)
    foldl f b (l1 @ l2) = g (foldl f b l1) (foldl f b l2)