Skip to content

Commit

Permalink
Clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
LeventErkok committed Dec 3, 2024
1 parent e0d7480 commit 65507ff
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Documentation/SBV/Examples/KnuckleDragger/Lists.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ mkUninterpretedSort ''A
data B
mkUninterpretedSort ''B

-- | An uninterpreted function, for use as a witness in the following higher-order proofs.
f :: SA -> SB
f = uninterpret "f"

-- | @reverse (x:xs) == reverse xs ++ [x]@
--
-- >>> runKD revCons
Expand All @@ -105,6 +101,10 @@ mapAppend = do
let p :: (SA -> SB) -> SList A -> SList A -> SBool
p g xs ys = map g (xs ++ ys) .== map g xs ++ map g ys

-- For an arbitrary uninterpreted function 'f':
f :: SA -> SB
f = uninterpret "f"

lemma "mapAppend"
(\(Forall @"xs" xs) (Forall @"ys" ys) -> p f xs ys)
-- induction is done on the last argument, so flip to do it on xs
Expand All @@ -129,6 +129,10 @@ mapReverse = do
let p :: (SA -> SB) -> SList A -> SBool
p g xs = reverse (map g xs) .== map g (reverse xs)

-- For an arbitrary uninterpreted function 'f':
f :: SA -> SB
f = uninterpret "f"

rCons <- revCons
mApp <- mapAppend

Expand Down

0 comments on commit 65507ff

Please sign in to comment.