SlideShare une entreprise Scribd logo
1  sur  34
Domain Specific Modelling as Theory Building Tony Clark t.n.clark@mdx.ac.uk BalbirBarn b.barn@mdx.ac.uk School of Engineering and Information Systems University Of Middlesex London, UK
Overview Motivation  Peter Naur: Programming as Theory Building Current State of Technologies A Language for Model Based Theory Building Examples
How do we understand a domain?
Naur’s Thesis: Features Programming is Theory Building. Understand the domain as a theory. Theories consist of information bearing statements about a domain that are true (or false). No such thing as the ideal  theory because: many consistent (incomplete) theories. theories are personal. theories consist of information necessary for stakeholder.
Naur’s Thesis: Benefit Claims Core IPR is in theories. Theories are more abstract than programs. Maintain system using theories. Introduce new people using theory not code. Theories are reusable (code fails to be). Theories allow questions to be articulated. Theories capture different views of a system.
Understanding is Theory Building
What do we currently do? Just look at the code. Misunderstandings because:  the domain is weakly represented in the modelling language. unable to articulate questions. (Tools for) DSLsare syntax-bound and semantics-free. Meaning is bound up with translations to code. Modularity cannot be applied to understanding: have to state the whole thing – no real views.
Naur’s Thesis Applied to DSM What’s the difference between modelling and programming? If programming is the construction of a theory that is then mapped to an implementation (theory) then:Modelling smells like programming to me. What’s the difference between modelling and domain specific modelling? A theory building framework gives us a context in which this can be analyzed.
What is a theory? theorem: true or false statements. theory: collections of theorems. axioms: statements that are givens. rules: ways of constructing theorems. mappings: between theories (and theorems) combinations: composing theories (and theorems). initial: an initial theory maps to all the others. terminal: every theory maps to a terminal theory.
What is a Domain Specific Theory? Suppose our questioner wants to understand when it follows that an influencing agent has an effect on an influenced agent. Questions might include: do the two agents have to be linked? does it depend on the states of the agents? if the influencer state satisfies the pre, must the influenced state satisfy the post? A theory is built by continued diligent questioning of the domain (expert or empirically).
Modelling Languages
Modelling Theories Traditional natural semantics-style deduction rules have their modelling counterpart. :y :x :z :T :D :Rule :Theory :T T(x,y,z) :a :c :x D T(a,x,c)
Abstract Syntax for Theories
Theory Semantics
Concrete Syntax for Model Based Theories Use enhanced object diagrams. Use a textual syntax consisting of class-models and rules.
The Domain (Again)
Abstract Syntax for DSM
Semantic Domain
Domain Question Given any collection of agents in any states and given influencing relationships between the agents – are the relationships satisfied or not?
Defining the Influencer Theory context influence_language::semantics theory influence {         import OCL;         import influence_language::syntax::AS;         import influence_language::semantics::SD;         relation I {       influences:Set(Influence);       state:Set(AgentState)         }         rule IR(Seq(evalOCL),Seq(I))<->I {        }   }
Defining an Axiom context influence_language           ::semantics::influence::IR   clause {     -> (I)[influences=Set{};state=S]   }
Defining a Rule context influence_language::semantics::influence::IR   clause {     (evalOCL)[             exp=p1; target=a1;       env=b1->including((Bind)[name='target';value=a2])]         (evalOCL)[             exp=p2; target=a2;       env=b2->including((Bind)[name='source';value=a1])]       ->          (I)[influences=Set{                  (Influence)[from=a1;to=a2;pre=p1;post=p2]};                  state={(AgentState)[agent=a1;vars=b1],                                 (AgentState)[agent=a2;vars=b2]                               }->including(S)]     }
Defining Induction context influence_language           ::semantics::influence::IR   clause {     (I)[influences=P;state=S]     (I)[influences=Q;state=S]     ->        (I)[influences=P->union(Q);state=S] }
Implementation Language: Concrete Syntax XModel ::= Fun*                            // programs Fun    ::= Name '(' Args ')' '{' Exp '}'   // function definitions Args::= Name (',' Name)* | Empty        // argument lists Exp    ::= Exp '.' Name                    // field reference              |   OCL                             // OCL expressions              |   'case' Name Name '{' Arm* '}'   // case analysis              |   'let' Bind* 'in' Exp            // local bindings              |   Name '(' Args ')'               // function call              |   Name                            //var reference Arm    ::= String String '->' Exp          // string detection Bind   ::= Name '=' Exp                   // local binding
Implementation Language
Implementation Theory context XL::semantics   theory run {        import OCL;        import XL::syntax::CS;        import XL::semantics::SD;        relation R {      prog:XModel;      exp:Exp;      val:Value;      env:Set(Bind)        }         relation RS {      prog:XModel;      exps:List(Exp);      vals:List(Value);      env:Set(Bind)        }     }
Mapping to An Implementation The domain theory can answer many questions. When mapping to an implementation it is usual to focus on one question. Select: given states for all agents, an operation and an action, can the agent use the action to perform the operation?
Mapping to Code(1)
Mapping to Code(2)
Implementation Language Theory Mapping Model Influencer Theory Implementation Theory
Model the Theory Mapping
Combinations of Theory Views Consider a Library that allows readers to register, books to be borrowed and fines to be paid. There are several views: temporal, registration, borrowing, payment. Each view is a separate theory in terms of a different view. What is the complete theory?
Complete Theory Register Theory Borrow Theory Repay Theory Time Theory WFF Theory
Conclusion Understanding is theory building. Modelling and programming are essentially the same. Modelling aims to be initial. Programming needs to be terminal. Modelling languages should support theories. Theories need to support: translation through mappings. different views through combination. patterns through parameterization.

