24.09., 9:00 - 11:00: Due to updates GitLab will be unavailable for some minutes between 09:00 and 11:00.

Commit 713dc7d0 authored by Philipp Meyer's avatar Philipp Meyer

Added not operator for PropResult

parent b6cb1c4e
......@@ -13,6 +13,7 @@ module Property
PropResult(..),
resultAnd,
resultOr,
resultNot,
resultsAnd,
resultsOr)
where
......@@ -124,7 +125,7 @@ showPropertyName :: Property -> String
showPropertyName p = showPropertyType (pcont p) ++ " property" ++
(if null (pname p) then "" else " " ++ show (pname p))
data PropResult = Satisfied | Unsatisfied | Unknown
data PropResult = Satisfied | Unsatisfied | Unknown deriving (Show,Read)
resultAnd :: PropResult -> PropResult -> PropResult
resultAnd Satisfied x = x
......@@ -138,6 +139,11 @@ resultOr _ Satisfied = Satisfied
resultOr Unsatisfied x = x
resultOr Unknown _ = Unknown
resultNot :: PropResult -> PropResult
resultNot Satisfied = Unsatisfied
resultNot Unsatisfied = Unsatisfied
resultNot Unknown = Unknown
resultsAnd :: [PropResult] -> PropResult
resultsAnd = foldr resultAnd Satisfied
......
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