Stability | experimental |
---|---|

Maintainer | erkokl@gmail.com |

Safe Haskell | None |

Proves (instances of) Shannon's expansion theorem and other relevant facts. See: http://en.wikipedia.org/wiki/Shannon's_expansion

- type Ternary = SBool -> SBool -> SBool -> SBool
- type Binary = SBool -> SBool -> SBool
- pos :: (SBool -> a) -> a
- neg :: (SBool -> a) -> a
- shannon :: IO ThmResult
- shannon2 :: IO ThmResult
- derivative :: Ternary -> Binary
- noWiggle :: IO ThmResult
- universal :: Ternary -> Binary
- univOK :: IO ThmResult
- existential :: Ternary -> Binary
- existsOK :: IO ThmResult

# Boolean functions

# Shannon cofactors

pos :: (SBool -> a) -> aSource

Positive Shannon cofactor of a boolean function, with respect to its first argument

neg :: (SBool -> a) -> aSource

Negative Shannon cofactor of a boolean function, with respect to its first argument

# Shannon expansion theorem

Shannon's expansion over the first argument of a function. We have:

`>>>`

Q.E.D.`shannon`

shannon2 :: IO ThmResultSource

Alternative form of Shannon's expansion over the first argument of a function. We have:

`>>>`

Q.E.D.`shannon2`

# Derivatives

derivative :: Ternary -> BinarySource

Computing the derivative of a boolean function (boolean difference). Defined as exclusive-or of Shannon cofactors with respect to that variable.

noWiggle :: IO ThmResultSource

The no-wiggle theorem: If the derivative of a function with respect to a variable is constant False, then that variable does not wiggle the function; i.e., any changes to it won't affect the result of the function. In fact, we have an equivalence: The variable only changes the result of the function iff the derivative with respect to it is not False:

`>>>`

Q.E.D.`noWiggle`

# Universal quantification

universal :: Ternary -> BinarySource

Universal quantification of a boolean function with respect to a variable. Simply defined as the conjunction of the Shannon cofactors.

Show that universal quantification is really meaningful: That is, if the universal quantification with respect to a variable is True, then both cofactors are true for those arguments. Of course, this is a trivial theorem if you think about it for a moment, or you can just let SBV prove it for you:

`>>>`

Q.E.D.`univOK`

# Existential quantification

existential :: Ternary -> BinarySource

Existential quantification of a boolean function with respect to a variable. Simply defined as the conjunction of the Shannon cofactors.

existsOK :: IO ThmResultSource

Show that existential quantification is really meaningful: That is, if the existential quantification with respect to a variable is True, then one of the cofactors must be true for those arguments. Again, this is a trivial theorem if you think about it for a moment, but we will just let SBV prove it:

`>>>`

Q.E.D.`existsOK`