Skip to content

Instantly share code, notes, and snippets.

@morteako
Created May 1, 2019 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morteako/12611f1aaf02f81ec6477e56c0c2ac18 to your computer and use it in GitHub Desktop.
Save morteako/12611f1aaf02f81ec6477e56c0c2ac18 to your computer and use it in GitHub Desktop.
{-# LANGUAGE RebindableSyntax #-}
import Prelude hiding ( (>>=),(>>) )
import qualified Prelude as P
import Liquid.Haskell.ProofCombinators
{-@ (>>) :: x:a -> y:{a | y == x} -> {v:a | v == x && v == y} @-}
(>>) x y = x === y
{-@ reflect nott @-}
nott True = False
nott False = True
{-@ testProofDo :: x:Bool -> { nott (nott x) = x } @-}
testProofDo True = toProof $ do
nott (nott True)
nott False
True
testProofDo False = toProof $ do
nott (nott False)
nott True
False
{-@ testProofNormal :: x:Bool -> { nott (nott x) = x } @-}
testProofNormal True
= nott (nott True)
=== nott False
=== True
*** QED
testProofNormal False
= nott (nott True)
=== nott False
=== True
*** QED
main = do
print 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment