Presentation is loading. Please wait.

Presentation is loading. Please wait.

Defining A Formal Semantics For The Rosetta Specification Language

Similar presentations


Presentation on theme: "Defining A Formal Semantics For The Rosetta Specification Language"— Presentation transcript:

1 Defining A Formal Semantics For The Rosetta Specification Language

2 Overview Introduction Definitions Basic Semantics
Denoting Units of Semantics State based model Event based model Ongoing work Conclusion 2/18/2019 ECBS'03

3 Next … Introduction Definitions Basic Semantics
Denoting Units of Semantics State based model Event based model Ongoing Work Conclusion 2/18/2019 ECBS'03

4 Introduction Rosetta systems level design language
Supports different computation models Addresses integration of information across domains Uses domains to define semantics of models – there is no unique semantics for all domains All languages have syntax and semantics Rosetta has a fixed syntax, but different semantics Use of denotational functions for interpreting Rosetta syntax Decomposition of semantics into modules - each module has a different set of denotational functions from another 2/18/2019 ECBS'03

5 Next … Introduction Definitions Basic Semantics
Denoting Units of Semantics State based model Event based model Ongoing Work Conclusion 2/18/2019 ECBS'03

6 Definitions Model of computation Semantic domain
Distinctive paradigm for computation, communication, … Semantic domain Set of mathematical objects used to model agents Unifying semantic domain Semantic domain that can be used to represent a variety of different computation paradigms Unit of semantics A unifying semantic domain Denotational semantics Use of valuation functions to map syntactic constructs to abstract values denoted 2/18/2019 ECBS'03

7 Next … Introduction Definitions Basic Semantics
Denoting Units of Semantics State based model Event based model Ongoing Work Conclusion 2/18/2019 ECBS'03

8 Basic Semantics – Semantic modules
Static (prelude) state-based-semantics signal-based-semantics continuous discrete discrete-time continuous-time CSP trace-based Unit of semantics Event-based State-based Discrete Cont. CSP SDF Rosetta logical framework / prelude 2/18/2019 ECBS'03

9 Basic Semantics – Denotational semantics
Denotation in the sense of The Scott-Strachey Approach to Programming Language Define a semantic function that maps symbols from a language to a “known” object E.g. Let N be such a function for numerals N1 = 1 None = 1 where ‘’ and ‘’ are semantic brackets, and the element enclosed by them is an object from the language being defined 2/18/2019 ECBS'03

10 Basic Semantics – Evaluation functions
Following Allison’s approach (A Practical Introduction to denotational semantics), we identify 4 semantic functions Expression evaluation function – given a store, maps an expression to a value E: Store  Values Constant evaluation function – maps constants and literals to their values in the abstract value space V: constants  Values Function evaluation function – maps binary operators to the corresponding function O: Values  Values  Values Term evaluation function – maps terms to a boolean function T: Terms  Store  boolFnc where boolFnc:Vars  boolean is a function of any number of parameters to a boolean value 2/18/2019 ECBS'03

11 Basic Semantics – Specific evaluation functions
E st = (st_value ) Ev st = Vv E  ’ st = O E st, E’ st O= = v1, v2. If v1 = v2 then True else False : univ  univ  boolean where  is an expression  represents identifiers st is the store v represents constants  is a binary operator (st_value x) indicates value of x in store st param.body:typeFnc is a lambda expression of type typeFnc 2/18/2019 ECBS'03

12 Basic semantics – Term evaluation examples
Assuming store st contains: x  2 myFnc  x:int . x + 1 Tx=2 st  O= (Ex st) V2  (v1, v2. If v1 = v2 then True else False) 2 2  if (2 = 2) then True else False  True 2/18/2019 ECBS'03