Contenu connexe

Tendances

Babar: Knowledge Recognition, Extraction and Representation
Babar: Knowledge Recognition, Extraction and RepresentationBabar: Knowledge Recognition, Extraction and Representation
Babar: Knowledge Recognition, Extraction and Representation
Pierre de Lacaze
 
09 logic programming
09 logic programming09 logic programming
09 logic programming
saru40
 
Python Programming - XI. String Manipulation and Regular Expressions
Python Programming - XI. String Manipulation and Regular ExpressionsPython Programming - XI. String Manipulation and Regular Expressions
Python Programming - XI. String Manipulation and Regular Expressions
Ranel Padon
 

Tendances (20)

Python Data-Types
Python Data-TypesPython Data-Types
Python Data-Types
 
Scheme Programming Language
Scheme Programming LanguageScheme Programming Language
Scheme Programming Language
 
Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015
Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015
Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015
 
Text Summarization
Text SummarizationText Summarization
Text Summarization
 
NLP_KASHK:Minimum Edit Distance
NLP_KASHK:Minimum Edit DistanceNLP_KASHK:Minimum Edit Distance
NLP_KASHK:Minimum Edit Distance
 
Babar: Knowledge Recognition, Extraction and Representation
Babar: Knowledge Recognition, Extraction and RepresentationBabar: Knowledge Recognition, Extraction and Representation
Babar: Knowledge Recognition, Extraction and Representation
 
Expert system with python -2
Expert system with python  -2Expert system with python  -2
Expert system with python -2
 
Prolog 7-Languages
Prolog 7-LanguagesProlog 7-Languages
Prolog 7-Languages
 
Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1
 
PROLOG: Recursion And Lists In Prolog
PROLOG: Recursion And Lists In PrologPROLOG: Recursion And Lists In Prolog
PROLOG: Recursion And Lists In Prolog
 
Compiler Construction | Lecture 9 | Constraint Resolution
Compiler Construction | Lecture 9 | Constraint ResolutionCompiler Construction | Lecture 9 | Constraint Resolution
Compiler Construction | Lecture 9 | Constraint Resolution
 
Regular Expressions
Regular ExpressionsRegular Expressions
Regular Expressions
 
Solid Deconstruction
Solid DeconstructionSolid Deconstruction
Solid Deconstruction
 
Pointers in C Programming
Pointers in C ProgrammingPointers in C Programming
Pointers in C Programming
 
A Survey of Various Methods for Text Summarization
A Survey of Various Methods for Text SummarizationA Survey of Various Methods for Text Summarization
A Survey of Various Methods for Text Summarization
 
Syntaxdirected
SyntaxdirectedSyntaxdirected
Syntaxdirected
 
09 logic programming
09 logic programming09 logic programming
09 logic programming
 
Lexical analyzer
Lexical analyzerLexical analyzer
Lexical analyzer
 
An Introduction : Python
An Introduction : PythonAn Introduction : Python
An Introduction : Python
 
Python Programming - XI. String Manipulation and Regular Expressions
Python Programming - XI. String Manipulation and Regular ExpressionsPython Programming - XI. String Manipulation and Regular Expressions
Python Programming - XI. String Manipulation and Regular Expressions
 

Similaire à Dsm as theory building

Information extraction for Free Text
Information extraction for Free TextInformation extraction for Free Text
Information extraction for Free Text
butest
 

