SlideShare uma empresa Scribd logo
1 de 74
Baixar para ler offline
Semantics     SOS         DSL’s                 SOS for a DSL                     Conclusions




                        Applying
            Structural Operational Semantics
                        to MDE
               Define the Semantics of your DSL


                       Tjerk Wolterink

                       University of Twente


                        March 30, 2009



                                  Applying , Structural Operational Semantics , to MDE
                                                                                         1 / 45
Semantics            SOS         DSL’s                 SOS for a DSL                     Conclusions


                                  Outline


            Semantics
     1



            Structural Operational Semantics
     2



            Domain Specific Languages
     3



            Structural Operational Semantics for a DSL in MDE
     4



            Conclusions
     5




                                         Applying , Structural Operational Semantics , to MDE
                                                                                                2 / 45
Semantics         SOS             DSL’s                 SOS for a DSL                     Conclusions


                              Introduction



      Observation MDE, generally, lacks formal semantics
     Problem Statement Can Structural Operational Semantics (SOS)
                 be successfully applied to MDE?
     Research Objectives     Make SOS useful for MDE
                        Providing a semantic language named SemLang
                        Proof by example: apply SemLang
                        Build a tool, the Semantic Engine to simulate models




                                          Applying , Structural Operational Semantics , to MDE
                                                                                                 3 / 45
Semantics            SOS         DSL’s                 SOS for a DSL                     Conclusions


                                  Outline


            Semantics
     1



            Structural Operational Semantics
     2



            Domain Specific Languages
     3



            Structural Operational Semantics for a DSL in MDE
     4



            Conclusions
     5




                                         Applying , Structural Operational Semantics , to MDE
                                                                                                4 / 45
Semantics             SOS             DSL’s                 SOS for a DSL                     Conclusions


                            Language Definition



     Abstract Syntax Determines the form and structure of programs
                            Textual languages, Iconic languages, Diagrammic
                            languages
                            Specification for parsers
            Semantics Models the computational meaning of each program
                            Specification for compilers/interpreters
                            Dimension: Informal vs Formal
                            Dimension: Static vs Dynamic




                                              Applying , Structural Operational Semantics , to MDE
                                                                                                     5 / 45
Semantics             SOS             DSL’s                 SOS for a DSL                     Conclusions


                            Language Definition



     Abstract Syntax Determines the form and structure of programs
                            Textual languages, Iconic languages, Diagrammic
                            languages
                            Specification for parsers
            Semantics Models the computational meaning of each program
                            Specification for compilers/interpreters
                            Dimension: Informal vs Formal
                            Dimension: Static vs Dynamic




                                              Applying , Structural Operational Semantics , to MDE
                                                                                                     5 / 45
Semantics            SOS            DSL’s                 SOS for a DSL                     Conclusions


                           Informal Semantics

            Meaning of a language is described using human readable text

     Example:”’Semantics of Java && operator:
     The && operator perform Conditional-AND operations on two
     boolean expressions. This operator exhibit ”short-circuiting”
     behaviour, which means that the second operand is evaluated only
     if needed.

       Advantages easy to read, easy to understand, easy to create
     Disadvantages imprecise, ambiguous, not computer-readable, not
                 useful for mathematical techniques (like proofs,
                 model checking etc.)


                                            Applying , Structural Operational Semantics , to MDE
                                                                                                   6 / 45
Semantics            SOS            DSL’s                 SOS for a DSL                     Conclusions


                           Informal Semantics

            Meaning of a language is described using human readable text

     Example:”’Semantics of Java && operator:
     The && operator perform Conditional-AND operations on two
     boolean expressions. This operator exhibit ”short-circuiting”
     behaviour, which means that the second operand is evaluated only
     if needed.

       Advantages easy to read, easy to understand, easy to create
     Disadvantages imprecise, ambiguous, not computer-readable, not
                 useful for mathematical techniques (like proofs,
                 model checking etc.)


                                            Applying , Structural Operational Semantics , to MDE
                                                                                                   6 / 45
Semantics            SOS           DSL’s                 SOS for a DSL                     Conclusions


                            Formal Semantics
            Semantic mapping from syntax L to a semantic domain S.
            M:L→S
            Semantic domain: well known mathematical domain: natural
            numbers, graphs, labelled transition systems etc.
            Semantic mapping: describes how the syntax relates to the
            semantic domain
            Approaches: Axiomatic, Denotational, Graph Transformations,
            Structural Operational Semantics

       Advantages precise, computer-readable, useful for mathematical
                  techniques (like proofs,system validation, simulation
                  etc.)
     Disadvantages often difficult to read, understand, create. Requires
                 understanding of the semantic domain.
                                           Applying , Structural Operational Semantics , to MDE
                                                                                                  7 / 45
Semantics            SOS           DSL’s                 SOS for a DSL                     Conclusions


                            Formal Semantics
            Semantic mapping from syntax L to a semantic domain S.
            M:L→S
            Semantic domain: well known mathematical domain: natural
            numbers, graphs, labelled transition systems etc.
            Semantic mapping: describes how the syntax relates to the
            semantic domain
            Approaches: Axiomatic, Denotational, Graph Transformations,
            Structural Operational Semantics

       Advantages precise, computer-readable, useful for mathematical
                  techniques (like proofs,system validation, simulation
                  etc.)
     Disadvantages often difficult to read, understand, create. Requires
                 understanding of the semantic domain.
                                           Applying , Structural Operational Semantics , to MDE
                                                                                                  7 / 45
Semantics            SOS             DSL’s                  SOS for a DSL                     Conclusions


                    Static vs Dynamic Semantics
            Static semantics models compile-time checks
                 Checks that can be performed before running
                 Well formedness
                 Type checking

     Example: Type checking a type cast
     (TypeA)new TypeB()
     Check that TypeA is a subclass of TypeB

            Dynamic semantics models run-time behaviour
                 Concerned with the observable behaviour of a running program
                 Description of computational steps

     Example: Evaluation of If-Expressions
     if(a) then b
     if a evaluates to true then evaluate b
                                              Applying , Structural Operational Semantics , to MDE
                                                                                                     8 / 45
Semantics            SOS             DSL’s                  SOS for a DSL                     Conclusions


                    Static vs Dynamic Semantics
            Static semantics models compile-time checks
                 Checks that can be performed before running
                 Well formedness
                 Type checking

     Example: Type checking a type cast
     (TypeA)new TypeB()
     Check that TypeA is a subclass of TypeB

            Dynamic semantics models run-time behaviour
                 Concerned with the observable behaviour of a running program
                 Description of computational steps

     Example: Evaluation of If-Expressions
     if(a) then b
     if a evaluates to true then evaluate b
                                              Applying , Structural Operational Semantics , to MDE
                                                                                                     8 / 45
Semantics            SOS         DSL’s                 SOS for a DSL                     Conclusions


                                  Outline


            Semantics
     1



            Structural Operational Semantics
     2



            Domain Specific Languages
     3



            Structural Operational Semantics for a DSL in MDE
     4



            Conclusions
     5




                                         Applying , Structural Operational Semantics , to MDE
                                                                                                9 / 45
Semantics             SOS              DSL’s                 SOS for a DSL                     Conclusions


      Overview of Structural Operational Semantics
                    (SOS & MSOS)

            MSOS is Modular SOS
            Semantic domain of SOS is a labelled terminal transition system
            (LTTS)

     Definition
     A LTTS is a quadruple (Q, T , A, →) with Q as set of states, a set A of
     labels α. A relation →⊆ Q × A × Q of labelled transitions ((s, α, s‘) is
                   α
     written as s −→ s‘), and a set T ⊆ Q of terminal configurations such
             α
     that s −→ s‘ implies s ∈ T
                            /

            SOS Specification consists of
                 Definitions of the sets Q, A and the end states T
                 A set of rules that specify the transition relation →

                                               Applying , Structural Operational Semantics , to MDE
                                                                                                      10 / 45
Semantics             SOS              DSL’s                 SOS for a DSL                     Conclusions


      Overview of Structural Operational Semantics
                    (SOS & MSOS)

            MSOS is Modular SOS
            Semantic domain of SOS is a labelled terminal transition system
            (LTTS)

     Definition
     A LTTS is a quadruple (Q, T , A, →) with Q as set of states, a set A of
     labels α. A relation →⊆ Q × A × Q of labelled transitions ((s, α, s‘) is
                   α
     written as s −→ s‘), and a set T ⊆ Q of terminal configurations such
             α
     that s −→ s‘ implies s ∈ T
                            /

            SOS Specification consists of
                 Definitions of the sets Q, A and the end states T
                 A set of rules that specify the transition relation →

                                               Applying , Structural Operational Semantics , to MDE
                                                                                                      10 / 45
Semantics                        SOS                         DSL’s                     SOS for a DSL                     Conclusions


                                                Overview of SOS


               States are sentences that conform to an extension of the abstract
               syntax: value-added syntax
               Transitions are specified inductively by rules
                         A single transition can be proven by a set of rules
                         Rules alter the structure of the states




            Graphics from Structural Operational Semantics 1981 by G.D. Plotkin




                                                                         Applying , Structural Operational Semantics , to MDE
                                                                                                                                11 / 45
Semantics              SOS               DSL’s                  SOS for a DSL                     Conclusions


                                    Rules in SOS
                                                              t‘
            A rule consist of transition assertions t −→ t“
            The terms t, t‘, t“ are language sentences that may contain
            meta-variables
     Rule Definition
                                          c1 , · · · , cn
                                                 c
            A rule has zero or more conditions c1 , · · · , cn and a conclusion c
                                                               t‘
            c1 , · · · , cn , c are transition assertions (t −→ t“)
            c1 , · · · , cn can also be simple assertions (equations)
            Informal meaning: if c1 , · · · , cn then c
     Example if rule for a pseudo language
                                          e1 → e1 ‘
                               if e1 then e2 → if e1 ‘ then e2
                                                  Applying , Structural Operational Semantics , to MDE
                                                                                                         12 / 45
