doc-src/IsarAdvanced/Codegen/Thy/examples/bool_literal.ML
author haftmann
Fri, 02 Mar 2007 15:43:17 +0100
changeset 22386 4ebe883b02ff
parent 21994 dfa5133dbe73
child 22479 de15ea8fb348
permissions -rw-r--r--
new code theorems

structure ROOT = 
struct

structure HOL = 
struct

datatype boola = True | False;

fun op_conj y True = y
  | op_conj x False = False
  | op_conj True y = y
  | op_conj False x = False;

end; (*struct HOL*)

structure Nat = 
struct

datatype nat = Zero_nat | Suc of nat;

fun less_nat n (Suc m) = less_eq_nat n m
  | less_nat n Zero_nat = HOL.False
and less_eq_nat (Suc n) m = less_nat n m
  | less_eq_nat Zero_nat m = HOL.True;

end; (*struct Nat*)

structure Codegen = 
struct

fun in_interval (k, l) n =
  HOL.op_conj (Nat.less_eq_nat k n) (Nat.less_eq_nat n l);

end; (*struct Codegen*)

end; (*struct ROOT*)