Similaire à Dsm as theory building (20)

Information extraction for Free Text
Information extraction for Free TextInformation extraction for Free Text
Information extraction for Free Text
 
Compiler Construction | Lecture 8 | Type Constraints
Compiler Construction | Lecture 8 | Type ConstraintsCompiler Construction | Lecture 8 | Type Constraints
Compiler Construction | Lecture 8 | Type Constraints
 
Erlang session1
Erlang session1Erlang session1
Erlang session1
 
Declare Your Language: Syntax Definition
Declare Your Language: Syntax DefinitionDeclare Your Language: Syntax Definition
Declare Your Language: Syntax Definition
 
Fosdem 2013 petra selmer flexible querying of graph data
Fosdem 2013 petra selmer   flexible querying of graph dataFosdem 2013 petra selmer   flexible querying of graph data
Fosdem 2013 petra selmer flexible querying of graph data
 
Language Technology Enhanced Learning
Language Technology Enhanced LearningLanguage Technology Enhanced Learning
Language Technology Enhanced Learning
 
Scala as a Declarative Language
Scala as a Declarative LanguageScala as a Declarative Language
Scala as a Declarative Language
 
AI: Logic in AI
AI: Logic in AIAI: Logic in AI
AI: Logic in AI
 
AI: Logic in AI
AI: Logic in AIAI: Logic in AI
AI: Logic in AI
 
AI Lab Manual.docx
AI Lab Manual.docxAI Lab Manual.docx
AI Lab Manual.docx
 
Functional Programming You Already Know
Functional Programming You Already KnowFunctional Programming You Already Know
Functional Programming You Already Know
 
Tricks in natural language processing
Tricks in natural language processingTricks in natural language processing
Tricks in natural language processing
 
Scala 3 Is Coming: Martin Odersky Shares What To Know
Scala 3 Is Coming: Martin Odersky Shares What To KnowScala 3 Is Coming: Martin Odersky Shares What To Know
Scala 3 Is Coming: Martin Odersky Shares What To Know
 
AI applications in education, Pascal Zoleko, Flexudy
AI applications in education, Pascal Zoleko, FlexudyAI applications in education, Pascal Zoleko, Flexudy
AI applications in education, Pascal Zoleko, Flexudy
 
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
 
GDSC SSN - solution Challenge : Fundamentals of Decision Making
GDSC SSN - solution Challenge : Fundamentals of Decision MakingGDSC SSN - solution Challenge : Fundamentals of Decision Making
GDSC SSN - solution Challenge : Fundamentals of Decision Making
 
Text Mining Analytics 101
Text Mining Analytics 101Text Mining Analytics 101
Text Mining Analytics 101
 
Crash-course in Natural Language Processing
Crash-course in Natural Language ProcessingCrash-course in Natural Language Processing
Crash-course in Natural Language Processing
 
Theory of computing
Theory of computingTheory of computing
Theory of computing
 
CPPDS Slide.pdf
CPPDS Slide.pdfCPPDS Slide.pdf
CPPDS Slide.pdf
 

Plus de 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
 
Model Slicing
Model SlicingModel Slicing
Model Slicing
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
 
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
 
Formalizing homogeneous language embeddings
Formalizing homogeneous language embeddingsFormalizing homogeneous language embeddings
Formalizing homogeneous language embeddings
ClarkTony
 
Filmstrip testing
Filmstrip testingFilmstrip testing
Filmstrip testing
ClarkTony
 

Plus de 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
 
Model Slicing
Model SlicingModel Slicing
Model Slicing
 
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
 

Dernier

