--- a/Nominal/Nominal2.thy Wed Dec 22 12:47:09 2010 +0000
+++ b/Nominal/Nominal2.thy Wed Dec 22 21:13:32 2010 +0000
@@ -44,11 +44,26 @@
| mk_union_env tys (t1, @{term "set ([]::atom list)"}) = t1
| mk_union_env tys (@{term "set ([]::atom list)"}, t2) = t2
| mk_union_env tys (t1, t2) = mk_binop_env tys @{const_name "sup"} (t1, t2)
+*}
-fun fold_union_env tys trms = fold_rev (curry (mk_union_env tys)) trms @{term "{}::atom set"}
+ML {*
+fun fold_left f [] z = z
+ | fold_left f [x] z = x
+ | fold_left f (x :: y :: xs) z = fold_left f (f (x, y) :: xs) z
+*}
+ML {*
+fun fold_union_env tys trms = fold_left (mk_union_env tys) trms @{term "{}::atom set"}
*}
+ML {*
+fold_union_env [] [@{term "t1::atom set"}, @{term "t2::atom set"}, @{term "t3::atom set"}]
+|> Syntax.string_of_term @{context}
+|> writeln
+*}
+
+
+
ML {*
fun process_ecase lthy c (params, prems, concl) bclauses =