13 Basic semantics – Term evaluation examples
T(myFnc 1) = 2 st  O= ((x:int . (x + 1) V1) V2)  O= ((x:int . (x + 1) 1) 2  True T(undefFnc x) = 2 st  O= ((EundefFnc st) 2) 2  if ((EundefFnc st) 2) = 2 then True else False For a facet/model to be consistent, terms always need to be true  ((EundefFnc st) 2) = 2 a boolean equation with one unknown (EundefFnc st) is the result of the evaluation 2/18/2019 ECBS'03

14 Next … Introduction Definitions Basic Semantics
Denoting Units of Semantics State based model Event based model Ongoing Work Conclusion 2/18/2019 ECBS'03

15 Denoting Units of Semantics – State based
Denotation of model is a relation over states Vocabulary of state based models States – set of states, finite or infinite, denumerable or nondenumerable  - the current state next – the state transformation function @ - the apply function used for dereferencing labels Semantics of vocabulary States= {Var  Values} – set of functions from variables to values : States = Var  Values – current state, particular function Next = States  States – the transformation function @: Label  States  Values – the apply function T: Terms  BoolFnc E   : Values where  is an expression 2/18/2019 ECBS'03

16 Denoting Units of Semantics – State based
In Rosetta, no sequential execution x := x + 1 is expressed as + 1 Change of state made explicit Elements of vocabulary apparent Definition of additional valuation functions = v1, fnc . fnc v1 : Label  (Label  univ)  univ st = E st y = (st_value ) ‘y’ st = (st_value next) (st_value ) ‘y’ 2/18/2019 ECBS'03

17 Next … Introduction Definitions Basic Semantics
Denoting Units of Semantics State based model Event based model Ongoing Work Conclusion 2/18/2019 ECBS'03

18 Denoting Units of Semantics – Event based
Notion started with Lee and Sangiovanni-Vincentelli’s Tagged Signal model Denotation of a process is partial function or relation on signals Vocabulary Tags – set of tags Values – set of values Events – set of events, i.e. set of T x V States – set of states, each state uniquely mapping to an event Signals – set of signals, each signal being a set of events @ - the apply function, dereferencing signals in states indexed by events 2/18/2019 ECBS'03

19 Denoting Units of Semantics – Event based
Semantics associated with vocabulary Events: {Tags x Values} – set of pairs of tags and values previousEvt: Events – used as index to last state of process evt: Events – refers to current state and is event being processed Signals: Events – set of sets of events sig: Signals = {Events} – particular set of events getEvent: Signals  Events – next event to be processed States: {SignalLabel  SignalValue} – states are dependent on events and are used to keep track of signals EventBasedState: Events  States – each state uniquely referred to by an event @: SignalLabel  Events  ((Events  States)  SignalValue) – the dereferencing of a signal label is obtained by first finding state corresponding to event and then applying state function to signal label to find signal value 2/18/2019 ECBS'03

20 Denoting Units of Semantics – Event based
Modified Valuation function = v1, evt . (fnc . (fnc evt) v1) : SignalLabels Events  (Events  States)  SignalValue An example st = sig (Eevnt st) (st_value EventBasedState) = sig (st_value evnt) (st_value EventBasedState) = (fnc . (fnc (st_value evnt)) sig) (st_value EventBasedState) = ((st_value EventBasedState) (st_value evt)) sig 2/18/2019 ECBS'03

21 Next … Introduction Definitions Basic Semantics
Denoting Units of Semantics State based model Event based model Ongoing Work Conclusion 2/18/2019 ECBS'03

22 Ongoing work Where are we going with this ?
Result of the denotation is a language (lambda) which allows us to do interpretation, evaluation and verification of a facet However, need to ensure correct and safe semantics Use of co-algebra as semantic basis for a facet model Show that Rosetta Facet Facet Co-algebra d, p, f : S where f; d Elaborated Facet Semantics (-language)  elaboration 2/18/2019 ECBS'03

23 Next … Introduction Definitions Basic Semantics
Denoting Units of Semantics State based model Event based model Ongoing Work Conclusion 2/18/2019 ECBS'03

24 Conclusion Rosetta provides a framework where different semantics may be defined Use of domain specific denotational semantics Also denote a facet by a monad to allow for facet composition Moggi – uses monads to modularize semantics Hudak and Liang – use monad transformers Wadler – uses monads to add interaction into a purely declarative language 2/18/2019 ECBS'03


Download ppt "Defining A Formal Semantics For The Rosetta Specification Language"

Similar presentations


Ads by Google