Commit 7db4fa3c authored by Steffen Michels's avatar Steffen Michels

add derived strictness information

parent 47156f7b
......@@ -40,8 +40,8 @@ SpectoIUTstep :: (Spec t i o) (t i -> [[o]]) -> IUTstep (t,RandomStream) i o | g
toSpec :: (state input -> [(state,[output])]) -> Spec state input output
genLongInputs :: s (Spec s i o) [i] Int [Int] -> [[i]]
generateFSMpaths :: s (Spec s i o) [i] (s->[i]) -> [[i]] | gEq{|*|} s
genLongInputs :: s (Spec s i o) [i] Int ![Int] -> [[i]]
generateFSMpaths :: s (Spec s i o) ![i] (s->[i]) -> [[i]] | gEq{|*|} s
testConfSM :: [TestOption s i o] (Spec s i o) s (IUTstep .t i o) .t (.t->.t) *d -> (.t,*d)
| FileSystem d & gEq{|*|}, gLess{|*|}, genShow{|*|} s & gEq{|*|}, genShow{|*|} o & ggen{|*|}, genShow{|*|} i // & genType{|*|} i
......@@ -51,7 +51,7 @@ testConfSM :: [TestOption s i o] (Spec s i o) s (IUTstep .t i o) .t (.t->.t) *d
(after) infix 0 :: [s] (Spec s i o) -> ([i] -> [s])
propDeterministic :: (Spec s i o) s i -> Bool
propTotal :: (Spec s i o) s i -> Bool
propDeterministic :: !(Spec s i o) s i -> Bool
propTotal :: !(Spec s i o) s i -> Bool
//propComplete :: (Spec s i o) s i -> Bool // equal to propTotal
propComplete spec s i :== propTotal spec s i
......@@ -179,7 +179,7 @@ genLongInput s n spec inputs [r,r2:x]
Ft f = abort "genLongInput Ft f"
= [ i : genLongInput s (n-1) spec inputs x ]
genLongInputs :: s (Spec s i o) [i] Int [Int] -> [[i]]
genLongInputs :: s (Spec s i o) [i] Int ![Int] -> [[i]]
genLongInputs s spec inputs n [r:x] = [genLongInput s n spec inputs (genRandInt r): genLongInputs s spec inputs n x]
testConfSM :: [TestOption s i o] (Spec s i o) s (IUTstep .t i o) .t (.t->.t) *d -> (.t,*d)
......@@ -690,7 +690,7 @@ where
revApp [] acc = acc
revApp [a:x] acc = revApp x [a:acc]
generateFSMpaths :: s (Spec s i o) [i] (s->[i]) -> [[i]] | gEq{|*|} s
generateFSMpaths :: s (Spec s i o) ![i] (s->[i]) -> [[i]] | gEq{|*|} s
generateFSMpaths start spec inputs identify = A4 (generateLTS spec start (\_=inputs)) identify
//----------------- the after operator from ioco theory -----------------//
......@@ -707,8 +707,8 @@ generateFSMpaths start spec inputs identify = A4 (generateLTS spec start (\_=inp
//----------------- properties of specifications -----------------//
propDeterministic :: (Spec s i o) s i -> Bool
propDeterministic :: !(Spec s i o) s i -> Bool
propDeterministic m s i = length (m s i) <= 1
propTotal :: (Spec s i o) s i -> Bool
propTotal :: !(Spec s i o) s i -> Bool
propTotal m s i = not (isEmpty (m s i))
......@@ -18,7 +18,7 @@ from Data.Map import :: Map
:: RandomStream :== [Int]
aStream :: RandomStream
splitRandomStream :: !RandomStream -> (RandomStream,RandomStream)
randomize :: [a] [Int] Int ([Int] -> [a]) -> [a]
randomize :: ![a] [Int] Int ([Int] -> [a]) -> [a]
generic ggen a :: !GenState -> [a]
......
......@@ -32,7 +32,7 @@ splitRandomStream _ = abort "Gast.Gen.icl: the increadable has been done, you ha
// -------
randomize :: [a] [Int] Int ([Int] -> [a]) -> [a]
randomize :: ![a] [Int] Int ([Int] -> [a]) -> [a]
randomize list rnd n c = rand list rnd n []
where
rand [] rnd m [] = c rnd
......
......@@ -16,10 +16,10 @@ import StdGeneric, Data.Generics.GenEq
import StdClass
//instance + String
(@@) infixl 2 :: (a->b) a -> b
(@@!)infixl 2 :: (a->b) !a -> b
(@@) infixl 2 :: !(a->b) a -> b
(@@!)infixl 2 :: !(a->b) !a -> b
generic genShow a :: String Bool a [String] -> [String]
generic genShow a :: !String !Bool !a ![String] -> [String]
generic gLess a :: a a -> Bool
derive genShow Int, Char, Bool, Real, String, UNIT, PAIR, EITHER, OBJECT, CONS of {gcd_name,gcd_arity},RECORD of {grd_name}, FIELD of {gfd_name}, [], (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,), (,,,,,,,,), (,,,,,,,,,), (->), {}, {!}
......
......@@ -13,15 +13,13 @@ implementation module Gast.GenLibTest
import StdEnv, StdGeneric, Data.Generics.GenEq
(@@)infixl 2 :: (a->b) a -> b
(@@)infixl 2 :: !(a->b) a -> b
(@@) f x = f x
(@@!)infixl 2 :: (a->b) !a -> b
(@@!)infixl 2 :: !(a->b) !a -> b
(@@!) f x = f x
//--- show ---//
generic genShow a :: String Bool a [String] -> [String]
genShow{|Int|} sep p x rest = [toString x: rest]
genShow{|Char|} sep p x rest = ["'",showChar x,"'": rest]
genShow{|Bool|} sep p x rest = [toString x: rest]
......
......@@ -31,7 +31,7 @@ instance \/ Property Property
//check :: (a a -> Bool) -> a a -> Property | genShow{|*|} a
check :: (a a -> Bool) !a !a -> Property | genShow{|*|} a
class (==>) infixr 1 b :: b p -> Property | Testable p
class (==>) infixr 1 b :: !b p -> Property | Testable p
instance ==> Bool
instance ==> Property
......
......@@ -15,8 +15,6 @@ import Gast.Testable, StdEnv
from Math.Random import genRandInt
import System.OS
class (==>) infixr 1 b :: b p -> Property | Testable p
instance ==> Bool
where
(==>) c p
......
......@@ -36,7 +36,7 @@ instance == Result
prop :: a -> Property | Testable a
class TestArg a | genShow{|*|} a & ggen{|*|} a
class Testable a where evaluate :: a GenState !Admin -> [Admin]
class Testable a where evaluate :: !a GenState !Admin -> [Admin]
instance Testable Bool
instance Testable Result
......@@ -57,7 +57,7 @@ NrOfTest :== 1000
//--- for implementation of properties ---//
diagonal :: [[a]] -> [a]
diagonal :: ![[a]] -> [a]
forAll :: !(a->b) ![a] GenState !Admin -> [Admin] | Testable b & TestArg a
//split :: !RandomStream -> (RandomStream,RandomStream)
//generateAll :: !RandomStream -> [a] | ggen{|*|} a
......@@ -80,7 +80,7 @@ generateAll :: !GenState -> [a] | ggen{|*|} a //& genType{|*|} a
| OutputTestEvents //* output test results as event specified in clean-platform {{Testing.TestEvents}}
| ArgTypes [GenType]
Test :: [Testoption] !p -> [String] | Testable p
Test :: ![Testoption] !p -> [String] | Testable p
TestList :: [Testoption] ![p] -> [String] | Testable p
verbose :: !RandomStream !p -> [String] | Testable p
......
......@@ -52,7 +52,7 @@ forAll f list genState r = diagonal [apply f a genState r \\ a<-list ] // copy t
apply :: !(a->b) a GenState !Admin -> [Admin] | Testable b & TestArg a
apply f a genState r = evaluate (f a) genState {Admin| r & args = [show1 a:r.Admin.args]}
diagonal :: [[a]] -> [a]
diagonal :: ![[a]] -> [a]
diagonal list = f 1 2 list []
where
f n m [] [] = []
......@@ -296,7 +296,7 @@ showArgs :: ![String] [String] -> [String]
showArgs [] c = c // ["\n":c] // c
showArgs [a:rest] c = [" ",a: showArgs rest c]
Test :: [Testoption] !p -> [String] | Testable p
Test :: ![Testoption] !p -> [String] | Testable p
Test options p = (\config.testConfig config.randoms {config & randoms = []} p) (foldl handleOption verboseConfig options)
where
handleOption c (Tests i) = {c & maxTests = i, maxArgs = 2*i}
......@@ -396,7 +396,7 @@ where
// continue with testing property
Nothing ->
let [res:rest] = results in
everyOutput (maxTests-nTests+1) res
//everyOutput (maxTests-nTests+1) res
( case res.res of
OK = analyse rest (nTests-1) (nArgs-1) nRej nUnd nE
counterExamples (admin res.labels labels) res.Admin.name
......
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