src/HOL/Tools/Nitpick/nitpick_rep.ML
changeset 46085 447cda88adfe
parent 46083 efeaa79f021b
child 55889 6bfbec3dff62
equal deleted inserted replaced
46084:dd7fb9e651ad 46085:447cda88adfe
   232   | _ => raise REP ("Nitpick_Rep.card_of_domain_from_rep", [R])
   232   | _ => raise REP ("Nitpick_Rep.card_of_domain_from_rep", [R])
   233 
   233 
   234 fun rep_to_binary_rel_rep ofs T R =
   234 fun rep_to_binary_rel_rep ofs T R =
   235   let
   235   let
   236     val k = exact_root 2 (card_of_domain_from_rep 2 R)
   236     val k = exact_root 2 (card_of_domain_from_rep 2 R)
   237     val j0 = offset_of_type ofs (fst (HOLogic.dest_prodT (domain_type T)))
   237     val j0 =
       
   238       offset_of_type ofs (fst (HOLogic.dest_prodT (pseudo_domain_type T)))
   238   in Func (Struct [Atom (k, j0), Atom (k, j0)], Formula Neut) end
   239   in Func (Struct [Atom (k, j0), Atom (k, j0)], Formula Neut) end
   239 
   240 
   240 fun best_one_rep_for_type (scope as {card_assigns, ...} : scope)
   241 fun best_one_rep_for_type (scope as {card_assigns, ...} : scope)
   241                           (Type (@{type_name fun}, [T1, T2])) =
   242                           (Type (@{type_name fun}, [T1, T2])) =
   242     Vect (card_of_type card_assigns T1, (best_one_rep_for_type scope T2))
   243     Vect (card_of_type card_assigns T1, (best_one_rep_for_type scope T2))