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

structure ROOT = 
struct

structure Orderings = 
struct

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

end; (*struct Orderings*)

structure Code_Generator = 
struct

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

end; (*struct Code_Generator*)

structure Codegen = 
struct

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

end; (*struct Codegen*)

end; (*struct ROOT*)