doc-src/IsarAdvanced/Codegen/Thy/examples/class.ML
author berghofe
Fri, 20 Apr 2007 16:11:17 +0200
changeset 22755 e268f608669a
parent 22751 1bfd75c1f232
child 22798 e3962371f568
permissions -rw-r--r--
Modified eqvt_tac to avoid failure due to introduction rules whose premises contain variables that do not occur in the conclusion.

structure ROOT = 
struct

structure Nat = 
struct

datatype nat = Zero_nat | Suc of nat;

end; (*struct Nat*)

structure Codegen = 
struct

type 'a null = {null : 'a};
fun null (A_:'a null) = #null A_;

fun head A_ (x :: xs) = x
  | head A_ [] = null A_;

val null_option : 'a option = NONE;

fun null_optiona () = {null = null_option} : ('b option) null;

val dummy : Nat.nat option =
  head (null_optiona ()) [SOME (Nat.Suc Nat.Zero_nat), NONE];

end; (*struct Codegen*)

end; (*struct ROOT*)