doc-src/IsarAdvanced/Codegen/Thy/examples/bool_literal.ML
author urbanc
Fri, 17 Nov 2006 17:32:30 +0100
changeset 21405 26b51f724fe6
parent 21341 3844037a8e2d
child 21993 4b802a9e0738
permissions -rw-r--r--
added an intro lemma for freshness of products; set up the simplifier so that it can deal with the compact and long notation for freshness constraints (FIXME: it should also be able to deal with the special case of freshness of atoms)

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