Semantics              SOS               DSL’s                  SOS for a DSL                     Conclusions


                                    Rules in SOS
                                                              t‘
            A rule consist of transition assertions t −→ t“
            The terms t, t‘, t“ are language sentences that may contain
            meta-variables
     Rule Definition
                                          c1 , · · · , cn
                                                 c
            A rule has zero or more conditions c1 , · · · , cn and a conclusion c
                                                               t‘
            c1 , · · · , cn , c are transition assertions (t −→ t“)
            c1 , · · · , cn can also be simple assertions (equations)
            Informal meaning: if c1 , · · · , cn then c
     Example if rule for a pseudo language
                                          e1 → e1 ‘
                               if e1 then e2 → if e1 ‘ then e2
                                                  Applying , Structural Operational Semantics , to MDE
                                                                                                         12 / 45
Semantics                 SOS                DSL’s                  SOS for a DSL                     Conclusions


                Rules define the Transition Relation →

     Given a set of rules, a triple (s, α, s‘) is in the transition relation if
     and only if a finite branching tree can be formed that follows
     satisfies the following conditions:
                All nodes are labelled by elements of Q × A × Q
            1


                the root nodes is labelled by (s, α, s‘)
            2

                                                                              c1 ,··· ,cn
                for each node with n child nodes there is a rule                            and an
            3
                                                                                   c
                interpretation of the meta-variables such that/
                     the label of the node is the interpretation of c
                     the labels of the child nodes are the interpretations of c1 , · · · , cn .

     Concrete examples will be given to make it easier to understand



                                                      Applying , Structural Operational Semantics , to MDE
                                                                                                             13 / 45
Semantics                 SOS                DSL’s                  SOS for a DSL                     Conclusions


                Rules define the Transition Relation →

     Given a set of rules, a triple (s, α, s‘) is in the transition relation if
     and only if a finite branching tree can be formed that follows
     satisfies the following conditions:
                All nodes are labelled by elements of Q × A × Q
            1


                the root nodes is labelled by (s, α, s‘)
            2

                                                                              c1 ,··· ,cn
                for each node with n child nodes there is a rule                            and an
            3
                                                                                   c
                interpretation of the meta-variables such that/
                     the label of the node is the interpretation of c
                     the labels of the child nodes are the interpretations of c1 , · · · , cn .

     Concrete examples will be given to make it easier to understand



                                                      Applying , Structural Operational Semantics , to MDE
                                                                                                             13 / 45
Semantics          SOS          DSL’s                 SOS for a DSL                     Conclusions


              Example: Simple Expression Lang
     First define the valid structure of a program, the syntax:
     Abstract syntax
     Numbers: n ∈ N = {0, 1, 2, · · · }
     Binary Operators: bop ∈ Bop = {+, −, ∗, · · · }
     Expressions: e ∈ Exp = n | e0 bop e1

     Example program
                                                               Exp
                                            Exp                   Bop           N
            (2 + 3) ∗ 8
                                   N        Bop            N         *           8
                                   2          +            3

                                        Applying , Structural Operational Semantics , to MDE
                                                                                               14 / 45
Semantics             SOS              DSL’s                 SOS for a DSL                     Conclusions


               Simple Expressions Lang Semantics




            The states Q are sentences of the language
            Numbers N = {0, 1, 2, · · · } are end states T
            No labels are used A = ∅




                                               Applying , Structural Operational Semantics , to MDE
                                                                                                      15 / 45
Semantics             SOS            DSL’s                 SOS for a DSL                     Conclusions


               Simple Expressions Lang Semantics



            The transition relation → is specified by a set of rules:
            Evaluate lhs Rule
                                          e0 → e0 ‘
                                                                                              (1)
                                   e0 bop e1 → e0 ‘ bop e1
            Evaluate rhs Rule
                                          e1 → e1 ‘
                                                                                              (2)
                                   n0 bop e1 → n0 bop e1 ‘




                                             Applying , Structural Operational Semantics , to MDE
                                                                                                    15 / 45
Semantics            SOS              DSL’s                 SOS for a DSL                     Conclusions


               Simple Expressions Lang Semantics



            Evaluate plus Rule
                                 bop = + n = n0 + n1
                                                                                               (1)
                                     n0 bop n1 → n

            Evaluate multiply Rule
                                     bop = ∗ n = n0 ∗ n1
                                                                                               (2)
                                        n0 bop n1 → n




                                              Applying , Structural Operational Semantics , to MDE
                                                                                                     15 / 45
Semantics         SOS        DSL’s                 SOS for a DSL                     Conclusions


                        Computation trace



     First transition
                         (2 + 3) ∗ 8 → 5 ∗ 8

     Transition proof
     Initial state
                             (2 + 3) ∗ 8




                                     Applying , Structural Operational Semantics , to MDE
                                                                                            16 / 45
Semantics         SOS            DSL’s                 SOS for a DSL                     Conclusions


                         Computation trace


     First transition
                            (2 + 3) ∗ 8 → 5 ∗ 8

     Transition proof
                                2 + 3 → e0 ‘
                            (2 + 3) ∗ 8 → e0 ‘ ∗ 8
     By applying the lhs evaluation rule:
                                  e0 → e0 ‘
                           e0 bop e1 → e0 ‘ bop e1



                                         Applying , Structural Operational Semantics , to MDE
                                                                                                16 / 45
Semantics         SOS            DSL’s                 SOS for a DSL                     Conclusions


                         Computation trace

     First transition
                           (2 + 3) ∗ 8 → 5 ∗ 8

     Transition proof
                          bop = + e0 ‘ = n0 + n1
                                2 + 3 → e0 ‘
                            (2 + 3) ∗ 8 → e0 ‘ ∗ 8
     By applying the evaluate plus rule:
                           bop = + n = n0 + n1
                               n0 bop n1 → n


                                         Applying , Structural Operational Semantics , to MDE
                                                                                                16 / 45
Semantics         SOS           DSL’s                 SOS for a DSL                     Conclusions


                        Computation trace


     First transition
                           (2 + 3) ∗ 8 → 5 ∗ 8

     Transition proof
                           + = + e0 ‘ = 2 + 3
                               2 + 3 → e0 ‘
                           2 + 3 ∗ 8 → e0 ‘ ∗ 8
     By substituting the meta variables

                        bop = + n0 = 2 n1 = 3



                                        Applying , Structural Operational Semantics , to MDE
                                                                                               16 / 45
Semantics          SOS           DSL’s                 SOS for a DSL                     Conclusions


                            Computation trace


     First transition
                             (2 + 3) ∗ 8 → 5 ∗ 8

     Transition proof
     Full proof
                               + = + e0 ‘ = 5
                                 2 + 3→5
                              2+3 ∗ 8→5 ∗ 8
     by substituting e0 ‘
                               e0 ‘ = 2 + 3 = 5



                                         Applying , Structural Operational Semantics , to MDE
                                                                                                16 / 45
Semantics            SOS         DSL’s                 SOS for a DSL                     Conclusions


                                  Outline


            Semantics
     1



            Structural Operational Semantics
     2



            Domain Specific Languages
     3



            Structural Operational Semantics for a DSL in MDE
     4



            Conclusions
     5




                                         Applying , Structural Operational Semantics , to MDE
                                                                                                17 / 45
Semantics             SOS            DSL’s                 SOS for a DSL                     Conclusions


                    Generic vs Specific Languages

                                                        DSL Domain Specific
            GPL General Purpose                         Language
            Language
                                                        Small ( often extensions of
            Large                                       GPLs (embedded))
            Gap between language                        Closer to problem domain:
            domain and problem domain                   captures domain knowledge
            Users: software-engineers,                  Users: Same as DSL plus
            programmers                                 domain-experts, end-users

     Examples                                   Examples
     C++, Java, Fortran, Lisp                   SQL, BNF, HTML, RegExp,
                                                XSLT

                                             Applying , Structural Operational Semantics , to MDE
                                                                                                    18 / 45
Semantics               SOS              DSL’s                   SOS for a DSL                     Conclusions


                                      Defining a DSL


   Executable vs Static DSL’s
   Define domain concepts and relations in a
   metamodel
            Plays the role of an abstract syntax
            Captures domain knowledge
   Define concrete syntax (optionally)
            Textually or visual
            Provides easier editing
   Define semantics
            Informally using code generation to a GPL
            Formally both dynamic and static semantics



                                                   Applying , Structural Operational Semantics , to MDE
                                                                                                          19 / 45
Semantics               SOS              DSL’s                   SOS for a DSL                     Conclusions


                                      Defining a DSL


   Executable vs Static DSL’s
   Define domain concepts and relations in a
   metamodel
            Plays the role of an abstract syntax
            Captures domain knowledge
   Define concrete syntax (optionally)
            Textually or visual
            Provides easier editing
   Define semantics
            Informally using code generation to a GPL
            Formally both dynamic and static semantics



                                                   Applying , Structural Operational Semantics , to MDE
                                                                                                          19 / 45
Semantics               SOS              DSL’s                   SOS for a DSL                     Conclusions


                                      Defining a DSL


   Executable vs Static DSL’s
   Define domain concepts and relations in a
   metamodel
            Plays the role of an abstract syntax
            Captures domain knowledge
   Define concrete syntax (optionally)
            Textually or visual
            Provides easier editing
   Define semantics
            Informally using code generation to a GPL
            Formally both dynamic and static semantics



                                                   Applying , Structural Operational Semantics , to MDE
                                                                                                          19 / 45
Semantics            SOS         DSL’s                 SOS for a DSL                     Conclusions


                                  Outline


            Semantics
     1



            Structural Operational Semantics
     2



            Domain Specific Languages
     3



            Structural Operational Semantics for a DSL in MDE
     4



            Conclusions
     5




                                         Applying , Structural Operational Semantics , to MDE
                                                                                                20 / 45
Semantics           SOS            DSL’s                 SOS for a DSL                     Conclusions


                Defining the Semantics of a DSL
            Take an MDE approach: everything is a model
            Define a DSL SemLang for defining semantics of other DSL’s
            SemLang: The Semantic Language DSL
                Builds upon SOS and MSOS




                                           Applying , Structural Operational Semantics , to MDE
                                                                                                  21 / 45
