{ * File: 01-multidim-constructs.sml.txt * Author: Manfred Jeusfeld, Thomas Kuehne * Created: 2023-03-01/M.Jeusfeld (2024-03-10/T.Kuehne) * ------------------------------------------------------ * Formalization of multidimensional instantiation according to orthogonal ontological classification * * License: Creative Commons license Attribution-NonCommercial 4.0 International http://creativecommons.org/licenses/by-nc/4.0/ http://creativecommons.org/licenses/by-nc/4.0/legalcode * } {* basic constructs for multi-dimensional MLM *} Dimension with attribute dimcolor: String end InstanceOf with attribute,single dimension: Dimension end IsA with attribute,single dimension: Dimension end Element with attribute memberOf: Dimension; potency: Integer end InstanceOfWithDim in QueryClass,MSFOLrule isA InstanceOf with constraint tc1: $ exists dim/Dimension (this dimension dim) $ end IsAWithDim in QueryClass,MSFOLrule isA IsA with constraint tc2: $ exists dim/Dimension (this dimension dim) $ end {---} {* Rules for the graphical layout of MultiDim model *} INSTOFDEDUCED_MDP_GT in Class,JavaGraphicalType with implementedBy implBy : "i5.cb.graph.cbeditor.CBLink" priority p : 7 property bgcolor : "255,0,0"; textcolor : "0,0,0"; edgecolor : "120,120,120"; edgewidth : "1"; edgeheadshape : "Caret"; edgestyle : "ldashed"; label : "" end INSTOF_MDP_GT in Class,JavaGraphicalType with implementedBy implBy : "i5.cb.graph.cbeditor.CBLink" priority p : 6 rule gtrule : $ forall a/InstanceOf (a graphtype INSTOF_MDP_GT) $ property bgcolor : "255,0,0"; textcolor : "0,0,0"; edgecolor : "0,0,0"; edgewidth : "1"; edgeheadshape : "Caret"; edgestyle : "ldashed"; label : "" end ISA_MDP_GT in Class,JavaGraphicalType with property bgcolor : "255,0,0"; textcolor : "0,0,0"; edgecolor : "0,0,0"; edgeheadcolor : "255,255,255"; edgeheadshape : "Arrow"; edgewidth : "1"; label : "" implementedBy implBy : "i5.cb.graph.cbeditor.CBLink" priority p : 8 rule gtrule : $ forall a/IsA (a graphtype ISA_MDP_GT) $ end ISADEDUCED_GT in Class,JavaGraphicalType with property bgcolor : "255,0,0"; textcolor : "0,0,0"; edgecolor : "120,120,120"; edgewidth : "1"; label : ""; edgeheadcolor : "255,255,255"; edgeheadshape : "Arrow" implementedBy implBy : "i5.cb.graph.cbeditor.CBLink" priority p : 8 end MultiDimPalette in Class,JavaGraphicalPalette isA TelosPalette with contains,implicitInstanceOf mdp1 : INSTOFDEDUCED_MDP_GT contains mdp2 : INSTOF_MDP_GT; mdp3 : ISA_MDP_GT contains,implicitIsA mdp4 : ISADEDUCED_GT rule colorrule1: $ forall inst/InstanceOf dim/Dimension col/String (inst dimension dim) and (dim dimcolor col) ==> (inst gproperty/edgecolor col) $; colorrule2: $ forall spec/IsA dim/Dimension col/String (spec dimension dim) and (dim dimcolor col) ==> (spec gproperty/edgecolor col) $; dimrule1: $ forall dim/Dimension pal/JavaGraphicalPalette (valueOf(currentPalette) = pal) and (pal isA MultiDimPalette) ==> (dim gproperty/nodelevel "-103") $; dimrule2 : $ forall dim/Dimension (dim gproperty/size "resizable") $; dimrule3 : $ forall dim/Dimension (dim gproperty/align "top") $ end DataType end Value end Integer in DataType isA Value end String in DataType isA Value end Real in DataType isA Value end Boolean in DataType isA Value end ValueOrDataType in QueryClass isA Individual with constraint c1d : $ (this in Value) or (this in DataType) $ end ProperElement in QueryClass,MSFOLrule isA Element with constraint c1a : $ not (this in QueryClass) and not (this in MSFOLassertion) and exists a/Attribute y/ValueOrDataType From(a,this) and To(a,y) $ end {* classical attribute definitions as opposed to associations *} ElementAttribute in QueryClass,MSFOLrule isA Attribute with constraint c2a: $ exists o/Element t/DataType From(this,o) and To(this,t) $ end ElementWithAttributes in GenericQueryClass isA ProperElement with parameter,computed_attribute class : ProperElement computed_attribute attrs : Proposition!attribute constraint c3 : $ exists n/Label b/ValueOrDataType Pa(~attrs,this,n,b) and (this = ~class) $ end {---} { 2023-03-01,19:41:48.704 } ElementFormat in AnswerFormat with forQuery q : ElementWithAttributes order o : ascending orderBy ob : "this" pattern p : "[b]{UQ({this})}[/b][hr][/hr]{Foreach( ({this.attrs}),(p), {LabelAC({p})}: {UQ({To({p})})}[br][/br] )}" end LabelRules in Class with rule lr1 : $ forall x/ProperElement lab/Label (lab = resultOf(ElementWithAttributes,x,ElementFormat)) ==> (x gproperty/label lab) $; lr2 : $ forall x/ProperElement lab/Label (x gproperty/size "wrap") $; lr3 : $ forall x/ProperElement lab/Label (x gproperty/labellength 800) $; lr4 : $ forall x/ProperElement (x gproperty/font "Arial") $ end {---} Element with attribute instanceOf: Element; instanceOf_trans: Element; specializationOf: Element; specializationOf_trans: Element; inIsa: Element; {* inIsa: either classification or generalizatoin; used to check well-formedness of a dimension tree *} inIsa_trans: Element; specConnected: Element; {* to capture elements connected via specialization regardless of direction *} orderNotInconsistent: Element {* to check consistent distances to a possibly existing common deep ancestor *} end MultiDimRules in Class with rule mdrule1: $ forall inst/InstanceOf x/Element dim/Dimension (inst dimension dim) and (From(inst,x) or To(inst,x)) ==> (x memberOf dim) $; mdrule2: $ forall spec/IsA x/Element dim/Dimension (spec dimension dim) and (From(spec,x) or To(spec,x)) ==> (x memberOf dim) $; mdrule3: $ forall inst/InstanceOfWithDim x,c/Element lab/Label dim/Dimension (inst dimension dim) and Label(dim,lab) and From(inst,x) and To(inst,c) ==> (x inIsa/lab c) $; mdrule4: $ forall spec/IsAWithDim c,d/Element lab/Label dim/Dimension (spec dimension dim) and Label(dim,lab) and From(spec,c) and To(spec,d) ==> (c inIsa/lab d) $; mdrule5: $ forall x,y/Element lab/Label (x inIsa/lab y) ==> (x inIsa_trans/lab y) $; mdrule6: $ forall x,y,z/Element lab/Label (x inIsa/lab z) and (z inIsa_trans/lab y) ==> (x inIsa_trans/lab y) $; mdrule7: $ forall inst/InstanceOfWithDim x,c/Element lab/Label dim/Dimension (inst dimension dim) and Label(dim,lab) and From(inst,x) and To(inst,c) ==> (x instanceOf/lab c) $; mdrule8: $ forall spec/IsAWithDim c,d/Element lab/Label dim/Dimension (spec dimension dim) and Label(dim,lab) and From(spec,c) and To(spec,d) ==> (c specializationOf/lab d) $; mdrule9: $ forall x,y/Element lab/Label (x instanceOf/lab y) ==> (x instanceOf_trans/lab y) $; mdrule10: $ forall x,y,z/Element lab/Label (x instanceOf/lab z) and (z instanceOf_trans/lab y) ==> (x instanceOf_trans/lab y) $; mdrule11: $ forall x,y/Element lab/Label (x specializationOf/lab y) ==> (x specializationOf_trans y) $; mdrule12: $ forall x,y,z/Element lab/Label (x specializationOf/lab z) and (z specializationOf_trans y) ==> (x specializationOf_trans y) $; mdrule13: $ forall x,c/Element lab/Label (x instanceOf/lab c) ==> (x instanceOf c) $; mdrule14: $ forall x,c,d/Element lab/Label (x instanceOf/lab c) and (c specializationOf_trans d) ==> (x instanceOf d) $; mdrule15: $ forall x,y/Element lab/Label (x specializationOf/lab y) ==> (x specializationOf_trans/lab y) $; mdrule16: $ forall x,y,z/Element lab/Label (x specializationOf/lab z) and (z specializationOf_trans/lab y) ==> (x specializationOf_trans/lab y) $; mdrule17: $ forall x,y/Element lab/Label ((x specializationOf/lab y) or (y specializationOf/lab x)) ==> (x specConnected/lab y) $; mdrule18: $ forall x,y,z/Element lab/Label (((x specializationOf/lab z) or (z specializationOf/lab x)) and (z specConnected/lab y)) ==> (x specConnected/lab y) $; mdrule19: $ forall c,d/Element lab/Label (c specializationOf/lab d) ==> (c specializationOf d) $; mdrule20: $ forall c,d/Element lab/Label (c specializationOf_trans/lab d) ==> (c specializationOf_trans d) $; mdrule21: $ forall x,y/Element lab/Label ((x = y) or (not (exists c/Element ((x instanceOf_trans/lab c) or (x = c)) and ((y instanceOf_trans/lab c) or (y = c))))) ==> (x orderNotInconsistent/lab y) $; mdrule22: $ forall x,y/Element lab/Label ((exists x1,y1/Element (x instanceOf/lab x1) and (y instanceOf/lab y1) and (x1 orderNotInconsistent/lab y1)) and (not ((x instanceOf_trans/lab y) or (y instanceOf_trans/lab x))) ) ==> (x orderNotInconsistent/lab y) $ end DimensionWithMembers in QueryClass isA Dimension with computed_attribute memb: Element constraint memconstr: $ (~memb memberOf ~this) $ end DimensionLabel in QueryClass,MSFOLrule isA Label with constraint islab: $ exists dim/Dimension Label(dim,this) $ end {* original version TopInDimension in GenericQueryClass isA Element with parameter,computed_attribute dim: Dimension constraint isTop: $ (this memberOf ~dim) and ( not exists inst/InstanceOfWithDim From(inst,this) and (inst dimension ~dim) ) and ( not exists spec/IsAWithDim From(spec,this) and (spec dimension ~dim) ) and ( exists c/Element lab/Label Label(dim,lab) and ( (c instanceOf/lab this) or (exists d/Element ((d instanceOf/lab c) and (c specializationOf_trans/lab this))) ) ) $ end *} {* new version *} TopInDimension in GenericQueryClass isA Element with parameter,computed_attribute dim: Dimension constraint isTop: $ (this memberOf ~dim) and ( not exists inst/InstanceOfWithDim From(inst,this) and (inst dimension ~dim) ) and ( exists c/Element lab/Label Label(dim,lab) and ( (c instanceOf/lab this) or (exists d/Element ((d instanceOf/lab c) and (c specializationOf_trans/lab this))) ) ) $ end TopElement in QueryClass isA Element with constraint isTop: $ ( not exists inst/InstanceOfWithDim From(inst,this) ) and ( not exists spec/IsAWithDim From(spec,this) ) $ end BottomElement in QueryClass isA Element with constraint isBottom: $ (not exists inst/InstanceOfWithDim To(inst,this)) and (not exists spec/IsAWithDim To(spec,this)) $ end {---} MultiDim in Module with comment author: "Manfred Jeusfeld,Thomas Kuehne"; created: "2023-03-01"; license : "Creative Commons Attribution-NonCommercial International 4.0 (CC BY-NC 4.0)" end SampleModel in Module end