equal
deleted
inserted
replaced
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) = |