Semantics             SOS            DSL’s                 SOS for a DSL                     Conclusions


                              SOS vs SemLang

                                                                 SemLang
               SOS & MSOS

                                                        MetaModel defines DSL
            Abstract Syntax defines
                                                        structure
            Language Structure
                                                        Models are states
            Sentences are states
                                                        → states are graphs
            → States are trees
                                                        Rules contain object
            Rules contain syntax
                                                        patterns

     SOS Rule
                                       e1 → e1 ‘
                            if e1 then e2 → if e1 ‘ then e2

                                             Applying , Structural Operational Semantics , to MDE
                                                                                                    22 / 45
Semantics        SOS         DSL’s                 SOS for a DSL                     Conclusions


                       SOS vs SemLang

     SemLang Rule
                                C → C‘
            IfExp(e1 = C, e2 = E) → IfExp(e1 = C‘, e2 = E)




                                     Applying , Structural Operational Semantics , to MDE
                                                                                            22 / 45
Semantics            SOS            DSL’s                  SOS for a DSL                     Conclusions


                         Understanding SemLang


            Understanding SemLang by example
            For each DSL we define
                MetaModel
                Sample model (sample program)
                Semantics in SemLang
            The sample model will be executed.
            The DSL’s:
                Simple Imperative Language
                Activity Diagram Language




                                             Applying , Structural Operational Semantics , to MDE
                                                                                                    23 / 45
Semantics            SOS            DSL’s                  SOS for a DSL                     Conclusions


                         Understanding SemLang


            Understanding SemLang by example
            For each DSL we define
                MetaModel
                Sample model (sample program)
                Semantics in SemLang
            The sample model will be executed.
            The DSL’s:
                Simple Imperative Language
                Activity Diagram Language




                                             Applying , Structural Operational Semantics , to MDE
                                                                                                    23 / 45
Semantics         SOS      DSL’s                 SOS for a DSL                     Conclusions


            Simple Imperative Language: MetaModel




                                   Applying , Structural Operational Semantics , to MDE
                                                                                          24 / 45
Semantics                      SOS                     DSL’s                      SOS for a DSL                          Conclusions


       Simple Imperative Language: Sample Model
                                                                                               Seq


                                                                                         c1          c0


                                                                        Seq                          Assign


                                                                 c0         c1                            e       name


                                              Assign                   Assign                        Number              a


                                          e      name                   e         name                    val


                          BinaryExp              b               BinaryExp              a            Integer:10


                         lhs     rhs    bop                      lhs    rhs       bop


             Number            Var        Plus          Var            Number               Minus


                 val             name                     name              val


            Integer:10          a                        b           Integer:3
                                                                  Applying , Structural Operational Semantics , to MDE
                                                                                                                                25 / 45
Semantics        SOS            DSL’s                 SOS for a DSL                     Conclusions


                       Binary Expressions Rule




                        Computes = {Nil, Number}

                                    L→NL
                                                                                        (3)
            BinExp(lhs=L,bop=O,rhs=R)→BinExp(lhs=NL,bop=O,rhs=R)


                                    R→NR
                                                                                        (4)
            BinExp(lhs=L,bop=O,rhs=R)→BinExp(lhs=L,bop=O,rhs=NR)




                                        Applying , Structural Operational Semantics , to MDE
                                                                                               26 / 45
Semantics       SOS            DSL’s                 SOS for a DSL                     Conclusions


                      Binary Expressions Rule




                                   O∈Plus
                                                                                       (3)
            BinExp(lhs=L,bop=O,rhs=R)→Number(val=(L.val+R.val))


                                  O∈Minus
                                                                                       (4)
            BinExp(lhs=L,bop=O,rhs=R)→Number(val=(L.val−R.val))




                                       Applying , Structural Operational Semantics , to MDE
                                                                                              26 / 45
Semantics         SOS           DSL’s                 SOS for a DSL                     Conclusions


                    Rules for Seq commands




                                C0 → NC
                                                                                        (5)
            Seq (c0 = C0, c1 = C1) → Seq (c0 = NC, c1 = C1)


                        Seq (c0 = C0 , c1 = C1) → C1                                    (6)




                                        Applying , Structural Operational Semantics , to MDE
                                                                                               27 / 45
Semantics            SOS             DSL’s                  SOS for a DSL                     Conclusions


             Imperative Language requires a Store


            In order to evaluate both a Var and a Assignment we need a store.
            A store is defined as a function
     Definition
     A function is defined as:

                    functionName : DomainClass → RangeClass

            A function contains zero or more tuples k → v

                     {k1 → v1 , k2 → v2 , . . . , kn−1 → vn−1 , kn → vn }




                                              Applying , Structural Operational Semantics , to MDE
                                                                                                     28 / 45
Semantics         SOS                 DSL’s                 SOS for a DSL                     Conclusions


                   Operations over Functions

     Definition
     Function invocation: If a is a function then a(k) equals:

                                            ,k → v ∈ a
                                        v
                           a(k) =
                                        Nil , k → v ∈ a
                                                    /

     Definition
     Override expression: If a and b are functions then a [b] equals:

                                               , k → vb ∈ b
                                         vb
                        a [b] (k) =
                                               , k → va ∈ ab
                                         va


                                              Applying , Structural Operational Semantics , to MDE
                                                                                                     29 / 45
Semantics             SOS               DSL’s                  SOS for a DSL                     Conclusions


                      Including Stores in SemLang

            A state is now a tuple M, F where:
                  M is the current model
              1

                  F is a set of functions
              2


            The functions in F represent the store
            Rules can read and update functions in F
                                         t‘
            The transition relation t −→ t“ is extended:
                  Function invocations are allowed in the terms t, t‘ and t“
              1

                  The label t‘ can now contain function assignments
              2


     Function assignment format
                               storeName ′ =<functionexpression>
                            t − − − − − − − − − − → t“
                              −−−−−−−−−−


                                                 Applying , Structural Operational Semantics , to MDE
                                                                                                        30 / 45
Semantics             SOS               DSL’s                  SOS for a DSL                     Conclusions


                      Including Stores in SemLang

            A state is now a tuple M, F where:
                  M is the current model
              1

                  F is a set of functions
              2


            The functions in F represent the store
            Rules can read and update functions in F
                                         t‘
            The transition relation t −→ t“ is extended:
                  Function invocations are allowed in the terms t, t‘ and t“
              1

                  The label t‘ can now contain function assignments
              2


     Function assignment format
                               storeName ′ =<functionexpression>
                            t − − − − − − − − − − → t“
                              −−−−−−−−−−


                                                 Applying , Structural Operational Semantics , to MDE
                                                                                                        30 / 45
Semantics         SOS           DSL’s                 SOS for a DSL                     Conclusions


                   Store definition and rules


                         store : String → Number                                        (7)



                        Var (name = N) → store (N)                                      (8)


                               E → NE
                                                             (9)
        Assign (name = N, e = E) → Assign (name = N, e = NE)


                                         store ′ =store[{N→E }]
            Assign (name = N, e = E ) − − − − − − − Nil
                                      − − − − − −→                                    (10)

                                        Applying , Structural Operational Semantics , to MDE
                                                                                               31 / 45
Semantics        SOS          DSL’s                 SOS for a DSL                     Conclusions


                             Simulation

     Model Simulation
     Simulating the model using the tool: Semantic Engine




                                      Applying , Structural Operational Semantics , to MDE
                                                                                             32 / 45
Semantics         SOS          DSL’s                 SOS for a DSL                     Conclusions


                        First Transition: Proof




                                C0 → NC
            Seq (c0 = C0, c1 = C1) → Seq (c0 = NC, c1 = C1)


                                       Applying , Structural Operational Semantics , to MDE
                                                                                              33 / 45
Semantics         SOS          DSL’s                 SOS for a DSL                     Conclusions


                        First Transition: Proof




                                           store ′ =store[{N→E }]
             Assign (name = N, e = E ) − − − − − − − Nil
                                       − − − − − −→
            Seq (c0 = C0, c1 = C1) → Seq (c0 = NC, c1 = C1)

                                       Applying , Structural Operational Semantics , to MDE
                                                                                              33 / 45
Semantics        SOS          DSL’s                 SOS for a DSL                     Conclusions


                       First Transition: Proof




                                                       store ′ =store[{N→E }]
      Assign (”a” = N, Number(val = 10) = E ) − − − − − − − Nil
                                              − − − − − −→
            Seq (c0 = C0, c1 = C1) → Seq (c0 = NC, c1 = C1)

                                      Applying , Structural Operational Semantics , to MDE
                                                                                             33 / 45
Semantics         SOS            DSL’s                 SOS for a DSL                     Conclusions


                        First Transition: Proof




                Assign (”a” = N, Number(val = 10) = E )
                    store ′ =store[{”a”→Number(val=10)}]
                    − − − − − − − − − − − − Nil
                     − − − − − − − − − − −→
            Seq (c0 = C0, c1 = C1) → Seq (c0 = NC, c1 = C1)
                                         Applying , Structural Operational Semantics , to MDE
                                                                                                33 / 45
Semantics         SOS              DSL’s                 SOS for a DSL                     Conclusions


                        First Transition: Proof




                Assign (”a” = N, Number(val = 10) = E )
                        store ′ =∅[{”a”→Number(val=10)}]
                     − − − − − − − − − − − Nil
                      − − − − − − − − − −→
            Seq (c0 = C0, c1 = C1) → Seq (c0 = NC, c1 = C1)
                                           Applying , Structural Operational Semantics , to MDE
                                                                                                  33 / 45
Semantics         SOS             DSL’s                 SOS for a DSL                     Conclusions


                        First Transition: Proof




                Assign (”a” = N, Number(val = 10) = E )
                        store ′ ={”a”→Number(val=10)}
                      − − − − − − − − − − Nil
                       − − − − − − − − −→
            Seq (c0 = C0, c1 = C1) → Seq (c0 = NC, c1 = C1)
                                          Applying , Structural Operational Semantics , to MDE
                                                                                                 33 / 45
Semantics         SOS             DSL’s                 SOS for a DSL                     Conclusions


                        First Transition: Proof




                Assign (”a” = N, Number(val = 10) = E )
                        store ′ ={”a”→Number(val=10)}
                      − − − − − − − − − − Nil
                       − − − − − − − − −→
            Seq (c0 = C0, c1 = C1) → Seq (c0 = Nil, c1 = C1)
                                          Applying , Structural Operational Semantics , to MDE
                                                                                                 33 / 45
Semantics   SOS             DSL’s                 SOS for a DSL                     Conclusions


                  First Transition: Proof




             Seq (c0 = C0, c1 = C1)
                    store ′ ={”a”→Number(val=10)}
                   −− − − − − − − − −
                   − − − − − − − − −→
                       Seq (c0 = Nil, c1 = C1)

                                    Applying , Structural Operational Semantics , to MDE
                                                                                           33 / 45
Semantics      SOS      DSL’s                 SOS for a DSL                     Conclusions


            Activity Diagram Lang: MetaModel




                                Applying , Structural Operational Semantics , to MDE
                                                                                       34 / 45
Semantics      SOS      DSL’s                 SOS for a DSL                     Conclusions


            Activity Diagram Lang: MetaModel




                                Applying , Structural Operational Semantics , to MDE
                                                                                       34 / 45
Semantics      SOS      DSL’s                 SOS for a DSL                     Conclusions


            Activity Diagram Lang: MetaModel




                                Applying , Structural Operational Semantics , to MDE
                                                                                       34 / 45
Semantics        SOS      DSL’s                 SOS for a DSL                     Conclusions


            Activity Diagram Lang: Example Model




                                  Applying , Structural Operational Semantics , to MDE
                                                                                         35 / 45
Semantics          SOS                                  DSL’s                                            SOS for a DSL                            Conclusions


            Activity Diagram Lang: Example Model
                                                                  Diagram


                                                                       nodes


                                                                 StartNode
                                                   nodes


                                                                next name                  nodes


                                                 VarDec                a
                        nodes                                                                                    nodes


                                             e        name     varName           next


                                Number            b              a                 Test


                                     value                     next        name e       next      alternative


                StopNode           Integer:1            test               BinaryExp                     Assign


                    name                                         lhs       rhs      bop                    e         name           varName


                  end                    Var            Number                    Eq                BinaryExp                   c             a


                                          name                 value                               rhs     lhs     bop


                                         a              Integer:5                   Number                Var            Plus


                                                                                          value            name


                                                                                   Integer:1               a


                                                                            Applying , Structural Operational Semantics , to MDE
                                                                                                                                                         35 / 45
Semantics      SOS          DSL’s                 SOS for a DSL                     Conclusions


              Activity Diagram Lang: Rules



              Computes = {StopNode, Number, Bool}                                 (11)


                      store : String → Object                                     (12)


            Diagram (nodes = NS ∃n ∈ StartNode ) → n                              (13)


                     StartNode (next = N) → N                                     (14)




                                    Applying , Structural Operational Semantics , to MDE
                                                                                           36 / 45
Semantics             SOS          DSL’s                 SOS for a DSL                     Conclusions


                 Activity Diagram Lang: Test Rules


                                   C → NC
              Test (name = N, e = C, next = NN, alternative = A)
             → Test (name = N, e = NC, next = NN, alternative = A)
                                                                 (15)


                                      C .value
            Test (name = N, e = C , next = NN, alternative = A) → NN
                                                                   (16)


                                    ¬C .value
            Test (name = N, e = C , next = NN, alternative = A) → A
                                                                  (17)

                                           Applying , Structural Operational Semantics , to MDE
                                                                                                  37 / 45
Semantics            SOS             DSL’s                 SOS for a DSL                     Conclusions


                   Activity Diagram Lang: VarDec




                             E → NE
                                                          (18)
        VarDec (name = N, varName = VN, e = E, next = NN)
        → VarDec (name = N, name = VN, e = NE, next = NN)


            VarDec (name = N, varName = VN, e = E , next = NN)
                           store ′ =storeρ [{VN→E }]
                           − − − − − − − → NN
                            −−−−−−−                                                        (19)




                                             Applying , Structural Operational Semantics , to MDE
                                                                                                    38 / 45
Semantics            SOS             DSL’s                 SOS for a DSL                     Conclusions


               Activity Diagram Lang: Assign Rules



                                   E → NE
             Assign (name = N, varName = VN, e = E, next = NN)
            → Assign (name = N, varName = VN, e = NE, next = NN)
                                                               (20)


            Assign (name = N, varName = VN, e = E , next = NN)
                           store ′ =storeρ [{VN→E }]
                           − − − − − − − → NN
                            −−−−−−−                                                        (21)




                                             Applying , Structural Operational Semantics , to MDE
                                                                                                    39 / 45
Semantics        SOS          DSL’s                 SOS for a DSL                     Conclusions


                             Simulation

     Model Simulation
     Simulating the model using the tool: Semantic Engine




                                      Applying , Structural Operational Semantics , to MDE
                                                                                             40 / 45
Semantics            SOS         DSL’s                 SOS for a DSL                     Conclusions


                                  Outline


            Semantics
     1



            Structural Operational Semantics
     2



            Domain Specific Languages
     3



            Structural Operational Semantics for a DSL in MDE
     4



            Conclusions
     5




                                         Applying , Structural Operational Semantics , to MDE
                                                                                                41 / 45
Semantics           SOS              DSL’s                  SOS for a DSL                     Conclusions


                                  Conclusions


            SOS can be applied to MDE!
                With some adjustments
                Proof of concept
                Tool support for simulation
            Future Research
                Extend SemLang
                Extend tool support
                Model checking
                Compiler Interpreter generation




                                              Applying , Structural Operational Semantics , to MDE
                                                                                                     42 / 45
Semantics                SOS           DSL’s                 SOS for a DSL                     Conclusions


             Differences with Graph Transformations
            Graph Transformations                                   SemLang

                                                          Multiple rule for a transition
            Single rule for a transition
                                                          Rule matching easy
            Rule matching hard:
                                                          Theoretic basis work in
            NP-complete
                                                          progress
            Sound theoretic basis
                                                          Limited Expressiveness
            Expressive
                                                          (future research)
            Better graph awareness
                                                          Locally tree oriented
            Less use of metamodel
                                                          Uses metamodel knowledge
            Not easy to map to
                                                          Related to interpreter design
            interpreters
                                                          pattern
            Modularity may be
                                                          MSOS aimed at modularity
            problematic
                                                          (future research)
                                               Applying , Structural Operational Semantics , to MDE
                                                                                                      43 / 45
Semantics   SOS      DSL’s                 SOS for a DSL                     Conclusions


                  Any Questions?




                             Applying , Structural Operational Semantics , to MDE
                                                                                    44 / 45
Semantics            SOS            DSL’s                 SOS for a DSL                     Conclusions


                                References I


            D. Harel and B. Rumpe. Semantic of semantics Springer LNCS,
            2004.
            Peter D. Mosses. Formal semantics of programming languages,
            an overview. Electronic Notes in Theoretical Computer Science
            148, pages 41–73, 2006.
            Gordon D. Plotkin. A structural approach to operational
            semantics. Technical report, University of Aarhus, Denmark, 1981.
            Peter D. Mosses. Modular structural operational semantics.
            Journal of Logic and Algebraic Programming 60-61, pages 195–228,
            2004.




                                            Applying , Structural Operational Semantics , to MDE
                                                                                                   45 / 45

Mais conteúdo relacionado

Mais procurados

Mais procurados (9)

Kuldeep presentation ppt
Kuldeep presentation pptKuldeep presentation ppt
Kuldeep presentation ppt
 
CSMR10b.ppt
CSMR10b.pptCSMR10b.ppt
CSMR10b.ppt
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
 
Pattern-based competence management
Pattern-based competence managementPattern-based competence management
Pattern-based competence management
 
G322 Mark Scheme (2011)
G322 Mark Scheme (2011)G322 Mark Scheme (2011)
G322 Mark Scheme (2011)
 
OCR G325 Mark Scheme Jan 2012
OCR G325 Mark Scheme Jan 2012OCR G325 Mark Scheme Jan 2012
OCR G325 Mark Scheme Jan 2012
 
Surface realization
Surface realizationSurface realization
Surface realization
 
Determining the Types of Temporal Relations in Discourse
Determining the Types of Temporal Relations in DiscourseDetermining the Types of Temporal Relations in Discourse
Determining the Types of Temporal Relations in Discourse
 
05 architectural design
05 architectural design05 architectural design
05 architectural design
 

Destaque

Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languagesVarun Garg
 
Alias Calculus for a Simple Imperative Language with Decidable Pointer Arithm...
Alias Calculus for a Simple Imperative Language with Decidable Pointer Arithm...Alias Calculus for a Simple Imperative Language with Decidable Pointer Arithm...
Alias Calculus for a Simple Imperative Language with Decidable Pointer Arithm...Iosif Itkin
 
The DEVS-Driven Modeling Language: Syntax and Semantics Definition by Meta-Mo...
The DEVS-Driven Modeling Language: Syntax and Semantics Definition by Meta-Mo...The DEVS-Driven Modeling Language: Syntax and Semantics Definition by Meta-Mo...
The DEVS-Driven Modeling Language: Syntax and Semantics Definition by Meta-Mo...Daniele Gianni
 
Learning the Semantics of Structured Data Sources
Learning the Semantics of Structured Data SourcesLearning the Semantics of Structured Data Sources
Learning the Semantics of Structured Data SourcesMohsen Taheriyan
 
Verification of 800 Automata-Based Programs Built by means of Genetic Program...
Verification of 800 Automata-Based Programs Built by means of Genetic Program...Verification of 800 Automata-Based Programs Built by means of Genetic Program...
Verification of 800 Automata-Based Programs Built by means of Genetic Program...Iosif Itkin
 
Dynamic Semantics Specification and Interpreter Generation
Dynamic Semantics Specification and Interpreter GenerationDynamic Semantics Specification and Interpreter Generation
Dynamic Semantics Specification and Interpreter GenerationEelco Visser
 
Backus Naur and Chomsky Normal Forms
Backus Naur and Chomsky Normal FormsBackus Naur and Chomsky Normal Forms
Backus Naur and Chomsky Normal FormsAshutosh Pandey
 
