k4st
public c v1 · immutable/*Given:f(x) => do: x = x+1 return x*2;y = 10We want: global context+-----------------------------------------------------------------------------| +-------------+ |-| Identifiers |-> *hash table*| +-------------+ | | +-------------+ |-| Statements |-> *function context*| +-------------+ +--------------------------------------------------------+| | +-------------+ +---------+ || |-| Identifiers |-> *hash table* | 1 | || | +-------------+ | / | || | | + | || | +-------------+ +-----------+ | / \ | || |-| Statements |-> | Statement |-| = x | || | +-------------+ +-----------+ | \ | || | | | x | || | | +---------+ || | | || | | || | | || | | +---------------+ || | \|/ | 2 | || | +-----------+ | / | || | | Statement |-| return - * | || | +-----------+ | \ | || | | x | || | +---------------+ || +--------------------------------------------------------+| || || || \|/| +-----------+| | Statement | ...| +-----------+*/