module ExampleCT1 where import Sequenic.CTy.Types import Sequenic.CTy.Combinations -- The classification tree provided by this example: ct :: CTree ct = [ "Color" <== ["Red", "Blue", "Yellow", "Green", "Purple"], "Shape" <== leaves ["Circle"] |++| ["4side" <== ["Square", "Rectangle"]] |++| ["Triangle" <== ["Isosceles", "Equilateral", "Scalene"]], "Size" <== ["Big","Small"], "Volume" <== leaves ["Pyramid","Sphere"] |++| ["Cube" <== ["Dice", "Rubik"]], "Material" <== leaves ["Wood", "Plastic", "Rubber"] |++| ["Metal" <== ["Iron", "Steel"]], "Inside" <== ["Hollow", "Full"] ] -- -- Some examples of rules -- -- should be 2040 full combinations r1 :: Rule r1 = rule_ (excl_ ["Blue"] `and_` all_ "Size" `and_` all_ "Shape") |++| rule_ (incl_ ["Blue"] `and_` incl_ ["Triangle"] `and_` incl_ ["Big"]) -- should be 1360 full combinations r2 :: Rule r2 = rule_ (incl_ ["Red","Blue"] `equ_` incl_ ["Square"]) --r2b :: Rule --r2b = rule_ (all_ "Color" `and_` all_ "Shape") -- should be 1200 full combinations r3 :: Rule r3 = rule_ . incl_ $ ["Triangle"] -- should be 360 full combinations r4 :: Rule r4 = rule_ ((incl_ ["Metal"] `nor_` incl_ ["Pyramid"]) `and_` incl_ ["4side"]) -- should 900 full combinations r5 :: Rule r5 = rule_ (incl_ ["Dice"] `nor_` incl_ ["Circle"]) |&&| rule_ (incl_ ["Rubik"] `equ_` incl_ ["Rectangle"]) rules :: [Rule] rules = [r1,r2,r3,r4,r5]