Language Interpreters in Maude - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

Language Interpreters in Maude

Description:

Example 1: Basic constructs. Example 2: Functional constructs. Example 3: Lambda calculus ... Example 1: A basic environment. Example 2: The store. Example 3: ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 20
Provided by: markh77
Category:

less

Transcript and Presenter's Notes

Title: Language Interpreters in Maude


1
Language Interpreters in Maude
  • Mark Hills
  • UIUC SIGPLAN
  • April 11, 2005

2
Overview
  • Language specification
  • Benefits
  • What to watch out for
  • Goal give you a sense of how Maude works,
    without getting bogged down in (too many) details

3
Language specification
  • Goal provide a formal specification of a
    language
  • Should be a mathematical model of how the
    language works
  • Benefit should be executable should be able to
    run programs in this model

4
General process
  • Specify syntax
  • Create execution environment
  • Specify semantics

5
Specify syntax
  • Syntax specified in mixfix notation
  • Similar to BNF productions
  • Can specify operator precedence and associativity

6
Example 1 Basic constructs
7
Example 2 Functional constructs
8
Example 3 Lambda calculus
9
Create execution environment
  • Maude does not provide a default execution
    environment for us we need to model it
  • Generally need an environment, a store, and some
    additional state information
  • Can add constructs to represent threads, locks,
    etc

10
Example 1 A basic environment
11
Example 2 The store
12
Example 3 Threads
13
Specify semantics
  • With syntax and an execution environment, need to
    specify semantics of the language features
  • Semantics have an operational feel based on
    equational reasoning
  • Semantics generally change the current expression
    and the state

14
Example 1 Basic math
15
Example 2 Loops
16
Example 3 Functions
17
Benefits
  • The model is mathematical it is a formal model
    that we can reason about
  • The model is executable we can actually run
    programs using this model
  • The model is fast programs run in a reasonable
    amount of time
  • The model is detailed we make no assumptions,
    so we understand how it works

18
What to watch out for
  • Parsing is tricky probably the biggest weakness
    to this approach
  • Closed world assumption cannot take input or
    generate output from the outside world
  • Performance sometimes does matter a cumbersome
    formal model will be slow, and probably can be
    streamlined

19
Questions?
Write a Comment
User Comments (0)
About PowerShow.com