doc-src/Codegen/Thy/examples/bool_infix.ML
author haftmann
Tue, 03 Mar 2009 11:00:51 +0100
changeset 30209 2f4684e2ea95
parent 26318 doc-src/IsarAdvanced/Codegen/Thy/examples/bool_infix.ML@967323f93c67
permissions -rw-r--r--
more canonical directory structure of manuals
haftmann@21341
     1
structure Nat = 
haftmann@21341
     2
struct
haftmann@21341
     3
haftmann@24421
     4
datatype nat = Suc of nat | Zero_nat;
haftmann@21341
     5
wenzelm@26318
     6
fun less_nat m (Suc n) = less_eq_nat m n
haftmann@21994
     7
  | less_nat n Zero_nat = false
wenzelm@26318
     8
and less_eq_nat (Suc m) n = less_nat m n
wenzelm@26318
     9
  | less_eq_nat Zero_nat n = true;
haftmann@21341
    10
haftmann@21341
    11
end; (*struct Nat*)
haftmann@21341
    12
haftmann@21341
    13
structure Codegen = 
haftmann@21341
    14
struct
haftmann@21341
    15
haftmann@21994
    16
fun in_interval (k, l) n =
haftmann@22015
    17
  Nat.less_eq_nat k n andalso Nat.less_eq_nat n l;
haftmann@21341
    18
haftmann@21341
    19
end; (*struct Codegen*)