Commit a7704c48 authored by Michael Hanus 's avatar Michael Hanus

Generation and printing of bottom values improved

parent 5b0887af
......@@ -3,6 +3,15 @@ of CurryCheck to check the equivalence of operations.
Since most of these are examples to test whether CurryCheck
is able to report counter-examples, their test fails intentionally.
These are the programs
- Ints12 (generators for infinite lists)
- NDInsert (non-deterministic list insertion)
- RevRev (double reverse)
- SimpleExample
- SortEquiv (two variants of permutation sort)
- Take (two variants of take)
The module `SortISortEquiv` contains a successful equivalence test.
The following programs contain successful equivalence tests:
- Fac (recursive specification of factorial vs. iterative implementation)
- SelectionSort
- SortISortEquiv
......@@ -85,3 +85,21 @@ instance (Show a, Show b) => Show (a -> b) where
show f = "<<function>>"
-------------------------------------------------------------------------
-- Auxiliaries for showing partial values:
-- Show bottom value
bottomValue :: String
bottomValue = "failed"
-- Show constructed value (first argument is constructor)
constrValue :: [String] -> String
constrValue xs = case xs of
[] -> ""
[c] -> c
[c,x,y] -> if Char.isAlpha (head c) then bracket $ unwords xs
else bracket $ unwords [x,c,y]
_ -> bracket $ unwords xs
where
bracket s = '(' : s ++ ")"
-------------------------------------------------------------------------
This diff is collapsed.
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