Created
July 20, 2016 01:55
-
-
Save mlieberman85/a63b8a311fb27cb1f639c85ad69f1459 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xor-linear : ∀ {n} (x y : BitVector n) → bitwise-xor x y ≡ zipWith _xor_ x y | |
xor-linear x y = refl | |
xor-comm : ∀ {n} (x y : BitVector n) → bitwise-xor x y ≡ bitwise-xor y x | |
xor-comm [] [] = refl | |
xor-comm (0# ∷ xs) (0# ∷ ys) rewrite xor-comm xs ys = refl | |
xor-comm (0# ∷ xs) (1# ∷ ys) rewrite xor-comm xs ys = refl | |
xor-comm (1# ∷ xs) (0# ∷ ys) rewrite xor-comm xs ys = refl | |
xor-comm (1# ∷ xs) (1# ∷ ys) rewrite xor-comm xs ys = refl | |
xor-involution : ∀ {n} (x y : BitVector n) → bitwise-xor (bitwise-xor x y) y ≡ x | |
xor-involution [] [] = refl | |
xor-involution (0# ∷ xs) (0# ∷ ys) rewrite xor-involution xs ys = refl | |
xor-involution (0# ∷ xs) (1# ∷ ys) rewrite xor-involution xs ys = refl | |
xor-involution (1# ∷ xs) (0# ∷ ys) rewrite xor-involution xs ys = refl | |
xor-involution (1# ∷ xs) (1# ∷ ys) rewrite xor-involution xs ys = refl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment