doc-src/Tutorial/CodeGen/exec
author wenzelm
Fri, 21 Dec 2001 23:16:17 +0100
changeset 12587 3f3d2ffb5df5
parent 5377 efb799c5ed3c
permissions -rw-r--r--
HOL/record: shared operations ("more", "fields", etc.) now need to be always qualified;

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)"