Commit d024dce0 authored by Michael Hanus 's avatar Michael Hanus

IO actions excluded for behavior equivalence checking

parent 2b85b464
......@@ -15,7 +15,8 @@ DEPS = src/CPM/*.curry src/CPM/*/*.curry
.PHONY: build
build: fetchdeps $(DEPS)
echo $(CURRYROOT)
@echo Root location of Curry system: $(CURRYROOT)
@if [ ! -d "$(CURRYROOT)" ] ; then echo "Error: not a valid directory!" ; exit 1; fi
@export CURRYPATH="$(CPATH)"; \
for i in `ls vendor`; do \
export CURRYPATH="$$CURRYPATH:`pwd`/vendor/$$i/src"; \
......
......@@ -20,7 +20,7 @@ import AbstractCurry.Build ( baseType, (~>), cmtfunc, cfunc, simpleRule
import AbstractCurry.Pretty (defaultOptions, ppCTypeExpr, showCProg)
import AbstractCurry.Select (publicFuncNames, funcName, functions, funcArity
, funcType, argTypes, typeName, types, tconsOfType
, resultType)
, resultType, isIOType)
import AbstractCurry.Transform (updCFuncDecl)
import AbstractCurry.Types ( CurryProg (..), CFuncDecl (..), CVisibility (..)
, CTypeExpr (..), CPattern (..), CExpr (..)
......@@ -200,6 +200,7 @@ renderRemoved rs =
reasonText Diffing = text "Different function types or function missing"
reasonText NonMatchingTypes = text "Some types inside the function type differ"
reasonText HighArity = text "Arity too high"
reasonText IOAction = text "IO action"
reasonText NoCompare = text "Marked NOCOMPARE"
reasonText FuncArg = text "Takes functions as arguments"
reasonText NonTerm = text "Possibly non-terminating"
......@@ -780,6 +781,7 @@ findFunctionsToCompare cfg repo gc dirA dirB useanalysis cmods =
log Debug ("All public functions: " ++ showFuncNames allFuncs) |>
let areDiffThenFilter = thenFilter allFuncs Diffing
areHighArityThenFilter = thenFilter allFuncs HighArity
areIOActionThenFilter = thenFilter allFuncs IOAction
areNoCompareThenFilter = thenFilter allFuncs NoCompare
areNonMatchingThenFilter = thenFilter allFuncs NonMatchingTypes
haveFuncArgThenFilter = thenFilter allFuncs FuncArg
......@@ -787,6 +789,7 @@ findFunctionsToCompare cfg repo gc dirA dirB useanalysis cmods =
(emptyFilter ((liftFilter $ filterDiffingFunctions diffs) acy allFuncs)
`areDiffThenFilter`
liftFilter filterHighArity `areHighArityThenFilter`
liftFilter filterIOAction `areIOActionThenFilter`
filterNoCompare dirA dirB depsA `areNoCompareThenFilter`
filterNonMatchingTypes dirA dirB depsA `areNonMatchingThenFilter`
filterFuncArg dirA dirB depsA `haveFuncArgThenFilter`
......@@ -870,6 +873,7 @@ emptyFilter st = st |>= \(a, fs) -> succeedIO (a, fs, [])
--- compared.
data FilterReason = NoReason
| HighArity
| IOAction
| NoCompare
| NonMatchingTypes
| Diffing
......@@ -987,6 +991,11 @@ filterNoCompare dirA dirB _ a fs =
filterHighArity :: [CFuncDecl] -> [CFuncDecl]
filterHighArity = filter ((<= 5) . length . argTypes . funcType)
--- Removes all IO actions since they cannot be compared as
--- properties in CurryCheck.
filterIOAction :: [CFuncDecl] -> [CFuncDecl]
filterIOAction = filter (not . isIOType . resultType . funcType)
--- Removes all functions that have a diff associated with their name from the
--- given list of functions.
---
......
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