startServer -new DeepTelosDB -t no cd oHome echo "Tell SOURCES/System-oHome.sml ..." tellModel "SOURCES/System-oHome.sml" showAnswer why cd MLT_telos echo "Tell SOURCES/System-oHome-MLT_telos.sml ..." tellModel "SOURCES/System-oHome-MLT_telos.sml" showAnswer why tell " Proposition with attribute ISA: Proposition; IN: Proposition end MapDeepTelosToMLT in Class with rule map1: $ forall x,y/Proposition (x IN y) ==> (x in TYPE) $; map2: $ forall x,y/Proposition (x IN y) ==> (y in TYPE) $; map3: $ forall x,y/Proposition (x ISA y) ==> (x in TYPE) $; map4: $ forall x,y/Proposition (x ISA y) ==> (y in TYPE) $; map5: $ forall x/Proposition y/TYPE (x isA y) and (x <> y) and not (x in QueryClass) ==> (x in TYPE) $; map6: $ forall x,y/TYPE (x IN y) ==> (y isPowerTypeOf x) $; map7: $ forall x,y/TYPE (x ISA y) ==> (x specializes y) $; map8: $ forall x,y/TYPE z/Proposition (x IN y) and (z in y) ==> (z in TYPE) $ end " showAnswer why mkdir DTExample1 mkdir DTExample2 mkdir DTExample3 mkdir DTExample4 mkdir DTExample5 # ---------------------------------------------------------------------------- cd DTExample1 echo "DTExample1 ...\\n" tell " C end M with IN class: C attribute a: d end d end " tell " c1 in C end c2 in C end " tell " x1 in c1 with a a: v1 end v1 in d end x2 in c1 end x3 in c1 end y1 in c2 end y2 in c2 end y3 in c2 end " showAnswer why # ---------------------------------------------------------------------------- cd DTExample2 echo "DTExample2 ...\\n" tell " ProductCategory with end ProductModel with IN c: ProductCategory end Product with IN c: ProductModel end CarModel in ProductCategory with end Car with IN c: CarModel end " showAnswer why # properties of products tell " ProductCategory with attribute categoryMgr: Person {* 3-1 *} end ProductModel with attribute listPrice: Integer {* 2-1 *} end CarModel with categoryMgr c: peter {* 2-0 *} attribute numberOfDoors: Integer {* 2-1 *} end Car with attribute mileage: Integer; {* 1-1 *} owner: AdultPerson {* 1-1 *} end Person end AdultPerson isA Person end peter in Person end PhoneModel in ProductCategory end Product with attribute owner: Person end " showAnswer why # product models tell " Porsche911 in CarModel with numberOfDoors d: 2 {* 1-0 *} listPrice p: 120000 {* 1-0 *} end GalaxyS3 in PhoneModel end " showAnswer why # example products tell " mary in AdultPerson end marysS3 in GalaxyS3 with owner o: mary {* 0-0 *} end marysCar in Porsche911 with mileage m: 27000 {* 0-0 *} owner o: mary {* 0-0 *} end " showAnswer why # ---------------------------------------------------------------------------- cd DTExample3 echo "DTExample3 ...\\n" tell " ProductCategory with end ProductModel with IN c: ProductCategory end Product with IN c: ProductModel end CarModel in ProductCategory with end Car with IN c: CarModel end " showAnswer why # properties of products tell " ProductCategory with attribute categoryMgr: Person {* 3-1 *} end ProductModel with attribute listPrice: Integer {* 2-1 *} end CarModel with categoryMgr c: peter {* 2-0 *} attribute numberOfDoors: Integer {* 2-1 *} end Car with attribute mileage: Integer {* 1-1 *} end Person end peter in Person end PhoneModel in ProductCategory end Product with attribute owner: Person end " showAnswer why # product models tell " Porsche911 in CarModel with numberOfDoors d: 2 {* 1-0 *} listPrice p: 120000 {* 1-0 *} end GalaxyS3 in PhoneModel end " showAnswer why # example products tell " mary in Person end marysS3 in GalaxyS3 with owner o: mary {* 0-0 *} end marysCar in Porsche911 with mileage m: 27000 {* 0-0 *} owner o: mary {* 0-0 *} end " showAnswer why