module Language.Nominal.Properties.NameSpec
where
import Test.QuickCheck
import Language.Nominal.Name
import Language.Nominal.Binder
prop_namelabel :: Name String -> String -> Bool
prop_namelabel n t = t == nameLabel (n `withLabel` t)
prop_twonames :: Name () -> Name () -> Property
prop_twonames n1 n2 =
expectFailure $ n1 == n2
prop_singleswap :: Name String -> Name String -> [Name String] -> Property
prop_singleswap n1 n2 l =
expectFailure $ swpN n1 n2 l == l
prop_freshswap :: Name String -> Name String -> (Name String, Name String, Name String) -> Property
prop_freshswap n1 n2 l =
n1 `freshFor` l ==> n2 `freshFor` l ==>
swpN n1 n2 l == l
prop_doubleswap :: Name String -> Name String -> [Name String] -> Bool
prop_doubleswap n1 n2 l =
swpN n1 n2 (swpN n1 n2 l) == l
prop_doubleswap_fresh' :: Name String -> Name String -> Name String -> Name String -> Property
prop_doubleswap_fresh' n n' n'' m =
n' `freshFor` m ==> n'' `freshFor` m ==>
swpN n'' n' (swpN n' n m) === swpN n'' n m
prop_doubleswap_fresh :: Name String -> Name String -> Name String -> [Name String] -> Property
prop_doubleswap_fresh n n' n'' l =
n' `freshFor` l ==> n'' `freshFor` l ==>
swpN n'' n' (swpN n' n l) === swpN n'' n l
prop_swap_symm :: Name String -> Name String -> [Name String] -> Bool
prop_swap_symm n' n x = swpN n' n x == swpN n n' x