6 //gen{|Euro|} = [f {euro=e,cent=c}\\e<-[0..], c <- [0..99], f<-[id,(~)]]
7 gen{|Euro|} = [f {euro=e,cent=c}\\e<-[0..], c <- merge [0..50] [51..99], f<-[id,(~)]]
9 merge [a:x] ys = [a:merge ys x]
11 derive string Euro, Product, []
12 derive gen Product, []
16 pPlusAssociative :: Euro Euro Euro -> Equ
17 pPlusAssociative a b c = a + (b + c) =.= (a + b) + c
19 pPlusCommutative :: Euro Euro -> Equ
20 pPlusCommutative a b = a + b =.= b + a
22 pPlusIdentity :: Euro -> Equ
23 pPlusIdentity i = i + zero =.= i
25 pNegSub :: Euro -> Equ
26 pNegSub i = zero - i =.= ~i
28 pNegNegId :: Euro -> Equ
29 pNegNegId i = ~ (~i) =.= i
31 //model :: [Product] Action -> ([Product],[Euro])
32 pFair :: [Product] Product -> Equ
33 pFair state p = euro state =.= euro t - euro o
35 (t,o) = model state (Rem p)
37 //pFair2 :: [Product] Action -> Equ //Euro
38 //pFair2 state action = euro state =.= euro t - euro o
39 //where (t,o) = model state action
42 [ ["pPlusAssociative: ":test pPlusAssociative]
43 , ["pPlusCommutative: ":test pPlusCommutative]
44 , ["pPlusIdentity: ":test pPlusIdentity]
45 , ["pNegSub: ":test pNegSub]
46 , ["pNegNegId: ":test pNegNegId]
47 // , ["pFair: ":test pFair]