startServer -new MLTtelosDB -t low 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 " #TYPE with # attribute # derivedPowerTypeOf: TYPE # rule # back1: $ forall t1,t2/TYPE # ( forall t3/TYPE ((t3 in t1) <==> (t3 specializes t2)) ) # ==> (t1 derivedPowerTypeOf t2) $ #end #" #showAnswer #why mkdir TestModule cd TestModule # ---------------------------------------------------------------------------- tell "Test1 in TYPE end" echo "Ask TYPEwithoutINDIVIDUAL ..." ask TYPEwithoutINDIVIDUAL showAnswer tell "Test1 in INDIVIDUAL end" showAnswer why # ---------------------------------------------------------------------------- cd MLT_telos mkdir Example1 mkdir Example1a mkdir Example2 mkdir Example3 mkdir Example4 mkdir Example5 mkdir Example6 mkdir Example7 # ---------------------------------------------------------------------------- cd Example1 echo "\\nExample 1 ..." tell " Person in TYPE end PersonType in TYPE with isPowerTypeOf type: Person end Man in TYPE,PersonType end Woman in TYPE,PersonType end " # Need to separate the transactions for types and instances tell " John in INDIVIDUAL,Man end Bob in INDIVIDUAL,Man end Ana in INDIVIDUAL,Woman end " showAnswer why # ---------------------------------------------------------------------------- cd Example1a echo "\\nExample 1a ..." tell " Person in TYPE end PersonType in TYPE with isPowerTypeOf type: Person end Man in TYPE,PersonType end Woman in TYPE,PersonType end YoungWoman in TYPE,PersonType with specializes t1: Woman end " # Need to separate the transactions for types and instances tell " John in INDIVIDUAL,Man end Bob in INDIVIDUAL,Man end Ana in INDIVIDUAL,Woman end Sara in INDIVIDUAL,YoungWoman end " showAnswer why # ---------------------------------------------------------------------------- cd Example2 echo "Example 2 ...\\n" tell " Person in TYPE end PersonType in TYPE with isPowerTypeOf type: Person end PersonByGender in TYPE with specializes t1: PersonType partitions t2: Person end Man in TYPE,PersonByGender end Woman in TYPE,PersonByGender end " # Need to separate the transactions for types and instances tell " John in INDIVIDUAL,Man end Bob in INDIVIDUAL,Man end Ana in INDIVIDUAL,Man,Woman end Data in INDIVIDUAL,Person end " ask IncompleteCategorization OBJNAMES FRAME Now showAnswer ask NondisjointCategorization OBJNAMES FRAME Now showAnswer # ---------------------------------------------------------------------------- cd Example3 echo "Example 3 ..." tell " LivingBeing in TYPE end Plant in TYPE with specializes t1: LivingBeing end Person in TYPE with specializes t1: LivingBeing end PersonType in TYPE with isPowerTypeOf type: Person end PersonByProfession in TYPE with specializes t1: PersonType partitions t2: Person end " tell " Professor in TYPE,PersonByProfession end Engineer in TYPE,PersonByProfession end Architect in TYPE,PersonByProfession end " # Need to separate the transactions for types and instances tell " John in INDIVIDUAL,Engineer end Bob in INDIVIDUAL,Architect end Ana in INDIVIDUAL,Professor end Data in INDIVIDUAL,Person end " why ask IncompleteCategorization OBJNAMES FRAME Now showAnswer # ---------------------------------------------------------------------------- cd Example4 echo "Example 4 ...\\n" tell " LivingBeing in TYPE end LivingBeingType in TYPE with isPowerTypeOf type: LivingBeing end PersonType in TYPE with specializes t1: LivingBeingType end Plant in TYPE with specializes t1: LivingBeing end Person in TYPE with specializes t1: LivingBeing end PersonByGender in TYPE with specializes t1: PersonType partitions t2: Person end " tell " Man in TYPE,PersonByGender end Woman in TYPE,PersonByGender end " # Need to separate the transactions for types and instances tell " John in INDIVIDUAL,Man end Bob in INDIVIDUAL,Man end Ana in INDIVIDUAL,Woman end Data in INDIVIDUAL,Person end " showAnswer why # ---------------------------------------------------------------------------- cd Example5 echo "Example 5 ...\\n" tell " Person in TYPE end PersonType in TYPE with isPowerTypeOf type: Person end Man in TYPE,PersonType end Woman in TYPE,PersonType end Adult in TYPE,PersonType end AdultMan in TYPE with specializes type1: Man; type2: Adult end " # Need to separate the transactions for types and instances tell " John in INDIVIDUAL,AdultMan end Bob in INDIVIDUAL,Man end Ana in INDIVIDUAL,Woman end " showAnswer why # ---------------------------------------------------------------------------- cd Example6 echo "Example 6 ...\\n" tell " 1stOT in TYPE with isPowerTypeOf type1: INDIVIDUAL end 2ndOT in TYPE with isPowerTypeOf type1: 1stOT end PersonByGender in TYPE, 2ndOT with partitions type: Person end Person in TYPE, 1stOT end Man in TYPE,PersonByGender with end Woman in TYPE,PersonByGender with end " showAnswer why # Here we do not need to explictely tell the instantiation to INDIVIDUAL because it is derived as consequence of (Person in 1stOT) tell " John in Man end Bob in Man end Ana in Woman end " showAnswer why # ---------------------------------------------------------------------------- cd Example7 echo "Example 7 ...\\n" tell " ProductCategory in TYPE with isPowerTypeOf type: ProductModel end ProductModel in TYPE with isPowerTypeOf type : Product end Product in TYPE end " tell " CarModel in TYPE,ProductCategory with isPowerTypeOf type: Car end Car in TYPE end " showAnswer why tell " Person end ProductCategory with attribute categoryMgr : Person end ProductModel with attribute listPrice : Integer end Product in Class with attribute owner : Person end peter in Person end CarModel with categoryMgr c : peter attribute numberOfDoors : Integer end Car with attribute mileage : Integer; owner : AdultPerson end AdultPerson isA Person end " showAnswer why tell " Porsche911 in TYPE,CarModel with numberOfDoors d : 2 listPrice p : 120000 end " tell " mary in Person end marysCar in INDIVIDUAL,Porsche911 with mileage m : 27000 owner o : mary end " showAnswer why