$v$ | ::= |
$() \;\;|\;\; n \in \mathbb{N} \;\;|\;\; l \in L \;\;|\;\; \mu_{ptr} f. \lambda \overrightarrow{x}. t$ |
$b$ | ::= |
$\overrightarrow{v} \;\;|\;\; \emptyset $ |
$\odot$ | ::= |
$+\;\;|\;\;-\;\;|\;\;\times$ |
$t$ | ::= |
$v \;\;|\;\; x \;\;|\;\; t \odot x \;\;|\;\; (t\;\overrightarrow{u})_{ptr}$ |
$\text{alloc}\;t\;\;|\;\;t[t]\;\;|\;\;t[t]\gets t\;|$ | ||
$\text{let}\;x=t\;\text{in}\;t$ | ||
$\text{if}\;t\;\text{then}\;t\;\text{else}\;t$ |
let x = alloc 2 in
x[0] ← 5
x[1] ← 15
...
let y = alloc 1 in
y[0] ← x[0] + x[1]
... // x is not used again
x
?
let x = alloc 2 in
x[0] ← 5
x[1] ← 15
...
let y = alloc 1 in
y[0] ← x[0] + x[1]
...
y[0] ← x[0] + x[1]
let x = alloc 2 in
x[0] ← 5
x[1] ← 15
...
let y = alloc 1 in
y[0] ← x[0] + x[1]
...
y[0] ← x[0] + x[1]
y[0] ← x[0] + x[1]