| Copyright | (c) Levent Erkok |
|---|---|
| License | BSD3 |
| Maintainer | erkokl@gmail.com |
| Stability | experimental |
| Safe Haskell | None |
| Language | Haskell2010 |
Documentation.SBV.Examples.KnuckleDragger.Induction
Description
Example use of the KnuckleDragger, for some inductive proofs
Synopsis
- sumConstProof :: IO Proof
- sumProof :: IO Proof
- sumSquareProof :: IO Proof
- elevenMinusFour :: IO Proof
Documentation
sumConstProof :: IO Proof Source #
Prove that sum of constants c from 0 to n is n*c.
We have:
>>>sumConstProofLemma: sumConst_correct Q.E.D. [Proven] sumConst_correct
Prove that sum of numbers from 0 to n is n*(n-1)/2.
We have:
>>>sumProofLemma: sum_correct Q.E.D. [Proven] sum_correct
sumSquareProof :: IO Proof Source #
Prove that sum of square of numbers from 0 to n is n*(n+1)*(2n+1)/6.
We have:
>>>sumSquareProofLemma: sumSquare_correct Q.E.D. [Proven] sumSquare_correct
elevenMinusFour :: IO Proof Source #
Prove that 11^n - 4^n is always divisible by 7. Note that power operator is hard for
SMT solvers to deal with due to non-linearity. For this example, we use cvc5 to discharge
the final goal, where z3 can't converge on it.
We have:
>>>elevenMinusFourLemma: pow0 Q.E.D. Lemma: powN Q.E.D. Lemma: elevenMinusFour Q.E.D. [Proven] elevenMinusFour