500 likes | 618 Views
Efficient Reasoning on Finite Satisfiability in UML Class Diagrams. Azzam Maraee Victor Makarenkov Mira Balaban. Agenda. Example Reasoning Problems Previous works Research Contribution. Conclusions and Future Work. Motivation. [Protein] [Chemical].
E N D
Efficient Reasoning on Finite Satisfiability in UML Class Diagrams Azzam Maraee Victor Makarenkov Mira Balaban
Agenda • Example • Reasoning Problems • Previous works • Research Contribution • Conclusions and Future Work
Motivation [Protein] [Chemical] [Enzyme]=2* [catalyzedReaction] [Enzyme] [Protein] ½*[Protein] ½* [Chemical] [Chemical] [Reaction] [catalyzedReaction] =1/2*[Enzyme] 2*[Chemical] [Chemical] What’s wrong with this ontology* ?
Agenda • Background • Reasoning Problems • Previous works • Research Contribution • Finite Satisfiability Method: • Class Hierarchy and Generalization Set Constraints • Conclusions and Future Work
Reasoning Problems (1):Inconsistency • Emptiness disjoint
Reasoning Problems (2):Infinity Problem (1) • Consider the pervious example:
Definitions • A legal instance of a class diagram is an instance that satisfies all constraints. • A class is consistent if it has a non empty extension in some legal instance. • A class is finitely satisfiable if it has a non empty extension in some legal instance.
Relevance of Reasoning • It is important to guarantee that models provide a reliable support for the designed systems. • Implementability : A class diagram is implemented into a running system. • Project cost: Early detection of problems. • Used with MDA: Precise and consistent enough to be used within MDA.
Reasoning Needs (2) • Current case tools do not support reasoning tasks. • Need for powerful CASE tools • with reasoning capabilities.
Agenda • Background • Reasoning Problems • Previous works • Research Contribution • Finite Satisfiability Method. • Class Hierarchy and Generalization Set Constraints • Conclusions and Future Work
Testing Finite Satisfiability • Lenzerini and Nobili (92): • ER diagrams without class hierarchy. • Calvanese and Lenzerini (94): • Extend with class hierarchy.
min2, max2 min1, max1 Lenzerini and Nobily (92). Method: • Transform cardinality constraints into an inequalities system. • Solve the system. Result: The diagram is finitely satisfiable iff the inequalities system has a solution. r≥min1∙a , r≤max1∙a ,r≥min2∙b , r≤max2∙b, a, b, r>0
Example 1 depend Reaction 2
Example 1 depend Reaction 2
Calvanese and Lenzerini (94) – Extension with class hierarchies (1) • Calvanese and Lenzerini extend the method of Lenzerini and Nobily (92) to apply to schemata with class hierarchy. • The expansion is based on the assumption that class extensions may overlap. • Compound Class. • Compound relationship:
Calvanese and Lenzerini (94) – Extension with class hierarchies (2) Advisor,Master_Student Advisor,PhD_Student Advisor,Master_Student, PhD Advisor
Calvanese and Lenzerini (94) – Extension with class hierarchies (3) Advisor, Master, Ph.D Advisor, PhD Advisor Advisor, Master Advisor,Master , Ph.D Advisor: Master
Calvanese and Lenzerini (94) – Extension with class hierarchies (2) • For a class diagram with three classes and one association: 12 variables and 26 inequalities • An exponential number of variables.
Hardness of Finite Satisfiability • Berardi et al (2005) showed : • Lutz et al (2005) showed:
Agenda • Background • Reasoning Problems • Previous works • Research Contribution • Finite Satisfiability Method • Conclusions and Future Work
FiniteSat Algorithm • The FiniteSat Algorithm • Input: A class diagram CD with binary multiplicity constraints, class hierarchy constraints, and GS constraints. • Output: A linear inequality system ψCD • Method: • For every class, association, or multiplicity constraint: create variables and inequalities according to the Lenzerini and Nobili method. • For every class hierarchy constraint, B being the subclass with variable b and A being the super class with variable a, extend the inequality system with the inequalities a ≥ b. • For every GS constraint GS(C, C1,...Cn; Const), C being the super-class, Cis being the subclasses, and Const being the GS constraint, extend the inequality system, as follows: • Const = disjoint: • Const = complete: • Const = incomplete: • Cons t= overlapping: Without inequality • Const = disjoint, incomplete: • Const = disjoint, complete: • Const = overlapping, complete: • Const = overlapping, incomplete:
The FiniteSat Algorithm • Class hierarchy constrain AB
GS Constraints -1 • For every GS constraint GS(C, C1,...Cn; Const):
GS Constraints -2 • For every GS constraint GS(C, C1,...Cn; Const):
Example 1 • Variable: • Chemical: ch ,Reaction: r, CatalyzedReaction:c, DNA: d, Potien:p, DNASegment, dn. Genome, ge, Gene:g, Enzyme:e • Catalyzed: ca , substrate: s, include: in • Inequalities: • Class hierarchy constraints inequalities: • ch>=d, c>=p, dn>=g, dn>=ge, p>=e, c>=r • Gs constraints inequalities: • dn>g+ge • Multiplicity constraint inequalities: • s>=ch, s=r, c<=r, ca=e, ca=2c, in>ge, in=dn • ch,r,c,d,p,dn,ge,e,ca,s,i>0
Performance Claim: A Class diagram CD is finitely satisfiabile iff the inequality system ψCD is solvable. Table 1 summarizes our results.
Splitting the Problem : Hierarchy Structure • Tree Structure.
Splitting the Problem: Hierarchy Structure • Tree Structure. • Acyclic Structure.
Splitting the Problem: Hierarchy Structure • Tree Structure • Acyclic Structure • Graph Structure.
Splitting the Problem Hierarchy Structure GS Constraint Tree Acyclic Graph Without With
FiniteSat Extension to Qualifier • Qualifier • Imposes a partitioning on the set of related instances. • Tightens the multiplicity constraint of its association. • Can cause finite satisfiability problems. B A q1 :Tq1[tq1] … qn:Tqn[tqn] R min1..max1 min2..max2
FiniteSat Extension to Qualifier - Example TV-Network 1 WeekdaySchedule 1 Broadcast Schedule Day : Weekday • In every legal instance • Number of broadcast schedules, b, is 7*t, where t is the number of TV-Networks. At the same time t=b. The only solution for: • b=7t • b=t Is empty or infinite! 1 1 NetworkSchedule Enum WeekDay = {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday}
FiniteSat Extension to Qualifier – General case • If a combined domain value is non-finite, ignore the qualifier constraint, and handle like regular association. • Else, extend the inequality system with the following inequalities: • min1 x b <= r <= max1 x b • min2 x a x tq1 x … x tqn <= r <= max2 x a x tq1 x … x tqn
Exploring the Limits • Infinity
The Inequalities System There is a solution
Future Work • Extensions: • Graph structure with disjoint, complete. • N-ary. • Aggregation. • Identification and Fixing (Sven Hartman, 2001) • integrate the implementation as add-in in existing case tool,
1 1 super super ISA1 ISA2 0..1 0..1 sub sub Finite Satisfiabilty over Unconstrained Tree Hierarchy A class diagram that includes binary associations and unconstrained tree hierarchy Create the Lenzerini & Nobili inequalities system and Solve. Class Diagram without hierarchy constraint
Finite Satisfiabilty over Unconstrained Tree Hierarchy Claims • Claim [correctness]: A class diagram with unconstrained tree hierarchy is finitely satisfiable iff there exists a solution to the inequalities system. • Claim [Complexity]: Unconstrained Tree Hierarchy finite satisfiabilty method adds to the Lenzerini and Nobili method an O(n) time complexity, where n is the size of the class diagram (including associations, classes and class hierarchy constraints).
Finite Satisfiabilty over Unconstrained Tree Hierarchy Proof [Correctness Claim] CD: finitely satisfiable CD’: finitely satisfiable CD CD’ A class diagram that includes binary associations and unconstrained tree hierarchy Class Diagram without hierarchy constraint Create the Lenzerini & Nobili inequalities system and Solve. It is sufficient to show a reduction of the finite satisfiability problem for CD to finite satisfiability problem for CD’ without generalization sets.
Finite Satisfiabilty over Unconstrained Tree Hierarchy CD CD’ Lenzerini & Nobili inequalities Reduction Proof CD’: finitely satisfiable CD: finitely satisfiable I’ I
rest of the diagram Consistency notions (1) • Berardi et al (2005), distinguish two cases: • Consistency of class diagram – has an instantiation with at-leastone non-empty class extension. • Class consistency – there is an instantiation in which the class extension is non-empty. Consistent The whole class diagram is consistent
Consistency notions (2) • All class consistency of a class diagram – every class is consistent. • Full consistency of a class diagram – has an instance in which all class extensions are non-empty.
Finite satisfiability notions • All class finite satisfiability of a class diagram – every class there is a finite instance in which the class extension is non-empty (strong satisfiability, Lenzerini and Nobili, 1990). • Finite satisfiability of a class diagram – it has a finite instance in which all class extensions are non-empty. Lenzerini & Nobili 92 Research Contribution UML Class Diagram
Class Diagram: Cardinality Constraint and Class Hierarchy • Class: Advisor and University • Association: Employment • Cardinality Constraint • Class Hierarchy 1..* 1 Legal Instance:
Class Diagram: Generalization Set Concept 1..* 1 {overlapping,incomplete} {disjoint, complete} {overlapping, complete} {disjoint, incomplete}