src/HOL/Nitpick.thy
 changeset 33556 cba22e2999d5 parent 33192 08a39a957ed7 child 33561 ab01b72715ef
```     1.1 --- a/src/HOL/Nitpick.thy	Tue Oct 27 15:55:36 2009 +0100
1.2 +++ b/src/HOL/Nitpick.thy	Tue Oct 27 16:52:06 2009 +0100
1.3 @@ -28,7 +28,6 @@
1.4
1.5  typedecl bisim_iterator
1.6
1.7 -(* FIXME: use axiomatization (here and elsewhere) *)
1.8  axiomatization unknown :: 'a
1.9             and undefined_fast_The :: 'a
1.10             and undefined_fast_Eps :: 'a
1.11 @@ -118,12 +117,16 @@
1.12   apply (simp only: unit.cases)
1.13  by simp
1.14
1.15 +declare unit.cases [nitpick_simp del]
1.16 +
1.17  lemma nat_case_def [nitpick_def]:
1.18  "nat_case x f n \<equiv> if n = 0 then x else f (n - 1)"
1.19  apply (rule eq_reflection)
1.20  by (case_tac n) auto
1.21
1.22 -lemmas dvd_def = dvd_eq_mod_eq_0 [THEN eq_reflection, nitpick_def]
1.23 +declare nat.cases [nitpick_simp del]
1.24 +
1.25 +lemmas [nitpick_def] = dvd_eq_mod_eq_0 [THEN eq_reflection]
1.26
1.27  lemma list_size_simp [nitpick_simp]:
1.28  "list_size f xs = (if xs = [] then 0
1.29 @@ -207,6 +210,21 @@
1.30  definition of_frac :: "'a \<Rightarrow> 'b\<Colon>{inverse,ring_1}" where
1.31  "of_frac q \<equiv> of_int (num q) / of_int (denom q)"
1.32
1.33 +(* While Nitpick normally avoids to unfold definitions for locales, it
1.34 +   unfortunately needs to unfold them when dealing with the following built-in
1.35 +   constants. A cleaner approach would be to change "Nitpick_HOL" and
1.36 +   "Nitpick_Nits" so that they handle the unexpanded overloaded constants
1.37 +   directly, but this is slightly more tricky to implement. *)
1.38 +lemmas [nitpick_def] = div_int_inst.div_int div_int_inst.mod_int
1.39 +    div_nat_inst.div_nat div_nat_inst.mod_nat lower_semilattice_fun_inst.inf_fun
1.40 +    minus_fun_inst.minus_fun minus_int_inst.minus_int minus_nat_inst.minus_nat
1.41 +    one_int_inst.one_int one_nat_inst.one_nat ord_fun_inst.less_eq_fun
1.42 +    ord_int_inst.less_eq_int ord_int_inst.less_int ord_nat_inst.less_eq_nat
1.43 +    ord_nat_inst.less_nat plus_int_inst.plus_int plus_nat_inst.plus_nat
1.44 +    times_int_inst.times_int times_nat_inst.times_nat uminus_int_inst.uminus_int
1.45 +    upper_semilattice_fun_inst.sup_fun zero_int_inst.zero_int
1.46 +    zero_nat_inst.zero_nat
1.47 +
1.48  use "Tools/Nitpick/kodkod.ML"
1.49  use "Tools/Nitpick/kodkod_sat.ML"
1.50  use "Tools/Nitpick/nitpick_util.ML"
1.51 @@ -231,10 +249,10 @@
1.52  hide (open) type bisim_iterator pair_box fun_box
1.53  hide (open) fact If_def Ex1_def rtrancl_def rtranclp_def tranclp_def refl'_def
1.54      wf'_def wf_wfrec'_def wfrec'_def card'_def setsum'_def fold_graph'_def
1.55 -    The_psimp Eps_psimp unit_case_def nat_case_def dvd_def list_size_simp
1.56 -    nat_gcd_def nat_lcm_def int_gcd_def int_lcm_def Frac_def zero_frac_def
1.57 -    one_frac_def num_def denom_def norm_frac_def frac_def plus_frac_def
1.58 -    times_frac_def uminus_frac_def number_of_frac_def inverse_frac_def
1.59 -    less_eq_frac_def of_frac_def
1.60 +    The_psimp Eps_psimp unit_case_def nat_case_def list_size_simp nat_gcd_def
1.61 +    nat_lcm_def int_gcd_def int_lcm_def Frac_def zero_frac_def one_frac_def
1.62 +    num_def denom_def norm_frac_def frac_def plus_frac_def times_frac_def
1.63 +    uminus_frac_def number_of_frac_def inverse_frac_def less_eq_frac_def
1.64 +    of_frac_def
1.65
1.66  end
```