doc-src/IsarAdvanced/Codegen/Thy/examples/bool_literal.ML
author berghofe
Wed, 07 Feb 2007 17:30:53 +0100
changeset 22264 6a65e9b2ae05
parent 21994 dfa5133dbe73
child 22386 4ebe883b02ff
permissions -rw-r--r--
Theorems for converting between wf and wfP are now declared as hints.

structure ROOT = 
struct

structure HOL = 
struct

datatype boola = True | False;

fun nota False = True
  | nota 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 Zero_nat (Suc n) = HOL.True
  | less_nat n Zero_nat = HOL.False
  | less_nat (Suc m) (Suc n) = less_nat m n;

fun less_eq_nat m n = HOL.nota (less_nat n m);

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