equal
deleted
inserted
replaced
43 Pretty.blk (1, Pretty.str "(" :: pretty_facts ctxt facts @ [Pretty.str ")"])]); |
43 Pretty.blk (1, Pretty.str "(" :: pretty_facts ctxt facts @ [Pretty.str ")"])]); |
44 |
44 |
45 fun name_results "" res = res |
45 fun name_results "" res = res |
46 | name_results name res = |
46 | name_results name res = |
47 let |
47 let |
48 val n = length (List.concat (map #2 res)); |
48 val n = length (List.concat (map snd res)); |
49 fun name_res (a, ths) i = |
49 fun name_res (a, ths) i = |
50 let |
50 let |
51 val m = length ths; |
51 val m = length ths; |
52 val j = i + m; |
52 val j = i + m; |
53 in |
53 in |
55 else if m = n then ((name, ths), j) |
55 else if m = n then ((name, ths), j) |
56 else if m = 1 then |
56 else if m = 1 then |
57 ((PureThy.string_of_thmref (NameSelection (name, [Single i])), ths), j) |
57 ((PureThy.string_of_thmref (NameSelection (name, [Single i])), ths), j) |
58 else ((PureThy.string_of_thmref (NameSelection (name, [FromTo (i, j - 1)])), ths), j) |
58 else ((PureThy.string_of_thmref (NameSelection (name, [FromTo (i, j - 1)])), ths), j) |
59 end; |
59 end; |
60 in #1 (fold_map name_res res 1) end; |
60 in fst (fold_map name_res res 1) end; |
61 |
61 |
62 in |
62 in |
63 |
63 |
64 fun print_results true = Pretty.writeln oo pretty_results |
64 fun print_results true = Pretty.writeln oo pretty_results |
65 | print_results false = K (K ()); |
65 | print_results false = K (K ()); |