src/HOL/Tools/Predicate_Compile/code_prolog.ML
changeset 61424 c3658c18b7bc
parent 61268 abe08fb15a12
child 62519 a564458f94db
equal deleted inserted replaced
61423:9b6a0fb85fa3 61424:c3658c18b7bc
   954     val options = code_options_of (Proof_Context.theory_of ctxt)
   954     val options = code_options_of (Proof_Context.theory_of ctxt)
   955     val split =
   955     val split =
   956       (case t_compr of
   956       (case t_compr of
   957         (Const (@{const_name Collect}, _) $ t) => t
   957         (Const (@{const_name Collect}, _) $ t) => t
   958       | _ => error ("Not a set comprehension: " ^ Syntax.string_of_term ctxt t_compr))
   958       | _ => error ("Not a set comprehension: " ^ Syntax.string_of_term ctxt t_compr))
   959     val (body, Ts, fp) = HOLogic.strip_psplits split
   959     val (body, Ts, fp) = HOLogic.strip_ptupleabs split
   960     val output_names = Name.variant_list (Term.add_free_names body [])
   960     val output_names = Name.variant_list (Term.add_free_names body [])
   961       (map (fn i => "x" ^ string_of_int i) (1 upto length Ts))
   961       (map (fn i => "x" ^ string_of_int i) (1 upto length Ts))
   962     val output_frees = rev (map2 (curry Free) output_names Ts)
   962     val output_frees = rev (map2 (curry Free) output_names Ts)
   963     val body = subst_bounds (output_frees, body)
   963     val body = subst_bounds (output_frees, body)
   964     val (pred as Const (name, T), all_args) =
   964     val (pred as Const (name, T), all_args) =