600 likes | 614 Views
Efficient Methods for Solving Finite Satisfiability Problems in UML Class Diagrams. Mira Balaban and Azzam Maraee. Motivation. What’s wrong with this ontology * ?. [Enzyme] [Protein] . [Protein] [Chemical]. [ Chemical] [Reaction] . [Reaction] < [Enzyme].
E N D
Efficient Methods for Solving Finite Satisfiability Problems in UML Class Diagrams Mira Balaban and Azzam Maraee
Motivation What’s wrong with this ontology* ? [Enzyme] [Protein] [Protein] [Chemical] [Chemical] [Reaction] [Reaction] < [Enzyme] [Enzyme] < [Enzyme] *Consistency Checking of Semantic Web OntologiesKenneth Baclawski, Mieczyslaw M. Kokar, Richard Waldinger, Paul A. Kogut
Agenda • Background • Reasoning Problems • Previous works • Research Contribution • Conclusions and Future Work
UML • UML is now widely accepted as the standard modeling language for software construction. • UML 2.0 updates came from 54 companies. • Class diagrams are widely used • software and language. • specification, database. • ontology engineering
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}
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:
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.
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
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
Splitting the Problem • Presents of Constraints: • Without • With • Hierarchy Structure: • Tree Structure. • Acyclic Structure. • Graph Structure.
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
Splitting the Problem Hierarchy Structure GS Constraint Tree Acyclic Graph Without With Limited
Finite Satisfiabilty over Unconstrained Tree Hierarchy • Input: • Tree class hierarchy. • Unconstrained generalization sets. • Binary associations. • Method: • A reduction to the algorithm of Lenzerini Nobili:
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 The Inequalities Systems d≥m d≥2d m=2d
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
Extensions of Finite Satisfiabilty Method • Applies properly also to the rest of the unconstrained structured: • Acyclic Structure. • Graph Structure.
Splitting the Problem Hierarchy Structure GS Constraint Tree Acyclic Graph Without With Limited
Master_Student Finite Satisfiabilty Method: Constrained Tree Hierarchy ma Constrained Tree Hierarchy {disjoint, complete} advisor Empty
Const Const 1 1 …………….. …... 0..1 0..1 Finite Satisfiabilty Method: Constrained Tree Hierarchy A class diagram that includes binary associations and constrained tree structure Class Diagram without hierarchy constraint. 1) Create the Lenzerini and Nobili inequalities system. 2) Expand the inequalities and Solve. OCL constraint: Const
Finite Satisfiabilty Method : Constrained Tree Hierarchy 1) Create the Lenzerini and Nobili inequalities system. 2) Expand the inequalities and Solve. A class diagram that includes binary associations and constrained tree structure Class Diagram without hierarchy constraint OCL constraint: Const Single Constraints
Finite Satisfiabilty Method: Constrained Tree Hierarchy • Claim [Correctness]: A class diagram with constrained tree structure is finitely satisfiable iff there exists a solution for the expanded inequalities system • Claim [Complexity]: 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
Correctness Claim (Intuition) CD: finitely satisfiable CD’: finitely satisfiable A class diagram that includes binary associations and constrained tree structure Class Diagram without hierarchy constraint. Expanded inequality system OCL constraint: Const I I’
Correctness Claim (Intuition) CD’: finitely satisfiable CD’: finitely satisfiable A class diagram that includes binary associations and constrained tree structure Class Diagram without hierarchy constraint. Expanded inequality system OCL constraint: Const I’ Solution
Finite Satisfiabilty Method: Constrained Tree Hierarchy 1) Create the Lenzerini and Nobili inequalities system. 2) Expand the inequalities and Solve. A class diagram that includes binary associations and [T-C]-GS Class Diagram without hierarchy constraint OCL constraint: Const
No Exclusive Inequalities 1) Create the Lenzerini and Nobili inequalities system. 2) Expand the inequalities and Solve. Class Diagram without hierarchy constraint. A class diagram that includes binary associations and constrained tree structure OCL constraint: Const
Finite Satisfiabilty MethodStructure Extension Hierarchy Structure GS Constraint Tree Acyclic Graph Without With Limited ?