SlideShare a Scribd company logo
IN4303 2015-2017
Compiler Construction
Term Rewriting
language specification
Guido Wachsmuth, Eelco Visser
Software Languages 2
DynSem
Stratego
NaBL2
SDF3
ESV
editor
SPT
tests
syntax definition
concrete syntax
abstract syntax
static semantics
name binding
type system
dynamic semantics
translation
interpretation
Software Languages 3
DynSem
Stratego
NaBL2
SDF3
ESV
editor
SPT
tests
syntax definition
concrete syntax
abstract syntax
static semantics
name binding
type system
dynamic semantics
translation
interpretation
Software Languages 4
Language Software
compiler construction
Software Languages 5
meta language facility
Software Languages 6
traditional compiler compilers
manual implementation
language
implementation
compile
compiler
Software Languages 7
traditional compiler compilers
compilation + compilation
language
implementation
compile
compiler
language
definition
compile
Software Languages 8
traditional compiler compilers
compilation + interpretation
interpreter
language
definition
compile
language
implementation
manual implementation
Term Rewriting
Spoofax Language Workbench
Stratego
• declarative DSL
• domain: program transformation
• means to manipulate ASTs
• working on ATerms
• compiles to Java (or C)
Stratego in Spoofax
• static analysis & error checking
• code generation
• semantic editor services
9
manual implementation
Term Rewriting
Spoofax Language Workbench
Stratego
• declarative DSL
• domain: program transformation
• means to manipulate ASTs
• working on ATerms
• compiles to Java (or C)
Stratego in Spoofax
• static analysis & error checking
• code generation
• semantic editor services
9
Note: static analysis is
replaced by the higher-level
NaBL2 language
concepts
Term Rewriting
Stratego
signatures
rewrite rules
• transform term to term
• left-hand side
• pattern matching & variable binding
• right-hand side
• pattern instantiation & variable substitution
rewrite strategies
• algorithm for applying rewrite rules
10
example
Term Rewriting
Stratego
module desugar
imports
include/Tiger
operators
strategies
desugar-all = innermost(desugar)
rules
desugar: IfThen(e1, e2) -> IfThenElse(e1, e2, NoVal())
11
Software Languages 12
Terms
Term Rewriting
Terms
13
Let(
[ FunDec(
"fact"
, [FArg("n", Tp(Tid("int")))]
, Tp(Tid("int"))
, If(
Lt(Var("n"), Int("1"))
, Int("1")
, Seq(
[ Times(
Var("n")
, Call(
Var("fact")
, [Minus(Var("n"), Int("1"))]
)
)
]
)
)
)
]
, [Call(Var("fact"), [Int("10")])]
)
let function fact(n : int) : int =
if n < 1 then 1 else (n * fact(n - 1))
in fact(10)
end
Term Rewriting
Syntax of Terms
module Terms
sorts Cons Term
lexical syntax
Cons = [a-zA-Z][a-zA-Z0-9]*
context-free syntax
Term.App = <<Cons>(<{Term ","}*>)>
14
Zero()
Succ(Zero())
Cons(A(), Cons(B(), Nil()))
Term Rewriting
Syntax of Terms
module Terms
sorts Cons Term
lexical syntax
Cons = [a-zA-Z][a-zA-Z0-9]*
context-free syntax
Term.App = <<Cons>(<{Term ","}*>)>
Term.List = <[<{Term ","}*>]>
Term.Tuple = <(<{Term ","}*>)>
15
Zero()
Succ(Zero())
[A(), B()]
Term Rewriting
Syntax of Terms
module ATerms
sorts Cons Term
lexical syntax
Cons = [a-zA-Z][a-zA-Z0-9]*
Cons = String
Int = [0-9]+
String = """ StringChar* """
StringChar = ~["n]
StringChar = "" ["]
context-free syntax
Term.Str = <<String>>
Term.Int = <<Int>>
Term.App = <<Cons>(<{Term ","}*>)>
Term.List = <[<{Term ","}*>]>
Term.Tuple = <(<{Term ","}*>)>
16
0
1
[A(), B()]
Var(“x”)
Let(
[ Decl(“x”, IntT()),
Decl(“y”, BoolT())
]
, Eq(Var(“x”), Int(0))
)
Term Rewriting
Syntax of A(nnotated)Terms
module ATerms
sorts Cons Term
lexical syntax
Cons = [a-zA-Z][a-zA-Z0-9]*
// more lexical syntax omitted
context-free syntax
Term.Anno = <<PreTerm>{<{Term “,"}*>}>
Term = <<PreTerm>>
PreTerm.Str = <<String>>
PreTerm.Int = <<Int>>
PreTerm.App = <<Cons>(<{Term ","}*>)>
PreTerm.List = <[<{Term ","}*>]>
PreTerm.Tuple = <(<{Term ","}*>)>
17
Var(“x”){Type(IntT())}
Software Languages 18
Signatures
context-free syntax
Exp.Uminus = [- [Exp]]
Exp.Power = [[Exp] ** [Exp]]
Exp.Times = [[Exp] * [Exp]]
Exp.Divide = [[Exp] / [Exp]]
Exp.Plus = [[Exp] + [Exp]]
Exp.Minus = [[Exp] - [Exp]]
Exp.CPlus = [[Exp] +i [Exp]]
Exp.CMinus = [[Exp] -i [Exp]]
Exp.Eq = [[Exp] = [Exp]]
Exp.Neq = [[Exp] <> [Exp]]
Exp.Gt = [[Exp] > [Exp]]
Exp.Lt = [[Exp] < [Exp]]
Exp.Geq = [[Exp] >= [Exp]]
Exp.Leq = [[Exp] <= [Exp]]
Exp.True = <true>
Exp.False = <false>
Exp.And = [[Exp] & [Exp]]
Exp.Or = [[Exp] | [Exp]]
Term Rewriting
Signatures
signature
constructors
Uminus : Exp -> Exp
Power : Exp * Exp -> Exp
Times : Exp * Exp -> Exp
Divide : Exp * Exp -> Exp
Plus : Exp * Exp -> Exp
Minus : Exp * Exp -> Exp
CPlus : Exp * Exp -> Exp
CMinus : Exp * Exp -> Exp
Eq : Exp * Exp -> Exp
Neq : Exp * Exp -> Exp
Gt : Exp * Exp -> Exp
Lt : Exp * Exp -> Exp
Geq : Exp * Exp -> Exp
Leq : Exp * Exp -> Exp
True : Exp
False : Exp
And : Exp * Exp -> Exp
Or : Exp * Exp -> Exp
19
Software Languages 20
Rewrite Rules
Term Rewriting
Desugaring
if x then
printint(x)
21
if x then
printint(x)
else
()
Term Rewriting
Desugaring
if x then
printint(x)
21
if x then
printint(x)
else
()
IfThen(
Var("x")
, Call(
"printint"
, [Var("x")]
)
)
IfThenElse(
Var("x")
, Call(
"printint"
, [Var("x")]
)
, NoVal()
)
desugar: IfThen(e1, e2) -> IfThenElse(e1, e2, NoVal())
Term Rewriting
Desugaring
if x then
printint(x)
21
if x then
printint(x)
else
()
IfThen(
Var("x")
, Call(
"printint"
, [Var("x")]
)
)
IfThenElse(
Var("x")
, Call(
"printint"
, [Var("x")]
)
, NoVal()
)
desugar: IfThen(e1, e2) -> IfThenElse(e1, e2, NoVal())
Term Rewriting
Desugaring
if x then
printint(x)
21
if x then
printint(x)
else
()
IfThen(
Var("x")
, Call(
"printint"
, [Var("x")]
)
)
IfThenElse(
Var("x")
, Call(
"printint"
, [Var("x")]
)
, NoVal()
)
pattern matching
desugar: IfThen(e1, e2) -> IfThenElse(e1, e2, NoVal())
Term Rewriting
Desugaring
if x then
printint(x)
21
if x then
printint(x)
else
()
IfThen(
Var("x")
, Call(
"printint"
, [Var("x")]
)
)
IfThenElse(
Var("x")
, Call(
"printint"
, [Var("x")]
)
, NoVal()
)
pattern matching
e1
e2
desugar: IfThen(e1, e2) -> IfThenElse(e1, e2, NoVal())
Term Rewriting
Desugaring
if x then
printint(x)
21
if x then
printint(x)
else
()
IfThen(
Var("x")
, Call(
"printint"
, [Var("x")]
)
)
IfThenElse(
Var("x")
, Call(
"printint"
, [Var("x")]
)
, NoVal()
)
pattern matching pattern instantiation
e1
e2
desugar: IfThen(e1, e2) -> IfThenElse(e1, e2, NoVal())
Term Rewriting
Desugaring
if x then
printint(x)
21
if x then
printint(x)
else
()
IfThen(
Var("x")
, Call(
"printint"
, [Var("x")]
)
)
IfThenElse(
Var("x")
, Call(
"printint"
, [Var("x")]
)
, NoVal()
)
pattern matching pattern instantiation
e1
e2
desugar: Uminus(e) -> Bop(MINUS(), Int("0"), e)
desugar: Plus(e1, e2) -> Bop(PLUS(), e1, e2)
desugar: Minus(e1, e2) -> Bop(MINUS(), e1, e2)
desugar: Times(e1, e2) -> Bop(MUL(), e1, e2)
desugar: Divide(e1, e2) -> Bop(DIV(), e1, e2)
desugar: Eq(e1, e2) -> Rop(EQ(), e1, e2)
desugar: Neq(e1, e2) -> Rop(NE(), e1, e2)
desugar: Leq(e1, e2) -> Rop(LE(), e1, e2)
desugar: Lt(e1, e2) -> Rop(LT(), e1, e2)
desugar: Geq(e1, e2) -> Rop(LE(), e2, e1)
desugar: Gt(e1, e2) -> Rop(LT(), e2, e1)
desugar: And(e1, e2) -> IfThenElse(e1, e2, Int("0"))
desugar: Or(e1, e2) -> IfThenElse(e1, Int("1"), e2)
Term Rewriting
More Desugaring
signature constructors
PLUS: BinOp
MINUS: BinOp
MUL: BinOp
DIV: BinOp
EQ: RelOp
NE: RelOp
LE: RelOp
LT: RelOp
Bop: BinOp * Expr * Expr -> Expr
Rop: RelOp * Expr * Expr -> Expr
22
Term Rewriting
Constant Folding
x := 21 + 21 + x
23
x := 42 + x
Term Rewriting
Constant Folding
x := 21 + 21 + x
23
x := 42 + x
Assign(
Var("x")
, Plus(
Plus(
Int("21")
, Int("21")
)
, Var("x")
)
)
Assign(
Var("x")
, Plus(
Int("42")
, Var("x")
)
)
eval: Bop(PLUS(), Int(i1), Int(i2)) -> Int(i3)
where <addS> (i1, i2) => i3
Term Rewriting
Constant Folding
x := 21 + 21 + x
23
x := 42 + x
Assign(
Var("x")
, Plus(
Plus(
Int("21")
, Int("21")
)
, Var("x")
)
)
Assign(
Var("x")
, Plus(
Int("42")
, Var("x")
)
)
eval: Bop(PLUS(), Int(i1), Int(i2)) -> Int(<addS> (i1, i2))
eval: Bop(MINUS(), Int(i1), Int(i2)) -> Int(<subtS> (i1, i2))
eval: Bop(MUL(), Int(i1), Int(i2)) -> Int(<mulS> (i1, i2))
eval: Bop(DIV(), Int(i1), Int(i2)) -> Int(<divS> (i1, i2))
eval: Rop(EQ(), Int(i), Int(i)) -> Int("1")
eval: Rop(EQ(), Int(i1), Int(i2)) -> Int("0") where not( <eq> (i1, i2) )
eval: Rop(NE(), Int(i), Int(i)) -> Int("0")
eval: Rop(NE(), Int(i1), Int(i2)) -> Int("1") where not( <eq> (i1, i2) )
eval: Rop(LT(), Int(i1), Int(i2)) -> Int("1") where <ltS> (i1, i2)
eval: Rop(LT(), Int(i1), Int(i2)) -> Int("0") where not( <ltS> (i1, i2) )
eval: Rop(LE(), Int(i1), Int(i2)) -> Int("1") where <leqS> (i1, i2)
eval: Rop(LE(), Int(i1), Int(i2)) -> Int("0") where not( <leqS> (i1, i2))
Term Rewriting
More Constant Folding
24
parameters
Term Rewriting
Rewrite Rules
f(x,y|a,b): lhs -> rhs
• strategy or rule parameters x,y
• term parameters a,b
• no matching
f(|a,b): lhs -> rhs
• optional strategy parameters
f(x,y): lhs -> rhs
• optional term parameters
f: lhs -> rhs
25
example: map
Term Rewriting
Rules with Parameters
26
[ 1
, 2
, 3
]
[ 2
, 3
, 4
]
map(inc)
example: map
Term Rewriting
Rules with Parameters
26
[ 1
, 2
, 3
]
[ 2
, 3
, 4
]
map(inc)
inc
1
2
3
2
3
4inc
inc
example: map
Term Rewriting
Rules with Parameters
map(s): [] -> []
map(s): [x|xs] -> [<s> x | <map(s)> xs]
26
[ 1
, 2
, 3
]
[ 2
, 3
, 4
]
map(inc)
inc
1
2
3
2
3
4inc
inc
example: zip
Term Rewriting
Rules with Parameters
27
[ 1
, 2
, 3
]
[ (1,4)
, (2,5)
, (3,6)
]
[ 4
, 5
, 6
]
zip
example: zip
Term Rewriting
Rules with Parameters
27
[ 1
, 2
, 3
]
[ (1,4)
, (2,5)
, (3,6)
]
[ 4
, 5
, 6
]
zip
[ 1
, 2
, 3
]
[ 5
, 7
, 9
]
[ 4
, 5
, 6
]
zip(add)
example: zip
Term Rewriting
Rules with Parameters
27
[ 1
, 2
, 3
]
[ (1,4)
, (2,5)
, (3,6)
]
[ 4
, 5
, 6
]
zip
[ 1
, 2
, 3
]
[ 5
, 7
, 9
]
[ 4
, 5
, 6
]
zip(add)
map(add)
example: zip
Term Rewriting
Rules with Parameters
zip(s): ([],[]) -> []
zip(s): ([x|xs],[y|ys]) -> [<s> (x,y) | <zip(s)> (xs,ys)]
zip = zip(id)
27
[ 1
, 2
, 3
]
[ (1,4)
, (2,5)
, (3,6)
]
[ 4
, 5
, 6
]
zip
[ 1
, 2
, 3
]
[ 5
, 7
, 9
]
[ 4
, 5
, 6
]
zip(add)
map(add)
example: fold
Term Rewriting
Rules with Parameters
28
[1,2,3] foldr(!0,add) 6
example: fold
Term Rewriting
Rules with Parameters
28
[1,2,3] foldr(!0,add) 6
[]
0
[3]
3
[2,3]
56
[1,2,3]
example: fold
Term Rewriting
Rules with Parameters
foldr(s1,s2): [] -> <s1>
foldr(s1,s2): [x|xs] -> <s2> (x,<foldr(s1,s2)> xs)
28
[1,2,3] foldr(!0,add) 6
[]
0
[3]
3
[2,3]
56
[1,2,3]
example: inverse
Term Rewriting
Rules with Parameters
29
[1,2,3] inverse(|[]) [3,2,1]
example: inverse
Term Rewriting
Rules with Parameters
29
[1,2,3] inverse(|[]) [3,2,1]
[2,3]
[1][]
[1,2,3] [3]
[2,1] [3,2,1]
[]
example: inverse
Term Rewriting
Rules with Parameters
inverse(|is): [] -> is
inverse(|is): [x|xs] -> <inverse(|[x|is])> xs
29
[1,2,3] inverse(|[]) [3,2,1]
[2,3]
[1][]
[1,2,3] [3]
[2,1] [3,2,1]
[]
Software Languages 30
Rewrite Strategies
rules and strategies
Term Rewriting
Transformation Definitions
rewrite rules
• term to term
• left-hand side matching
• right-hand side instantiation
• conditional
• partial transformation
rewrite strategies
• rule selection
• algorithm
• composition of transformations
31
example
Term Rewriting
Stratego
module desugar
imports
include/Tiger
operators
strategies
desugar-all = innermost(desugar)
rules
desugar: IfThen(e1, e2) -> IfThenElse(e1, e2, NoVal())
32
example
Term Rewriting
Stratego
module eval
imports
include/Tiger
operators
desugar
strategies
eval-all = innermost(desugar + eval)
rules
eval: Bop(PLUS(),Int(i1),Int(i2)) -> Int(i3)
where <addS> (i1, i2) => i3
33
Term Rewriting
Strategy Combinators
identity
id
34
Term Rewriting
Strategy Combinators
identity
id
failure
fail
34
Term Rewriting
Strategy Combinators
identity
id
failure
fail
sequential composition
s1 ; s2
34
Term Rewriting
Strategy Combinators
identity
id
failure
fail
sequential composition
s1 ; s2
deterministic choice
s1 <+ s2
34
Term Rewriting
Strategy Combinators
identity
id
failure
fail
sequential composition
s1 ; s2
deterministic choice
s1 <+ s2
non-deterministic choice
s1 + s2
34
Term Rewriting
Strategy Combinators
identity
id
failure
fail
sequential composition
s1 ; s2
deterministic choice
s1 <+ s2
non-deterministic choice
s1 + s2
guarded choice
s1 < s2 + s3
34
variables
Term Rewriting
Strategy Combinators
pattern matching
?t
35
variables
Term Rewriting
Strategy Combinators
pattern matching
?t
pattern instantiation
!t
35
variables
Term Rewriting
Strategy Combinators
pattern matching
?t
pattern instantiation
!t
strategy application
<s> t ≣ !t ; s
35
variables
Term Rewriting
Strategy Combinators
pattern matching
?t
pattern instantiation
!t
strategy application
<s> t ≣ !t ; s
result matching
s => t ≣ s ; ?t
<s> t1 => t2
t2 := <s> t1
35
variables
Term Rewriting
Strategy Combinators
pattern matching
?t
pattern instantiation
!t
strategy application
<s> t ≣ !t ; s
result matching
s => t ≣ s ; ?t
<s> t1 => t2
t2 := <s> t1
variable scope
{x,y: s}
35
rules and strategies
Term Rewriting
Strategy Combinators
named rewrite rule
l: t1 -> t2 where s ≣ l = ?t1 ; s ; !t2
36
rules and strategies
Term Rewriting
Strategy Combinators
named rewrite rule
l: t1 -> t2 where s ≣ l = ?t1 ; s ; !t2
unscoped rewrite rule
(t1 -> t2 where s) ≣ ?t1 ; s ; !t2
36
rules and strategies
Term Rewriting
Strategy Combinators
named rewrite rule
l: t1 -> t2 where s ≣ l = ?t1 ; s ; !t2
unscoped rewrite rule
(t1 -> t2 where s) ≣ ?t1 ; s ; !t2
strategy definition
f(x,y|a,b) = s
36
examples
Term Rewriting
Strategy Combinators
try(s) = s <+ id
37
examples
Term Rewriting
Strategy Combinators
try(s) = s <+ id
repeat(s) = try(s ; repeat(s))
37
examples
Term Rewriting
Strategy Combinators
try(s) = s <+ id
repeat(s) = try(s ; repeat(s))
topdown(s) = s ; all(topdown(s))
37
examples
Term Rewriting
Strategy Combinators
try(s) = s <+ id
repeat(s) = try(s ; repeat(s))
topdown(s) = s ; all(topdown(s))
alltd(s) = s <+ all(alltd(s))
37
examples
Term Rewriting
Strategy Combinators
try(s) = s <+ id
repeat(s) = try(s ; repeat(s))
topdown(s) = s ; all(topdown(s))
alltd(s) = s <+ all(alltd(s))
bottomup(s) = all(bottomup(s)) ; s
37
examples
Term Rewriting
Strategy Combinators
try(s) = s <+ id
repeat(s) = try(s ; repeat(s))
topdown(s) = s ; all(topdown(s))
alltd(s) = s <+ all(alltd(s))
bottomup(s) = all(bottomup(s)) ; s
innermost(s) = bottomup(try(s ; innermost(s)))
37
examples
Term Rewriting
Strategy Combinators
try(s) = s <+ id
repeat(s) = try(s ; repeat(s))
topdown(s) = s ; all(topdown(s))
alltd(s) = s <+ all(alltd(s))
bottomup(s) = all(bottomup(s)) ; s
innermost(s) = bottomup(try(s ; innermost(s)))
oncetd(s) = s <+ one(oncetd(s))
37
examples
Term Rewriting
Strategy Combinators
try(s) = s <+ id
repeat(s) = try(s ; repeat(s))
topdown(s) = s ; all(topdown(s))
alltd(s) = s <+ all(alltd(s))
bottomup(s) = all(bottomup(s)) ; s
innermost(s) = bottomup(try(s ; innermost(s)))
oncetd(s) = s <+ one(oncetd(s))
contains(|t) = oncetd(?t)
37
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
topdown(s) = s ; all(topdown(s))
topdown(switch)
38
Const
Mul
Const
3 4 5
Const
Add
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
topdown(s) = s ; all(topdown(s))
topdown(switch)
38
Const
Mul
Const
3 4 5
Const
Add1
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
topdown(s) = s ; all(topdown(s))
topdown(switch)
39
Mul
Const
3
Const
4 5
Const
Add1
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
topdown(s) = s ; all(topdown(s))
topdown(switch)
39
Mul
Const
3
Const
4 5
Const
Add1
2
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
topdown(s) = s ; all(topdown(s))
topdown(switch)
40
Mul
Const
3
Const
5 4
Const
Add1
2
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
topdown(s) = s ; all(topdown(s))
topdown(switch)
40
Mul
Const
3
Const
5 4
Const
Add1
2
3
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
topdown(s) = s ; all(topdown(s))
topdown(try(switch))
41
Const
Mul
Const
3 4 5
Const
Add
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
topdown(s) = s ; all(topdown(s))
topdown(try(switch))
41
Const
Mul
Const
3 4 5
Const
Add1
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
topdown(s) = s ; all(topdown(s))
topdown(try(switch))
42
Mul
Const
3
Const
4 5
Const
Add1
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
topdown(s) = s ; all(topdown(s))
topdown(try(switch))
42
Mul
Const
3
Const
4 5
Const
Add1
2
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
topdown(s) = s ; all(topdown(s))
topdown(try(switch))
43
Mul
Const
3
Const
5 4
Const
Add1
2
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
topdown(s) = s ; all(topdown(s))
topdown(try(switch))
43
Mul
Const
3
Const
5 4
Const
Add1
2
3
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
topdown(s) = s ; all(topdown(s))
topdown(try(switch))
43
Mul
Const
3
Const
5 4
Const
Add1
2
3
4
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
topdown(s) = s ; all(topdown(s))
topdown(try(switch))
43
Mul
Const
3
Const
5 4
Const
Add1
2
3
4
5
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
topdown(s) = s ; all(topdown(s))
topdown(try(switch))
43
Mul
Const
3
Const
5 4
Const
Add1
2
3
4
5
6
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
topdown(s) = s ; all(topdown(s))
topdown(try(switch))
43
Mul
Const
3
Const
5 4
Const
Add1
2
3
4
5
6
7
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
topdown(s) = s ; all(topdown(s))
topdown(try(switch))
43
Mul
Const
3
Const
5 4
Const
Add1
2
3
4
5
6
7
8
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
alltd(s) = s <+ all(alltd(s))
alltd(switch)
44
Const
Mul
Const
3 4 5
Const
Add
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
alltd(s) = s <+ all(alltd(s))
alltd(switch)
44
Const
Mul
Const
3 4 5
Const
Add1
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
alltd(s) = s <+ all(alltd(s))
alltd(switch)
45
Mul
Const
3
Const
4 5
Const
Add1
example
Term Rewriting
Stratego
switch: Mul(e1, e2) -> Mul(e2, e1)
alltd(s) = s <+ all(alltd(s))
alltd(switch)
46
Const
Mul
Const
3 4 5
Const
Add
example
Term Rewriting
Stratego
switch: Mul(e1, e2) -> Mul(e2, e1)
alltd(s) = s <+ all(alltd(s))
alltd(switch)
46
Const
Mul
Const
3 4 5
Const
Add1
example
Term Rewriting
Stratego
switch: Mul(e1, e2) -> Mul(e2, e1)
alltd(s) = s <+ all(alltd(s))
alltd(switch)
46
Const
Mul
Const
3 4 5
Const
Add1
2
example
Term Rewriting
Stratego
switch: Mul(e1, e2) -> Mul(e2, e1)
alltd(s) = s <+ all(alltd(s))
alltd(switch)
46
Const
Mul
Const
3 4 5
Const
Add1
2
3
example
Term Rewriting
Stratego
switch: Mul(e1, e2) -> Mul(e2, e1)
alltd(s) = s <+ all(alltd(s))
alltd(switch)
46
Const
Mul
Const
3 4 5
Const
Add1
2
3
4
example
Term Rewriting
Stratego
switch: Mul(e1, e2) -> Mul(e2, e1)
alltd(s) = s <+ all(alltd(s))
alltd(switch)
47
Const
Mul
Const
3 5 4
Const
Add1
2
3
4
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
bottomup(s) = all(bottomup(s)) ; s
bottomup(switch)
48
Const
Mul
Const
3 4 5
Const
Add
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
bottomup(s) = all(bottomup(s)) ; s
bottomup(switch)
48
Const
Mul
Const
3 4 5
Const
Add1
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
bottomup(s) = all(bottomup(s)) ; s
bottomup(switch)
48
Const
Mul
Const
3 4 5
Const
Add1
2
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
bottomup(s) = all(bottomup(s)) ; s
bottomup(switch)
48
Const
Mul
Const
3 4 5
Const
Add1
2
3
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
bottomup(s) = all(bottomup(s)) ; s
bottomup(try(switch))
49
Const
Mul
Const
3 4 5
Const
Add
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
bottomup(s) = all(bottomup(s)) ; s
bottomup(try(switch))
49
Const
Mul
Const
3 4 5
Const
Add1
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
bottomup(s) = all(bottomup(s)) ; s
bottomup(try(switch))
49
Const
Mul
Const
3 4 5
Const
Add1
2
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
bottomup(s) = all(bottomup(s)) ; s
bottomup(try(switch))
49
Const
Mul
Const
3 4 5
Const
Add1
2
3
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
bottomup(s) = all(bottomup(s)) ; s
bottomup(try(switch))
49
Const
Mul
Const
3 4 5
Const
Add1
2
3
4
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
bottomup(s) = all(bottomup(s)) ; s
bottomup(try(switch))
49
Const
Mul
Const
3 4 5
Const
Add1
2
3
4
5
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
bottomup(s) = all(bottomup(s)) ; s
bottomup(try(switch))
49
Const
Mul
Const
3 4 5
Const
Add1
2
3
4
5
6
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
bottomup(s) = all(bottomup(s)) ; s
bottomup(try(switch))
49
Const
Mul
Const
3 4 5
Const
Add1
2
3
4
5
6
7
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
bottomup(s) = all(bottomup(s)) ; s
bottomup(try(switch))
49
Const
Mul
Const
3 4 5
Const
Add1
2
3
4
5
6
7
8
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
bottomup(s) = all(bottomup(s)) ; s
bottomup(try(switch))
50
Const
Mul
Const
3 4 5
Const
Add1
2
3
4
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
bottomup(s) = all(bottomup(s)) ; s
bottomup(try(switch))
51
Const
Mul
Const
3 5 4
Const
Add1
2
3
4
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
bottomup(s) = all(bottomup(s)) ; s
bottomup(try(switch))
52
Const
Mul
Const
3 5 4
Const
Add1
Mul
Const
3
Const
5 4
Const
Add
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
bottomup(s) = all(bottomup(s)) ; s
bottomup(try(switch))
53
1
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
innermost(s) = bottomup(try(s ; innermost(s)))
innermost(switch)
54
Const
Mul
Const
3 4 5
Const
Add
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
innermost(s) = bottomup(try(s ; innermost(s)))
innermost(switch)
54
Const
Mul
Const
3 4 5
Const
Add1
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
innermost(s) = bottomup(try(s ; innermost(s)))
innermost(switch)
54
Const
Mul
Const
3 4 5
Const
Add1
2
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
innermost(s) = bottomup(try(s ; innermost(s)))
innermost(switch)
54
Const
Mul
Const
3 4 5
Const
Add1
2
3
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
innermost(s) = bottomup(try(s ; innermost(s)))
innermost(switch)
54
Const
Mul
Const
3 4 5
Const
Add1
2
3
4
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
innermost(s) = bottomup(try(s ; innermost(s)))
innermost(switch)
54
Const
Mul
Const
3 4 5
Const
Add1
2
3
4
5
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
innermost(s) = bottomup(try(s ; innermost(s)))
innermost(switch)
54
Const
Mul
Const
3 4 5
Const
Add1
2
3
4
5
6
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
innermost(s) = bottomup(try(s ; innermost(s)))
innermost(switch)
54
Const
Mul
Const
3 4 5
Const
Add1
2
3
4
5
6
7
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
innermost(s) = bottomup(try(s ; innermost(s)))
innermost(switch)
54
Const
Mul
Const
3 4 5
Const
Add1
2
3
4
5
6
7
8
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
innermost(s) = bottomup(try(s ; innermost(s)))
innermost(switch)
55
Const
Mul
Const
3 4 5
Const
Add1
2
3
4
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
innermost(s) = bottomup(try(s ; innermost(s)))
innermost(switch)
56
Const
Mul
Const
3 5 4
Const
Add1
2
3
4
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
innermost(s) = bottomup(try(s ; innermost(s)))
innermost(switch)
56
Const
Mul
Const
3 5 4
Const
Add1
2
3
4
9
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
innermost(s) = bottomup(try(s ; innermost(s)))
innermost(switch)
56
Const
Mul
Const
3 5 4
Const
Add1
2
3
4
9
10
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
innermost(s) = bottomup(try(s ; innermost(s)))
innermost(switch)
56
Const
Mul
Const
3 5 4
Const
Add1
2
3
4
9
10
11
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
innermost(s) = bottomup(try(s ; innermost(s)))
innermost(switch)
56
Const
Mul
Const
3 5 4
Const
Add1
2
3
4
9
10
11
12
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
innermost(s) = bottomup(try(s ; innermost(s)))
innermost(switch)
57
Const
Mul
Const
3 5 4
Const
Add1
2
3
4
example
Term Rewriting
Stratego
switch: Add(e1, e2) -> Add(e2, e1)
switch: Mul(e1, e2) -> Mul(e2, e1)
innermost(s) = bottomup(try(s ; innermost(s)))
innermost(switch)
58
Const
Mul
Const
3 4 5
Const
Add1
2
3
4
lessons learned
Term Rewriting
Summary
59
lessons learned
Term Rewriting
Summary
How do you define AST transformations in Stratego?
• signatures
• rewrite rules
• rewrite strategies
• strategy combinators
59
lessons learned
Term Rewriting
Summary
How do you define AST transformations in Stratego?
• signatures
• rewrite rules
• rewrite strategies
• strategy combinators
What kind of strategies can you find in the Stratego library?
• arithmetics
• map, zip, foldr
• generic traversals
59
learn more
Term Rewriting
Literature
60
learn more
Term Rewriting
Literature
Spoofax
Lennart C. L. Kats, Eelco Visser: The Spoofax Language Workbench.
Rules for Declarative Specification of Languages and IDEs. OOPSLA
2010
http://www.spoofax.org
60
learn more
Term Rewriting
Literature
Spoofax
Lennart C. L. Kats, Eelco Visser: The Spoofax Language Workbench.
Rules for Declarative Specification of Languages and IDEs. OOPSLA
2010
http://www.spoofax.org
Stratego
Martin Bravenboer, Karl Trygve Kalleberg, Rob Vermaas, Eelco Visser:
Stratego/XT 0.17. A language and toolset for program transformation.
Science of Computer Programming, 72(1-2), 2008.
http://www.strategoxt.org
60
Software Languages 61
Except where otherwise noted, this work is licensed under
Software Languages 62
attribution
slide title author license
1, 35 Programming language textbooks K.lee public domain
2 The Bigger Picture F. Delventhal CC BY 2.0
5 Rose 2 des Kleinen Prinzen Antoine Saint-Exupéry public domain
11 Dog and owner on Ballykinler Beach Jonny Green CC BY 2.0
12 Fashionable melange of English words (1) trialsanderrors public domain
13 Gift asenat29 CC BY 2.0
13 Toxic John Morgan CC BY 2.0
14 Latin Grammar Anthony Nelzin
15 Ginkgo Biloba Johann Wolfgang von Goethe public domain
16 Sub-deb slang genibee CC BY-NC 2.0
17 Wednesday Michael Fawcett CC BY-NC-SA 2.0
19, 25, 67 Thesaurus Enoch Lau CC BY-SA 3.0
22
The captured Swiftsure, Seven Oaks, Loyal
George and Convertine brought through
Goeree Gat
Willem van de Velde the Younger public domain
Software Languages 63
Stra
slide title author license
23 Tower of Babel Pieter Bruegel the Elder public domain
26 The Ashtadhyayi translated by Srisa Chandra Vasu public domain
27 Buchdruckerduden public domain
28
Boeing 737-300 -400 -500 Manitenance
Manual Alaska Airlines
Bill Abbott CC BY-SA 2.0
30 Esperanto public domain
31 Quenya Juanma Pérez Rabasco CC BY 2.0
32 Klingon Dictionary Josh Bancroft CC BY-NC 2.0
33 Overweight Na'vi HARRY NGUYEN CC BY 2.0
36, 45, 46 IBM Electronic Data Processing Machine NASA public domain
41 Tiger Bernard Landgraf CC BY-SA 3.0
42 The C Programming Language Bill Bradford CC BY 2.0
43 Italian Java book cover
49-73 PICOL icons Melih Bilgil CC BY 3.0

More Related Content

What's hot

Declare Your Language (at DLS)
Declare Your Language (at DLS)Declare Your Language (at DLS)
Declare Your Language (at DLS)
Eelco Visser
 
Declarative Type System Specification with Statix
Declarative Type System Specification with StatixDeclarative Type System Specification with Statix
Declarative Type System Specification with Statix
Eelco Visser
 

What's hot (20)

Declarative Syntax Definition - Grammars and Trees
Declarative Syntax Definition - Grammars and TreesDeclarative Syntax Definition - Grammars and Trees
Declarative Syntax Definition - Grammars and Trees
 
Introduction - Imperative and Object-Oriented Languages
Introduction - Imperative and Object-Oriented LanguagesIntroduction - Imperative and Object-Oriented Languages
Introduction - Imperative and Object-Oriented Languages
 
Pure and Declarative Syntax Definition: Paradise Lost and Regained
Pure and Declarative Syntax Definition: Paradise Lost and RegainedPure and Declarative Syntax Definition: Paradise Lost and Regained
Pure and Declarative Syntax Definition: Paradise Lost and Regained
 
Syntax Definition
Syntax DefinitionSyntax Definition
Syntax Definition
 
Syntax Definition
Syntax DefinitionSyntax Definition
Syntax Definition
 
Compiler Components and their Generators - Lexical Analysis
Compiler Components and their Generators - Lexical AnalysisCompiler Components and their Generators - Lexical Analysis
Compiler Components and their Generators - Lexical Analysis
 
Compiler Components and their Generators - Traditional Parsing Algorithms
Compiler Components and their Generators - Traditional Parsing AlgorithmsCompiler Components and their Generators - Traditional Parsing Algorithms
Compiler Components and their Generators - Traditional Parsing Algorithms
 
Declare Your Language: Syntactic (Editor) Services
Declare Your Language: Syntactic (Editor) ServicesDeclare Your Language: Syntactic (Editor) Services
Declare Your Language: Syntactic (Editor) Services
 
Declare Your Language: Transformation by Strategic Term Rewriting
Declare Your Language: Transformation by Strategic Term RewritingDeclare Your Language: Transformation by Strategic Term Rewriting
Declare Your Language: Transformation by Strategic Term Rewriting
 
Declare Your Language: Type Checking
Declare Your Language: Type CheckingDeclare Your Language: Type Checking
Declare Your Language: Type Checking
 
Type analysis
Type analysisType analysis
Type analysis
 
Declare Your Language: Name Resolution
Declare Your Language: Name ResolutionDeclare Your Language: Name Resolution
Declare Your Language: Name Resolution
 
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
 
Dynamic Semantics Specification and Interpreter Generation
Dynamic Semantics Specification and Interpreter GenerationDynamic Semantics Specification and Interpreter Generation
Dynamic Semantics Specification and Interpreter Generation
 
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 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 (at DLS)
Declare Your Language (at DLS)Declare Your Language (at DLS)
Declare Your Language (at DLS)
 
CS4200 2019 | Lecture 3 | Parsing
CS4200 2019 | Lecture 3 | ParsingCS4200 2019 | Lecture 3 | Parsing
CS4200 2019 | Lecture 3 | Parsing
 
Declarative Type System Specification with Statix
Declarative Type System Specification with StatixDeclarative Type System Specification with Statix
Declarative Type System Specification with Statix
 
"That scripting language called Prolog"
"That scripting language called Prolog""That scripting language called Prolog"
"That scripting language called Prolog"
 

Similar to Term Rewriting

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
Eelco Visser
 
Ejercicios de estilo en la programación
Ejercicios de estilo en la programaciónEjercicios de estilo en la programación
Ejercicios de estilo en la programación
Software Guru
 
The Magnificent Seven
The Magnificent SevenThe Magnificent Seven
The Magnificent Seven
Mike Fogus
 
Five Languages in a Moment
Five Languages in a MomentFive Languages in a Moment
Five Languages in a Moment
Sergio Gil
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
agnonchik
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
 

Similar to Term Rewriting (20)

Introduction to R programming
Introduction to R programmingIntroduction to R programming
Introduction to R programming
 
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
 
Ejercicios de estilo en la programación
Ejercicios de estilo en la programaciónEjercicios de estilo en la programación
Ejercicios de estilo en la programación
 
The Magnificent Seven
The Magnificent SevenThe Magnificent Seven
The Magnificent Seven
 
Five Languages in a Moment
Five Languages in a MomentFive Languages in a Moment
Five Languages in a Moment
 
Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...
Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...
Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...
 
Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기
 
Alastair Butler - 2015 - Round trips with meaning stopovers
Alastair Butler - 2015 - Round trips with meaning stopoversAlastair Butler - 2015 - Round trips with meaning stopovers
Alastair Butler - 2015 - Round trips with meaning stopovers
 
Python lecture 05
Python lecture 05Python lecture 05
Python lecture 05
 
Pune Clojure Course Outline
Pune Clojure Course OutlinePune Clojure Course Outline
Pune Clojure Course Outline
 
Scope Graphs: A fresh look at name binding in programming languages
Scope Graphs: A fresh look at name binding in programming languagesScope Graphs: A fresh look at name binding in programming languages
Scope Graphs: A fresh look at name binding in programming languages
 
Scala as a Declarative Language
Scala as a Declarative LanguageScala as a Declarative Language
Scala as a Declarative Language
 
R language introduction
R language introductionR language introduction
R language introduction
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Functional Programming Advanced
Functional Programming AdvancedFunctional Programming Advanced
Functional Programming Advanced
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
A Proposition for Business Process Modeling
A Proposition for Business Process ModelingA Proposition for Business Process Modeling
A Proposition for Business Process Modeling
 
R Programming: Export/Output Data In R
R Programming: Export/Output Data In RR Programming: Export/Output Data In R
R Programming: Export/Output Data In R
 
Basics of Python programming (part 2)
Basics of Python programming (part 2)Basics of Python programming (part 2)
Basics of Python programming (part 2)
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 

More from Eelco Visser

More from Eelco Visser (20)

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 2 | syntax-definition
CS4200 2019 | Lecture 2 | syntax-definitionCS4200 2019 | Lecture 2 | syntax-definition
CS4200 2019 | Lecture 2 | syntax-definition
 
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 14 | Interpreters
Compiler Construction | Lecture 14 | InterpretersCompiler Construction | Lecture 14 | Interpreters
Compiler Construction | Lecture 14 | Interpreters
 
Compiler Construction | Lecture 13 | Code Generation
Compiler Construction | Lecture 13 | Code GenerationCompiler Construction | Lecture 13 | Code Generation
Compiler Construction | Lecture 13 | Code Generation
 
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 9 | Constraint Resolution
Compiler Construction | Lecture 9 | Constraint ResolutionCompiler Construction | Lecture 9 | Constraint Resolution
Compiler Construction | Lecture 9 | Constraint Resolution
 
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 4 | Parsing
Compiler Construction | Lecture 4 | Parsing Compiler Construction | Lecture 4 | Parsing
Compiler Construction | Lecture 4 | Parsing
 
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 2 | Declarative Syntax Definition
Compiler Construction | Lecture 2 | Declarative Syntax DefinitionCompiler Construction | Lecture 2 | Declarative Syntax Definition
Compiler Construction | Lecture 2 | Declarative Syntax Definition
 
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
 

Recently uploaded

Recently uploaded (20)

How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
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
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting software
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 

Term Rewriting