Skip to content

Commit

Permalink
Fix doctest and example
Browse files Browse the repository at this point in the history
  • Loading branch information
LeventErkok committed Aug 30, 2024
1 parent e5e922c commit 3a3f243
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Documentation/SBV/Examples/KnuckleDragger/Induction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import qualified Data.SBV.List as SL
-- We have:
--
-- >>> sumProof
-- Axiom: sum_induction Admitted.
-- Axiom: Nat.induction Admitted.
-- Lemma: sum_correct Q.E.D.
sumProof :: IO Proven
sumProof = do
Expand All @@ -49,7 +49,7 @@ sumProof = do
-- We have:
--
-- >>> sumSquareProof
-- Axiom: sumSquare_induction Admitted.
-- Axiom: Nat.induction Admitted.
-- Lemma: sumSquare_correct Q.E.D.
sumSquareProof :: IO Proven
sumSquareProof = do
Expand All @@ -71,10 +71,12 @@ sumSquareProof = do
-- We have:
--
-- >>> listLengthProof
-- Axiom: List(a).induction Admitted.
-- Lemma: length_correct Q.E.D.
listLengthProof :: IO Proven
listLengthProof = do
let length :: SList Integer -> SInteger
length = smtFunction "length" $ \xs -> ite (SL.null xs) 0 (5 + length (SL.tail xs))
length = smtFunction "length" $ \xs -> ite (SL.null xs) 0 (1 + length (SL.tail xs))

spec :: SList Integer -> SInteger
spec = SL.length
Expand Down

0 comments on commit 3a3f243

Please sign in to comment.