An Eclipse-based Integrated Environment for Developing Executable S - - PowerPoint PPT Presentation

an eclipse based integrated environment for developing
SMART_READER_LITE
LIVE PREVIEW

An Eclipse-based Integrated Environment for Developing Executable S - - PowerPoint PPT Presentation

An Eclipse-based Integrated Environment for Developing Executable S tructural Operational S emantics S pecifications Adrian Pop and Peter Fritzson Programming Environment Laboratory Department of Computer and Information S cience


slide-1
SLIDE 1

An Eclipse-based Integrated Environment for Developing Executable S tructural Operational S emantics S pecifications

Adrian Pop and Peter Fritzson

Programming Environment Laboratory Department of Computer and Information S cience Linköping University 2006-08-26 S OS ’ 2006, August 26, Bonn, Germany

slide-2
SLIDE 2

2

Outline

Introduction

Relational Meta-Language (RML)

Eclipse Environment for RML

Framework overview Examples

Conclusions and Future Work Demo

slide-3
SLIDE 3

3

Relational Meta-Language

a system for generation of efficient executable

code from S OS / Natural S emantics specifications

fast learning curve, used in teaching and

specification of languages such as: Java, Modelica, MiniML, Pascal,..

developed by Mikael Pet t erson

“ Compiling Nat ural S

emant ics” PhD Linköping Universit y 1996

also as S

pringer Lect ure Not es in Comput er S cience (LNCS ) vol. 1549 in 1999

previously poor environment support (Emacs,

command line tools)

slide-4
SLIDE 4

4

S OS / Natural S emantics vs. Relational Meta– Language

RML has the same visual syntax as S OS / Natural S emantics

rule <cond> RelName1(H1,T1) => R1 & ... RelNameN(Hn,Tn) => Rn &

  • RelName(H, T) => R

RML language properties

S

eparation of input and output arguments/ results

S

tatically strongly typed

Polymorphic type inference Efficient compilation of pattern-matching

slide-5
SLIDE 5

5

S OS / Natural S emantics vs. Relational Meta-Language

Natural S emantics formalism Relational Meta-Language

module exp1:

(* Abstract syntax of language Exp1 *)

datatype Exp = INTconst of int

| ADDop of Exp * Exp | S UBop of Exp * Exp | MULop of Exp * Exp | DIVop of Exp * Exp | NEGop of Exp

relation eval: Exp => int end

integers: expressions (abstract syntax): :: | 1 2 | 1 2 | 1* 2 | 1/ 2 | v Int e Exp v e e e e e e e e e ∈ ∈ = + − −

slide-6
SLIDE 6

6

Natural S emantics vs. Relational Meta-Language

Natural S emantics formalism Relational Meta-Language

relation eval: Exp => int = axiom eval(INTconst(ival)) => ival rule eval(e1) => v1 & eval(e2) => v2 & int_add(v1,v2) => v3

  • eval( ADDop(e1, e2) ) => v3

rule eval(e1) => v1 & eval(e2) => v2 & int_sub(v1,v2) => v3

  • eval( SUBop(e1, e2) ) => v3

rule eval(e1) => v1 & eval(e2) => v2 & int_mul(v1,v2) => v3

  • eval( MULop(e1, e2) ) => v3

rule eval(e1) => v1 & eval(e2) => v2 & int_div(v1,v2) => v3

  • eval( DIVop(e1, e2) ) => v3

rule eval(e) => v & int_neg(v) => vneg

  • eval( NEGop(e) ) => vneg

end (* eval *)

1 1 2 2 v1+v2 v3 1 2 3 1 1 2 2 v1-v2 v3 1 2 3 1 1 2 2 v1*v2 v3 1 2 3 1 1 2 2 v1/v2 v3 1 2 3

  • v

vneg

(1) (2) (3) (4) (5) (6)

e v e v e e v e v e v e e v e v e v e e v e v e v e e v e v e vneg

v v

⇒ ⇒ ⇒ + ⇒ ⇒ ⇒ ⇒ + ⇒ ⇒ ⇒ ⇒ + ⇒ ⇒ ⇒ ⇒ + ⇒ ⇒ ⇒ − ⇒

slide-7
SLIDE 7

7

The Need for RML Integrated Environment

Facilitate language learning and specification

development

easy creation of RML proj ects and modules easy discovery of errors browsing, code highlighting and assistance debugging (step, run, stop and inspect features) code refactorings

Large specifications are hard to develop

Example: The OpenModelica compiler for Modelica

43 packages 57083 lines of code 4054 relations 132 data structures

slide-8
SLIDE 8

8

The RML S ystem

.rml file

RML Compiler Frontend

.c file .c file

GCC Compiler

slide-9
SLIDE 9

9

The RML Eclipse Environment – Overview (I)

RML System

RML Parser RML Code Assistant RML Compiler RML Debugging Framework

SOSDT Environment RML Editor RML Debugging

RML Debug Interface

SOSDT Perspective

RML Browsing

RML Browser

slide-10
SLIDE 10

10

The RML Eclipse Environment – Overview (II)

.rml file

RML Compiler RML Parser

Eclipse RML model

Type Inference Information AST Information

RML Browser RML Code Assistant RML Editor

slide-11
SLIDE 11

11

The RML Eclipse Environment – Overview (III)

.rml file

RML Compiler

Eclipse

RML Debug Interface RML Editor Executable + Debugging runtime

slide-12
SLIDE 12

12

Creating RML proj ects

Creation of RML proj ects using wizards

slide-13
SLIDE 13

13

Creating RML modules (I)

Creation of RML modules using wizards

slide-14
SLIDE 14

14

Creating RML modules (II)

Creation of RML proj ects and modules using wizards

slide-15
SLIDE 15

15

Code browsing

Code Browsing for

easy navigation within large RML files. Automatic update on file save.

slide-16
SLIDE 16

16

Error detection (I)

Parse error detection on file save

slide-17
SLIDE 17

17

Error detection (II)

S emantic error detection on file save

slide-18
SLIDE 18

18

Conclusions and Future work

Conclusions

first prototype of RML Eclipse Environment proj ect and file management code browsing and assistance integrated debugging

Future Work

a lot of bug fixing code folding (comments, relations, etc) refactorings (AS

T refactorings)

better code checking faster debugging more code assistance code templates better integration with the RML compiler

slide-19
SLIDE 19

19

RML Eclipse Environment Demo

Demo

slide-20
SLIDE 20

20

End

Thank you! Questions?

RML: http://www.ida.liu.se/~pelab/rml SOSDT: http://www.ida.liu.se/~adrpo/sosdt