Commit 2603ebfb authored by Michael Hanus 's avatar Michael Hanus

Changes w.r.t. new module Test.Prop.Types

parent b50c4a44
...@@ -607,7 +607,7 @@ funDeclsWith pred = filter (pred . snd . funcName) ...@@ -607,7 +607,7 @@ funDeclsWith pred = filter (pred . snd . funcName)
propResultType :: CTypeExpr -> CTypeExpr propResultType :: CTypeExpr -> CTypeExpr
propResultType te = case te of propResultType te = case te of
CFuncType from to -> CFuncType from (propResultType to) CFuncType from to -> CFuncType from (propResultType to)
_ -> baseType (easyCheckModule,"Prop") _ -> baseType (propTypesModule,"Prop")
-- Transforms a function declaration into a post condition test if -- Transforms a function declaration into a post condition test if
-- there is a post condition for this function (i.e., a relation named -- there is a post condition for this function (i.e., a relation named
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
--- a Curry program. --- a Curry program.
--- ---
--- @author Michael Hanus --- @author Michael Hanus
--- @version December 2017 --- @version January 2019
------------------------------------------------------------------------ ------------------------------------------------------------------------
module PropertyUsage module PropertyUsage
( isProperty, isPropType, isPropIOType, isEquivProperty ( isProperty, isPropType, isPropIOType, isEquivProperty
, propModule, easyCheckModule, easyCheckExecModule , propModule, propTypesModule, easyCheckModule, easyCheckExecModule
) where ) where
import AbstractCurry.Types import AbstractCurry.Types
...@@ -25,13 +25,13 @@ isProperty = isPropertyType . typeOfQualType . funcType ...@@ -25,13 +25,13 @@ isProperty = isPropertyType . typeOfQualType . funcType
--- Is the type expression the type Test.EasyCheck.Prop? --- Is the type expression the type Test.EasyCheck.Prop?
isPropType :: CTypeExpr -> Bool isPropType :: CTypeExpr -> Bool
isPropType texp = case texp of isPropType texp = case texp of
CTCons (mn,tc) -> tc == "Prop" && isCheckModule mn CTCons (mn,tc) -> tc == "Prop" && mn == propTypesModule
_ -> False _ -> False
--- Is the type expression the type Test.EasyCheck.PropIO? --- Is the type expression the type Test.EasyCheck.PropIO?
isPropIOType :: CTypeExpr -> Bool isPropIOType :: CTypeExpr -> Bool
isPropIOType texp = case texp of isPropIOType texp = case texp of
CTCons (mn,tc) -> tc == "PropIO" && isCheckModule mn CTCons (mn,tc) -> tc == "PropIO" && mn == propTypesModule
_ -> False _ -> False
--- Check whether a function definition is an equivalence property, i.e., --- Check whether a function definition is an equivalence property, i.e.,
...@@ -54,6 +54,10 @@ isCheckModule mn = mn == propModule || mn == easyCheckModule ...@@ -54,6 +54,10 @@ isCheckModule mn = mn == propModule || mn == easyCheckModule
propModule :: String propModule :: String
propModule = "Test.Prop" propModule = "Test.Prop"
--- Name of the Test.Prop.Types module (containing property type definitions).
propTypesModule :: String
propTypesModule = "Test.Prop.Types"
--- Name of the EasyCheck module. --- Name of the EasyCheck module.
easyCheckModule :: String easyCheckModule :: String
easyCheckModule = "Test.EasyCheck" easyCheckModule = "Test.EasyCheck"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment