SlideShare a Scribd company logo
Program Slicing
                         Model Slicing
          A General Slicing Framework
                            Case Study
                            Conclusion




A General Model Based Slicing Framework

                               Tony Clark

School of Engineering and Information Sciences, Middlesex University


                        September 30, 2011




                           Tony Clark    A General Model Based Slicing Framework
Program Slicing
                                  Model Slicing
                   A General Slicing Framework
                                     Case Study
                                     Conclusion


Contents

  1   Program Slicing

  2   Model Slicing

  3   A General Slicing Framework
        GSF for Programs
        GSF for Models

  4   Case Study

  5   Conclusion


                                    Tony Clark    A General Model Based Slicing Framework
Program Slicing
                             Model Slicing
              A General Slicing Framework
                                Case Study
                                Conclusion


Definition and Use Cases



      What? Slicing is used to reduce the size of programs by
            removing those statements that do not contribute to
            the values of specified variables at a given program
            location.
       Why? Debugging; comprehension; verification.
       How? Static (backwards,forwards); dynamic; conditioned;
            union.




                               Tony Clark    A General Model Based Slicing Framework
Program Slicing
                             Model Slicing
              A General Slicing Framework
                                Case Study
                                Conclusion


Backward Slicing: Example1




   Original                          Criterion                                             Slice
    x = 42
    d = 23                                   d                                    d = 23




                               Tony Clark        A General Model Based Slicing Framework
Program Slicing
                            Model Slicing
             A General Slicing Framework
                               Case Study
                               Conclusion


Backward Slicing: Example2


   Original               Criterion                                                   Slice
    sum=0
    prod=1                                                   prod = 1
    read(i)                                                  read(i)
    while(i<11) {                                            while (i<11) {
      sum=sum+i
      prod=prod*i                                                prod=prod*i
      i=i+1                                                      i=i+1
    }                       prod                             }




                              Tony Clark    A General Model Based Slicing Framework
Program Slicing
                            Model Slicing
             A General Slicing Framework
                               Case Study
                               Conclusion


Dynamic Slicing


   Original               Criterion                                                   Slice
    sum=0
    prod=1
                                                                         prod = 1
    read(i)
                                                                         read(i)
    while(i<11) {
      sum=sum+i
      prod=prod*i
      i=i+1
    }                       prod, pos(next(input))=11




                              Tony Clark    A General Model Based Slicing Framework
Program Slicing
                             Model Slicing
              A General Slicing Framework
                                Case Study
                                Conclusion


Conditioned Slicing




   Original   Criterion                                                         Slice
    read(a)                                                                 read(a)
    if(a<0)
     a=-a
    x=1/a        x, +ve(next(input))                                        x=1/a




                               Tony Clark    A General Model Based Slicing Framework
Program Slicing
                                Model Slicing
                 A General Slicing Framework
                                   Case Study
                                   Conclusion


Unions
   Original                             Criterion                                             Slice
    a = 42                                                                       a = 42
    x = 2
    b = 23 + a                                                                   b = 23 + a
    y = 3
    c = b + 2                                   c                                c = b + 2
    a = 42
    x = 2
    b = 23 + a
    y = 3                                                                                y = 3
    c = b + 2                                   y
    a = 42                                                                       a = 42
    x = 2
    b = 23 + a                                                                   b = 23 + a
    y = 3                                                                        y = 3
    c = b + 2                             y and c                                c = b + 2

                                  Tony Clark        A General Model Based Slicing Framework
Program Slicing
                                  Model Slicing
                   A General Slicing Framework
                                     Case Study
                                     Conclusion


Contents

  1   Program Slicing

  2   Model Slicing

  3   A General Slicing Framework
        GSF for Programs
        GSF for Models

  4   Case Study

  5   Conclusion


                                    Tony Clark    A General Model Based Slicing Framework
Program Slicing
                              Model Slicing
               A General Slicing Framework
                                 Case Study
                                 Conclusion


Definition and Use Cases



      What? erm - drop some bits?
       Why? Model management and comprehension; debugging
            transformations; debugging executable models; model
            verification.
       How? State machines; class diagrams (syntax); specific
            technologies.
     Problem No general definition for model slicing.




                                Tony Clark    A General Model Based Slicing Framework
Program Slicing
                              Model Slicing
               A General Slicing Framework
                                 Case Study
                                 Conclusion


Differences to Programs



     No starting point for execution.
     Static and dynamic slices.
     Multiple languages.
     DSLs, profiles, meta-models.
     Highly structured.
     Weak semantics.
     Links to model transformations; transformation combinations.




                                Tony Clark    A General Model Based Slicing Framework
Program Slicing
                                  Model Slicing
                                                  GSF for Programs
                   A General Slicing Framework
                                                  GSF for Models
                                     Case Study
                                     Conclusion


Contents

  1   Program Slicing

  2   Model Slicing

  3   A General Slicing Framework
        GSF for Programs
        GSF for Models

  4   Case Study

  5   Conclusion


                                    Tony Clark    A General Model Based Slicing Framework
Program Slicing
                                 Model Slicing
                                                 GSF for Programs
                  A General Slicing Framework
                                                 GSF for Models
                                    Case Study
                                    Conclusion


A General Slicing Framework
                                        φ                - σ:Σ
          γ:Γ


                      p




                                                                          x
                                                     q
                          -




                                                 




                                                                              -
                                φ                                         z-
          p                γ :Γ - σ :Σ                       - q               ω:Σ




                                                                            -
                                                       q
                  p




                                                                          y
              ?                                              ?




                                                            -
              




         γ :Γ                                            - σ :Σ
                                φ
            Γ   Syntax domain.
           Σ    Semantic domain.
         p, q   Projections.
            φ   Semantics.
       (x, ω)   Slicing criterion.
                                   Tony Clark    A General Model Based Slicing Framework
Program Slicing
                               Model Slicing
                                               GSF for Programs
                A General Slicing Framework
                                               GSF for Models
                                  Case Study
                                  Conclusion


Key Features

  To set up the framework for a particular domain you will need:
    syntax (Γ) The things you want to slice.
  semantics (Σ, φ) The meaning of the syntax defined as a semantic
               domain and a semantic mapping.
  projections (p, q) Relationships that hold between syntactic and
                semantic elements and that remove items that are
                not of interest.
  criterion (x, ω) The things that remain invariant, defined in terms
                 of the semantic domain.
     products If the syntax and semantic domain also define
              products for elements and projections then there is
              scope for slicing composition.

                                 Tony Clark    A General Model Based Slicing Framework
Program Slicing
                           Model Slicing
                                           GSF for Programs
            A General Slicing Framework
                                           GSF for Models
                              Case Study
                              Conclusion


Semantic Domain for Programs




                             Tony Clark    A General Model Based Slicing Framework
Program Slicing
                               Model Slicing
                                                   GSF for Programs
                A General Slicing Framework
                                                   GSF for Models
                                  Case Study
                                  Conclusion


GSF: Program Example1

   Original                            Criterion                                             Slice
    x = 42
    d = 23                                     d                                    d = 23



  Semantics is σ = {[{x → 41; d → 23}]} The slice criterion requires
  that any trace in σ when projected onto the second step has a
  value for d, so ω = {{d → v } | v ∈ V } Therefore the smallest set
  of traces for which there exists a structural projection is
  σ = {[{d → v } | v ∈ V }]}.



                                 Tony Clark        A General Model Based Slicing Framework
Program Slicing
                                   Model Slicing
                                                   GSF for Programs
                    A General Slicing Framework
                                                   GSF for Models
                                      Case Study
                                      Conclusion


GSF: Program Example2
    Original                Criterion                                         Slice
      sum=0
      prod=1                                                      prod = 1
      read(i)                                                     read(i)
      while(i11) {                                               while (i11) {
        sum=sum+i
        prod=prod*i                                                 prod=prod*i
        i=i+1                                                       i=i+1
      }                      prod                                 }
  Semantics is σ = {[{sum → 0}, {sum → 0; prod → 1}, {sum → 0; prod →
  1; i → v }] + trace(v ) | v ∈ 0 . . . 10} ] where trace(0) = []

         trace(v ) = trace(v − 1) + [{sum →                      i; prod →!v ; i → v }]
                                                       i∈0...v

  Criterion requires that ω = {prod → v | v ∈ V } and x maps each trace onto
  the last maplet for prod.

                                     Tony Clark    A General Model Based Slicing Framework
Program Slicing
                           Model Slicing
                                           GSF for Programs
            A General Slicing Framework
                                           GSF for Models
                              Case Study
                              Conclusion
Modelling Language: Syntax
                             Tony Clark    A General Model Based Slicing Framework
Program Slicing
                           Model Slicing
                                           GSF for Programs
            A General Slicing Framework
                                           GSF for Models
                              Case Study
                              Conclusion
Modelling Language: Semantic Domain
                             Tony Clark    A General Model Based Slicing Framework
Program Slicing
                                  Model Slicing
                   A General Slicing Framework
                                     Case Study
                                     Conclusion


Contents

  1   Program Slicing

  2   Model Slicing

  3   A General Slicing Framework
        GSF for Programs
        GSF for Models

  4   Case Study

  5   Conclusion


                                    Tony Clark    A General Model Based Slicing Framework
Program Slicing
                           Model Slicing
            A General Slicing Framework
                              Case Study
                              Conclusion


Case Study: Use Cases




                             Tony Clark    A General Model Based Slicing Framework
Program Slicing
                            Model Slicing
             A General Slicing Framework
                               Case Study
                               Conclusion


Case Study: Class Model




                              Tony Clark    A General Model Based Slicing Framework
Program Slicing
                             Model Slicing
              A General Slicing Framework
                                Case Study
                                Conclusion


OCL




 c o n t e x t Library :: borrow ( reader , book )
     p r e not hasFine ( reader ) and
     p o s t borrows -  includes ( b |
                b . reader = getReader ( reader ) and
                b . book = getBook ( book ) and
                b . date = date ())




                               Tony Clark    A General Model Based Slicing Framework
Program Slicing
                           Model Slicing
            A General Slicing Framework
                              Case Study
                              Conclusion


Case Study: State Machine




                             Tony Clark    A General Model Based Slicing Framework
Program Slicing
                           Model Slicing
            A General Slicing Framework
                              Case Study
                              Conclusion


Case Study: Sequence Model




                             Tony Clark    A General Model Based Slicing Framework
Program Slicing
                                   Model Slicing
                    A General Slicing Framework
                                      Case Study
                                      Conclusion


A Borrowing Step


  ( s1 , ok = 0 - borrow ( fred , b ) ,f , s6 )
     where
         s1 = ({(0 ,* , Library )[ limit = l ] ,(1 ,* , Book )[ name =n , id =1] ,
                   (2 , initialized , Reader )[ name = fred , id =2]} ,{})
         f = [( s1 , false = 0 - hasFine ( fred ) ,... , s1 ) ,
                ( s1 ,2 = 0 - getReader ( fred ) ,... , s1 ) ,
                ( s1 ,1 = 0 - getBook ( n ) ,... , s1 ) ,
                ( s1 , d = 0 - getDate () ,... , s1 ) ,
                ( s1 ,3 = 0 - new ( Borrows ) ,[] , s2 ) ,
                ( s2 , ok = 3 - setReader (2) ,... , s4 ) ,
              ....]
         s2 = ({(0 ,* , Library )[ limit = l ] ,(1 ,* , Book )[ name =n , id =1] ,
                   (2 , initialized , Reader )[ name = fred , id =2] ,
                   (3 ,* , Borrows )[]} ,{})




                                     Tony Clark    A General Model Based Slicing Framework
Program Slicing
                                 Model Slicing
                  A General Slicing Framework
                                    Case Study
                                    Conclusion


Slicing Criterion


  B ={( s1 , v = l - borrow (r , b ) ,F , s2 ) |
              F - Filmstrip ,
              s1 - Snapshot ,
              s2 - Snapshot ,
              v - Value ,
              l - Id ,
              r - Str ,
              b - Str }

  Use ω = B ∗ as basis for slicing criterion.
  x1 projects a filmstrip to the sequence of borrow steps it contains.



                                   Tony Clark    A General Model Based Slicing Framework
Program Slicing
                              Model Slicing
               A General Slicing Framework
                                 Case Study
                                 Conclusion
Sliced Model
                                Tony Clark    A General Model Based Slicing Framework
Program Slicing
                                Model Slicing
                 A General Slicing Framework
                                   Case Study
                                   Conclusion


Refining the Slice



  {[( s1 , v = l - borrow (r , b ) ,[] , s2 )] |
       s1 - Snapshot ,
       s2 - Snapshot ,
       v - Value ,
       l - Id ,
       r - Str ,
       b - Str }

  The mapping part x2 is a refinement of x1 that maps all nested
  filmstrips to [].




                                  Tony Clark    A General Model Based Slicing Framework
Program Slicing
                              Model Slicing
               A General Slicing Framework
                                 Case Study
                                 Conclusion
Refined Slice
                                Tony Clark    A General Model Based Slicing Framework
Program Slicing
                                  Model Slicing
                   A General Slicing Framework
                                     Case Study
                                     Conclusion


Contents

  1   Program Slicing

  2   Model Slicing

  3   A General Slicing Framework
        GSF for Programs
        GSF for Models

  4   Case Study

  5   Conclusion


                                    Tony Clark    A General Model Based Slicing Framework
Program Slicing
                              Model Slicing
               A General Slicing Framework
                                 Case Study
                                 Conclusion


Issues and Problems



     Constructing slicing transformations: use of existing model
     transformation languages? New languages?
     Projection definition for OCL - requires theorem proving?
     Combination of slices? Consistency of slices?
     Slicing theories?
     Restricted forms of slicing: static, dynamic, conditioned?




                                Tony Clark    A General Model Based Slicing Framework

More Related Content

Viewers also liked

Automated Debugging: Are We There Yet?
Automated Debugging: Are We There Yet?Automated Debugging: Are We There Yet?
Automated Debugging: Are We There Yet?
Alex Orso
 
The HercuLeS HLS Environment
The HercuLeS HLS EnvironmentThe HercuLeS HLS Environment
The HercuLeS HLS Environment
kaveirious
 
Umesh
UmeshUmesh
Umesh
Umesh Mali
 
Slicing of Object-Oriented Programs
Slicing of Object-Oriented ProgramsSlicing of Object-Oriented Programs
Slicing of Object-Oriented Programs
Praveen Penumathsa
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
Akshaya Arunan
 
Graal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them AllGraal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them All
Thomas Wuerthinger
 
Programing Slicing and Its applications
Programing Slicing and Its applicationsPrograming Slicing and Its applications
Programing Slicing and Its applications
Ankur Jain
 

Viewers also liked (7)

Automated Debugging: Are We There Yet?
Automated Debugging: Are We There Yet?Automated Debugging: Are We There Yet?
Automated Debugging: Are We There Yet?
 
The HercuLeS HLS Environment
The HercuLeS HLS EnvironmentThe HercuLeS HLS Environment
The HercuLeS HLS Environment
 
Umesh
UmeshUmesh
Umesh
 
Slicing of Object-Oriented Programs
Slicing of Object-Oriented ProgramsSlicing of Object-Oriented Programs
Slicing of Object-Oriented Programs
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
 
Graal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them AllGraal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them All
 
Programing Slicing and Its applications
Programing Slicing and Its applicationsPrograming Slicing and Its applications
Programing Slicing and Its applications
 

More from ClarkTony

The Uncertain Enterprise
The Uncertain EnterpriseThe Uncertain Enterprise
The Uncertain Enterprise
ClarkTony
 
Actors for Behavioural Simulation
Actors for Behavioural SimulationActors for Behavioural Simulation
Actors for Behavioural Simulation
ClarkTony
 
Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...
Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...
Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...
ClarkTony
 
LEAP A Language for Architecture Design, Simulation and Analysis
LEAP A Language for Architecture Design, Simulation and AnalysisLEAP A Language for Architecture Design, Simulation and Analysis
LEAP A Language for Architecture Design, Simulation and Analysis
ClarkTony
 
A Common Basis for Modelling Service-Oriented and Event-Driven Architecture
A Common Basis for Modelling Service-Oriented and Event-Driven ArchitectureA Common Basis for Modelling Service-Oriented and Event-Driven Architecture
A Common Basis for Modelling Service-Oriented and Event-Driven Architecture
ClarkTony
 
Context Aware Reactive Applications
Context Aware Reactive ApplicationsContext Aware Reactive Applications
Context Aware Reactive Applications
ClarkTony
 
Patterns 200711
Patterns 200711Patterns 200711
Patterns 200711
ClarkTony
 
Kings 120711
Kings 120711Kings 120711
Kings 120711
ClarkTony
 
Iswim for testing
Iswim for testingIswim for testing
Iswim for testing
ClarkTony
 
Iswim for testing
Iswim for testingIswim for testing
Iswim for testing
ClarkTony
 
Kiss at oopsla 09
Kiss at oopsla 09Kiss at oopsla 09
Kiss at oopsla 09
ClarkTony
 
Mcms and ids sig
Mcms and ids sigMcms and ids sig
Mcms and ids sig
ClarkTony
 
Ocl 09
Ocl 09Ocl 09
Ocl 09
ClarkTony
 
Scam 08
Scam 08Scam 08
Scam 08
ClarkTony
 
Reverse engineering and theory building v3
Reverse engineering and theory building v3Reverse engineering and theory building v3
Reverse engineering and theory building v3
ClarkTony
 
Onward presentation.en
Onward presentation.enOnward presentation.en
Onward presentation.en
ClarkTony
 
Hcse pres
Hcse presHcse pres
Hcse pres
ClarkTony
 
Formalizing homogeneous language embeddings
Formalizing homogeneous language embeddingsFormalizing homogeneous language embeddings
Formalizing homogeneous language embeddings
ClarkTony
 
Filmstrip testing
Filmstrip testingFilmstrip testing
Filmstrip testing
ClarkTony
 
Dsm as theory building
Dsm as theory buildingDsm as theory building
Dsm as theory building
ClarkTony
 

More from ClarkTony (20)

The Uncertain Enterprise
The Uncertain EnterpriseThe Uncertain Enterprise
The Uncertain Enterprise
 
Actors for Behavioural Simulation
Actors for Behavioural SimulationActors for Behavioural Simulation
Actors for Behavioural Simulation
 
Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...
Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...
Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...
 
LEAP A Language for Architecture Design, Simulation and Analysis
LEAP A Language for Architecture Design, Simulation and AnalysisLEAP A Language for Architecture Design, Simulation and Analysis
LEAP A Language for Architecture Design, Simulation and Analysis
 
A Common Basis for Modelling Service-Oriented and Event-Driven Architecture
A Common Basis for Modelling Service-Oriented and Event-Driven ArchitectureA Common Basis for Modelling Service-Oriented and Event-Driven Architecture
A Common Basis for Modelling Service-Oriented and Event-Driven Architecture
 
Context Aware Reactive Applications
Context Aware Reactive ApplicationsContext Aware Reactive Applications
Context Aware Reactive Applications
 
Patterns 200711
Patterns 200711Patterns 200711
Patterns 200711
 
Kings 120711
Kings 120711Kings 120711
Kings 120711
 
Iswim for testing
Iswim for testingIswim for testing
Iswim for testing
 
Iswim for testing
Iswim for testingIswim for testing
Iswim for testing
 
Kiss at oopsla 09
Kiss at oopsla 09Kiss at oopsla 09
Kiss at oopsla 09
 
Mcms and ids sig
Mcms and ids sigMcms and ids sig
Mcms and ids sig
 
Ocl 09
Ocl 09Ocl 09
Ocl 09
 
Scam 08
Scam 08Scam 08
Scam 08
 
Reverse engineering and theory building v3
Reverse engineering and theory building v3Reverse engineering and theory building v3
Reverse engineering and theory building v3
 
Onward presentation.en
Onward presentation.enOnward presentation.en
Onward presentation.en
 
Hcse pres
Hcse presHcse pres
Hcse pres
 
Formalizing homogeneous language embeddings
Formalizing homogeneous language embeddingsFormalizing homogeneous language embeddings
Formalizing homogeneous language embeddings
 
Filmstrip testing
Filmstrip testingFilmstrip testing
Filmstrip testing
 
Dsm as theory building
Dsm as theory buildingDsm as theory building
Dsm as theory building
 

Recently uploaded

Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
FODUU
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 

Recently uploaded (20)

Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 

Model Slicing

  • 1. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion A General Model Based Slicing Framework Tony Clark School of Engineering and Information Sciences, Middlesex University September 30, 2011 Tony Clark A General Model Based Slicing Framework
  • 2. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Contents 1 Program Slicing 2 Model Slicing 3 A General Slicing Framework GSF for Programs GSF for Models 4 Case Study 5 Conclusion Tony Clark A General Model Based Slicing Framework
  • 3. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Definition and Use Cases What? Slicing is used to reduce the size of programs by removing those statements that do not contribute to the values of specified variables at a given program location. Why? Debugging; comprehension; verification. How? Static (backwards,forwards); dynamic; conditioned; union. Tony Clark A General Model Based Slicing Framework
  • 4. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Backward Slicing: Example1 Original Criterion Slice x = 42 d = 23 d d = 23 Tony Clark A General Model Based Slicing Framework
  • 5. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Backward Slicing: Example2 Original Criterion Slice sum=0 prod=1 prod = 1 read(i) read(i) while(i<11) { while (i<11) { sum=sum+i prod=prod*i prod=prod*i i=i+1 i=i+1 } prod } Tony Clark A General Model Based Slicing Framework
  • 6. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Dynamic Slicing Original Criterion Slice sum=0 prod=1 prod = 1 read(i) read(i) while(i<11) { sum=sum+i prod=prod*i i=i+1 } prod, pos(next(input))=11 Tony Clark A General Model Based Slicing Framework
  • 7. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Conditioned Slicing Original Criterion Slice read(a) read(a) if(a<0) a=-a x=1/a x, +ve(next(input)) x=1/a Tony Clark A General Model Based Slicing Framework
  • 8. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Unions Original Criterion Slice a = 42 a = 42 x = 2 b = 23 + a b = 23 + a y = 3 c = b + 2 c c = b + 2 a = 42 x = 2 b = 23 + a y = 3 y = 3 c = b + 2 y a = 42 a = 42 x = 2 b = 23 + a b = 23 + a y = 3 y = 3 c = b + 2 y and c c = b + 2 Tony Clark A General Model Based Slicing Framework
  • 9. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Contents 1 Program Slicing 2 Model Slicing 3 A General Slicing Framework GSF for Programs GSF for Models 4 Case Study 5 Conclusion Tony Clark A General Model Based Slicing Framework
  • 10. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Definition and Use Cases What? erm - drop some bits? Why? Model management and comprehension; debugging transformations; debugging executable models; model verification. How? State machines; class diagrams (syntax); specific technologies. Problem No general definition for model slicing. Tony Clark A General Model Based Slicing Framework
  • 11. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Differences to Programs No starting point for execution. Static and dynamic slices. Multiple languages. DSLs, profiles, meta-models. Highly structured. Weak semantics. Links to model transformations; transformation combinations. Tony Clark A General Model Based Slicing Framework
  • 12. Program Slicing Model Slicing GSF for Programs A General Slicing Framework GSF for Models Case Study Conclusion Contents 1 Program Slicing 2 Model Slicing 3 A General Slicing Framework GSF for Programs GSF for Models 4 Case Study 5 Conclusion Tony Clark A General Model Based Slicing Framework
  • 13. Program Slicing Model Slicing GSF for Programs A General Slicing Framework GSF for Models Case Study Conclusion A General Slicing Framework φ - σ:Σ γ:Γ p x q - - φ z- p γ :Γ - σ :Σ - q ω:Σ - q p y ? ? - γ :Γ - σ :Σ φ Γ Syntax domain. Σ Semantic domain. p, q Projections. φ Semantics. (x, ω) Slicing criterion. Tony Clark A General Model Based Slicing Framework
  • 14. Program Slicing Model Slicing GSF for Programs A General Slicing Framework GSF for Models Case Study Conclusion Key Features To set up the framework for a particular domain you will need: syntax (Γ) The things you want to slice. semantics (Σ, φ) The meaning of the syntax defined as a semantic domain and a semantic mapping. projections (p, q) Relationships that hold between syntactic and semantic elements and that remove items that are not of interest. criterion (x, ω) The things that remain invariant, defined in terms of the semantic domain. products If the syntax and semantic domain also define products for elements and projections then there is scope for slicing composition. Tony Clark A General Model Based Slicing Framework
  • 15. Program Slicing Model Slicing GSF for Programs A General Slicing Framework GSF for Models Case Study Conclusion Semantic Domain for Programs Tony Clark A General Model Based Slicing Framework
  • 16. Program Slicing Model Slicing GSF for Programs A General Slicing Framework GSF for Models Case Study Conclusion GSF: Program Example1 Original Criterion Slice x = 42 d = 23 d d = 23 Semantics is σ = {[{x → 41; d → 23}]} The slice criterion requires that any trace in σ when projected onto the second step has a value for d, so ω = {{d → v } | v ∈ V } Therefore the smallest set of traces for which there exists a structural projection is σ = {[{d → v } | v ∈ V }]}. Tony Clark A General Model Based Slicing Framework
  • 17. Program Slicing Model Slicing GSF for Programs A General Slicing Framework GSF for Models Case Study Conclusion GSF: Program Example2 Original Criterion Slice sum=0 prod=1 prod = 1 read(i) read(i) while(i11) { while (i11) { sum=sum+i prod=prod*i prod=prod*i i=i+1 i=i+1 } prod } Semantics is σ = {[{sum → 0}, {sum → 0; prod → 1}, {sum → 0; prod → 1; i → v }] + trace(v ) | v ∈ 0 . . . 10} ] where trace(0) = [] trace(v ) = trace(v − 1) + [{sum → i; prod →!v ; i → v }] i∈0...v Criterion requires that ω = {prod → v | v ∈ V } and x maps each trace onto the last maplet for prod. Tony Clark A General Model Based Slicing Framework
  • 18. Program Slicing Model Slicing GSF for Programs A General Slicing Framework GSF for Models Case Study Conclusion Modelling Language: Syntax Tony Clark A General Model Based Slicing Framework
  • 19. Program Slicing Model Slicing GSF for Programs A General Slicing Framework GSF for Models Case Study Conclusion Modelling Language: Semantic Domain Tony Clark A General Model Based Slicing Framework
  • 20. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Contents 1 Program Slicing 2 Model Slicing 3 A General Slicing Framework GSF for Programs GSF for Models 4 Case Study 5 Conclusion Tony Clark A General Model Based Slicing Framework
  • 21. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Case Study: Use Cases Tony Clark A General Model Based Slicing Framework
  • 22. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Case Study: Class Model Tony Clark A General Model Based Slicing Framework
  • 23. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion OCL c o n t e x t Library :: borrow ( reader , book ) p r e not hasFine ( reader ) and p o s t borrows - includes ( b | b . reader = getReader ( reader ) and b . book = getBook ( book ) and b . date = date ()) Tony Clark A General Model Based Slicing Framework
  • 24. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Case Study: State Machine Tony Clark A General Model Based Slicing Framework
  • 25. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Case Study: Sequence Model Tony Clark A General Model Based Slicing Framework
  • 26. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion A Borrowing Step ( s1 , ok = 0 - borrow ( fred , b ) ,f , s6 ) where s1 = ({(0 ,* , Library )[ limit = l ] ,(1 ,* , Book )[ name =n , id =1] , (2 , initialized , Reader )[ name = fred , id =2]} ,{}) f = [( s1 , false = 0 - hasFine ( fred ) ,... , s1 ) , ( s1 ,2 = 0 - getReader ( fred ) ,... , s1 ) , ( s1 ,1 = 0 - getBook ( n ) ,... , s1 ) , ( s1 , d = 0 - getDate () ,... , s1 ) , ( s1 ,3 = 0 - new ( Borrows ) ,[] , s2 ) , ( s2 , ok = 3 - setReader (2) ,... , s4 ) , ....] s2 = ({(0 ,* , Library )[ limit = l ] ,(1 ,* , Book )[ name =n , id =1] , (2 , initialized , Reader )[ name = fred , id =2] , (3 ,* , Borrows )[]} ,{}) Tony Clark A General Model Based Slicing Framework
  • 27. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Slicing Criterion B ={( s1 , v = l - borrow (r , b ) ,F , s2 ) | F - Filmstrip , s1 - Snapshot , s2 - Snapshot , v - Value , l - Id , r - Str , b - Str } Use ω = B ∗ as basis for slicing criterion. x1 projects a filmstrip to the sequence of borrow steps it contains. Tony Clark A General Model Based Slicing Framework
  • 28. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Sliced Model Tony Clark A General Model Based Slicing Framework
  • 29. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Refining the Slice {[( s1 , v = l - borrow (r , b ) ,[] , s2 )] | s1 - Snapshot , s2 - Snapshot , v - Value , l - Id , r - Str , b - Str } The mapping part x2 is a refinement of x1 that maps all nested filmstrips to []. Tony Clark A General Model Based Slicing Framework
  • 30. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Refined Slice Tony Clark A General Model Based Slicing Framework
  • 31. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Contents 1 Program Slicing 2 Model Slicing 3 A General Slicing Framework GSF for Programs GSF for Models 4 Case Study 5 Conclusion Tony Clark A General Model Based Slicing Framework
  • 32. Program Slicing Model Slicing A General Slicing Framework Case Study Conclusion Issues and Problems Constructing slicing transformations: use of existing model transformation languages? New languages? Projection definition for OCL - requires theorem proving? Combination of slices? Consistency of slices? Slicing theories? Restricted forms of slicing: static, dynamic, conditioned? Tony Clark A General Model Based Slicing Framework