src/HOL/Tools/Nitpick/nitpick_scope.ML
changeset 39118 12f3788be67b
parent 38240 a44d108a8d39
child 41052 3db267a01c1d
equal deleted inserted replaced
39117:399977145846 39118:12f3788be67b
   140 fun spec_of_type ({card_assigns, ofs, ...} : scope) T =
   140 fun spec_of_type ({card_assigns, ofs, ...} : scope) T =
   141   (card_of_type card_assigns T
   141   (card_of_type card_assigns T
   142    handle TYPE ("Nitpick_HOL.card_of_type", _, _) => ~1, offset_of_type ofs T)
   142    handle TYPE ("Nitpick_HOL.card_of_type", _, _) => ~1, offset_of_type ofs T)
   143 
   143 
   144 fun quintuple_for_scope code_type code_term code_string
   144 fun quintuple_for_scope code_type code_term code_string
   145         ({hol_ctxt = {ctxt, stds, ...}, card_assigns, bits, bisim_depth,
   145         ({hol_ctxt = {ctxt = ctxt0, stds, ...}, card_assigns, bits, bisim_depth,
   146          datatypes, ...} : scope) =
   146          datatypes, ...} : scope) =
   147   let
   147   let
       
   148     val ctxt = set_show_all_types ctxt0
   148     val boring_Ts = [@{typ unsigned_bit}, @{typ signed_bit},
   149     val boring_Ts = [@{typ unsigned_bit}, @{typ signed_bit},
   149                      @{typ bisim_iterator}]
   150                      @{typ bisim_iterator}]
   150     val (iter_assigns, card_assigns) =
   151     val (iter_assigns, card_assigns) =
   151       card_assigns |> filter_out (member (op =) boring_Ts o fst)
   152       card_assigns |> filter_out (member (op =) boring_Ts o fst)
   152                    |> List.partition (is_fp_iterator_type o fst)
   153                    |> List.partition (is_fp_iterator_type o fst)
   173       (if bits = 0 then []
   174       (if bits = 0 then []
   174        else [code_string ("bits = " ^ string_of_int bits)]) @
   175        else [code_string ("bits = " ^ string_of_int bits)]) @
   175       (if bisim_depth < 0 andalso forall (not o #co) datatypes then []
   176       (if bisim_depth < 0 andalso forall (not o #co) datatypes then []
   176        else [code_string ("bisim_depth = " ^ signed_string_of_int bisim_depth)])
   177        else [code_string ("bisim_depth = " ^ signed_string_of_int bisim_depth)])
   177   in
   178   in
   178     setmp_show_all_types
   179     (cards primary_card_assigns, cards secondary_card_assigns,
   179         (fn () => (cards primary_card_assigns, cards secondary_card_assigns,
   180      maxes (), iters (), miscs ())
   180                    maxes (), iters (), miscs ())) ()
       
   181   end
   181   end
   182 
   182 
   183 fun pretties_for_scope scope verbose =
   183 fun pretties_for_scope scope verbose =
   184   let
   184   let
   185     fun standard_blocks s = map (Pretty.block o cons (Pretty.str (s ^ " ")))
   185     fun standard_blocks s = map (Pretty.block o cons (Pretty.str (s ^ " ")))