author | wenzelm |
Mon, 09 Jul 2007 11:44:20 +0200 | |
changeset 23660 | 18765718cf62 |
parent 23250 | 9886802cbbd6 |
child 23850 | f1434532a562 |
permissions | -rw-r--r-- |
21147 | 1 |
structure ROOT = |
2 |
struct |
|
3 |
||
23250 | 4 |
structure HOL = |
21147 | 5 |
struct |
6 |
||
23107 | 7 |
type 'a eq = {eq : 'a -> 'a -> bool}; |
8 |
fun eq (A_:'a eq) = #eq A_; |
|
21147 | 9 |
|
23250 | 10 |
end; (*struct HOL*) |
21147 | 11 |
|
12 |
structure List = |
|
13 |
struct |
|
14 |
||
23250 | 15 |
fun memberl A_ x (y :: ys) = HOL.eq A_ x y orelse memberl A_ x ys |
22188
a63889770d57
adjusted manual to improved treatment of overloaded constants
haftmann
parents:
22015
diff
changeset
|
16 |
| memberl A_ x [] = false; |
21147 | 17 |
|
18 |
end; (*struct List*) |
|
19 |
||
20 |
structure Codegen = |
|
21 |
struct |
|
22 |
||
22798 | 23 |
fun collect_duplicates B_ xs ys (z :: zs) = |
24 |
(if List.memberl B_ z xs |
|
25 |
then (if List.memberl B_ z ys then collect_duplicates B_ xs ys zs |
|
26 |
else collect_duplicates B_ xs (z :: ys) zs) |
|
27 |
else collect_duplicates B_ (z :: xs) (z :: ys) zs) |
|
28 |
| collect_duplicates B_ xs ys [] = xs; |
|
21147 | 29 |
|
30 |
end; (*struct Codegen*) |
|
31 |
||
32 |
end; (*struct ROOT*) |