doc-src/Tutorial/CodeGen/exec
author nipkow
Fri, 09 Oct 1998 11:15:07 +0200
changeset 5626 f67c34721486
parent 5377 efb799c5ed3c
permissions -rw-r--r--
New inductive definition of `card'

consts exec :: ('a => 'v) => 'v list => (('a,'v) instr) list => 'v list
primrec
"exec s vs [] = vs"
"exec s vs (i#is) = (case i of
    Const v  => exec s (v#vs) is
  | Load a   => exec s ((s a)#vs) is
  | Apply f  => exec s ( (f (hd vs) (hd(tl vs)))#(tl(tl vs)) ) is)"