src/HOL/Tools/Nitpick/nitpick_hol.ML
changeset 59038 e50f1973cb0a
parent 58843 521cea5fa777
child 59058 a78612c67ec0
equal deleted inserted replaced
59037:650dcf624729 59038:e50f1973cb0a
   413    ((@{const_name times_class.times}, int_T --> int_T --> int_T), 0),
   413    ((@{const_name times_class.times}, int_T --> int_T --> int_T), 0),
   414    ((@{const_name div_class.div}, int_T --> int_T --> int_T), 0),
   414    ((@{const_name div_class.div}, int_T --> int_T --> int_T), 0),
   415    ((@{const_name uminus_class.uminus}, int_T --> int_T), 0),
   415    ((@{const_name uminus_class.uminus}, int_T --> int_T), 0),
   416    ((@{const_name ord_class.less}, int_T --> int_T --> bool_T), 2),
   416    ((@{const_name ord_class.less}, int_T --> int_T --> bool_T), 2),
   417    ((@{const_name ord_class.less_eq}, int_T --> int_T --> bool_T), 2)]
   417    ((@{const_name ord_class.less_eq}, int_T --> int_T --> bool_T), 2)]
   418 val built_in_set_like_consts =
       
   419   [(@{const_name ord_class.less_eq}, 2)]
       
   420 
   418 
   421 fun unarize_type @{typ "unsigned_bit word"} = nat_T
   419 fun unarize_type @{typ "unsigned_bit word"} = nat_T
   422   | unarize_type @{typ "signed_bit word"} = int_T
   420   | unarize_type @{typ "signed_bit word"} = int_T
   423   | unarize_type (Type (s, Ts as _ :: _)) = Type (s, map unarize_type Ts)
   421   | unarize_type (Type (s, Ts as _ :: _)) = Type (s, map unarize_type Ts)
   424   | unarize_type T = T
   422   | unarize_type T = T
  1380         SOME n => SOME n
  1378         SOME n => SOME n
  1381       | NONE =>
  1379       | NONE =>
  1382         case s of
  1380         case s of
  1383           @{const_name zero_class.zero} => if is_iterator_type T then SOME 0 else NONE
  1381           @{const_name zero_class.zero} => if is_iterator_type T then SOME 0 else NONE
  1384         | @{const_name Suc} => if is_iterator_type (domain_type T) then SOME 0 else NONE
  1382         | @{const_name Suc} => if is_iterator_type (domain_type T) then SOME 0 else NONE
  1385         | _ => if is_fun_type T andalso is_set_like_type (domain_type T) then
  1383         | _ => NONE
  1386                  AList.lookup (op =) built_in_set_like_consts s
       
  1387                else
       
  1388                  NONE
       
  1389 
  1384 
  1390 val is_built_in_const = is_some o arity_of_built_in_const
  1385 val is_built_in_const = is_some o arity_of_built_in_const
  1391 
  1386 
  1392 (* This function is designed to work for both real definition axioms and
  1387 (* This function is designed to work for both real definition axioms and
  1393    simplification rules (equational specifications). *)
  1388    simplification rules (equational specifications). *)