053ac97e6a76c26b6f16f458b058979ecf6ac66d
[clean-tests.git] / afp / a12 / gastyStart.dcl
1 definition module gastyStart
2
3 /*
4 Pieter Koopman, Radboud University, 2016 - 2018
5 pieter@cs.ru.nl
6 Advanced programming
7 A simplified MBT tool based on logical properties
8
9 Use the iTask environment!
10 Execute with "Basic values only" option
11 */
12
13 import StdEnv, StdGeneric, Data.GenEq
14
15 test :: p -> [String] | prop p
16 class prop a where holds :: a Prop -> [Prop]
17
18 :: Prop
19
20 instance prop Bool
21 instance prop (a->b) | prop b & testArg a
22 class testArg a | gen{|*|}, string{|*|}, gEq{|*|} a
23
24 generic gen a :: [a]
25 derive gen Int, Real, Bool, Char, UNIT, PAIR, EITHER, CONS, OBJECT, RECORD, FIELD
26
27 generic string a :: a -> String
28 derive string Int, Real, Bool, Char, UNIT, PAIR, EITHER, CONS of gcd, OBJECT, RECORD of grd, FIELD of gfd
29
30 :: For = E.a b: (For) infix 0 (a -> b) [a] & prop b & string{|*|} a
31 instance prop For
32
33 :: Select = E.p: (==>) infixl 0 Bool p & prop p
34 instance prop Select
35
36 :: Equ = E.a: (=.=) infix 4 a a & testArg a
37 instance prop Equ