Dernier (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Dsm as theory building

  • 1. Domain Specific Modelling as Theory Building Tony Clark t.n.clark@mdx.ac.uk BalbirBarn b.barn@mdx.ac.uk School of Engineering and Information Systems University Of Middlesex London, UK
  • 2. Overview Motivation Peter Naur: Programming as Theory Building Current State of Technologies A Language for Model Based Theory Building Examples
  • 3. How do we understand a domain?
  • 4. Naur’s Thesis: Features Programming is Theory Building. Understand the domain as a theory. Theories consist of information bearing statements about a domain that are true (or false). No such thing as the ideal theory because: many consistent (incomplete) theories. theories are personal. theories consist of information necessary for stakeholder.
  • 5. Naur’s Thesis: Benefit Claims Core IPR is in theories. Theories are more abstract than programs. Maintain system using theories. Introduce new people using theory not code. Theories are reusable (code fails to be). Theories allow questions to be articulated. Theories capture different views of a system.
  • 7. What do we currently do? Just look at the code. Misunderstandings because: the domain is weakly represented in the modelling language. unable to articulate questions. (Tools for) DSLsare syntax-bound and semantics-free. Meaning is bound up with translations to code. Modularity cannot be applied to understanding: have to state the whole thing – no real views.
  • 8. Naur’s Thesis Applied to DSM What’s the difference between modelling and programming? If programming is the construction of a theory that is then mapped to an implementation (theory) then:Modelling smells like programming to me. What’s the difference between modelling and domain specific modelling? A theory building framework gives us a context in which this can be analyzed.
  • 9. What is a theory? theorem: true or false statements. theory: collections of theorems. axioms: statements that are givens. rules: ways of constructing theorems. mappings: between theories (and theorems) combinations: composing theories (and theorems). initial: an initial theory maps to all the others. terminal: every theory maps to a terminal theory.
  • 10. What is a Domain Specific Theory? Suppose our questioner wants to understand when it follows that an influencing agent has an effect on an influenced agent. Questions might include: do the two agents have to be linked? does it depend on the states of the agents? if the influencer state satisfies the pre, must the influenced state satisfy the post? A theory is built by continued diligent questioning of the domain (expert or empirically).
  • 12. Modelling Theories Traditional natural semantics-style deduction rules have their modelling counterpart. :y :x :z :T :D :Rule :Theory :T T(x,y,z) :a :c :x D T(a,x,c)
  • 15. Concrete Syntax for Model Based Theories Use enhanced object diagrams. Use a textual syntax consisting of class-models and rules.
  • 19. Domain Question Given any collection of agents in any states and given influencing relationships between the agents – are the relationships satisfied or not?
  • 20. Defining the Influencer Theory context influence_language::semantics theory influence { import OCL; import influence_language::syntax::AS; import influence_language::semantics::SD; relation I { influences:Set(Influence); state:Set(AgentState) } rule IR(Seq(evalOCL),Seq(I))<->I { } }
  • 21. Defining an Axiom context influence_language ::semantics::influence::IR clause { -> (I)[influences=Set{};state=S] }
  • 22. Defining a Rule context influence_language::semantics::influence::IR clause { (evalOCL)[ exp=p1; target=a1; env=b1->including((Bind)[name='target';value=a2])] (evalOCL)[ exp=p2; target=a2; env=b2->including((Bind)[name='source';value=a1])] -> (I)[influences=Set{ (Influence)[from=a1;to=a2;pre=p1;post=p2]}; state={(AgentState)[agent=a1;vars=b1], (AgentState)[agent=a2;vars=b2] }->including(S)] }
  • 23. Defining Induction context influence_language ::semantics::influence::IR clause { (I)[influences=P;state=S] (I)[influences=Q;state=S] -> (I)[influences=P->union(Q);state=S] }
  • 24. Implementation Language: Concrete Syntax XModel ::= Fun* // programs Fun ::= Name '(' Args ')' '{' Exp '}' // function definitions Args::= Name (',' Name)* | Empty // argument lists Exp ::= Exp '.' Name // field reference | OCL // OCL expressions | 'case' Name Name '{' Arm* '}' // case analysis | 'let' Bind* 'in' Exp // local bindings | Name '(' Args ')' // function call | Name //var reference Arm ::= String String '->' Exp // string detection Bind ::= Name '=' Exp // local binding
  • 26. Implementation Theory context XL::semantics theory run { import OCL; import XL::syntax::CS; import XL::semantics::SD; relation R { prog:XModel; exp:Exp; val:Value; env:Set(Bind) } relation RS { prog:XModel; exps:List(Exp); vals:List(Value); env:Set(Bind) } }
  • 27. Mapping to An Implementation The domain theory can answer many questions. When mapping to an implementation it is usual to focus on one question. Select: given states for all agents, an operation and an action, can the agent use the action to perform the operation?
  • 30. Implementation Language Theory Mapping Model Influencer Theory Implementation Theory
  • 31. Model the Theory Mapping
  • 32. Combinations of Theory Views Consider a Library that allows readers to register, books to be borrowed and fines to be paid. There are several views: temporal, registration, borrowing, payment. Each view is a separate theory in terms of a different view. What is the complete theory?
  • 33. Complete Theory Register Theory Borrow Theory Repay Theory Time Theory WFF Theory
  • 34. Conclusion Understanding is theory building. Modelling and programming are essentially the same. Modelling aims to be initial. Programming needs to be terminal. Modelling languages should support theories. Theories need to support: translation through mappings. different views through combination. patterns through parameterization.