Oracle PL/SQL exception handling
Oracle PL/SQL exception handlingOracle PL/SQL exception handling
Oracle PL/SQL exception handlingSmitha Padmanabhan
 
Java & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkJava & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkMohit Belwal
 
8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED CAman Sharma
 

Destaque (11)

Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
 
Alias Calculus for a Simple Imperative Language with Decidable Pointer Arithm...
Alias Calculus for a Simple Imperative Language with Decidable Pointer Arithm...Alias Calculus for a Simple Imperative Language with Decidable Pointer Arithm...
Alias Calculus for a Simple Imperative Language with Decidable Pointer Arithm...
 
The DEVS-Driven Modeling Language: Syntax and Semantics Definition by Meta-Mo...
The DEVS-Driven Modeling Language: Syntax and Semantics Definition by Meta-Mo...The DEVS-Driven Modeling Language: Syntax and Semantics Definition by Meta-Mo...
The DEVS-Driven Modeling Language: Syntax and Semantics Definition by Meta-Mo...
 
Learning the Semantics of Structured Data Sources
Learning the Semantics of Structured Data SourcesLearning the Semantics of Structured Data Sources
Learning the Semantics of Structured Data Sources
 
Verification of 800 Automata-Based Programs Built by means of Genetic Program...
Verification of 800 Automata-Based Programs Built by means of Genetic Program...Verification of 800 Automata-Based Programs Built by means of Genetic Program...
Verification of 800 Automata-Based Programs Built by means of Genetic Program...
 
Dynamic Semantics Specification and Interpreter Generation
Dynamic Semantics Specification and Interpreter GenerationDynamic Semantics Specification and Interpreter Generation
Dynamic Semantics Specification and Interpreter Generation
 
Backus Naur and Chomsky Normal Forms
Backus Naur and Chomsky Normal FormsBackus Naur and Chomsky Normal Forms
Backus Naur and Chomsky Normal Forms
 
Oracle PL/SQL exception handling
Oracle PL/SQL exception handlingOracle PL/SQL exception handling
Oracle PL/SQL exception handling
 
Syntax
SyntaxSyntax
Syntax
 
Java & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkJava & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate Framework
 
8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C
 

Semelhante a Applying SOS to MDE

MODELSWARD 2017 Panel
MODELSWARD 2017 PanelMODELSWARD 2017 Panel
MODELSWARD 2017 Panelmiso_uam
 
DSL, the absolute weapon for the development
DSL, the absolute weapon for the developmentDSL, the absolute weapon for the development
DSL, the absolute weapon for the developmentESUG
 
Reifying the concurrency concern into xDSML specifications
Reifying the concurrency concern into xDSML specificationsReifying the concurrency concern into xDSML specifications
Reifying the concurrency concern into xDSML specificationsBenoit Combemale
 
Domain Driven Design and Model Driven Software Development
Domain Driven Design and Model Driven Software DevelopmentDomain Driven Design and Model Driven Software Development
Domain Driven Design and Model Driven Software DevelopmentBahram Maravandi
 
Sioux Hot-or-Not: Domain Driven Design (Edwin Van Dillen)
Sioux Hot-or-Not: Domain Driven Design (Edwin Van Dillen)Sioux Hot-or-Not: Domain Driven Design (Edwin Van Dillen)
Sioux Hot-or-Not: Domain Driven Design (Edwin Van Dillen)siouxhotornot
 
ModelTalk - When Everything is a Domain Specific Language
ModelTalk - When Everything is a Domain Specific LanguageModelTalk - When Everything is a Domain Specific Language
ModelTalk - When Everything is a Domain Specific LanguageAtzmon Hen-Tov
 
On the Use of an Internal DSL for Enriching EMF Models
On the Use of an Internal DSL for Enriching EMF ModelsOn the Use of an Internal DSL for Enriching EMF Models
On the Use of an Internal DSL for Enriching EMF ModelsFilip Krikava
 
STREAMING PUNCTUATION: A NOVEL PUNCTUATION TECHNIQUE LEVERAGING BIDIRECTIONAL...
STREAMING PUNCTUATION: A NOVEL PUNCTUATION TECHNIQUE LEVERAGING BIDIRECTIONAL...STREAMING PUNCTUATION: A NOVEL PUNCTUATION TECHNIQUE LEVERAGING BIDIRECTIONAL...
STREAMING PUNCTUATION: A NOVEL PUNCTUATION TECHNIQUE LEVERAGING BIDIRECTIONAL...kevig
 
Streaming Punctuation: A Novel Punctuation Technique Leveraging Bidirectional...
Streaming Punctuation: A Novel Punctuation Technique Leveraging Bidirectional...Streaming Punctuation: A Novel Punctuation Technique Leveraging Bidirectional...
Streaming Punctuation: A Novel Punctuation Technique Leveraging Bidirectional...kevig
 
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...Solution de génération de rapport OpenDocument à partir de plusieurs sources ...
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...EclipseDayParis
 
Eclipse Modeling & MoDisco - An Introduction to Modeling and (Model Driven) R...
Eclipse Modeling & MoDisco - An Introduction to Modeling and (Model Driven) R...Eclipse Modeling & MoDisco - An Introduction to Modeling and (Model Driven) R...
Eclipse Modeling & MoDisco - An Introduction to Modeling and (Model Driven) R...Hugo Bruneliere
 
UML Generator (NCC18)
UML Generator (NCC18)UML Generator (NCC18)
UML Generator (NCC18)IT Industry
 
The role of MDE in Software Architecture Descriptions
The role of MDE in Software Architecture DescriptionsThe role of MDE in Software Architecture Descriptions
The role of MDE in Software Architecture DescriptionsHenry Muccini
 
Model-Driven Software Development
Model-Driven Software DevelopmentModel-Driven Software Development
Model-Driven Software Developmentelliando dias
 

Semelhante a Applying SOS to MDE (20)

GroovyDSLs
GroovyDSLsGroovyDSLs
GroovyDSLs
 
MODELSWARD 2017 Panel
MODELSWARD 2017 PanelMODELSWARD 2017 Panel
MODELSWARD 2017 Panel
 
Introduction To MDD
Introduction To MDDIntroduction To MDD
Introduction To MDD
 
DSL, the absolute weapon for the development
DSL, the absolute weapon for the developmentDSL, the absolute weapon for the development
DSL, the absolute weapon for the development
 
DSL Best Practices
DSL Best PracticesDSL Best Practices
DSL Best Practices
 
Reifying the concurrency concern into xDSML specifications
Reifying the concurrency concern into xDSML specificationsReifying the concurrency concern into xDSML specifications
Reifying the concurrency concern into xDSML specifications
 
Domain Driven Design and Model Driven Software Development
Domain Driven Design and Model Driven Software DevelopmentDomain Driven Design and Model Driven Software Development
Domain Driven Design and Model Driven Software Development
 
Sioux Hot-or-Not: Domain Driven Design (Edwin Van Dillen)
Sioux Hot-or-Not: Domain Driven Design (Edwin Van Dillen)Sioux Hot-or-Not: Domain Driven Design (Edwin Van Dillen)
Sioux Hot-or-Not: Domain Driven Design (Edwin Van Dillen)
 
ModelTalk - When Everything is a Domain Specific Language
ModelTalk - When Everything is a Domain Specific LanguageModelTalk - When Everything is a Domain Specific Language
ModelTalk - When Everything is a Domain Specific Language
 
Antlr Conexaojava
Antlr ConexaojavaAntlr Conexaojava
Antlr Conexaojava
 
On the Use of an Internal DSL for Enriching EMF Models
On the Use of an Internal DSL for Enriching EMF ModelsOn the Use of an Internal DSL for Enriching EMF Models
On the Use of an Internal DSL for Enriching EMF Models
 
Interacting Domain Specific Languages
Interacting Domain Specific LanguagesInteracting Domain Specific Languages
Interacting Domain Specific Languages
 
STREAMING PUNCTUATION: A NOVEL PUNCTUATION TECHNIQUE LEVERAGING BIDIRECTIONAL...
STREAMING PUNCTUATION: A NOVEL PUNCTUATION TECHNIQUE LEVERAGING BIDIRECTIONAL...STREAMING PUNCTUATION: A NOVEL PUNCTUATION TECHNIQUE LEVERAGING BIDIRECTIONAL...
STREAMING PUNCTUATION: A NOVEL PUNCTUATION TECHNIQUE LEVERAGING BIDIRECTIONAL...
 
Streaming Punctuation: A Novel Punctuation Technique Leveraging Bidirectional...
Streaming Punctuation: A Novel Punctuation Technique Leveraging Bidirectional...Streaming Punctuation: A Novel Punctuation Technique Leveraging Bidirectional...
Streaming Punctuation: A Novel Punctuation Technique Leveraging Bidirectional...
 
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...Solution de génération de rapport OpenDocument à partir de plusieurs sources ...
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...
 
Eclipse Modeling & MoDisco - An Introduction to Modeling and (Model Driven) R...
Eclipse Modeling & MoDisco - An Introduction to Modeling and (Model Driven) R...Eclipse Modeling & MoDisco - An Introduction to Modeling and (Model Driven) R...
Eclipse Modeling & MoDisco - An Introduction to Modeling and (Model Driven) R...
 
UML Generator (NCC18)
UML Generator (NCC18)UML Generator (NCC18)
UML Generator (NCC18)
 
The role of MDE in Software Architecture Descriptions
The role of MDE in Software Architecture DescriptionsThe role of MDE in Software Architecture Descriptions
The role of MDE in Software Architecture Descriptions
 
Metamorphic Domain-Specific Languages
Metamorphic Domain-Specific LanguagesMetamorphic Domain-Specific Languages
Metamorphic Domain-Specific Languages
 
Model-Driven Software Development
Model-Driven Software DevelopmentModel-Driven Software Development
Model-Driven Software Development
 

