improving the compilation to handle predicate arguments in higher-order argument positions
--- a/src/HOL/Tools/Predicate_Compile/predicate_compile_core.ML Wed Sep 29 10:33:15 2010 +0200
+++ b/src/HOL/Tools/Predicate_Compile/predicate_compile_core.ML Wed Sep 29 10:33:15 2010 +0200
@@ -1696,7 +1696,13 @@
ctxt name mode,
Comp_Mod.funT_of compilation_modifiers mode T)))
| (Free (s, T), Context m) =>
- SOME (Free (s, Comp_Mod.funT_of compilation_modifiers m T))
+ (case (AList.lookup (op =) param_modes s) of
+ SOME mode => SOME (Free (s, Comp_Mod.funT_of compilation_modifiers m T))
+ | NONE =>
+ let
+ val bs = map (pair "x") (binder_types (fastype_of t))
+ val bounds = map Bound (rev (0 upto (length bs) - 1))
+ in SOME (list_abs (bs, mk_if compfuns (list_comb (t, bounds)))) end)
| (t, Context m) =>
let
val bs = map (pair "x") (binder_types (fastype_of t))