doc-src/IsarAdvanced/Codegen/Thy/examples/lexicographic.ML
author haftmann
Tue, 05 Jun 2007 15:16:08 +0200
changeset 23247 b99dce43d252
parent 23107 0c3c55b7c98f
child 23250 9886802cbbd6
permissions -rw-r--r--
merged Code_Generator.thy into HOL.thy

structure ROOT = 
struct

structure Orderings = 
struct

type 'a ord = {less_eq : 'a -> 'a -> bool, less : 'a -> 'a -> bool};
fun less_eq (A_:'a ord) = #less_eq A_;
fun less (A_:'a ord) = #less A_;

end; (*struct Orderings*)

structure Code_Generator = 
struct

type 'a eq = {eq : 'a -> 'a -> bool};
fun eq (A_:'a eq) = #eq A_;

end; (*struct Code_Generator*)

structure Codegen = 
struct

fun less_eq_product (A1_, A2_) B_ (x1, y1) (x2, y2) =
  Orderings.less A2_ x1 x2 orelse
    Code_Generator.eq A1_ x1 x2 andalso Orderings.less_eq B_ y1 y2;

end; (*struct Codegen*)

end; (*struct ROOT*)