tool support for msos
play

Tool Support for MSOS Peter Mosses University of Wales Swansea - PowerPoint PPT Presentation

Modularity Tool support Tool Support for MSOS Peter Mosses University of Wales Swansea BCTCS, Nottingham, 22 March 2005 Peter Mosses Tool Support for MSOS Modularity Tool support Outline Modularity of semantic descriptions 1 Tool


  1. Modularity Tool support Tool Support for MSOS Peter Mosses University of Wales Swansea BCTCS, Nottingham, 22 March 2005 Peter Mosses Tool Support for MSOS

  2. Modularity Tool support Outline Modularity of semantic descriptions 1 Tool support for semantic descriptions 2 Peter Mosses Tool Support for MSOS

  3. Modularity Tool support Semantic descriptions need to be modular! Modularity is crucial for: extension of described language reuse of parts of descriptions understanding individual constructs Peter Mosses Tool Support for MSOS

  4. Modularity Tool support SOS is not so modular SOS: Structural Operational Semantics Plotkin [Aarhus 1981, JLAP 2004] small-step: rules specify a transition relation big-step: rules specify an evaluation relation rules are generally structural Peter Mosses Tool Support for MSOS

  5. Modularity Tool support SOS is not so modular SOS: Structural Operational Semantics Plotkin [Aarhus 1981, JLAP 2004] small-step: rules specify a transition relation big-step: rules specify an evaluation relation rules are generally structural Unfortunately, in SOS: the notation used in each rule depends on the rest of the described language Peter Mosses Tool Support for MSOS

  6. Modularity Tool support MSOS is highly modular MSOS: Modular Structural Operational Semantics PDM [MFCS 1999, JLAP 2004] simple variant of SOS greater use of labelled transitions/evaluations labels are extensible records Peter Mosses Tool Support for MSOS

  7. Modularity Tool support MSOS is highly modular MSOS: Modular Structural Operational Semantics PDM [MFCS 1999, JLAP 2004] simple variant of SOS greater use of labelled transitions/evaluations labels are extensible records In contrast to SOS: the notation used in each rule is independent of the rest of the described language – much as in monadic denotational semantics Peter Mosses Tool Support for MSOS

  8. Modularity Tool support MSOS example: expressions E : Exp State ::= Exp Final ::= Value Exp ::= Value Peter Mosses Tool Support for MSOS

  9. Modularity Tool support MSOS example: expression values V : Value Peter Mosses Tool Support for MSOS

  10. Modularity Tool support MSOS example: if-expressions Exp ::= if Exp then Exp else Exp Value ::= Boolean Peter Mosses Tool Support for MSOS

  11. Modularity Tool support MSOS example: if-expressions Exp ::= if Exp then Exp else Exp Value ::= Boolean { ... } → E ′ − − E 1 1 { ... } → if E ′ − − if E 1 then E 2 else E 3 1 then E 2 else E 3 if true then E 2 else E 3 − → E 2 if false then E 2 else E 3 − → E 3 Peter Mosses Tool Support for MSOS

  12. Modularity Tool support MSOS example: if-expressions Conventional notation for abstract syntax: Exp ::= if Exp then Exp else Exp Value ::= Boolean { ... } → E ′ − − E 1 1 { ... } → if E ′ − − if E 1 then E 2 else E 3 1 then E 2 else E 3 if true then E 2 else E 3 − → E 2 if false then E 2 else E 3 − → E 3 Peter Mosses Tool Support for MSOS

  13. Modularity Tool support MSOS example: conditional expressions Language-independent notation for abstract syntax: Exp ::= cond ( Exp , Exp , Exp ) Value ::= Boolean Peter Mosses Tool Support for MSOS

  14. Modularity Tool support MSOS example: conditional expressions Language-independent notation for abstract syntax: Exp ::= cond ( Exp , Exp , Exp ) Value ::= Boolean { ... } → E ′ − − E 1 1 { ... } → cond ( E ′ cond ( E 1 , E 2 , E 3 ) − − 1 , E 2 , E 3 ) cond ( true , E 2 , E 3 ) − → E 2 cond ( false , E 2 , E 3 ) − → E 3 Peter Mosses Tool Support for MSOS

  15. Modularity Tool support MSOS example: declarations D : Dec State ::= Dec Final ::= Env Dec ::= Env Peter Mosses Tool Support for MSOS

  16. Modularity Tool support MSOS example: environments ρ : Env = ( Id , Bindable ) Map Peter Mosses Tool Support for MSOS

  17. Modularity Tool support MSOS example: local declarations Exp ::= local ( Dec , Exp ) Label ::= { env : Env , . . . } Peter Mosses Tool Support for MSOS

  18. Modularity Tool support MSOS example: local declarations Exp ::= local ( Dec , Exp ) Label ::= { env : Env , . . . } { ... } → D ′ − − D { ... } → local ( D ′ , E ) local ( D , E ) − − { env = ρ 0 [ ρ ] ,... } → E ′ − − − − − − − − E { env = ρ 0 ,... } → local ( ρ, E ′ ) local ( ρ, E ) − − − − − − local ( ρ, V ) − → V Peter Mosses Tool Support for MSOS

  19. Modularity Tool support Semantic descriptions need tool support! Tool support is crucial for: validation of accuracy of descriptions generating prototype implementations teaching semantics Peter Mosses Tool Support for MSOS

  20. Modularity Tool support SOS has some tool support Execution (mainly for big-step SOS): TypoL [INRIA-Sophia 1987] RML [Pettersson 1996] Letos [Hartel 1997] Living with non-modularity: TinkerType [Levin&Pierce 2000] REK: Rule Evolution Kit [Lämmel 2004] Model-checking, verification, . . . Peter Mosses Tool Support for MSOS

  21. Modularity Tool support MSOS tool support Using Prolog [PDM 2004] : modular translation from MSDF to Prolog language parsing specified by DCGs (Definite Clause Grammars) Peter Mosses Tool Support for MSOS

  22. Modularity Tool support MSOS tool support Using Prolog [PDM 2004] : modular translation from MSDF to Prolog language parsing specified by DCGs (Definite Clause Grammars) Using Maude [Braga&Chalub 2004] : modular translation from MSDF to Maude language parsing specified in Maude Peter Mosses Tool Support for MSOS

  23. Modularity Tool support MSOS in MSDF: local declarations Exp ::= local(Dec, Exp) Label = {env:Env,...} D --{...}-> D’ ------------------------------------ local(D,E):Exp --{...}-> local(D’,E) (ENV/ENV0) = ENV’, E --{env=ENV’,...}-> E’ ------------------------------------------------- local(ENV,E):Exp --{env=ENV0,...}-> local(ENV,E’) local(ENV,V):Exp ---> V Peter Mosses Tool Support for MSOS

  24. Modularity Tool support MSOS in Prolog: local declarations :-ensure_loaded(’Cons/Exp/ABS’). :-ensure_loaded(’Cons/Dec/ABS’). declare(’Exp’>local(’Dec’, ’Exp’)). :-ensure_loaded(’Data/Env/ABS’). readable(env). local(D, E):’Exp’---X--->local(D_1, E) :- check(D:’D’), check(E:’E’), D:’D’---X--->D_1, check(D_1:’D’). local(ENV, E):’Exp’---X_--->local(ENV, E_1) :- eq_label(X_, [env=ENV0|X]), check(ENV:’ENV’), check(E:’E’), check(ENV0:’ENV’), eq(ENV/ENV0, ENV_1), check(ENV_1:’ENV’), E:’E’---[env=ENV_1|X]--->E_1, check(E_1:’E’). local(ENV, V):’Exp’---U--->V :- check(ENV:’ENV’), check(V:’V’), check(U:’U’). Peter Mosses Tool Support for MSOS

  25. Modularity Tool support Work in progress initial version of MSOS Tool and lecture notes available at www.brics.dk/~pdm/MSOS Peter Mosses Tool Support for MSOS

  26. Modularity Tool support Work in progress initial version of MSOS Tool and lecture notes available at www.brics.dk/~pdm/MSOS improved version due by summer 2005: more checking of MSDF specifications more efficient more examples compatible with Maude version of MSOS Tool Peter Mosses Tool Support for MSOS

  27. Modularity Tool support Work in progress initial version of MSOS Tool and lecture notes available at www.brics.dk/~pdm/MSOS improved version due by summer 2005: more checking of MSDF specifications more efficient more examples compatible with Maude version of MSOS Tool CFP: SOS 2005 ICALP workshop, Lisbon, 10 July 2005 www.cs.le.ac.uk/events/SOS2005 Abstract by 13 May – full paper by 23 May Peter Mosses Tool Support for MSOS

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend