doc-src/IsarAdvanced/Codegen/Thy/examples/lexicographic.ML
author berghofe
Wed, 07 May 2008 10:56:52 +0200
changeset 26803 0af0f674845d
parent 26513 6f306c8c2c54
permissions -rw-r--r--
- Explicitely passed pred_subset_eq and pred_equals_eq as an argument to the to_set and to_pred attributes, because it is no longer applied automatically - Manually applied predicate1I in proof of accp_subset, because it is no longer part of the claset - Replaced psubset_def by less_le
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23250
9886802cbbd6 updated documentation
haftmann
parents: 23107
diff changeset
     1
structure HOL = 
9886802cbbd6 updated documentation
haftmann
parents: 23107
diff changeset
     2
struct
9886802cbbd6 updated documentation
haftmann
parents: 23107
diff changeset
     3
26513
6f306c8c2c54 explicit class "eq" for operational equality
haftmann
parents: 24421
diff changeset
     4
type 'a eq = {eq : 'a -> 'a -> bool};
6f306c8c2c54 explicit class "eq" for operational equality
haftmann
parents: 24421
diff changeset
     5
fun eq (A_:'a eq) = #eq A_;
23250
9886802cbbd6 updated documentation
haftmann
parents: 23107
diff changeset
     6
22386
4ebe883b02ff new code theorems
haftmann
parents: 22188
diff changeset
     7
type 'a ord = {less_eq : 'a -> 'a -> bool, less : 'a -> 'a -> bool};
4ebe883b02ff new code theorems
haftmann
parents: 22188
diff changeset
     8
fun less_eq (A_:'a ord) = #less_eq A_;
4ebe883b02ff new code theorems
haftmann
parents: 22188
diff changeset
     9
fun less (A_:'a ord) = #less A_;
21147
737a94f047e3 continued tutorial
haftmann
parents:
diff changeset
    10
24193
926dde4d96de updated
haftmann
parents: 23850
diff changeset
    11
end; (*struct HOL*)
21147
737a94f047e3 continued tutorial
haftmann
parents:
diff changeset
    12
737a94f047e3 continued tutorial
haftmann
parents:
diff changeset
    13
structure Codegen = 
737a94f047e3 continued tutorial
haftmann
parents:
diff changeset
    14
struct
737a94f047e3 continued tutorial
haftmann
parents:
diff changeset
    15
24421
acfb2413faa3 updated
haftmann
parents: 24193
diff changeset
    16
fun less_eq (A1_, A2_) B_ (x1, y1) (x2, y2) =
26513
6f306c8c2c54 explicit class "eq" for operational equality
haftmann
parents: 24421
diff changeset
    17
  HOL.less A2_ x1 x2 orelse HOL.eq A1_ x1 x2 andalso HOL.less_eq B_ y1 y2;
21147
737a94f047e3 continued tutorial
haftmann
parents:
diff changeset
    18
737a94f047e3 continued tutorial
haftmann
parents:
diff changeset
    19
end; (*struct Codegen*)