equal
deleted
inserted
replaced
176 Context.theory_map o unregister_term_postprocessor_generic |
176 Context.theory_map o unregister_term_postprocessor_generic |
177 |
177 |
178 fun tuple_list_for_name rel_table bounds name = |
178 fun tuple_list_for_name rel_table bounds name = |
179 the (AList.lookup (op =) bounds (the_rel rel_table name)) handle NUT _ => [[]] |
179 the (AList.lookup (op =) bounds (the_rel rel_table name)) handle NUT _ => [[]] |
180 |
180 |
181 fun unarize_unbox_etc_term (Const (@{const_name FinFun}, _) $ t1) = |
181 fun unarize_unbox_etc_term (Const (@{const_name FunBox}, _) $ t1) = |
182 unarize_unbox_etc_term t1 |
|
183 | unarize_unbox_etc_term (Const (@{const_name FunBox}, _) $ t1) = |
|
184 unarize_unbox_etc_term t1 |
182 unarize_unbox_etc_term t1 |
185 | unarize_unbox_etc_term |
183 | unarize_unbox_etc_term |
186 (Const (@{const_name PairBox}, |
184 (Const (@{const_name PairBox}, |
187 Type (@{type_name fun}, [T1, Type (@{type_name fun}, [T2, _])])) |
185 Type (@{type_name fun}, [T1, Type (@{type_name fun}, [T2, _])])) |
188 $ t1 $ t2) = |
186 $ t1 $ t2) = |
557 val seen = seen |> maybe_cyclic ? cons (T, j) |
555 val seen = seen |> maybe_cyclic ? cons (T, j) |
558 val ts = |
556 val ts = |
559 if length arg_Ts = 0 then |
557 if length arg_Ts = 0 then |
560 [] |
558 [] |
561 else |
559 else |
562 map3 (fn Ts => |
560 map3 (fn Ts => term_for_rep true seen Ts Ts) arg_Ts arg_Rs |
563 term_for_rep (constr_s <> @{const_name FinFun}) |
561 arg_jsss |
564 seen Ts Ts) arg_Ts arg_Rs arg_jsss |
|
565 |> mk_tuple (HOLogic.mk_tupleT uncur_arg_Ts) |
562 |> mk_tuple (HOLogic.mk_tupleT uncur_arg_Ts) |
566 |> dest_n_tuple (length uncur_arg_Ts) |
563 |> dest_n_tuple (length uncur_arg_Ts) |
567 val t = |
564 val t = |
568 if constr_s = @{const_name Abs_Frac} then |
565 if constr_s = @{const_name Abs_Frac} then |
569 case ts of |
566 case ts of |
933 end |
930 end |
934 fun pretty_for_datatype ({typ, card, complete, ...} : datatype_spec) = |
931 fun pretty_for_datatype ({typ, card, complete, ...} : datatype_spec) = |
935 Pretty.block (Pretty.breaks |
932 Pretty.block (Pretty.breaks |
936 (pretty_for_type ctxt typ :: |
933 (pretty_for_type ctxt typ :: |
937 (case typ of |
934 (case typ of |
938 Type (@{type_name fin_fun}, _) => [Pretty.str "[finite]"] |
935 Type (@{type_name fun_box}, _) => [Pretty.str "[boxed]"] |
939 | Type (@{type_name fun_box}, _) => [Pretty.str "[boxed]"] |
|
940 | Type (@{type_name pair_box}, _) => [Pretty.str "[boxed]"] |
936 | Type (@{type_name pair_box}, _) => [Pretty.str "[boxed]"] |
941 | _ => []) @ |
937 | _ => []) @ |
942 [Pretty.str "=", |
938 [Pretty.str "=", |
943 Pretty.enum "," "{" "}" |
939 Pretty.enum "," "{" "}" |
944 (map (Syntax.pretty_term ctxt) (all_values card typ) @ |
940 (map (Syntax.pretty_term ctxt) (all_values card typ) @ |