Modify runtime sketch to define procedures as closures.