Defining A Formal Semantics For The Rosetta Specification Language - PowerPoint PPT Presentation

About This Presentation
Title:

Defining A Formal Semantics For The Rosetta Specification Language

Description:

Basic Semantics Semantic modules. Static (prelude) state-based-semantics ... Basic Semantics Denotational semantics ... Basic Semantics Evaluation functions ... – PowerPoint PPT presentation

Number of Views:90
Avg rating:3.0/5.0
Slides: 25
Provided by: cindy67
Learn more at: http://www.ittc.ku.edu
Category:

less

Transcript and Presenter's Notes

Title: Defining A Formal Semantics For The Rosetta Specification Language


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

3
Next
  • Introduction
  • Definitions
  • Basic Semantics
  • Denoting Units of Semantics
  • State based model
  • Event based model
  • Ongoing Work
  • Conclusion

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

5
Next
  • Introduction
  • Definitions
  • Basic Semantics
  • Denoting Units of Semantics
  • State based model
  • Event based model
  • Ongoing Work
  • Conclusion

6
Definitions
  • Model of computation
  • 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

7
Next
  • Introduction
  • Definitions
  • Basic Semantics
  • Denoting Units of Semantics
  • State based model
  • Event based model
  • Ongoing Work
  • Conclusion

8
Basic Semantics Semantic modules
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

10
Basic Semantics Evaluation functions
  • Following Allisons 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 boolFncVars ? boolean is a function of any
    number of parameters to a boolean value

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?.bodytypeFnc is a lambda expression of
    type typeFnc

12
Basic semantics Term evaluation examples
  • Assuming store st contains
  • x ? 2
  • myFnc ? ?xint . x 1
  • T?x2? 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

13
Basic semantics Term evaluation examples
  • T?(myFnc 1) 2? st
  • ? O?? ((?xint . (x 1) V?1?) V?2?)
  • ? O?? ((?xint . (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

14
Next
  • Introduction
  • Definitions
  • Basic Semantics
  • Denoting Units of Semantics
  • State based model
  • Event based model
  • Ongoing Work
  • Conclusion

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
  • _at_ - 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
  • _at_ Label ? States ? Values the apply function
  • T Terms ? BoolFnc
  • E ?? ? Values where ? is an expression

16
Denoting Units of Semantics State based
  • In Rosetta, no sequential execution
  • x x 1 is expressed as x_at_next(s)x_at_s 1
  • Change of state made explicit
  • Elements of vocabulary apparent
  • Definition of additional valuation functions
  • O?_at_? ??v1, fnc? . fnc v1
  • Label ? (Label ? univ) ? univ
  • E?y_at_?? st E??? st y (st_value ?) y
  • E?y_at_next(?)? st (st_value next) (st_value ?) y

17
Next
  • Introduction
  • Definitions
  • Basic Semantics
  • Denoting Units of Semantics
  • State based model
  • Event based model
  • Ongoing Work
  • Conclusion

18
Denoting Units of Semantics Event based
  • Notion started with Lee and Sangiovanni-Vincentell
    is 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
  • _at_ - the apply function, dereferencing signals in
    states indexed by events

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
  • _at_ 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

20
Denoting Units of Semantics Event based
  • Modified Valuation function
  • O?_at_? ??v1, evt? . (??fnc? . (fnc evt) v1)
  • SignalLabels ?Events ? (Events ? States) ?
    SignalValue
  • An example
  • E?sig_at_evnt? st
  • O?_at_? sig (E?evnt? st) (st_value EventBasedState)
  • O?_at_? sig (st_value evnt) (st_value
    EventBasedState)
  • (??fnc? . (fnc (st_value evnt)) sig) (st_value
    EventBasedState)
  • ((st_value EventBasedState) (st_value evt)) sig

21
Next
  • Introduction
  • Definitions
  • Basic Semantics
  • Denoting Units of Semantics
  • State based model
  • Event based model
  • Ongoing Work
  • Conclusion

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

23
Next
  • Introduction
  • Definitions
  • Basic Semantics
  • Denoting Units of Semantics
  • State based model
  • Event based model
  • Ongoing Work
  • Conclusion

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
Write a Comment
User Comments (0)
About PowerShow.com