doc-src/IsarAdvanced/Codegen/Thy/examples/lookup.ML
author krauss
Fri, 22 Jun 2007 10:23:37 +0200
changeset 23473 997bca36d4fe
parent 21994 dfa5133dbe73
permissions -rw-r--r--
new method "elim_to_cases" provides ad-hoc conversion of obtain-style elimination goals to a disjunction of existentials.

structure ROOT = 
struct

structure Codegen = 
struct

fun lookup ((k, v) :: xs) l =
  (if ((k : string) = l) then SOME v else lookup xs l)
  | lookup [] l = NONE;

end; (*struct Codegen*)

end; (*struct ROOT*)