NL to OCL via SBVR
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

NL to OCL via SBVR

  • 917 views
Uploaded on

Natural Langauge to OCL Transforamtion via SBVR

Natural Langauge to OCL Transforamtion via SBVR

More in: Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
917
On Slideshare
827
From Embeds
90
Number of Embeds
13

Actions

Shares
Downloads
20
Comments
0
Likes
0

Embeds 90

http://nl2ocllviasbvr.blogspot.com 48
http://nl2ocllviasbvr.blogspot.in 9
http://nl2ocllviasbvr.blogspot.com.br 8
http://nl2ocllviasbvr.blogspot.fr 6
http://nl2ocllviasbvr.blogspot.nl 5
http://nl2ocllviasbvr.blogspot.co.uk 4
http://nl2ocllviasbvr.blogspot.com.es 3
http://nl2ocllviasbvr.blogspot.com.au 2
http://webcache.googleusercontent.com 1
http://nl2ocllviasbvr.blogspot.be 1
http://nl2ocllviasbvr.blogspot.pt 1
http://www.slideshare.net 1
http://nl2ocllviasbvr.blogspot.ie 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Translation of Natural Language Specification to OCL A PhD Research Work Presentation RSMG 2 Imran Sarwar Bajwa PhD Student Natural Language Processing Group [email_address]
  • 2. Presentation Foot Steps
    • 1. Introduction
      • 1.1 Motivation
      • 1.2 Basic Concepts
      • 1.3 Research Problem
      • 1.4 Research Objectives
    • 2. Concluded Work
      • 2.1 State of the Art
      • 2.2 Proposed Solution
    • 3. Conclusions
    29 | April | 2010 | 16 Natural Language Processing Group School of Computer Science University of Birmingham, UK
  • 3. 1.1 Motivation
    • 1.1 Motivation
    • Object Constraint Language (OCL) is used to annotate Unified Modeling Language (UML) models with constraints.
    • But OCL is the least used language among the 13 UML languages.
    • OCL is difficult to write due to its hard syntax.
    • Creating OCL code is difficult and that results in less
    • adaptability of OCL
    • Constraints specification is easy to write in natural language e.g. English
    • A Natural language interface can be useful in automatic creation of OCL
    29 | April | 2010 | 16 Natural Language Processing Group School of Computer Science University of Birmingham, UK
  • 4. 1.2 Background
    • Natural Language (NL)
    • Natural languages (NL) e.g. English, Arabic, French, etc are basic source of communication for humans.
    • Computational processing of NL is a long standing challenge.
    • Basic steps involved in translation of Natural Language Text are following
    29 | April | 2010 | 16 Natural Language Processing Group School of Computer Science University of Birmingham, UK Basic steps of Natural language Translation NL Text ( Source String ) Lexical Analysis ( Tokenizing ) g Syntactic Analysis ( Parsing ) Semantic Analysis ( Meaning Extraction ) Output ( Target String ) Translation
  • 5. 1.2 Background
    • Object Constraint Language
    • An OCL constraint defines a restriction on state or behaviour of an entity in a UML model.
    • a. Invariants: The invariants are conditions those have to be TRUE always.
    • context driver
    • inv: self.age >= 18
    •  
    • b. Precondition: This constraint that should be TRUE always before the execution of a method starts.
    • context driver :: isAdult(dDOB: Integer): Boolean
    • pre: dDOB >= 1990  
    • b. Postcondition: This constraint should be TRUE always after the execution of a method has finished.
    • context driver :: isAdult(dDOB: Integer): Boolean
    • post : result >= 18
    29 | April | 2010 | 16 Natural Language Processing Group School of Computer Science University of Birmingham, UK
  • 6. 1.2 Background
    • OCL Simple Example
    29 | April | 2010 | 16 Natural Language Processing Group School of Computer Science University of Birmingham, UK
      • context Flight
      • inv self. maxNrPassengers <= 500
    • Flight Capacity Constraint: The maximum number of passengers that can be on a flight must be less than or equal to 500.
    Airport Flight * * departTime: Time arrivalTime: Time duration : Interval maxNrPassengers: Integer origin desti- nation name: String arriving Flights departing Flights 1 1
  • 7. 1.2 Background
    • OCL Hard Example
    29 | April | 2010 | 16 Natural Language Processing Group School of Computer Science University of Birmingham, UK
      • context Department
      • inv MaxSalary: Department.allInstances() -> forAll(d|not d.employee -> select(e|e.age<25) -> exists(e|e.salary > d.maxJuniorSal)).
    • Junior Employee Salary Constraint: The maximum salary of a junior employee those with an age lower than 25 can not earn more than the maximum junior salary value defined for their department.
  • 8. 1.2 Background
    • OCL Very Hard Example
    29 | April | 2010 | 16 Natural Language Processing Group School of Computer Science University of Birmingham, UK
    • Junior Employee Salary Constraint: In the enroll() operation of LoyaltyProgram, the Postcondition includes that there is no one more customer than before and that the new customer’s loyalty account has no points and no transactions.
      • context LoyaltyProgram::enroll(int c:Customer)
      • inv pre: not customer -> includes(c)
      • post: customer = customer @ pre -> including(c)
      • post: membership -> select(customer=c) -> forAll(
      • loyaltyAccount -> notEmpty() and
      • loyaltyAccount.points = 0 and
      • loyaltyAccount.transations -> isEmpty)
  • 9. 1.2 Background
    • Another OCL very Hard Example
    29 | April | 2010 | 16 Natural Language Processing Group School of Computer Science University of Birmingham, UK
    • Context LineFinder::rows : Set(Set(Integer))
    • derive : Set{ Set{0, 3, 6}, Set{1, 4, 7}, Set{2, 5, 8}, Set{0, 1, 2}, Set{3, 4, 5}, Set{6, 7, 8}, Set{0, 4, 8}, Set{6, 4, 2}}
    • Context LineFinder::findWinningLines(board:Sequence(Piece)) :
    • Set(Line)
    • body : let winners : Set(Set(Integer)) = LineFinder::rows -> select(row | row -> forAll(a, b : Integer | board -> at(a) = board -> at(b) and board -> at(a) <> Piece::Empty) ) in winners -> iterate(row : Set(Integer); lines : Set(Line) = Set{} | lines -> including(LineFinder::newLine(board -> at(row -> any(true)), row)))
    • TIC-TAC-TOE Winning Line Constraint: Finds all winning lines where it's possible to have more than one line, but if the other rules are enforced and all winning lines should be for the same piece.
  • 10. 1.2 Background
    • Semantic Business Vocabulary and Rules (SBVR)
    • SBVR has two components
      • SBVR vocabulary
        • SBVR vocabulary is made up of two elements: concepts and fact types .
        • - A concept can be a noun Concept or individual Concept .
        • - A fact type is a verb that specifies the relationship among different concepts in a business rule.
      • SBVR rules
        • SBVR rules are of two types: Definitional Rules and Behavioural Rules .
    • a. Definitional Rules:
    • Definitional Rules or structural rules are used to define an organization’s setup e.g . It is necessary that each customer has at least one bank account .
    • b. Behavioural Rules:
    • Behavioural Rules or operative rules express the conduct of an entity e.g. It is obligatory that each customer can withdraw at most GBP 200 per day .
    29 | April | 2010 | 16 Natural Language Processing Group School of Computer Science University of Birmingham, UK
  • 11. 1.3 Problem Description
    • 1.3. Problem Description
    • OCL is hard to write due to a number of reasons. Major reasons are
      • OCL syntax is difficult to grasp.
      • Manually creation of OCL code results in incorrect and erroneous OCL constraints.
      • So many OCL tools but they provide only type-checking facilities.
      • OCL is not adaptable in its current interface.
    • English is difficult to process due to following reasons
      • English is vast and has no domain boundaries
      • English sentence structure is ambiguous
      • Most English words have multiple senses
      • A single meaning can be represented in multiple ways
    29 | April | 2010 | 16 Natural Language Processing Group School of Computer Science University of Birmingham, UK
  • 12. 1.4 Research Objectives
    • 1.4. Objectives of Research
    • Major objectives of the research are
      • To make OCL more adoptable through translation from natural languages.
      • Overcoming limitations of natural languages with the help of SBVR
      • Presenting a framework that can be used to automatically generate OCL code from natural language specification .
      • Creating a tool for creating OCL from NL by implementing the proposed framework.
    29 | April | 2010 | 16 Natural Language Processing Group School of Computer Science University of Birmingham, UK
  • 13. 2.1 Related Work
    • 2.1 State of the Art
      • NL Specification to Object Oriented Analysis ( Moreno, 1997, Kop, 2002; Lee, 2002; Perez-Gonzalez, 2002; Mich, 1996; Li, 2004; Mala, 2006 )
      • NL Specification to UML Diagrams ( Bryant, 2003; Harmain, 2003; Clavel, 2007; Seco, 2004; Oliviera, 2004; Ilieva, 2005; Whittle, 2009; Kovacs, 2009 )
      • No work done for NL to OCL translation
      • SBVR based Controlled Natural Languages ( Kliener, 2009; Silvie, 2009; Spreeuwenburg, 2009 )
      • SBVR specification to UML model ( Raj, 2008 )
    29 | April | 2010 | 16 Natural Language Processing Group School of Computer Science University of Birmingham, UK
  • 14. 2.2 Proposed Solution 29 | April | 2010 | 16 Natural Language Processing Group School of Computer Science University of Birmingham, UK Natural Language Specifications Structured English based SBVR SBVR to OCL Translation Mapping NL to SBVR Rules Validated OCL code Designer UML Model SBVR Rules OCL Expression Application Scenario of Natural language to OCL transformation context driver inv: self.age >= 18 It is necessary that each driver must be at least 18 years old . A driver should be 18 years old.
  • 15. 3. Conclusion 29 | April | 2010 | 16 Natural Language Processing Group School of Computer Science University of Birmingham, UK Finally!! OCL can be made more adaptable and usable by providing a natural language e.g. English based user interface.
  • 16. 29 | April | 2010 | 16 Natural Language Processing Group School of Computer Science University of Birmingham, UK
    • Questions
      • ?