module ExampleCT2 where import CTy.DSL import CTy.TestVal -- import CTy.Concretization import CTy.CRule import CTy.TCgen -- a function to fill in class with some dummy test-value, and weigth val_ v = v %%= (Frag v, (1.1::Float)) ct :: CTree (TestVal,Float) ct = tree [age,gender,studentType,nationality,pc,os,height,weight,occupation,status] where age = "Age" <== map val_ ["<18", "18-40", ">40"] gender = "Gender" <== map val_ ["Male", "Female"] studentType = "sType" <== [master, val_ "Bachelor", val_ "PhD"] where master = "Master" <== map val_ ["fullMaster", "Mixed"] nationality = "Nationality" <== [foreign, val_ "Dutch"] where foreign = "Foreign" <== map val_ ["EU", "non-EU"] pc = "PC" <== [laptop, val_ "DeskPC"] where laptop = "Laptop" <== [macLaptop,winLaptop] where macLaptop :: Partition (TestVal,Float) macLaptop = "macLaptop" <== map val_ ["MacBook", "Powerbook"] winLaptop :: Partition (TestVal,Float) winLaptop = "winLaptop" <== map val_ ["Asus", "HP", "Toshiba"] os = "OS" <== [linux,windows,val_ "MacOS"] where linux = "Linux" <== map val_ ["Ubuntu", "Debian", "RedHat"] windows = "Windows" <== map val_ ["WinXP", "WinVista", "Win7"] height = "Height" <== map val_ ["<1,60", "1,60-1,74", "1,75-1,90", ">1,90"] weight = "Weight" <== map val_ ["<60", "60-74", "75-90", ">90"] occupation = "Occupation" <== map val_ ["Just Student", "Part-Time Worker", "Full-time Worker"] status = "Status" <== map val_ ["Single", "Married", "Divorced", "Widow"] -- #580608 fullsuite = allf ct r1 = rule (incl ["winLaptop"]) -- #290304 suite1 = ct $$ r1 >>= paddingf >>= fixorder >>= lift_ . strip2 suite1b = ct $$ r1 >>= paddingf >>= fixorder >>= wsort >>= lift_ . strip2 >>= lift_ . take 100 r2 = rule (incl ["18-40"] &&* ((incl ["Foreign"] `impf` incl ["Mixed"]) &&- incl ["Male"])) -- #48384 suite2 = ct $$ r2 >>= paddingf >>= fixorder >>= lift_ . strip2 suite2b = ct $$ r2 >>= paddingf >>= fixorder >>= wsort >>= lift_ . strip2 >>= lift_ . take 100 r3 = rule ((incl ["Laptop"] `orf` incl ["Windows"]) &&- (incl [">90"] `norf` incl [">1,90"])) `suchthat` rule (incl ["Laptop"] `orf` incl ["MacOS"]) -- #30240 suite3 = ct $$ r3 >>= paddingf >>= fixorder >>= lift_ . strip2 suite3b = ct $$ r3 >>= paddingf >>= fixorder >>= wsort >>= lift_ . strip2 >>= lift_ . take 100 suites = [suite1,suite2,suite3] suitesSort = [suite1b,suite2b,suite3b]