src/HOL/Tools/Predicate_Compile/predicate_compile_core.ML
changeset 33525 05c384cb1181
parent 33487 6fe8b9baf4db
child 33526 1a989c0b80d0
equal deleted inserted replaced
33512:771ec7306438 33525:05c384cb1181
  2552     val t_eval = if null outargs then t_pred else
  2552     val t_eval = if null outargs then t_pred else
  2553       let
  2553       let
  2554         val outargs_bounds = map (fn Bound i => i) outargs;
  2554         val outargs_bounds = map (fn Bound i => i) outargs;
  2555         val outargsTs = map (nth Ts) outargs_bounds;
  2555         val outargsTs = map (nth Ts) outargs_bounds;
  2556         val T_pred = HOLogic.mk_tupleT outargsTs;
  2556         val T_pred = HOLogic.mk_tupleT outargsTs;
  2557         val T_compr = HOLogic.mk_ptupleT fp Ts;
  2557         val T_compr = HOLogic.mk_ptupleT fp (rev Ts);
  2558         val arrange_bounds = map_index I outargs_bounds
  2558         val k = length outargs - 1;
       
  2559         val arrange_bounds = map_index (fn (i, j) => (k-i, k-j)) outargs_bounds
  2559           |> sort (prod_ord (K EQUAL) int_ord)
  2560           |> sort (prod_ord (K EQUAL) int_ord)
  2560           |> map fst;
  2561           |> map fst;
  2561         val arrange = funpow (length outargs_bounds - 1) HOLogic.mk_split
  2562         val (outargsTs', outargsT) = split_last outargsTs;
  2562           (Term.list_abs (map (pair "") outargsTs,
  2563         val (arrange, _) = fold_rev (fn U => fn (t, T) =>
  2563             HOLogic.mk_ptuple fp T_compr (map Bound arrange_bounds)))
  2564             (HOLogic.split_const (U, T, T_compr) $ Abs ("", U, t),
       
  2565              HOLogic.mk_prodT (U, T)))
       
  2566           outargsTs' (Abs ("", outargsT,
       
  2567             HOLogic.mk_ptuple fp T_compr (map Bound arrange_bounds)), outargsT)
  2564       in mk_map compfuns T_pred T_compr arrange t_pred end
  2568       in mk_map compfuns T_pred T_compr arrange t_pred end
  2565   in t_eval end;
  2569   in t_eval end;
  2566 
  2570 
  2567 fun eval thy param_user_modes (options as (depth_limit, (random, annotated))) t_compr =
  2571 fun eval thy param_user_modes (options as (depth_limit, (random, annotated))) t_compr =
  2568   let
  2572   let