Último

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Último (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Applying SOS to MDE

  • 1. Semantics SOS DSL’s SOS for a DSL Conclusions Applying Structural Operational Semantics to MDE Define the Semantics of your DSL Tjerk Wolterink University of Twente March 30, 2009 Applying , Structural Operational Semantics , to MDE 1 / 45
  • 2. Semantics SOS DSL’s SOS for a DSL Conclusions Outline Semantics 1 Structural Operational Semantics 2 Domain Specific Languages 3 Structural Operational Semantics for a DSL in MDE 4 Conclusions 5 Applying , Structural Operational Semantics , to MDE 2 / 45
  • 3. Semantics SOS DSL’s SOS for a DSL Conclusions Introduction Observation MDE, generally, lacks formal semantics Problem Statement Can Structural Operational Semantics (SOS) be successfully applied to MDE? Research Objectives Make SOS useful for MDE Providing a semantic language named SemLang Proof by example: apply SemLang Build a tool, the Semantic Engine to simulate models Applying , Structural Operational Semantics , to MDE 3 / 45
  • 4. Semantics SOS DSL’s SOS for a DSL Conclusions Outline Semantics 1 Structural Operational Semantics 2 Domain Specific Languages 3 Structural Operational Semantics for a DSL in MDE 4 Conclusions 5 Applying , Structural Operational Semantics , to MDE 4 / 45
  • 5. Semantics SOS DSL’s SOS for a DSL Conclusions Language Definition Abstract Syntax Determines the form and structure of programs Textual languages, Iconic languages, Diagrammic languages Specification for parsers Semantics Models the computational meaning of each program Specification for compilers/interpreters Dimension: Informal vs Formal Dimension: Static vs Dynamic Applying , Structural Operational Semantics , to MDE 5 / 45
  • 6. Semantics SOS DSL’s SOS for a DSL Conclusions Language Definition Abstract Syntax Determines the form and structure of programs Textual languages, Iconic languages, Diagrammic languages Specification for parsers Semantics Models the computational meaning of each program Specification for compilers/interpreters Dimension: Informal vs Formal Dimension: Static vs Dynamic Applying , Structural Operational Semantics , to MDE 5 / 45
  • 7. Semantics SOS DSL’s SOS for a DSL Conclusions Informal Semantics Meaning of a language is described using human readable text Example:”’Semantics of Java && operator: The && operator perform Conditional-AND operations on two boolean expressions. This operator exhibit ”short-circuiting” behaviour, which means that the second operand is evaluated only if needed. Advantages easy to read, easy to understand, easy to create Disadvantages imprecise, ambiguous, not computer-readable, not useful for mathematical techniques (like proofs, model checking etc.) Applying , Structural Operational Semantics , to MDE 6 / 45
  • 8. Semantics SOS DSL’s SOS for a DSL Conclusions Informal Semantics Meaning of a language is described using human readable text Example:”’Semantics of Java && operator: The && operator perform Conditional-AND operations on two boolean expressions. This operator exhibit ”short-circuiting” behaviour, which means that the second operand is evaluated only if needed. Advantages easy to read, easy to understand, easy to create Disadvantages imprecise, ambiguous, not computer-readable, not useful for mathematical techniques (like proofs, model checking etc.) Applying , Structural Operational Semantics , to MDE 6 / 45
  • 9. Semantics SOS DSL’s SOS for a DSL Conclusions Formal Semantics Semantic mapping from syntax L to a semantic domain S. M:L→S Semantic domain: well known mathematical domain: natural numbers, graphs, labelled transition systems etc. Semantic mapping: describes how the syntax relates to the semantic domain Approaches: Axiomatic, Denotational, Graph Transformations, Structural Operational Semantics Advantages precise, computer-readable, useful for mathematical techniques (like proofs,system validation, simulation etc.) Disadvantages often difficult to read, understand, create. Requires understanding of the semantic domain. Applying , Structural Operational Semantics , to MDE 7 / 45
  • 10. Semantics SOS DSL’s SOS for a DSL Conclusions Formal Semantics Semantic mapping from syntax L to a semantic domain S. M:L→S Semantic domain: well known mathematical domain: natural numbers, graphs, labelled transition systems etc. Semantic mapping: describes how the syntax relates to the semantic domain Approaches: Axiomatic, Denotational, Graph Transformations, Structural Operational Semantics Advantages precise, computer-readable, useful for mathematical techniques (like proofs,system validation, simulation etc.) Disadvantages often difficult to read, understand, create. Requires understanding of the semantic domain. Applying , Structural Operational Semantics , to MDE 7 / 45
  • 11. Semantics SOS DSL’s SOS for a DSL Conclusions Static vs Dynamic Semantics Static semantics models compile-time checks Checks that can be performed before running Well formedness Type checking Example: Type checking a type cast (TypeA)new TypeB() Check that TypeA is a subclass of TypeB Dynamic semantics models run-time behaviour Concerned with the observable behaviour of a running program Description of computational steps Example: Evaluation of If-Expressions if(a) then b if a evaluates to true then evaluate b Applying , Structural Operational Semantics , to MDE 8 / 45
  • 12. Semantics SOS DSL’s SOS for a DSL Conclusions Static vs Dynamic Semantics Static semantics models compile-time checks Checks that can be performed before running Well formedness Type checking Example: Type checking a type cast (TypeA)new TypeB() Check that TypeA is a subclass of TypeB Dynamic semantics models run-time behaviour Concerned with the observable behaviour of a running program Description of computational steps Example: Evaluation of If-Expressions if(a) then b if a evaluates to true then evaluate b Applying , Structural Operational Semantics , to MDE 8 / 45
  • 13. Semantics SOS DSL’s SOS for a DSL Conclusions Outline Semantics 1 Structural Operational Semantics 2 Domain Specific Languages 3 Structural Operational Semantics for a DSL in MDE 4 Conclusions 5 Applying , Structural Operational Semantics , to MDE 9 / 45
  • 14. Semantics SOS DSL’s SOS for a DSL Conclusions Overview of Structural Operational Semantics (SOS & MSOS) MSOS is Modular SOS Semantic domain of SOS is a labelled terminal transition system (LTTS) Definition A LTTS is a quadruple (Q, T , A, →) with Q as set of states, a set A of labels α. A relation →⊆ Q × A × Q of labelled transitions ((s, α, s‘) is α written as s −→ s‘), and a set T ⊆ Q of terminal configurations such α that s −→ s‘ implies s ∈ T / SOS Specification consists of Definitions of the sets Q, A and the end states T A set of rules that specify the transition relation → Applying , Structural Operational Semantics , to MDE 10 / 45
  • 15. Semantics SOS DSL’s SOS for a DSL Conclusions Overview of Structural Operational Semantics (SOS & MSOS) MSOS is Modular SOS Semantic domain of SOS is a labelled terminal transition system (LTTS) Definition A LTTS is a quadruple (Q, T , A, →) with Q as set of states, a set A of labels α. A relation →⊆ Q × A × Q of labelled transitions ((s, α, s‘) is α written as s −→ s‘), and a set T ⊆ Q of terminal configurations such α that s −→ s‘ implies s ∈ T / SOS Specification consists of Definitions of the sets Q, A and the end states T A set of rules that specify the transition relation → Applying , Structural Operational Semantics , to MDE 10 / 45
  • 16. Semantics SOS DSL’s SOS for a DSL Conclusions Overview of SOS States are sentences that conform to an extension of the abstract syntax: value-added syntax Transitions are specified inductively by rules A single transition can be proven by a set of rules Rules alter the structure of the states Graphics from Structural Operational Semantics 1981 by G.D. Plotkin Applying , Structural Operational Semantics , to MDE 11 / 45
  • 17. Semantics SOS DSL’s SOS for a DSL Conclusions Rules in SOS t‘ A rule consist of transition assertions t −→ t“ The terms t, t‘, t“ are language sentences that may contain meta-variables Rule Definition c1 , · · · , cn c A rule has zero or more conditions c1 , · · · , cn and a conclusion c t‘ c1 , · · · , cn , c are transition assertions (t −→ t“) c1 , · · · , cn can also be simple assertions (equations) Informal meaning: if c1 , · · · , cn then c Example if rule for a pseudo language e1 → e1 ‘ if e1 then e2 → if e1 ‘ then e2 Applying , Structural Operational Semantics , to MDE 12 / 45
  • 18. Semantics SOS DSL’s SOS for a DSL Conclusions Rules in SOS t‘ A rule consist of transition assertions t −→ t“ The terms t, t‘, t“ are language sentences that may contain meta-variables Rule Definition c1 , · · · , cn c A rule has zero or more conditions c1 , · · · , cn and a conclusion c t‘ c1 , · · · , cn , c are transition assertions (t −→ t“) c1 , · · · , cn can also be simple assertions (equations) Informal meaning: if c1 , · · · , cn then c Example if rule for a pseudo language e1 → e1 ‘ if e1 then e2 → if e1 ‘ then e2 Applying , Structural Operational Semantics , to MDE 12 / 45
  • 19. Semantics SOS DSL’s SOS for a DSL Conclusions Rules define the Transition Relation → Given a set of rules, a triple (s, α, s‘) is in the transition relation if and only if a finite branching tree can be formed that follows satisfies the following conditions: All nodes are labelled by elements of Q × A × Q 1 the root nodes is labelled by (s, α, s‘) 2 c1 ,··· ,cn for each node with n child nodes there is a rule and an 3 c interpretation of the meta-variables such that/ the label of the node is the interpretation of c the labels of the child nodes are the interpretations of c1 , · · · , cn . Concrete examples will be given to make it easier to understand Applying , Structural Operational Semantics , to MDE 13 / 45
  • 20. Semantics SOS DSL’s SOS for a DSL Conclusions Rules define the Transition Relation → Given a set of rules, a triple (s, α, s‘) is in the transition relation if and only if a finite branching tree can be formed that follows satisfies the following conditions: All nodes are labelled by elements of Q × A × Q 1 the root nodes is labelled by (s, α, s‘) 2 c1 ,··· ,cn for each node with n child nodes there is a rule and an 3 c interpretation of the meta-variables such that/ the label of the node is the interpretation of c the labels of the child nodes are the interpretations of c1 , · · · , cn . Concrete examples will be given to make it easier to understand Applying , Structural Operational Semantics , to MDE 13 / 45
  • 21. Semantics SOS DSL’s SOS for a DSL Conclusions Example: Simple Expression Lang First define the valid structure of a program, the syntax: Abstract syntax Numbers: n ∈ N = {0, 1, 2, · · · } Binary Operators: bop ∈ Bop = {+, −, ∗, · · · } Expressions: e ∈ Exp = n | e0 bop e1 Example program Exp Exp Bop N (2 + 3) ∗ 8 N Bop N * 8 2 + 3 Applying , Structural Operational Semantics , to MDE 14 / 45
  • 22. Semantics SOS DSL’s SOS for a DSL Conclusions Simple Expressions Lang Semantics The states Q are sentences of the language Numbers N = {0, 1, 2, · · · } are end states T No labels are used A = ∅ Applying , Structural Operational Semantics , to MDE 15 / 45
  • 23. Semantics SOS DSL’s SOS for a DSL Conclusions Simple Expressions Lang Semantics The transition relation → is specified by a set of rules: Evaluate lhs Rule e0 → e0 ‘ (1) e0 bop e1 → e0 ‘ bop e1 Evaluate rhs Rule e1 → e1 ‘ (2) n0 bop e1 → n0 bop e1 ‘ Applying , Structural Operational Semantics , to MDE 15 / 45
  • 24. Semantics SOS DSL’s SOS for a DSL Conclusions Simple Expressions Lang Semantics Evaluate plus Rule bop = + n = n0 + n1 (1) n0 bop n1 → n Evaluate multiply Rule bop = ∗ n = n0 ∗ n1 (2) n0 bop n1 → n Applying , Structural Operational Semantics , to MDE 15 / 45
  • 25. Semantics SOS DSL’s SOS for a DSL Conclusions Computation trace First transition (2 + 3) ∗ 8 → 5 ∗ 8 Transition proof Initial state (2 + 3) ∗ 8 Applying , Structural Operational Semantics , to MDE 16 / 45
  • 26. Semantics SOS DSL’s SOS for a DSL Conclusions Computation trace First transition (2 + 3) ∗ 8 → 5 ∗ 8 Transition proof 2 + 3 → e0 ‘ (2 + 3) ∗ 8 → e0 ‘ ∗ 8 By applying the lhs evaluation rule: e0 → e0 ‘ e0 bop e1 → e0 ‘ bop e1 Applying , Structural Operational Semantics , to MDE 16 / 45
  • 27. Semantics SOS DSL’s SOS for a DSL Conclusions Computation trace First transition (2 + 3) ∗ 8 → 5 ∗ 8 Transition proof bop = + e0 ‘ = n0 + n1 2 + 3 → e0 ‘ (2 + 3) ∗ 8 → e0 ‘ ∗ 8 By applying the evaluate plus rule: bop = + n = n0 + n1 n0 bop n1 → n Applying , Structural Operational Semantics , to MDE 16 / 45
  • 28. Semantics SOS DSL’s SOS for a DSL Conclusions Computation trace First transition (2 + 3) ∗ 8 → 5 ∗ 8 Transition proof + = + e0 ‘ = 2 + 3 2 + 3 → e0 ‘ 2 + 3 ∗ 8 → e0 ‘ ∗ 8 By substituting the meta variables bop = + n0 = 2 n1 = 3 Applying , Structural Operational Semantics , to MDE 16 / 45
  • 29. Semantics SOS DSL’s SOS for a DSL Conclusions Computation trace First transition (2 + 3) ∗ 8 → 5 ∗ 8 Transition proof Full proof + = + e0 ‘ = 5 2 + 3→5 2+3 ∗ 8→5 ∗ 8 by substituting e0 ‘ e0 ‘ = 2 + 3 = 5 Applying , Structural Operational Semantics , to MDE 16 / 45
  • 30. Semantics SOS DSL’s SOS for a DSL Conclusions Outline Semantics 1 Structural Operational Semantics 2 Domain Specific Languages 3 Structural Operational Semantics for a DSL in MDE 4 Conclusions 5 Applying , Structural Operational Semantics , to MDE 17 / 45
  • 31. Semantics SOS DSL’s SOS for a DSL Conclusions Generic vs Specific Languages DSL Domain Specific GPL General Purpose Language Language Small ( often extensions of Large GPLs (embedded)) Gap between language Closer to problem domain: domain and problem domain captures domain knowledge Users: software-engineers, Users: Same as DSL plus programmers domain-experts, end-users Examples Examples C++, Java, Fortran, Lisp SQL, BNF, HTML, RegExp, XSLT Applying , Structural Operational Semantics , to MDE 18 / 45
  • 32. Semantics SOS DSL’s SOS for a DSL Conclusions Defining a DSL Executable vs Static DSL’s Define domain concepts and relations in a metamodel Plays the role of an abstract syntax Captures domain knowledge Define concrete syntax (optionally) Textually or visual Provides easier editing Define semantics Informally using code generation to a GPL Formally both dynamic and static semantics Applying , Structural Operational Semantics , to MDE 19 / 45
  • 33. Semantics SOS DSL’s SOS for a DSL Conclusions Defining a DSL Executable vs Static DSL’s Define domain concepts and relations in a metamodel Plays the role of an abstract syntax Captures domain knowledge Define concrete syntax (optionally) Textually or visual Provides easier editing Define semantics Informally using code generation to a GPL Formally both dynamic and static semantics Applying , Structural Operational Semantics , to MDE 19 / 45
  • 34. Semantics SOS DSL’s SOS for a DSL Conclusions Defining a DSL Executable vs Static DSL’s Define domain concepts and relations in a metamodel Plays the role of an abstract syntax Captures domain knowledge Define concrete syntax (optionally) Textually or visual Provides easier editing Define semantics Informally using code generation to a GPL Formally both dynamic and static semantics Applying , Structural Operational Semantics , to MDE 19 / 45
  • 35. Semantics SOS DSL’s SOS for a DSL Conclusions Outline Semantics 1 Structural Operational Semantics 2 Domain Specific Languages 3 Structural Operational Semantics for a DSL in MDE 4 Conclusions 5 Applying , Structural Operational Semantics , to MDE 20 / 45
  • 36. Semantics SOS DSL’s SOS for a DSL Conclusions Defining the Semantics of a DSL Take an MDE approach: everything is a model Define a DSL SemLang for defining semantics of other DSL’s SemLang: The Semantic Language DSL Builds upon SOS and MSOS Applying , Structural Operational Semantics , to MDE 21 / 45
  • 37. Semantics SOS DSL’s SOS for a DSL Conclusions SOS vs SemLang SemLang SOS & MSOS MetaModel defines DSL Abstract Syntax defines structure Language Structure Models are states Sentences are states → states are graphs → States are trees Rules contain object Rules contain syntax patterns SOS Rule e1 → e1 ‘ if e1 then e2 → if e1 ‘ then e2 Applying , Structural Operational Semantics , to MDE 22 / 45
  • 38. Semantics SOS DSL’s SOS for a DSL Conclusions SOS vs SemLang SemLang Rule C → C‘ IfExp(e1 = C, e2 = E) → IfExp(e1 = C‘, e2 = E) Applying , Structural Operational Semantics , to MDE 22 / 45
  • 39. Semantics SOS DSL’s SOS for a DSL Conclusions Understanding SemLang Understanding SemLang by example For each DSL we define MetaModel Sample model (sample program) Semantics in SemLang The sample model will be executed. The DSL’s: Simple Imperative Language Activity Diagram Language Applying , Structural Operational Semantics , to MDE 23 / 45
  • 40. Semantics SOS DSL’s SOS for a DSL Conclusions Understanding SemLang Understanding SemLang by example For each DSL we define MetaModel Sample model (sample program) Semantics in SemLang The sample model will be executed. The DSL’s: Simple Imperative Language Activity Diagram Language Applying , Structural Operational Semantics , to MDE 23 / 45
  • 41. Semantics SOS DSL’s SOS for a DSL Conclusions Simple Imperative Language: MetaModel Applying , Structural Operational Semantics , to MDE 24 / 45
  • 42. Semantics SOS DSL’s SOS for a DSL Conclusions Simple Imperative Language: Sample Model Seq c1 c0 Seq Assign c0 c1 e name Assign Assign Number a e name e name val BinaryExp b BinaryExp a Integer:10 lhs rhs bop lhs rhs bop Number Var Plus Var Number Minus val name name val Integer:10 a b Integer:3 Applying , Structural Operational Semantics , to MDE 25 / 45
  • 43. Semantics SOS DSL’s SOS for a DSL Conclusions Binary Expressions Rule Computes = {Nil, Number} L→NL (3) BinExp(lhs=L,bop=O,rhs=R)→BinExp(lhs=NL,bop=O,rhs=R) R→NR (4) BinExp(lhs=L,bop=O,rhs=R)→BinExp(lhs=L,bop=O,rhs=NR) Applying , Structural Operational Semantics , to MDE 26 / 45
  • 44. Semantics SOS DSL’s SOS for a DSL Conclusions Binary Expressions Rule O∈Plus (3) BinExp(lhs=L,bop=O,rhs=R)→Number(val=(L.val+R.val)) O∈Minus (4) BinExp(lhs=L,bop=O,rhs=R)→Number(val=(L.val−R.val)) Applying , Structural Operational Semantics , to MDE 26 / 45
  • 45. Semantics SOS DSL’s SOS for a DSL Conclusions Rules for Seq commands C0 → NC (5) Seq (c0 = C0, c1 = C1) → Seq (c0 = NC, c1 = C1) Seq (c0 = C0 , c1 = C1) → C1 (6) Applying , Structural Operational Semantics , to MDE 27 / 45
  • 46. Semantics SOS DSL’s SOS for a DSL Conclusions Imperative Language requires a Store In order to evaluate both a Var and a Assignment we need a store. A store is defined as a function Definition A function is defined as: functionName : DomainClass → RangeClass A function contains zero or more tuples k → v {k1 → v1 , k2 → v2 , . . . , kn−1 → vn−1 , kn → vn } Applying , Structural Operational Semantics , to MDE 28 / 45
  • 47. Semantics SOS DSL’s SOS for a DSL Conclusions Operations over Functions Definition Function invocation: If a is a function then a(k) equals: ,k → v ∈ a v a(k) = Nil , k → v ∈ a / Definition Override expression: If a and b are functions then a [b] equals: , k → vb ∈ b vb a [b] (k) = , k → va ∈ ab va Applying , Structural Operational Semantics , to MDE 29 / 45
  • 48. Semantics SOS DSL’s SOS for a DSL Conclusions Including Stores in SemLang A state is now a tuple M, F where: M is the current model 1 F is a set of functions 2 The functions in F represent the store Rules can read and update functions in F t‘ The transition relation t −→ t“ is extended: Function invocations are allowed in the terms t, t‘ and t“ 1 The label t‘ can now contain function assignments 2 Function assignment format storeName ′ =<functionexpression> t − − − − − − − − − − → t“ −−−−−−−−−− Applying , Structural Operational Semantics , to MDE 30 / 45
  • 49. Semantics SOS DSL’s SOS for a DSL Conclusions Including Stores in SemLang A state is now a tuple M, F where: M is the current model 1 F is a set of functions 2 The functions in F represent the store Rules can read and update functions in F t‘ The transition relation t −→ t“ is extended: Function invocations are allowed in the terms t, t‘ and t“ 1 The label t‘ can now contain function assignments 2 Function assignment format storeName ′ =<functionexpression> t − − − − − − − − − − → t“ −−−−−−−−−− Applying , Structural Operational Semantics , to MDE 30 / 45
  • 50. Semantics SOS DSL’s SOS for a DSL Conclusions Store definition and rules store : String → Number (7) Var (name = N) → store (N) (8) E → NE (9) Assign (name = N, e = E) → Assign (name = N, e = NE) store ′ =store[{N→E }] Assign (name = N, e = E ) − − − − − − − Nil − − − − − −→ (10) Applying , Structural Operational Semantics , to MDE 31 / 45
  • 51. Semantics SOS DSL’s SOS for a DSL Conclusions Simulation Model Simulation Simulating the model using the tool: Semantic Engine Applying , Structural Operational Semantics , to MDE 32 / 45
  • 52. Semantics SOS DSL’s SOS for a DSL Conclusions First Transition: Proof C0 → NC Seq (c0 = C0, c1 = C1) → Seq (c0 = NC, c1 = C1) Applying , Structural Operational Semantics , to MDE 33 / 45
  • 53. Semantics SOS DSL’s SOS for a DSL Conclusions First Transition: Proof store ′ =store[{N→E }] Assign (name = N, e = E ) − − − − − − − Nil − − − − − −→ Seq (c0 = C0, c1 = C1) → Seq (c0 = NC, c1 = C1) Applying , Structural Operational Semantics , to MDE 33 / 45
  • 54. Semantics SOS DSL’s SOS for a DSL Conclusions First Transition: Proof store ′ =store[{N→E }] Assign (”a” = N, Number(val = 10) = E ) − − − − − − − Nil − − − − − −→ Seq (c0 = C0, c1 = C1) → Seq (c0 = NC, c1 = C1) Applying , Structural Operational Semantics , to MDE 33 / 45
  • 55. Semantics SOS DSL’s SOS for a DSL Conclusions First Transition: Proof Assign (”a” = N, Number(val = 10) = E ) store ′ =store[{”a”→Number(val=10)}] − − − − − − − − − − − − Nil − − − − − − − − − − −→ Seq (c0 = C0, c1 = C1) → Seq (c0 = NC, c1 = C1) Applying , Structural Operational Semantics , to MDE 33 / 45
  • 56. Semantics SOS DSL’s SOS for a DSL Conclusions First Transition: Proof Assign (”a” = N, Number(val = 10) = E ) store ′ =∅[{”a”→Number(val=10)}] − − − − − − − − − − − Nil − − − − − − − − − −→ Seq (c0 = C0, c1 = C1) → Seq (c0 = NC, c1 = C1) Applying , Structural Operational Semantics , to MDE 33 / 45
  • 57. Semantics SOS DSL’s SOS for a DSL Conclusions First Transition: Proof Assign (”a” = N, Number(val = 10) = E ) store ′ ={”a”→Number(val=10)} − − − − − − − − − − Nil − − − − − − − − −→ Seq (c0 = C0, c1 = C1) → Seq (c0 = NC, c1 = C1) Applying , Structural Operational Semantics , to MDE 33 / 45
  • 58. Semantics SOS DSL’s SOS for a DSL Conclusions First Transition: Proof Assign (”a” = N, Number(val = 10) = E ) store ′ ={”a”→Number(val=10)} − − − − − − − − − − Nil − − − − − − − − −→ Seq (c0 = C0, c1 = C1) → Seq (c0 = Nil, c1 = C1) Applying , Structural Operational Semantics , to MDE 33 / 45
  • 59. Semantics SOS DSL’s SOS for a DSL Conclusions First Transition: Proof Seq (c0 = C0, c1 = C1) store ′ ={”a”→Number(val=10)} −− − − − − − − − − − − − − − − − − −→ Seq (c0 = Nil, c1 = C1) Applying , Structural Operational Semantics , to MDE 33 / 45
  • 60. Semantics SOS DSL’s SOS for a DSL Conclusions Activity Diagram Lang: MetaModel Applying , Structural Operational Semantics , to MDE 34 / 45
  • 61. Semantics SOS DSL’s SOS for a DSL Conclusions Activity Diagram Lang: MetaModel Applying , Structural Operational Semantics , to MDE 34 / 45
  • 62. Semantics SOS DSL’s SOS for a DSL Conclusions Activity Diagram Lang: MetaModel Applying , Structural Operational Semantics , to MDE 34 / 45
  • 63. Semantics SOS DSL’s SOS for a DSL Conclusions Activity Diagram Lang: Example Model Applying , Structural Operational Semantics , to MDE 35 / 45
  • 64. Semantics SOS DSL’s SOS for a DSL Conclusions Activity Diagram Lang: Example Model Diagram nodes StartNode nodes next name nodes VarDec a nodes nodes e name varName next Number b a Test value next name e next alternative StopNode Integer:1 test BinaryExp Assign name lhs rhs bop e name varName end Var Number Eq BinaryExp c a name value rhs lhs bop a Integer:5 Number Var Plus value name Integer:1 a Applying , Structural Operational Semantics , to MDE 35 / 45
  • 65. Semantics SOS DSL’s SOS for a DSL Conclusions Activity Diagram Lang: Rules Computes = {StopNode, Number, Bool} (11) store : String → Object (12) Diagram (nodes = NS ∃n ∈ StartNode ) → n (13) StartNode (next = N) → N (14) Applying , Structural Operational Semantics , to MDE 36 / 45
  • 66. Semantics SOS DSL’s SOS for a DSL Conclusions Activity Diagram Lang: Test Rules C → NC Test (name = N, e = C, next = NN, alternative = A) → Test (name = N, e = NC, next = NN, alternative = A) (15) C .value Test (name = N, e = C , next = NN, alternative = A) → NN (16) ¬C .value Test (name = N, e = C , next = NN, alternative = A) → A (17) Applying , Structural Operational Semantics , to MDE 37 / 45
  • 67. Semantics SOS DSL’s SOS for a DSL Conclusions Activity Diagram Lang: VarDec E → NE (18) VarDec (name = N, varName = VN, e = E, next = NN) → VarDec (name = N, name = VN, e = NE, next = NN) VarDec (name = N, varName = VN, e = E , next = NN) store ′ =storeρ [{VN→E }] − − − − − − − → NN −−−−−−− (19) Applying , Structural Operational Semantics , to MDE 38 / 45
  • 68. Semantics SOS DSL’s SOS for a DSL Conclusions Activity Diagram Lang: Assign Rules E → NE Assign (name = N, varName = VN, e = E, next = NN) → Assign (name = N, varName = VN, e = NE, next = NN) (20) Assign (name = N, varName = VN, e = E , next = NN) store ′ =storeρ [{VN→E }] − − − − − − − → NN −−−−−−− (21) Applying , Structural Operational Semantics , to MDE 39 / 45
  • 69. Semantics SOS DSL’s SOS for a DSL Conclusions Simulation Model Simulation Simulating the model using the tool: Semantic Engine Applying , Structural Operational Semantics , to MDE 40 / 45
  • 70. Semantics SOS DSL’s SOS for a DSL Conclusions Outline Semantics 1 Structural Operational Semantics 2 Domain Specific Languages 3 Structural Operational Semantics for a DSL in MDE 4 Conclusions 5 Applying , Structural Operational Semantics , to MDE 41 / 45
  • 71. Semantics SOS DSL’s SOS for a DSL Conclusions Conclusions SOS can be applied to MDE! With some adjustments Proof of concept Tool support for simulation Future Research Extend SemLang Extend tool support Model checking Compiler Interpreter generation Applying , Structural Operational Semantics , to MDE 42 / 45
  • 72. Semantics SOS DSL’s SOS for a DSL Conclusions Differences with Graph Transformations Graph Transformations SemLang Multiple rule for a transition Single rule for a transition Rule matching easy Rule matching hard: Theoretic basis work in NP-complete progress Sound theoretic basis Limited Expressiveness Expressive (future research) Better graph awareness Locally tree oriented Less use of metamodel Uses metamodel knowledge Not easy to map to Related to interpreter design interpreters pattern Modularity may be MSOS aimed at modularity problematic (future research) Applying , Structural Operational Semantics , to MDE 43 / 45
  • 73. Semantics SOS DSL’s SOS for a DSL Conclusions Any Questions? Applying , Structural Operational Semantics , to MDE 44 / 45
  • 74. Semantics SOS DSL’s SOS for a DSL Conclusions References I D. Harel and B. Rumpe. Semantic of semantics Springer LNCS, 2004. Peter D. Mosses. Formal semantics of programming languages, an overview. Electronic Notes in Theoretical Computer Science 148, pages 41–73, 2006. Gordon D. Plotkin. A structural approach to operational semantics. Technical report, University of Aarhus, Denmark, 1981. Peter D. Mosses. Modular structural operational semantics. Journal of Logic and Algebraic Programming 60-61, pages 195–228, 2004. Applying , Structural Operational Semantics , to MDE 45 / 45