SlideShare a Scribd company logo
1 of 38
Download to read offline
Dynamic Semantics Speciļ¬cation
and Interpreter Generation
Eelco Visser and Vlad Vergu
Compiler Construction 2015
What is the meaning of a program?
meaning(p) = what happens when executing the
generated (byte) code to which p is compiled
source
code
parse generate
machine
code
check
meaning(p) = behavior(p)
What is the meaning of a program?
Mapping input to output
What is behavior?
Changes to state of the system
How can we observe behavior?
meaning(p) = behavior(p)
Which behavior is essential, which accidental?
Is there a more direct description of semanticsL1?
How can we deļ¬ne the semantics of a program?
Compiler deļ¬nes translational semantics
semanticsL1(p) = semanticsL2(translate(p))
Requires understanding translate and semanticsL2
How do we know that translate is correct?
Motivation
parser
type checker
code generator
interpreter
parser
error recovery
syntax highlighting
outline
code completion
navigation
type checker
debugger
syntax deļ¬nition
static semantics
dynamic semantics
abstract syntax
type system
operational
semantics
type soundness
proof
Language Design
Syntax
Deļ¬nition
Name
Binding
Type
Constraints
Dynamic
Semantics
Transform
Syntax Deļ¬nition
Name Binding
Type Analysis
Editor
AST
Spoofax Language Workbench
Language Design
Syntax
Deļ¬nition
Name
Binding
Type
Constraints
Dynamic
Semantics
Transform
Veriļ¬cation of soundness properties
Generation of high-performance interpreters
Research Project: Language Designerā€™s Workbench
(1) Operational Semantics
(2) DynSem: A DSL for dynamic semantics
(3) Interpreter Generation from DynSem
Outline
Operational Semantics
What is the result of execution of a
program and how is that result achieved?
Operational Semantics
Natural Semantics: How is overall result of
execution obtained?
Structural Operational Semantics: What
are the individual steps of an execution?
Deļ¬ned using a transition system
Transition System
e1 āžž e1ā€™ ā€¦ en āžž enā€™
e āžž eā€™ conclusion
premises
rule
e āžž eā€™axiom
reduction p āžž v
derivation tree to prove
v is value of program p
Structural Operational (Small-Step) Semantics
e1 āžž e1ā€™
ifz(e1) e2 else e3 āžž ifz(e1ā€™) e2 else e3
i != 0
ifz(i) e2 else e3 āžž e3
ifz(0) e2 else e3 āžž e2
(x.e) v1 āžž e[x := v1]
e1 āžž e1ā€™
e1 e2 āžž e1ā€™ e2
e2 āžž e2ā€™
v e2 āžž v e2ā€™
e1 āžž e1ā€™
e1 + e2 āžž e1ā€™ + e2
e2 āžž e2ā€™
e1 + e2 āžž e1 + e2ā€™
i + j āžž i + j
e āžž e
reducing expressions
e = x | i | e + e |  x.e | e e | ifz(e) e else e
order of evaluation?
E āŠ¢ e1 NumV(i)
E āŠ¢ e2 NumV(j)
E āŠ¢ e1 + e2 NumV(i + j)
E[x] = v
E āŠ¢ x v
Natural (Big-Step) Semantics
E āŠ¢ x.e ClosV(x, e, E)
E āŠ¢ i NumV(i)
E āŠ¢ e1 NumV(0)
E āŠ¢ e2 v
E āŠ¢ if(e1) e2 else e3 v
E āŠ¢ e1 NumV(i), i != 0
E āŠ¢ e3 v
E āŠ¢ if(e1) e2 else e3 v
E1 āŠ¢ e1 ClosV(x, e, E2)
E1 āŠ¢ e2 v1
{x ā†¦ v1, E2} āŠ¢ e v2
E1 āŠ¢ e1 e2 v2
E āŠ¢ e v
reducing expressions to values
e = x | i | e + e |  x.e | e e | ifz(e) e else e
DynSem: A DSL for Dynamic
Semantics Speciļ¬cation
Vlad Vergu, Pierre Neron, Eelco Visser
RTA 2015
It Works
Concise
ModularExecutable
Portable
Design Goals
M. Churchill, P. D. Mosses, and P. Torrini.
Reusable components of semantic
speciļ¬cations. In MODULARITY, April 2014.
High-performance Statically Typed
Big-Step I-MSOS
Unsurprising
Example: DynSem Semantics of PAPL-Box
let
fac = box(0)
in
let f = fun (n) {
if (n == 0)
1
else
n * (unbox(fac) (n - 1))
end
}
in
setbox(fac, f);
unbox(fac)(10)
end
end
Features
- Arithmetic
- Booleans
- Comparisons
- Mutable variables
- Functions
- Boxes
Components
- Syntax in SDF3
- Dynamic Semantics in DynSem
Abstract Syntax from Concrete Syntax
module Arithmetic
imports Expressions
imports Common
context-free syntax
Expr.Num = INT
Expr.Plus = [[Expr] + [Expr]] {left}
Expr.Minus = [[Expr] - [Expr]] {left}
Expr.Times = [[Expr] * [Expr]] {left}
Expr.Mod = [[Expr] % [Expr]] {left}
context-free priorities
{left: Expr.Times Expr.Mod }
> {left: Expr.Minus Expr.Plus }
module Arithmetic-sig
imports Expressions-sig
imports Common-sig
signature
sorts
Expr
constructors
Num : INT -> Expr
Plus : Expr * Expr -> Expr
Minus : Expr * Expr -> Expr
Times : Expr * Expr -> Expr
Mod : Expr * Expr -> Expr
src-gen/ds-signatures/Arithmetic-sig
module expressions
imports values
imports Expressions-sig
signature
arrows
Expr --> V
variables
e : Expr
x : String
module values
signature
sorts V Unit
constructors
U : Unit
variables
v: V
Values, Meta-Variables, and Arrows
module arithmetic-explicit
imports expressions primitives Arithmetic-sig
signature
constructors
NumV: Int -> V
rules
Num(__String2INT__(n)) --> NumV(str2int(n)).
Plus(e1, e2) --> NumV(plusI(i1, i2))
where
e1 --> NumV(i1); e2 --> NumV(i2).
Minus(e1, e2) --> NumV(minusI(i1, i2))
where
e1 --> NumV(i1); e2 --> NumV(i2).
Term Reduction Rules
module primitives
signature
native operators
str2int : String -> Int
plusI : Int * Int -> Int
minusI : Int * Int -> Int
Native Operations
public class Natives {
public static int plusI_2(int i1, int i2) {
return i1 + i2;
}
public static int str2int_1(String s) {
return Integer.parseInt(s);
}
}
module primitives
signature
native operators
str2int : String -> Int
plusI : Int * Int -> Int
minusI : Int * Int -> Int
rules
Plus(e1, e2) --> NumV(plusI(i1, i2))
where
e1 --> NumV(i1);
e2 --> NumV(i2).
rules
Plus(NumV(i1), NumV(i2)) --> NumV(plusI(i1, i2)).
signature
constructors
Plus : Expr * Expr -> Expr
NumV : Int -> V
arrows
Expr --> V
Arrows as Coercions
module boolean
imports Booleans-sig expressions
signature
constructors
BoolV : Bool -> V
rules
True() --> BoolV(true).
False() --> BoolV(false).
Not(BoolV(false)) --> BoolV(true).
Not(BoolV(true)) --> BoolV(false).
Or(BoolV(true), _) --> BoolV(true).
Or(BoolV(false), e) --> e.
And(BoolV(false), _) --> BoolV(false).
And(BoolV(true), e) --> e.
module comparison
imports Comparisons-sig arithmetic boolean
rules
Gt(NumV(i1), NumV(i2)) --> BoolV(gtI(i1, i2)).
Eq(NumV(i1), NumV(i2)) --> BoolV(eqI(i1, i2)).
Eq(BoolV(b1), BoolV(b2)) --> BoolV(eqB(b1, b2)).
module arithmetic
imports Arithmetic-sig
imports expressions
imports primitives
signature
constructors
NumV: Int -> V
rules
Num(str) --> NumV(str2int(str)).
Plus(NumV(i1), NumV(i2)) --> NumV(plusI(i1, i2)).
Minus(NumV(i1), NumV(i2)) --> NumV(minusI(i1, i2)).
Times(NumV(i1), NumV(i2)) --> NumV(timesI(i1, i2)).
Mod(NumV(i1), NumV(i2)) --> NumV(modI(i1, i2)).
Modular
module controlflow
imports ControlFlow-sig
imports expressions
imports boolean
rules
Seq(v, e2) --> e2.
If(BoolV(true), e1, _) --> e1.
If(BoolV(false), _, e2) --> e2.
Control-Flow
module controlflow
imports ControlFlow-sig
imports expressions
imports boolean
rules
Seq(e1, e2) --> v2
where
e1 --> v1;
e2 --> v2.
If(e1, e2, e3) --> v
where
e1 --> BoolV(true);
e2 --> v.
If(e1, e2, e3) --> v
where
e1 --> BoolV(false);
e3 --> v.
constructors
Let : ID * Expr * Expr -> Expr
Var : ID -> Expr
module variables
imports Variables-sig environment
rules
E |- Let(x, v: V, e2) --> v2
where
Env {x |--> v, E} |- e2 --> v2.
E |- Var(x) --> E[x].
Immutable Variables: Environment Passing
module environment
imports values
signature
sort aliases
Env = Map<String, V>
variables
E : Env
module unary-functions
imports expressions environment
signature
constructors
ClosV : String * Expr * Env -> V
rules
E |- Fun(x, e) --> ClosV(x, e, E).
E |- App(e1, e2) --> v
where
E |- e1 --> ClosV(x, e, E');
E |- e2 --> v2;
Env {x |--> v2, E'} |- e --> v.
constructors
Fun : ID * Expr -> Expr
App : Expr * Expr -> Expr
First-Class Functions: Environment in Closure
module environment
imports values
signature
sort aliases
Env = Map<String, V>
variables
E : Env
rules
E |- Plus(e1, e2) --> NumV(plusI(i1, i2))
where
E |- e1 --> NumV(i1);
E |- e2 --> NumV(i2).
Implicit Propagation
rules
Plus(e1, e2) --> NumV(plusI(i1, i2))
where
e1 --> NumV(i1);
e2 --> NumV(i2).
rules
Plus(NumV(i1), NumV(i2)) --> NumV(plusI(i1, i2)).
module box
imports store arithmetic
signature
constructors
Box : Expr -> Expr
Unbox : Expr -> Expr
SetBox : Expr * Expr -> Expr
constructors
BoxV: Int -> V
rules
Box(e) :: S --> BoxV(loc) :: Store {loc |--> v, S'}
where e :: S --> v :: S';
fresh => loc.
Unbox(BoxV(loc)) :: S --> S[loc].
SetBox(BoxV(loc), v) :: S --> v :: Store {loc |--> v, S}.
module store
imports values
signature
sort aliases
Store = Map<Int, V>
variables
S : Store
Mutable Boxes: Store
Mutable Variables: Environment + Store
constructors
Let : ID * Expr * Expr -> Expr
Var : ID -> Expr
Set : String * Expr -> Expr
module variables-mutable
imports Variables-sig store
rules
E |- Var(x) :: S --> v :: S
where E[x] => loc; S[loc] => v.
E |- Let(x, v, e2) :: S1 --> v2 :: S3
where
fresh => loc;
{loc |--> v, S1} => S2;
Env {x |--> loc, E} |- e2 :: S2 --> v2 :: S3.
E |- Set(x, v) :: S --> v :: Store {loc |--> v, S}
where E[x] => loc.
module store
imports values
signature
sort aliases
Env = Map<ID, Int>
Store = Map<Int, V>
variables
E : Env
S : Store
rules
E |- Plus(e1, e2) :: S1 --> NumV(plusI(i1, i2)) :: S3
where
E |- e1 :: S1 --> NumV(i1) :: S2;
E |- e2 :: S2 --> NumV(i2) :: S3.
rules
Plus(e1, e2) --> NumV(plusI(i1, i2))
where
e1 --> NumV(i1);
e2 --> NumV(i2).
rules
Plus(NumV(i1), NumV(i2)) --> NumV(plusI(i1, i2)).
Implicit Store Threading
module store
imports values
signature
sort aliases
Env = Map<String, Int>
Store = Map<Int, V>
variables
E : Env
S : Store
constructors
readVar : String --> V
bindVar : String * V --> Env
writeVar : String * V --> V
allocate : V --> Int
write : Int * V --> V
read : Int --> V
rules
allocate(v) --> loc
where
fresh => loc;
write(loc, v) --> _.
write(loc, v) :: S -->
v :: Store {loc |--> v, S}.
read(loc) :: S --> S[loc] :: S.
rules
bindVar(x, v) --> {x |--> loc}
where allocate(v) --> loc.
E |- readVar(x) --> read(E[x]).
E |- writeVar(x, v) --> write(E[x], v).
Abstraction: Env/Store Meta Functions
module boxes
signature
constructors
Box : Expr -> Expr
Unbox : Expr -> Expr
SetBox : Expr * Expr -> Expr
constructors
BoxV: V -> V
rules
Box(v) --> BoxV(NumV(allocate(v))).
Unbox(BoxV(NumV(loc))) --> read(loc).
SetBox(BoxV(NumV(loc)), v) --> write(loc, v).
Boxes with Env/Store Meta Functions
Mutable Variables with Env/Store Meta Functions
module variables
imports expressions store
rules
Var(x) --> readVar(x).
E |- Let(x, v1, e) --> v2
where
bindVar(x, v1) --> E';
Env {E', E} |- e --> v2.
Set(x, v) --> v
where writeVar(x, v) --> _.
constructors
Let : String * Expr * Expr -> Expr
Var : String -> Expr
Set : String * Expr -> Expr
Functions with Multiple Arguments
module functions
imports Functions-sig
imports variables
signature
constructors
ClosV : List(ID) * Expr * Env -> V
bindArgs : List(ID) * List(Expr) --> Env
rules
E |- Fun(xs, e) --> ClosV(xs, e, E).
App(ClosV(xs, e_body, E_clos), es) --> v'
where
bindArgs(xs, es) --> E_params;
Env {E_params, E_clos} |- e_body --> v'.
bindArgs([], []) --> {}.
bindArgs([x | xs], [e | es]) --> {E, E'}
where
bindVar(x, e) --> E;
bindArgs(xs, es) --> E'.
Summary
Next:
Interpreter
Generation

More Related Content

What's hot

Declare Your Language: Syntactic (Editor) Services
Declare Your Language: Syntactic (Editor) ServicesDeclare Your Language: Syntactic (Editor) Services
Declare Your Language: Syntactic (Editor) ServicesEelco Visser
Ā 
Compiler Construction | Lecture 4 | Parsing
Compiler Construction | Lecture 4 | Parsing Compiler Construction | Lecture 4 | Parsing
Compiler Construction | Lecture 4 | Parsing Eelco Visser
Ā 
Declarative Semantics Definition - Term Rewriting
Declarative Semantics Definition - Term RewritingDeclarative Semantics Definition - Term Rewriting
Declarative Semantics Definition - Term RewritingGuido Wachsmuth
Ā 
Term Rewriting
Term RewritingTerm Rewriting
Term RewritingEelco Visser
Ā 
Declare Your Language: Dynamic Semantics
Declare Your Language: Dynamic SemanticsDeclare Your Language: Dynamic Semantics
Declare Your Language: Dynamic SemanticsEelco Visser
Ā 
CS4200 2019 | Lecture 5 | Transformation by Term Rewriting
CS4200 2019 | Lecture 5 | Transformation by Term RewritingCS4200 2019 | Lecture 5 | Transformation by Term Rewriting
CS4200 2019 | Lecture 5 | Transformation by Term RewritingEelco Visser
Ā 
Declare Your Language: Syntax Definition
Declare Your Language: Syntax DefinitionDeclare Your Language: Syntax Definition
Declare Your Language: Syntax DefinitionEelco Visser
Ā 
Compiler Construction | Lecture 9 | Constraint Resolution
Compiler Construction | Lecture 9 | Constraint ResolutionCompiler Construction | Lecture 9 | Constraint Resolution
Compiler Construction | Lecture 9 | Constraint ResolutionEelco Visser
Ā 
Static Analysis
Static AnalysisStatic Analysis
Static AnalysisEelco Visser
Ā 
Compiler Construction | Lecture 5 | Transformation by Term Rewriting
Compiler Construction | Lecture 5 | Transformation by Term RewritingCompiler Construction | Lecture 5 | Transformation by Term Rewriting
Compiler Construction | Lecture 5 | Transformation by Term RewritingEelco Visser
Ā 
Type analysis
Type analysisType analysis
Type analysisEelco Visser
Ā 
Compiler Construction | Lecture 14 | Interpreters
Compiler Construction | Lecture 14 | InterpretersCompiler Construction | Lecture 14 | Interpreters
Compiler Construction | Lecture 14 | InterpretersEelco Visser
Ā 
Lexical Analysis
Lexical AnalysisLexical Analysis
Lexical AnalysisEelco Visser
Ā 
Declarative Type System Specification with Statix
Declarative Type System Specification with StatixDeclarative Type System Specification with Statix
Declarative Type System Specification with StatixEelco Visser
Ā 
Chapter 22. Lambda Expressions and LINQ
Chapter 22. Lambda Expressions and LINQChapter 22. Lambda Expressions and LINQ
Chapter 22. Lambda Expressions and LINQIntro C# Book
Ā 
Compiler Construction | Lecture 8 | Type Constraints
Compiler Construction | Lecture 8 | Type ConstraintsCompiler Construction | Lecture 8 | Type Constraints
Compiler Construction | Lecture 8 | Type ConstraintsEelco Visser
Ā 
CS4200 2019 | Lecture 3 | Parsing
CS4200 2019 | Lecture 3 | ParsingCS4200 2019 | Lecture 3 | Parsing
CS4200 2019 | Lecture 3 | ParsingEelco Visser
Ā 
CS4200 2019 | Lecture 2 | syntax-definition
CS4200 2019 | Lecture 2 | syntax-definitionCS4200 2019 | Lecture 2 | syntax-definition
CS4200 2019 | Lecture 2 | syntax-definitionEelco Visser
Ā 
Compiler Construction | Lecture 2 | Declarative Syntax Definition
Compiler Construction | Lecture 2 | Declarative Syntax DefinitionCompiler Construction | Lecture 2 | Declarative Syntax Definition
Compiler Construction | Lecture 2 | Declarative Syntax DefinitionEelco Visser
Ā 
09. Java Methods
09. Java Methods09. Java Methods
09. Java MethodsIntro C# Book
Ā 

What's hot (20)

Declare Your Language: Syntactic (Editor) Services
Declare Your Language: Syntactic (Editor) ServicesDeclare Your Language: Syntactic (Editor) Services
Declare Your Language: Syntactic (Editor) Services
Ā 
Compiler Construction | Lecture 4 | Parsing
Compiler Construction | Lecture 4 | Parsing Compiler Construction | Lecture 4 | Parsing
Compiler Construction | Lecture 4 | Parsing
Ā 
Declarative Semantics Definition - Term Rewriting
Declarative Semantics Definition - Term RewritingDeclarative Semantics Definition - Term Rewriting
Declarative Semantics Definition - Term Rewriting
Ā 
Term Rewriting
Term RewritingTerm Rewriting
Term Rewriting
Ā 
Declare Your Language: Dynamic Semantics
Declare Your Language: Dynamic SemanticsDeclare Your Language: Dynamic Semantics
Declare Your Language: Dynamic Semantics
Ā 
CS4200 2019 | Lecture 5 | Transformation by Term Rewriting
CS4200 2019 | Lecture 5 | Transformation by Term RewritingCS4200 2019 | Lecture 5 | Transformation by Term Rewriting
CS4200 2019 | Lecture 5 | Transformation by Term Rewriting
Ā 
Declare Your Language: Syntax Definition
Declare Your Language: Syntax DefinitionDeclare Your Language: Syntax Definition
Declare Your Language: Syntax Definition
Ā 
Compiler Construction | Lecture 9 | Constraint Resolution
Compiler Construction | Lecture 9 | Constraint ResolutionCompiler Construction | Lecture 9 | Constraint Resolution
Compiler Construction | Lecture 9 | Constraint Resolution
Ā 
Static Analysis
Static AnalysisStatic Analysis
Static Analysis
Ā 
Compiler Construction | Lecture 5 | Transformation by Term Rewriting
Compiler Construction | Lecture 5 | Transformation by Term RewritingCompiler Construction | Lecture 5 | Transformation by Term Rewriting
Compiler Construction | Lecture 5 | Transformation by Term Rewriting
Ā 
Type analysis
Type analysisType analysis
Type analysis
Ā 
Compiler Construction | Lecture 14 | Interpreters
Compiler Construction | Lecture 14 | InterpretersCompiler Construction | Lecture 14 | Interpreters
Compiler Construction | Lecture 14 | Interpreters
Ā 
Lexical Analysis
Lexical AnalysisLexical Analysis
Lexical Analysis
Ā 
Declarative Type System Specification with Statix
Declarative Type System Specification with StatixDeclarative Type System Specification with Statix
Declarative Type System Specification with Statix
Ā 
Chapter 22. Lambda Expressions and LINQ
Chapter 22. Lambda Expressions and LINQChapter 22. Lambda Expressions and LINQ
Chapter 22. Lambda Expressions and LINQ
Ā 
Compiler Construction | Lecture 8 | Type Constraints
Compiler Construction | Lecture 8 | Type ConstraintsCompiler Construction | Lecture 8 | Type Constraints
Compiler Construction | Lecture 8 | Type Constraints
Ā 
CS4200 2019 | Lecture 3 | Parsing
CS4200 2019 | Lecture 3 | ParsingCS4200 2019 | Lecture 3 | Parsing
CS4200 2019 | Lecture 3 | Parsing
Ā 
CS4200 2019 | Lecture 2 | syntax-definition
CS4200 2019 | Lecture 2 | syntax-definitionCS4200 2019 | Lecture 2 | syntax-definition
CS4200 2019 | Lecture 2 | syntax-definition
Ā 
Compiler Construction | Lecture 2 | Declarative Syntax Definition
Compiler Construction | Lecture 2 | Declarative Syntax DefinitionCompiler Construction | Lecture 2 | Declarative Syntax Definition
Compiler Construction | Lecture 2 | Declarative Syntax Definition
Ā 
09. Java Methods
09. Java Methods09. Java Methods
09. Java Methods
Ā 

Viewers also liked

Applying SOS to MDE
Applying SOS to MDEApplying SOS to MDE
Applying SOS to MDETjerk Wolterink
Ā 
Backus Naur and Chomsky Normal Forms
Backus Naur and Chomsky Normal FormsBackus Naur and Chomsky Normal Forms
Backus Naur and Chomsky Normal FormsAshutosh Pandey
Ā 
Oracle PL/SQL exception handling
Oracle PL/SQL exception handlingOracle PL/SQL exception handling
Oracle PL/SQL exception handlingSmitha Padmanabhan
Ā 
Java & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkJava & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkMohit Belwal
Ā 
8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED CAman Sharma
Ā 
Principles of programming languages. Detail notes
Principles of programming languages. Detail notesPrinciples of programming languages. Detail notes
Principles of programming languages. Detail notesVIKAS SINGH BHADOURIA
Ā 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languagesVarun Garg
Ā 

Viewers also liked (8)

Applying SOS to MDE
Applying SOS to MDEApplying SOS to MDE
Applying SOS to MDE
Ā 
Backus Naur and Chomsky Normal Forms
Backus Naur and Chomsky Normal FormsBackus Naur and Chomsky Normal Forms
Backus Naur and Chomsky Normal Forms
Ā 
Oracle PL/SQL exception handling
Oracle PL/SQL exception handlingOracle PL/SQL exception handling
Oracle PL/SQL exception handling
Ā 
Syntax
SyntaxSyntax
Syntax
Ā 
Java & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkJava & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate Framework
Ā 
8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C
Ā 
Principles of programming languages. Detail notes
Principles of programming languages. Detail notesPrinciples of programming languages. Detail notes
Principles of programming languages. Detail notes
Ā 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
Ā 

Similar to Dynamic Semantics Specification and Interpreter Generation

IntroducciĆ³n a Elixir
IntroducciĆ³n a ElixirIntroducciĆ³n a Elixir
IntroducciĆ³n a ElixirSvet Ivantchev
Ā 
Compiler Construction | Lecture 13 | Code Generation
Compiler Construction | Lecture 13 | Code GenerationCompiler Construction | Lecture 13 | Code Generation
Compiler Construction | Lecture 13 | Code GenerationEelco Visser
Ā 
Model-Driven Software Development - Static Analysis & Error Checking
Model-Driven Software Development - Static Analysis & Error CheckingModel-Driven Software Development - Static Analysis & Error Checking
Model-Driven Software Development - Static Analysis & Error CheckingEelco Visser
Ā 
An overview of Python 2.7
An overview of Python 2.7An overview of Python 2.7
An overview of Python 2.7decoupled
Ā 
Chapter 2&3 (java fundamentals and Control Structures).ppt
Chapter 2&3 (java fundamentals and Control Structures).pptChapter 2&3 (java fundamentals and Control Structures).ppt
Chapter 2&3 (java fundamentals and Control Structures).ppthenokmetaferia1
Ā 
Yoyak ScalaDays 2015
Yoyak ScalaDays 2015Yoyak ScalaDays 2015
Yoyak ScalaDays 2015ihji
Ā 
Brief tour of psp-std
Brief tour of psp-stdBrief tour of psp-std
Brief tour of psp-stdPaul Phillips
Ā 
[FT-11][suhorng] ā€œPoor Man'sā€ Undergraduate Compilers
[FT-11][suhorng] ā€œPoor Man'sā€ Undergraduate Compilers[FT-11][suhorng] ā€œPoor Man'sā€ Undergraduate Compilers
[FT-11][suhorng] ā€œPoor Man'sā€ Undergraduate CompilersFunctional Thursday
Ā 
12IRGeneration.pdf
12IRGeneration.pdf12IRGeneration.pdf
12IRGeneration.pdfSHUJEHASSAN
Ā 
Social network-analysis-in-python
Social network-analysis-in-pythonSocial network-analysis-in-python
Social network-analysis-in-pythonJoe OntheRocks
Ā 
Introduction to python programming ( part-2 )
Introduction to python programming ( part-2 )Introduction to python programming ( part-2 )
Introduction to python programming ( part-2 )Ziyauddin Shaik
Ā 
C Code and the Art of Obfuscation
C Code and the Art of ObfuscationC Code and the Art of Obfuscation
C Code and the Art of Obfuscationguest9006ab
Ā 
How would you implement a node classs and an edge class to create .pdf
How would you implement a node classs and an edge class to create .pdfHow would you implement a node classs and an edge class to create .pdf
How would you implement a node classs and an edge class to create .pdfinfo309708
Ā 
TSP algorithm (Computational Thinking) Dropbox
TSP algorithm (Computational Thinking) DropboxTSP algorithm (Computational Thinking) Dropbox
TSP algorithm (Computational Thinking) DropboxSeb Sear
Ā 
ifelse.pptx
ifelse.pptxifelse.pptx
ifelse.pptxJananiJ19
Ā 
Super Advanced Python ā€“act1
Super Advanced Python ā€“act1Super Advanced Python ā€“act1
Super Advanced Python ā€“act1Ke Wei Louis
Ā 
Python 2.5 reference card (2009)
Python 2.5 reference card (2009)Python 2.5 reference card (2009)
Python 2.5 reference card (2009)gekiaruj
Ā 
[CONFidence 2016] Mateusz Kocielski - Torturing the PHP interpreter
[CONFidence 2016] Mateusz Kocielski - Torturing the PHP interpreter [CONFidence 2016] Mateusz Kocielski - Torturing the PHP interpreter
[CONFidence 2016] Mateusz Kocielski - Torturing the PHP interpreter PROIDEA
Ā 
Torturing the PHP interpreter
Torturing the PHP interpreterTorturing the PHP interpreter
Torturing the PHP interpreterLogicaltrust pl
Ā 

Similar to Dynamic Semantics Specification and Interpreter Generation (20)

IntroducciĆ³n a Elixir
IntroducciĆ³n a ElixirIntroducciĆ³n a Elixir
IntroducciĆ³n a Elixir
Ā 
Compiler Construction | Lecture 13 | Code Generation
Compiler Construction | Lecture 13 | Code GenerationCompiler Construction | Lecture 13 | Code Generation
Compiler Construction | Lecture 13 | Code Generation
Ā 
Model-Driven Software Development - Static Analysis & Error Checking
Model-Driven Software Development - Static Analysis & Error CheckingModel-Driven Software Development - Static Analysis & Error Checking
Model-Driven Software Development - Static Analysis & Error Checking
Ā 
An overview of Python 2.7
An overview of Python 2.7An overview of Python 2.7
An overview of Python 2.7
Ā 
A tour of Python
A tour of PythonA tour of Python
A tour of Python
Ā 
Chapter 2&3 (java fundamentals and Control Structures).ppt
Chapter 2&3 (java fundamentals and Control Structures).pptChapter 2&3 (java fundamentals and Control Structures).ppt
Chapter 2&3 (java fundamentals and Control Structures).ppt
Ā 
Yoyak ScalaDays 2015
Yoyak ScalaDays 2015Yoyak ScalaDays 2015
Yoyak ScalaDays 2015
Ā 
Brief tour of psp-std
Brief tour of psp-stdBrief tour of psp-std
Brief tour of psp-std
Ā 
[FT-11][suhorng] ā€œPoor Man'sā€ Undergraduate Compilers
[FT-11][suhorng] ā€œPoor Man'sā€ Undergraduate Compilers[FT-11][suhorng] ā€œPoor Man'sā€ Undergraduate Compilers
[FT-11][suhorng] ā€œPoor Man'sā€ Undergraduate Compilers
Ā 
12IRGeneration.pdf
12IRGeneration.pdf12IRGeneration.pdf
12IRGeneration.pdf
Ā 
Social network-analysis-in-python
Social network-analysis-in-pythonSocial network-analysis-in-python
Social network-analysis-in-python
Ā 
Introduction to python programming ( part-2 )
Introduction to python programming ( part-2 )Introduction to python programming ( part-2 )
Introduction to python programming ( part-2 )
Ā 
C Code and the Art of Obfuscation
C Code and the Art of ObfuscationC Code and the Art of Obfuscation
C Code and the Art of Obfuscation
Ā 
How would you implement a node classs and an edge class to create .pdf
How would you implement a node classs and an edge class to create .pdfHow would you implement a node classs and an edge class to create .pdf
How would you implement a node classs and an edge class to create .pdf
Ā 
TSP algorithm (Computational Thinking) Dropbox
TSP algorithm (Computational Thinking) DropboxTSP algorithm (Computational Thinking) Dropbox
TSP algorithm (Computational Thinking) Dropbox
Ā 
ifelse.pptx
ifelse.pptxifelse.pptx
ifelse.pptx
Ā 
Super Advanced Python ā€“act1
Super Advanced Python ā€“act1Super Advanced Python ā€“act1
Super Advanced Python ā€“act1
Ā 
Python 2.5 reference card (2009)
Python 2.5 reference card (2009)Python 2.5 reference card (2009)
Python 2.5 reference card (2009)
Ā 
[CONFidence 2016] Mateusz Kocielski - Torturing the PHP interpreter
[CONFidence 2016] Mateusz Kocielski - Torturing the PHP interpreter [CONFidence 2016] Mateusz Kocielski - Torturing the PHP interpreter
[CONFidence 2016] Mateusz Kocielski - Torturing the PHP interpreter
Ā 
Torturing the PHP interpreter
Torturing the PHP interpreterTorturing the PHP interpreter
Torturing the PHP interpreter
Ā 

More from Eelco Visser

CS4200 2019 | Lecture 4 | Syntactic Services
CS4200 2019 | Lecture 4 | Syntactic ServicesCS4200 2019 | Lecture 4 | Syntactic Services
CS4200 2019 | Lecture 4 | Syntactic ServicesEelco Visser
Ā 
CS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionCS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionEelco Visser
Ā 
A Direct Semantics of Declarative Disambiguation Rules
A Direct Semantics of Declarative Disambiguation RulesA Direct Semantics of Declarative Disambiguation Rules
A Direct Semantics of Declarative Disambiguation RulesEelco Visser
Ā 
Compiler Construction | Lecture 17 | Beyond Compiler Construction
Compiler Construction | Lecture 17 | Beyond Compiler ConstructionCompiler Construction | Lecture 17 | Beyond Compiler Construction
Compiler Construction | Lecture 17 | Beyond Compiler ConstructionEelco Visser
Ā 
Domain Specific Languages for Parallel Graph AnalytiX (PGX)
Domain Specific Languages for Parallel Graph AnalytiX (PGX)Domain Specific Languages for Parallel Graph AnalytiX (PGX)
Domain Specific Languages for Parallel Graph AnalytiX (PGX)Eelco Visser
Ā 
Compiler Construction | Lecture 15 | Memory Management
Compiler Construction | Lecture 15 | Memory ManagementCompiler Construction | Lecture 15 | Memory Management
Compiler Construction | Lecture 15 | Memory ManagementEelco Visser
Ā 
Compiler Construction | Lecture 12 | Virtual Machines
Compiler Construction | Lecture 12 | Virtual MachinesCompiler Construction | Lecture 12 | Virtual Machines
Compiler Construction | Lecture 12 | Virtual MachinesEelco Visser
Ā 
Compiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone FrameworksCompiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone FrameworksEelco Visser
Ā 
Compiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow AnalysisCompiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow AnalysisEelco Visser
Ā 
Compiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type CheckingCompiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type CheckingEelco Visser
Ā 
Compiler Construction | Lecture 6 | Introduction to Static Analysis
Compiler Construction | Lecture 6 | Introduction to Static AnalysisCompiler Construction | Lecture 6 | Introduction to Static Analysis
Compiler Construction | Lecture 6 | Introduction to Static AnalysisEelco Visser
Ā 
Compiler Construction | Lecture 3 | Syntactic Editor Services
Compiler Construction | Lecture 3 | Syntactic Editor ServicesCompiler Construction | Lecture 3 | Syntactic Editor Services
Compiler Construction | Lecture 3 | Syntactic Editor ServicesEelco Visser
Ā 
Compiler Construction | Lecture 1 | What is a compiler?
Compiler Construction | Lecture 1 | What is a compiler?Compiler Construction | Lecture 1 | What is a compiler?
Compiler Construction | Lecture 1 | What is a compiler?Eelco Visser
Ā 
Declare Your Language: Virtual Machines & Code Generation
Declare Your Language: Virtual Machines & Code GenerationDeclare Your Language: Virtual Machines & Code Generation
Declare Your Language: Virtual Machines & Code GenerationEelco Visser
Ā 
Declare Your Language: Constraint Resolution 2
Declare Your Language: Constraint Resolution 2Declare Your Language: Constraint Resolution 2
Declare Your Language: Constraint Resolution 2Eelco Visser
Ā 
Declare Your Language: Constraint Resolution 1
Declare Your Language: Constraint Resolution 1Declare Your Language: Constraint Resolution 1
Declare Your Language: Constraint Resolution 1Eelco Visser
Ā 

More from Eelco Visser (16)

CS4200 2019 | Lecture 4 | Syntactic Services
CS4200 2019 | Lecture 4 | Syntactic ServicesCS4200 2019 | Lecture 4 | Syntactic Services
CS4200 2019 | Lecture 4 | Syntactic Services
Ā 
CS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionCS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: Introduction
Ā 
A Direct Semantics of Declarative Disambiguation Rules
A Direct Semantics of Declarative Disambiguation RulesA Direct Semantics of Declarative Disambiguation Rules
A Direct Semantics of Declarative Disambiguation Rules
Ā 
Compiler Construction | Lecture 17 | Beyond Compiler Construction
Compiler Construction | Lecture 17 | Beyond Compiler ConstructionCompiler Construction | Lecture 17 | Beyond Compiler Construction
Compiler Construction | Lecture 17 | Beyond Compiler Construction
Ā 
Domain Specific Languages for Parallel Graph AnalytiX (PGX)
Domain Specific Languages for Parallel Graph AnalytiX (PGX)Domain Specific Languages for Parallel Graph AnalytiX (PGX)
Domain Specific Languages for Parallel Graph AnalytiX (PGX)
Ā 
Compiler Construction | Lecture 15 | Memory Management
Compiler Construction | Lecture 15 | Memory ManagementCompiler Construction | Lecture 15 | Memory Management
Compiler Construction | Lecture 15 | Memory Management
Ā 
Compiler Construction | Lecture 12 | Virtual Machines
Compiler Construction | Lecture 12 | Virtual MachinesCompiler Construction | Lecture 12 | Virtual Machines
Compiler Construction | Lecture 12 | Virtual Machines
Ā 
Compiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone FrameworksCompiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone Frameworks
Ā 
Compiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow AnalysisCompiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow Analysis
Ā 
Compiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type CheckingCompiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type Checking
Ā 
Compiler Construction | Lecture 6 | Introduction to Static Analysis
Compiler Construction | Lecture 6 | Introduction to Static AnalysisCompiler Construction | Lecture 6 | Introduction to Static Analysis
Compiler Construction | Lecture 6 | Introduction to Static Analysis
Ā 
Compiler Construction | Lecture 3 | Syntactic Editor Services
Compiler Construction | Lecture 3 | Syntactic Editor ServicesCompiler Construction | Lecture 3 | Syntactic Editor Services
Compiler Construction | Lecture 3 | Syntactic Editor Services
Ā 
Compiler Construction | Lecture 1 | What is a compiler?
Compiler Construction | Lecture 1 | What is a compiler?Compiler Construction | Lecture 1 | What is a compiler?
Compiler Construction | Lecture 1 | What is a compiler?
Ā 
Declare Your Language: Virtual Machines & Code Generation
Declare Your Language: Virtual Machines & Code GenerationDeclare Your Language: Virtual Machines & Code Generation
Declare Your Language: Virtual Machines & Code Generation
Ā 
Declare Your Language: Constraint Resolution 2
Declare Your Language: Constraint Resolution 2Declare Your Language: Constraint Resolution 2
Declare Your Language: Constraint Resolution 2
Ā 
Declare Your Language: Constraint Resolution 1
Declare Your Language: Constraint Resolution 1Declare Your Language: Constraint Resolution 1
Declare Your Language: Constraint Resolution 1
Ā 

Recently uploaded

%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
Ā 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
Ā 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
Ā 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
Ā 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
Ā 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
Ā 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfWilly Marroquin (WillyDevNET)
Ā 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
Ā 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
Ā 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
Ā 
Introducing Microsoftā€™s new Enterprise Work Management (EWM) Solution
Introducing Microsoftā€™s new Enterprise Work Management (EWM) SolutionIntroducing Microsoftā€™s new Enterprise Work Management (EWM) Solution
Introducing Microsoftā€™s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
Ā 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp KrisztiƔn
Ā 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
Ā 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
Ā 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
Ā 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
Ā 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
Ā 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
Ā 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
Ā 

Recently uploaded (20)

Abortion Pill Prices Tembisa [(+27832195400*)] šŸ„ Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] šŸ„ Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] šŸ„ Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] šŸ„ Women's Abortion Clinic in T...
Ā 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
Ā 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
Ā 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
Ā 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Ā 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
Ā 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
Ā 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
Ā 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
Ā 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Ā 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
Ā 
Introducing Microsoftā€™s new Enterprise Work Management (EWM) Solution
Introducing Microsoftā€™s new Enterprise Work Management (EWM) SolutionIntroducing Microsoftā€™s new Enterprise Work Management (EWM) Solution
Introducing Microsoftā€™s new Enterprise Work Management (EWM) Solution
Ā 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
Ā 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
Ā 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
Ā 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
Ā 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
Ā 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
Ā 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
Ā 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
Ā 

Dynamic Semantics Specification and Interpreter Generation

  • 1. Dynamic Semantics Speciļ¬cation and Interpreter Generation Eelco Visser and Vlad Vergu Compiler Construction 2015
  • 2. What is the meaning of a program? meaning(p) = what happens when executing the generated (byte) code to which p is compiled source code parse generate machine code check meaning(p) = behavior(p)
  • 3. What is the meaning of a program? Mapping input to output What is behavior? Changes to state of the system How can we observe behavior? meaning(p) = behavior(p) Which behavior is essential, which accidental?
  • 4. Is there a more direct description of semanticsL1? How can we deļ¬ne the semantics of a program? Compiler deļ¬nes translational semantics semanticsL1(p) = semanticsL2(translate(p)) Requires understanding translate and semanticsL2 How do we know that translate is correct?
  • 6.
  • 7. parser type checker code generator interpreter parser error recovery syntax highlighting outline code completion navigation type checker debugger syntax deļ¬nition static semantics dynamic semantics abstract syntax type system operational semantics type soundness proof
  • 9. Syntax Deļ¬nition Name Binding Type Analysis Editor AST Spoofax Language Workbench
  • 10. Language Design Syntax Deļ¬nition Name Binding Type Constraints Dynamic Semantics Transform Veriļ¬cation of soundness properties Generation of high-performance interpreters Research Project: Language Designerā€™s Workbench
  • 11. (1) Operational Semantics (2) DynSem: A DSL for dynamic semantics (3) Interpreter Generation from DynSem Outline
  • 13. What is the result of execution of a program and how is that result achieved? Operational Semantics Natural Semantics: How is overall result of execution obtained? Structural Operational Semantics: What are the individual steps of an execution? Deļ¬ned using a transition system
  • 14. Transition System e1 āžž e1ā€™ ā€¦ en āžž enā€™ e āžž eā€™ conclusion premises rule e āžž eā€™axiom reduction p āžž v derivation tree to prove v is value of program p
  • 15. Structural Operational (Small-Step) Semantics e1 āžž e1ā€™ ifz(e1) e2 else e3 āžž ifz(e1ā€™) e2 else e3 i != 0 ifz(i) e2 else e3 āžž e3 ifz(0) e2 else e3 āžž e2 (x.e) v1 āžž e[x := v1] e1 āžž e1ā€™ e1 e2 āžž e1ā€™ e2 e2 āžž e2ā€™ v e2 āžž v e2ā€™ e1 āžž e1ā€™ e1 + e2 āžž e1ā€™ + e2 e2 āžž e2ā€™ e1 + e2 āžž e1 + e2ā€™ i + j āžž i + j e āžž e reducing expressions e = x | i | e + e | x.e | e e | ifz(e) e else e order of evaluation?
  • 16. E āŠ¢ e1 NumV(i) E āŠ¢ e2 NumV(j) E āŠ¢ e1 + e2 NumV(i + j) E[x] = v E āŠ¢ x v Natural (Big-Step) Semantics E āŠ¢ x.e ClosV(x, e, E) E āŠ¢ i NumV(i) E āŠ¢ e1 NumV(0) E āŠ¢ e2 v E āŠ¢ if(e1) e2 else e3 v E āŠ¢ e1 NumV(i), i != 0 E āŠ¢ e3 v E āŠ¢ if(e1) e2 else e3 v E1 āŠ¢ e1 ClosV(x, e, E2) E1 āŠ¢ e2 v1 {x ā†¦ v1, E2} āŠ¢ e v2 E1 āŠ¢ e1 e2 v2 E āŠ¢ e v reducing expressions to values e = x | i | e + e | x.e | e e | ifz(e) e else e
  • 17. DynSem: A DSL for Dynamic Semantics Speciļ¬cation Vlad Vergu, Pierre Neron, Eelco Visser RTA 2015
  • 19. Concise ModularExecutable Portable Design Goals M. Churchill, P. D. Mosses, and P. Torrini. Reusable components of semantic speciļ¬cations. In MODULARITY, April 2014. High-performance Statically Typed Big-Step I-MSOS Unsurprising
  • 20. Example: DynSem Semantics of PAPL-Box let fac = box(0) in let f = fun (n) { if (n == 0) 1 else n * (unbox(fac) (n - 1)) end } in setbox(fac, f); unbox(fac)(10) end end Features - Arithmetic - Booleans - Comparisons - Mutable variables - Functions - Boxes Components - Syntax in SDF3 - Dynamic Semantics in DynSem
  • 21. Abstract Syntax from Concrete Syntax module Arithmetic imports Expressions imports Common context-free syntax Expr.Num = INT Expr.Plus = [[Expr] + [Expr]] {left} Expr.Minus = [[Expr] - [Expr]] {left} Expr.Times = [[Expr] * [Expr]] {left} Expr.Mod = [[Expr] % [Expr]] {left} context-free priorities {left: Expr.Times Expr.Mod } > {left: Expr.Minus Expr.Plus } module Arithmetic-sig imports Expressions-sig imports Common-sig signature sorts Expr constructors Num : INT -> Expr Plus : Expr * Expr -> Expr Minus : Expr * Expr -> Expr Times : Expr * Expr -> Expr Mod : Expr * Expr -> Expr src-gen/ds-signatures/Arithmetic-sig
  • 22. module expressions imports values imports Expressions-sig signature arrows Expr --> V variables e : Expr x : String module values signature sorts V Unit constructors U : Unit variables v: V Values, Meta-Variables, and Arrows
  • 23. module arithmetic-explicit imports expressions primitives Arithmetic-sig signature constructors NumV: Int -> V rules Num(__String2INT__(n)) --> NumV(str2int(n)). Plus(e1, e2) --> NumV(plusI(i1, i2)) where e1 --> NumV(i1); e2 --> NumV(i2). Minus(e1, e2) --> NumV(minusI(i1, i2)) where e1 --> NumV(i1); e2 --> NumV(i2). Term Reduction Rules module primitives signature native operators str2int : String -> Int plusI : Int * Int -> Int minusI : Int * Int -> Int
  • 24. Native Operations public class Natives { public static int plusI_2(int i1, int i2) { return i1 + i2; } public static int str2int_1(String s) { return Integer.parseInt(s); } } module primitives signature native operators str2int : String -> Int plusI : Int * Int -> Int minusI : Int * Int -> Int
  • 25. rules Plus(e1, e2) --> NumV(plusI(i1, i2)) where e1 --> NumV(i1); e2 --> NumV(i2). rules Plus(NumV(i1), NumV(i2)) --> NumV(plusI(i1, i2)). signature constructors Plus : Expr * Expr -> Expr NumV : Int -> V arrows Expr --> V Arrows as Coercions
  • 26. module boolean imports Booleans-sig expressions signature constructors BoolV : Bool -> V rules True() --> BoolV(true). False() --> BoolV(false). Not(BoolV(false)) --> BoolV(true). Not(BoolV(true)) --> BoolV(false). Or(BoolV(true), _) --> BoolV(true). Or(BoolV(false), e) --> e. And(BoolV(false), _) --> BoolV(false). And(BoolV(true), e) --> e. module comparison imports Comparisons-sig arithmetic boolean rules Gt(NumV(i1), NumV(i2)) --> BoolV(gtI(i1, i2)). Eq(NumV(i1), NumV(i2)) --> BoolV(eqI(i1, i2)). Eq(BoolV(b1), BoolV(b2)) --> BoolV(eqB(b1, b2)). module arithmetic imports Arithmetic-sig imports expressions imports primitives signature constructors NumV: Int -> V rules Num(str) --> NumV(str2int(str)). Plus(NumV(i1), NumV(i2)) --> NumV(plusI(i1, i2)). Minus(NumV(i1), NumV(i2)) --> NumV(minusI(i1, i2)). Times(NumV(i1), NumV(i2)) --> NumV(timesI(i1, i2)). Mod(NumV(i1), NumV(i2)) --> NumV(modI(i1, i2)). Modular
  • 27. module controlflow imports ControlFlow-sig imports expressions imports boolean rules Seq(v, e2) --> e2. If(BoolV(true), e1, _) --> e1. If(BoolV(false), _, e2) --> e2. Control-Flow module controlflow imports ControlFlow-sig imports expressions imports boolean rules Seq(e1, e2) --> v2 where e1 --> v1; e2 --> v2. If(e1, e2, e3) --> v where e1 --> BoolV(true); e2 --> v. If(e1, e2, e3) --> v where e1 --> BoolV(false); e3 --> v.
  • 28. constructors Let : ID * Expr * Expr -> Expr Var : ID -> Expr module variables imports Variables-sig environment rules E |- Let(x, v: V, e2) --> v2 where Env {x |--> v, E} |- e2 --> v2. E |- Var(x) --> E[x]. Immutable Variables: Environment Passing module environment imports values signature sort aliases Env = Map<String, V> variables E : Env
  • 29. module unary-functions imports expressions environment signature constructors ClosV : String * Expr * Env -> V rules E |- Fun(x, e) --> ClosV(x, e, E). E |- App(e1, e2) --> v where E |- e1 --> ClosV(x, e, E'); E |- e2 --> v2; Env {x |--> v2, E'} |- e --> v. constructors Fun : ID * Expr -> Expr App : Expr * Expr -> Expr First-Class Functions: Environment in Closure module environment imports values signature sort aliases Env = Map<String, V> variables E : Env
  • 30. rules E |- Plus(e1, e2) --> NumV(plusI(i1, i2)) where E |- e1 --> NumV(i1); E |- e2 --> NumV(i2). Implicit Propagation rules Plus(e1, e2) --> NumV(plusI(i1, i2)) where e1 --> NumV(i1); e2 --> NumV(i2). rules Plus(NumV(i1), NumV(i2)) --> NumV(plusI(i1, i2)).
  • 31. module box imports store arithmetic signature constructors Box : Expr -> Expr Unbox : Expr -> Expr SetBox : Expr * Expr -> Expr constructors BoxV: Int -> V rules Box(e) :: S --> BoxV(loc) :: Store {loc |--> v, S'} where e :: S --> v :: S'; fresh => loc. Unbox(BoxV(loc)) :: S --> S[loc]. SetBox(BoxV(loc), v) :: S --> v :: Store {loc |--> v, S}. module store imports values signature sort aliases Store = Map<Int, V> variables S : Store Mutable Boxes: Store
  • 32. Mutable Variables: Environment + Store constructors Let : ID * Expr * Expr -> Expr Var : ID -> Expr Set : String * Expr -> Expr module variables-mutable imports Variables-sig store rules E |- Var(x) :: S --> v :: S where E[x] => loc; S[loc] => v. E |- Let(x, v, e2) :: S1 --> v2 :: S3 where fresh => loc; {loc |--> v, S1} => S2; Env {x |--> loc, E} |- e2 :: S2 --> v2 :: S3. E |- Set(x, v) :: S --> v :: Store {loc |--> v, S} where E[x] => loc. module store imports values signature sort aliases Env = Map<ID, Int> Store = Map<Int, V> variables E : Env S : Store
  • 33. rules E |- Plus(e1, e2) :: S1 --> NumV(plusI(i1, i2)) :: S3 where E |- e1 :: S1 --> NumV(i1) :: S2; E |- e2 :: S2 --> NumV(i2) :: S3. rules Plus(e1, e2) --> NumV(plusI(i1, i2)) where e1 --> NumV(i1); e2 --> NumV(i2). rules Plus(NumV(i1), NumV(i2)) --> NumV(plusI(i1, i2)). Implicit Store Threading
  • 34. module store imports values signature sort aliases Env = Map<String, Int> Store = Map<Int, V> variables E : Env S : Store constructors readVar : String --> V bindVar : String * V --> Env writeVar : String * V --> V allocate : V --> Int write : Int * V --> V read : Int --> V rules allocate(v) --> loc where fresh => loc; write(loc, v) --> _. write(loc, v) :: S --> v :: Store {loc |--> v, S}. read(loc) :: S --> S[loc] :: S. rules bindVar(x, v) --> {x |--> loc} where allocate(v) --> loc. E |- readVar(x) --> read(E[x]). E |- writeVar(x, v) --> write(E[x], v). Abstraction: Env/Store Meta Functions
  • 35. module boxes signature constructors Box : Expr -> Expr Unbox : Expr -> Expr SetBox : Expr * Expr -> Expr constructors BoxV: V -> V rules Box(v) --> BoxV(NumV(allocate(v))). Unbox(BoxV(NumV(loc))) --> read(loc). SetBox(BoxV(NumV(loc)), v) --> write(loc, v). Boxes with Env/Store Meta Functions
  • 36. Mutable Variables with Env/Store Meta Functions module variables imports expressions store rules Var(x) --> readVar(x). E |- Let(x, v1, e) --> v2 where bindVar(x, v1) --> E'; Env {E', E} |- e --> v2. Set(x, v) --> v where writeVar(x, v) --> _. constructors Let : String * Expr * Expr -> Expr Var : String -> Expr Set : String * Expr -> Expr
  • 37. Functions with Multiple Arguments module functions imports Functions-sig imports variables signature constructors ClosV : List(ID) * Expr * Env -> V bindArgs : List(ID) * List(Expr) --> Env rules E |- Fun(xs, e) --> ClosV(xs, e, E). App(ClosV(xs, e_body, E_clos), es) --> v' where bindArgs(xs, es) --> E_params; Env {E_params, E_clos} |- e_body --> v'. bindArgs([], []) --> {}. bindArgs([x | xs], [e | es]) --> {E, E'} where bindVar(x, e) --> E; bindArgs(xs, es) --> E'.