src/HOL/Complex/ex/MIR.thy
changeset 23858 5500610fe1e5
parent 23477 f4b83f03cac9
child 23993 f30b7a652823
equal deleted inserted replaced
23857:ad26287a9ccb 23858:5500610fe1e5
     3 *)
     3 *)
     4 
     4 
     5 header {* Quatifier elimination for R(0,1,+,floor,<) *}
     5 header {* Quatifier elimination for R(0,1,+,floor,<) *}
     6 
     6 
     7 theory MIR
     7 theory MIR
     8   imports Real GCD
     8   imports Real GCD Pretty_Int
     9   uses ("mireif.ML") ("mirtac.ML")
     9   uses ("mireif.ML") ("mirtac.ML")
    10   begin
    10   begin
    11 
    11 
    12 declare real_of_int_floor_cancel [simp del]
    12 declare real_of_int_floor_cancel [simp del]
    13 
    13 
   104   hence "\<forall>x.\<forall>k. ((a::int) dvd (x + t)) = (a dvd (x+k*d + t))"  by simp
   104   hence "\<forall>x.\<forall>k. ((a::int) dvd (x + t)) = (a dvd (x+k*d + t))"  by simp
   105   then show ?thesis by simp
   105   then show ?thesis by simp
   106 qed
   106 qed
   107 
   107 
   108   (* The Divisibility relation between reals *)	
   108   (* The Divisibility relation between reals *)	
   109 consts rdvd:: "real \<Rightarrow> real \<Rightarrow> bool" (infixl 50)
   109 definition
   110 defs rdvd_def: "x rdvd y \<equiv> \<exists> (k::int). y=x*(real k)"
   110   rdvd:: "real \<Rightarrow> real \<Rightarrow> bool" (infixl "rdvd" 50)
       
   111 where
       
   112   rdvd_def: "x rdvd y \<longleftrightarrow> (\<exists>k\<Colon>int. y = x * real k)"
   111 
   113 
   112 lemma int_rdvd_real: 
   114 lemma int_rdvd_real: 
   113   shows "real (i::int) rdvd x = (i dvd (floor x) \<and> real (floor x) = x)" (is "?l = ?r")
   115   shows "real (i::int) rdvd x = (i dvd (floor x) \<and> real (floor x) = x)" (is "?l = ?r")
   114 proof
   116 proof
   115   assume "?l" 
   117   assume "?l" 
   635   "lex_ns (n#ns, m#ms) = (n<m \<or> ((n = m) \<and> lex_ns (ns,ms))) "
   637   "lex_ns (n#ns, m#ms) = (n<m \<or> ((n = m) \<and> lex_ns (ns,ms))) "
   636 constdefs lex_bnd :: "num \<Rightarrow> num \<Rightarrow> bool"
   638 constdefs lex_bnd :: "num \<Rightarrow> num \<Rightarrow> bool"
   637   "lex_bnd t s \<equiv> lex_ns (bnds t, bnds s)"
   639   "lex_bnd t s \<equiv> lex_ns (bnds t, bnds s)"
   638 
   640 
   639 consts 
   641 consts 
   640   numgcd :: "num \<Rightarrow> int"
       
   641   numgcdh:: "num \<Rightarrow> int \<Rightarrow> int"
   642   numgcdh:: "num \<Rightarrow> int \<Rightarrow> int"
   642   reducecoeffh:: "num \<Rightarrow> int \<Rightarrow> num"
   643   reducecoeffh:: "num \<Rightarrow> int \<Rightarrow> num"
   643   reducecoeff :: "num \<Rightarrow> num"
       
   644   dvdnumcoeff:: "num \<Rightarrow> int \<Rightarrow> bool"
   644   dvdnumcoeff:: "num \<Rightarrow> int \<Rightarrow> bool"
   645 consts maxcoeff:: "num \<Rightarrow> int"
   645 consts maxcoeff:: "num \<Rightarrow> int"
   646 recdef maxcoeff "measure size"
   646 recdef maxcoeff "measure size"
   647   "maxcoeff (C i) = abs i"
   647   "maxcoeff (C i) = abs i"
   648   "maxcoeff (CN n c t) = max (abs c) (maxcoeff t)"
   648   "maxcoeff (CN n c t) = max (abs c) (maxcoeff t)"
   656 recdef numgcdh "measure size"
   656 recdef numgcdh "measure size"
   657   "numgcdh (C i) = (\<lambda>g. igcd i g)"
   657   "numgcdh (C i) = (\<lambda>g. igcd i g)"
   658   "numgcdh (CN n c t) = (\<lambda>g. igcd c (numgcdh t g))"
   658   "numgcdh (CN n c t) = (\<lambda>g. igcd c (numgcdh t g))"
   659   "numgcdh (CF c s t) = (\<lambda>g. igcd c (numgcdh t g))"
   659   "numgcdh (CF c s t) = (\<lambda>g. igcd c (numgcdh t g))"
   660   "numgcdh t = (\<lambda>g. 1)"
   660   "numgcdh t = (\<lambda>g. 1)"
   661 defs numgcd_def: "numgcd t \<equiv> numgcdh t (maxcoeff t)"
   661 
       
   662 definition
       
   663   numgcd :: "num \<Rightarrow> int"
       
   664 where
       
   665   numgcd_def: "numgcd t = numgcdh t (maxcoeff t)"
   662 
   666 
   663 recdef reducecoeffh "measure size"
   667 recdef reducecoeffh "measure size"
   664   "reducecoeffh (C i) = (\<lambda> g. C (i div g))"
   668   "reducecoeffh (C i) = (\<lambda> g. C (i div g))"
   665   "reducecoeffh (CN n c t) = (\<lambda> g. CN n (c div g) (reducecoeffh t g))"
   669   "reducecoeffh (CN n c t) = (\<lambda> g. CN n (c div g) (reducecoeffh t g))"
   666   "reducecoeffh (CF c s t) = (\<lambda> g. CF (c div g)  s (reducecoeffh t g))"
   670   "reducecoeffh (CF c s t) = (\<lambda> g. CF (c div g)  s (reducecoeffh t g))"
   667   "reducecoeffh t = (\<lambda>g. t)"
   671   "reducecoeffh t = (\<lambda>g. t)"
   668 
   672 
   669 defs reducecoeff_def: "reducecoeff t \<equiv> 
   673 definition
       
   674   reducecoeff :: "num \<Rightarrow> num"
       
   675 where
       
   676   reducecoeff_def: "reducecoeff t =
   670   (let g = numgcd t in 
   677   (let g = numgcd t in 
   671   if g = 0 then C 0 else if g=1 then t else reducecoeffh t g)"
   678   if g = 0 then C 0 else if g=1 then t else reducecoeffh t g)"
   672 
   679 
   673 recdef dvdnumcoeff "measure size"
   680 recdef dvdnumcoeff "measure size"
   674   "dvdnumcoeff (C i) = (\<lambda> g. g dvd i)"
   681   "dvdnumcoeff (C i) = (\<lambda> g. g dvd i)"
   830 
   837 
   831 consts
   838 consts
   832   simpnum:: "num \<Rightarrow> num"
   839   simpnum:: "num \<Rightarrow> num"
   833   numadd:: "num \<times> num \<Rightarrow> num"
   840   numadd:: "num \<times> num \<Rightarrow> num"
   834   nummul:: "num \<Rightarrow> int \<Rightarrow> num"
   841   nummul:: "num \<Rightarrow> int \<Rightarrow> num"
   835   numfloor:: "num \<Rightarrow> num"
       
   836 
   842 
   837 recdef numadd "measure (\<lambda> (t,s). size t + size s)"
   843 recdef numadd "measure (\<lambda> (t,s). size t + size s)"
   838   "numadd (CN n1 c1 r1,CN n2 c2 r2) =
   844   "numadd (CN n1 c1 r1,CN n2 c2 r2) =
   839   (if n1=n2 then 
   845   (if n1=n2 then 
   840   (let c = c1 + c2
   846   (let c = c1 + c2
   937 qed (auto simp add: Let_def isint_iff isint_Floor isint_add isint_Mul split_def ring_simps)
   943 qed (auto simp add: Let_def isint_iff isint_Floor isint_add isint_Mul split_def ring_simps)
   938 
   944 
   939 lemma split_int_nb: "numbound0 t \<Longrightarrow> numbound0 (fst (split_int t)) \<and> numbound0 (snd (split_int t)) "
   945 lemma split_int_nb: "numbound0 t \<Longrightarrow> numbound0 (fst (split_int t)) \<and> numbound0 (snd (split_int t)) "
   940 by (induct t rule: split_int.induct, auto simp add: Let_def split_def)
   946 by (induct t rule: split_int.induct, auto simp add: Let_def split_def)
   941 
   947 
   942 defs numfloor_def: "numfloor t \<equiv> (let (tv,ti) = split_int t in 
   948 definition
       
   949   numfloor:: "num \<Rightarrow> num"
       
   950 where
       
   951   numfloor_def: "numfloor t = (let (tv,ti) = split_int t in 
   943   (case tv of C i \<Rightarrow> numadd (tv,ti) 
   952   (case tv of C i \<Rightarrow> numadd (tv,ti) 
   944   | _ \<Rightarrow> numadd(CF 1 tv (C 0),ti)))"
   953   | _ \<Rightarrow> numadd(CF 1 tv (C 0),ti)))"
   945 
   954 
   946 lemma numfloor[simp]: "Inum bs (numfloor t) = Inum bs (Floor t)" (is "?n t = ?N (Floor t)")
   955 lemma numfloor[simp]: "Inum bs (numfloor t) = Inum bs (Floor t)" (is "?n t = ?N (Floor t)")
   947 proof-
   956 proof-
  3882   have ans: "?N x a = ?N x (CN 0 n s)" and nb: "numbound0 s" by auto
  3891   have ans: "?N x a = ?N x (CN 0 n s)" and nb: "numbound0 s" by auto
  3883   with ga f have "?I x (f n s)" by auto
  3892   with ga f have "?I x (f n s)" by auto
  3884   with rsplit_ex fnsS fx show "?I x (rsplit f a)" by auto
  3893   with rsplit_ex fnsS fx show "?I x (rsplit f a)" by auto
  3885 qed
  3894 qed
  3886 
  3895 
  3887 consts 
  3896 definition
  3888   lt :: "int \<Rightarrow> num \<Rightarrow> fm"
  3897   lt :: "int \<Rightarrow> num \<Rightarrow> fm"
       
  3898 where
       
  3899   lt_def: "lt c t = (if c = 0 then (Lt t) else if c > 0 then (Lt (CN 0 c t)) 
       
  3900                         else (Gt (CN 0 (-c) (Neg t))))"
       
  3901 
       
  3902 definition
  3889   le :: "int \<Rightarrow> num \<Rightarrow> fm"
  3903   le :: "int \<Rightarrow> num \<Rightarrow> fm"
       
  3904 where
       
  3905   le_def: "le c t = (if c = 0 then (Le t) else if c > 0 then (Le (CN 0 c t)) 
       
  3906                         else (Ge (CN 0 (-c) (Neg t))))"
       
  3907 
       
  3908 definition
  3890   gt :: "int \<Rightarrow> num \<Rightarrow> fm"
  3909   gt :: "int \<Rightarrow> num \<Rightarrow> fm"
       
  3910 where
       
  3911   gt_def: "gt c t = (if c = 0 then (Gt t) else if c > 0 then (Gt (CN 0 c t)) 
       
  3912                         else (Lt (CN 0 (-c) (Neg t))))"
       
  3913 
       
  3914 definition
  3891   ge :: "int \<Rightarrow> num \<Rightarrow> fm"
  3915   ge :: "int \<Rightarrow> num \<Rightarrow> fm"
       
  3916 where
       
  3917   ge_def: "ge c t = (if c = 0 then (Ge t) else if c > 0 then (Ge (CN 0 c t)) 
       
  3918                         else (Le (CN 0 (-c) (Neg t))))"
       
  3919 
       
  3920 definition
  3892   eq :: "int \<Rightarrow> num \<Rightarrow> fm"
  3921   eq :: "int \<Rightarrow> num \<Rightarrow> fm"
       
  3922 where
       
  3923   eq_def: "eq c t = (if c = 0 then (Eq t) else if c > 0 then (Eq (CN 0 c t)) 
       
  3924                         else (Eq (CN 0 (-c) (Neg t))))"
       
  3925 
       
  3926 definition
  3893   neq :: "int \<Rightarrow> num \<Rightarrow> fm"
  3927   neq :: "int \<Rightarrow> num \<Rightarrow> fm"
  3894 
  3928 where
  3895 defs lt_def: "lt c t \<equiv> (if c = 0 then (Lt t) else if c > 0 then (Lt (CN 0 c t)) 
  3929   neq_def: "neq c t = (if c = 0 then (NEq t) else if c > 0 then (NEq (CN 0 c t)) 
  3896                         else (Gt (CN 0 (-c) (Neg t))))"
       
  3897 defs le_def: "le c t \<equiv> (if c = 0 then (Le t) else if c > 0 then (Le (CN 0 c t)) 
       
  3898                         else (Ge (CN 0 (-c) (Neg t))))"
       
  3899 defs gt_def: "gt c t \<equiv> (if c = 0 then (Gt t) else if c > 0 then (Gt (CN 0 c t)) 
       
  3900                         else (Lt (CN 0 (-c) (Neg t))))"
       
  3901 defs ge_def: "ge c t \<equiv> (if c = 0 then (Ge t) else if c > 0 then (Ge (CN 0 c t)) 
       
  3902                         else (Le (CN 0 (-c) (Neg t))))"
       
  3903 defs eq_def: "eq c t \<equiv> (if c = 0 then (Eq t) else if c > 0 then (Eq (CN 0 c t)) 
       
  3904                         else (Eq (CN 0 (-c) (Neg t))))"
       
  3905 defs neq_def: "neq c t \<equiv> (if c = 0 then (NEq t) else if c > 0 then (NEq (CN 0 c t)) 
       
  3906                         else (NEq (CN 0 (-c) (Neg t))))"
  3930                         else (NEq (CN 0 (-c) (Neg t))))"
  3907 
  3931 
  3908 lemma lt_mono: "\<forall> a n s. Inum (x#bs) a = Inum (x#bs) (CN 0 n s) \<and> numbound0 s \<longrightarrow> Ifm (x#bs) (lt n s) = Ifm (x#bs) (Lt a)"
  3932 lemma lt_mono: "\<forall> a n s. Inum (x#bs) a = Inum (x#bs) (CN 0 n s) \<and> numbound0 s \<longrightarrow> Ifm (x#bs) (lt n s) = Ifm (x#bs) (Lt a)"
  3909   (is "\<forall> a n s . ?N a = ?N (CN 0 n s) \<and> _\<longrightarrow> ?I (lt n s) = ?I (Lt a)")
  3933   (is "\<forall> a n s . ?N a = ?N (CN 0 n s) \<and> _\<longrightarrow> ?I (lt n s) = ?I (Lt a)")
  3910 proof(clarify)
  3934 proof(clarify)
  3970 qed
  3994 qed
  3971 
  3995 
  3972 lemma neq_l: "isrlfm (rsplit neq a)"
  3996 lemma neq_l: "isrlfm (rsplit neq a)"
  3973   by (rule rsplit_l[where f="neq" and a="a"], auto simp add: neq_def) 
  3997   by (rule rsplit_l[where f="neq" and a="a"], auto simp add: neq_def) 
  3974 (case_tac s, simp_all, case_tac"nat", simp_all)
  3998 (case_tac s, simp_all, case_tac"nat", simp_all)
  3975 
       
  3976 consts
       
  3977   DVD :: "int \<Rightarrow> int \<Rightarrow> num \<Rightarrow> fm"
       
  3978   DVDJ:: "int \<Rightarrow> int \<Rightarrow> num \<Rightarrow> fm"
       
  3979   NDVD :: "int \<Rightarrow> int \<Rightarrow> num \<Rightarrow> fm"
       
  3980   NDVDJ:: "int \<Rightarrow> int \<Rightarrow> num \<Rightarrow> fm"
       
  3981 
  3999 
  3982 lemma small_le: 
  4000 lemma small_le: 
  3983   assumes u0:"0 \<le> u" and u1: "u < 1"
  4001   assumes u0:"0 \<le> u" and u1: "u < 1"
  3984   shows "(-u \<le> real (n::int)) = (0 \<le> n)"
  4002   shows "(-u \<le> real (n::int)) = (0 \<le> n)"
  3985 using u0 u1  by auto
  4003 using u0 u1  by auto
  4015     by (auto cong: conj_cong)
  4033     by (auto cong: conj_cong)
  4016   also have "\<dots> = ?rhs" by(simp cong: conj_cong) (simp add: ring_simps )
  4034   also have "\<dots> = ?rhs" by(simp cong: conj_cong) (simp add: ring_simps )
  4017   finally show ?thesis .
  4035   finally show ?thesis .
  4018 qed
  4036 qed
  4019 
  4037 
  4020 defs DVDJ_def: "DVDJ i n s \<equiv> (foldr disj (map (\<lambda> j. conj (Eq (CN 0 n (Add s (Sub (Floor (Neg s)) (C j))))) (Dvd i (Sub (C j) (Floor (Neg s))))) (iupt(0,n - 1))) F)"
  4038 definition
  4021 defs NDVDJ_def: "NDVDJ i n s \<equiv> (foldr conj (map (\<lambda> j. disj (NEq (CN 0 n (Add s (Sub (Floor (Neg s)) (C j))))) (NDvd i (Sub (C j) (Floor (Neg s))))) (iupt(0,n - 1))) T)"
  4039   DVDJ:: "int \<Rightarrow> int \<Rightarrow> num \<Rightarrow> fm"
       
  4040 where
       
  4041   DVDJ_def: "DVDJ i n s = (foldr disj (map (\<lambda> j. conj (Eq (CN 0 n (Add s (Sub (Floor (Neg s)) (C j))))) (Dvd i (Sub (C j) (Floor (Neg s))))) (iupt(0,n - 1))) F)"
       
  4042 
       
  4043 definition
       
  4044   NDVDJ:: "int \<Rightarrow> int \<Rightarrow> num \<Rightarrow> fm"
       
  4045 where
       
  4046   NDVDJ_def: "NDVDJ i n s = (foldr conj (map (\<lambda> j. disj (NEq (CN 0 n (Add s (Sub (Floor (Neg s)) (C j))))) (NDvd i (Sub (C j) (Floor (Neg s))))) (iupt(0,n - 1))) T)"
  4022 
  4047 
  4023 lemma DVDJ_DVD: 
  4048 lemma DVDJ_DVD: 
  4024   assumes xp:"x\<ge> 0" and x1: "x < 1" and np:"real n > 0"
  4049   assumes xp:"x\<ge> 0" and x1: "x < 1" and np:"real n > 0"
  4025   shows "Ifm (x#bs) (DVDJ i n s) = Ifm (x#bs) (Dvd i (CN 0 n s))"
  4050   shows "Ifm (x#bs) (DVDJ i n s) = Ifm (x#bs) (Dvd i (CN 0 n s))"
  4026 proof-
  4051 proof-
  4075                       (NDvd i (Sub (C j) (Floor (Neg s))))"
  4100                       (NDvd i (Sub (C j) (Floor (Neg s))))"
  4076   have th: "\<forall> j. isrlfm (?f j)" using nb np by auto
  4101   have th: "\<forall> j. isrlfm (?f j)" using nb np by auto
  4077   from NDVDJ_def foldr_And_map_rlfm2[OF th] show ?thesis by auto
  4102   from NDVDJ_def foldr_And_map_rlfm2[OF th] show ?thesis by auto
  4078 qed
  4103 qed
  4079 
  4104 
  4080 defs DVD_def: "DVD i c t \<equiv> 
  4105 definition
       
  4106   DVD :: "int \<Rightarrow> int \<Rightarrow> num \<Rightarrow> fm"
       
  4107 where
       
  4108   DVD_def: "DVD i c t =
  4081   (if i=0 then eq c t else 
  4109   (if i=0 then eq c t else 
  4082   if c = 0 then (Dvd i t) else if c >0 then DVDJ (abs i) c t else DVDJ (abs i) (-c) (Neg t))"
  4110   if c = 0 then (Dvd i t) else if c >0 then DVDJ (abs i) c t else DVDJ (abs i) (-c) (Neg t))"
  4083 defs NDVD_def: "NDVD i c t \<equiv> 
  4111 
       
  4112 definition
       
  4113   NDVD :: "int \<Rightarrow> int \<Rightarrow> num \<Rightarrow> fm"
       
  4114 where
       
  4115   "NDVD i c t =
  4084   (if i=0 then neq c t else 
  4116   (if i=0 then neq c t else 
  4085   if c = 0 then (NDvd i t) else if c >0 then NDVDJ (abs i) c t else NDVDJ (abs i) (-c) (Neg t))"
  4117   if c = 0 then (NDvd i t) else if c >0 then NDVDJ (abs i) c t else NDVDJ (abs i) (-c) (Neg t))"
  4086 
  4118 
  4087 lemma DVD_mono: 
  4119 lemma DVD_mono: 
  4088   assumes xp: "0\<le> x" and x1: "x < 1" 
  4120   assumes xp: "0\<le> x" and x1: "x < 1" 
  5748   using qelim_ci[OF mirlfr] prep by (auto simp add: mirlfrqe_def)
  5780   using qelim_ci[OF mirlfr] prep by (auto simp add: mirlfrqe_def)
  5749 
  5781 
  5750 declare zdvd_iff_zmod_eq_0 [code]
  5782 declare zdvd_iff_zmod_eq_0 [code]
  5751 declare max_def [code unfold]
  5783 declare max_def [code unfold]
  5752 
  5784 
  5753 code_module Mir
  5785 definition
  5754 file "mir.ML"
  5786   "test1 (u\<Colon>unit) = mircfrqe (A (And (Le (Sub (Floor (Bound 0)) (Bound 0))) (Le (Add (Bound 0) (Floor (Neg (Bound 0)))))))"
  5755 contains 
  5787 
  5756   mircfrqe = "mircfrqe"
  5788 definition
  5757   mirlfrqe = "mirlfrqe"
  5789   "test2 (u\<Colon>unit) = mircfrqe (A (Iff (Eq (Add (Floor (Bound 0)) (Floor (Neg (Bound 0))))) (Eq (Sub (Floor (Bound 0)) (Bound 0)))))"
  5758   test = "%x . mircfrqe (A (And (Le (Sub (Floor (Bound 0)) (Bound 0))) (Le (Add (Bound 0) (Floor (Neg (Bound 0)))))))"
  5790 
  5759   test2 = "%x . mircfrqe (A (Iff (Eq (Add (Floor (Bound 0)) (Floor (Neg (Bound 0))))) (Eq (Sub (Floor (Bound 0)) (Bound 0)))))"
  5791 definition
  5760   test' = "%x . mirlfrqe (A (And (Le (Sub (Floor (Bound 0)) (Bound 0))) (Le (Add (Bound 0) (Floor (Neg (Bound 0)))))))"
  5792   "test3 (u\<Colon>unit) = mirlfrqe (A (And (Le (Sub (Floor (Bound 0)) (Bound 0))) (Le (Add (Bound 0) (Floor (Neg (Bound 0)))))))"
  5761   test2' = "%x . mirlfrqe (A (Iff (Eq (Add (Floor (Bound 0)) (Floor (Neg (Bound 0))))) (Eq (Sub (Floor (Bound 0)) (Bound 0)))))"
  5793 
  5762 test3 = "%x .mircfrqe (A(E(And (Ge(Sub (Bound 1) (Bound 0))) (Eq (Add (Floor (Bound 1)) (Floor (Neg(Bound 0))))))))"
  5794 definition
  5763 
  5795   "test4 (u\<Colon>unit) = mirlfrqe (A (Iff (Eq (Add (Floor (Bound 0)) (Floor (Neg (Bound 0))))) (Eq (Sub (Floor (Bound 0)) (Bound 0)))))"
  5764 ML {* use "mir.ML" *}
  5796 
       
  5797 definition
       
  5798   "test5 (u\<Colon>unit) = mircfrqe (A(E(And (Ge(Sub (Bound 1) (Bound 0))) (Eq (Add (Floor (Bound 1)) (Floor (Neg(Bound 0))))))))"
       
  5799 
       
  5800 code_gen mircfrqe mirlfrqe test1 test2 test3 test4 test5
       
  5801   in SML to Mir
       
  5802 
       
  5803 code_gen mircfrqe mirlfrqe in SML to Mir file "raw_mir.ML"
       
  5804 
  5765 ML "set Toplevel.timing"
  5805 ML "set Toplevel.timing"
  5766 ML "Mir.test ()"
  5806 ML "Mir.test1 ()"
  5767 ML "Mir.test2 ()"
  5807 ML "Mir.test2 ()"
  5768 ML "Mir.test' ()"
       
  5769 ML "Mir.test2' ()"
       
  5770 ML "Mir.test3 ()"
  5808 ML "Mir.test3 ()"
       
  5809 ML "Mir.test4 ()"
       
  5810 ML "Mir.test5 ()"
       
  5811 ML "reset Toplevel.timing"
  5771 
  5812 
  5772 use "mireif.ML"
  5813 use "mireif.ML"
  5773 oracle mircfr_oracle ("term") = ReflectedMir.mircfr_oracle
  5814 oracle mircfr_oracle ("term") = ReflectedMir.mircfr_oracle
  5774 oracle mirlfr_oracle ("term") = ReflectedMir.mirlfr_oracle
  5815 oracle mirlfr_oracle ("term") = ReflectedMir.mirlfr_oracle
  5775 use"mirtac.ML"
  5816 use "mirtac.ML"
  5776 setup "MirTac.setup"
  5817 setup "MirTac.setup"
  5777 
  5818 
  5778 ML "set Toplevel.timing"
  5819 ML "set Toplevel.timing"
       
  5820 
  5779 lemma "ALL (x::real). (\<lfloor>x\<rfloor> = \<lceil>x\<rceil> = (x = real \<lfloor>x\<rfloor>))"
  5821 lemma "ALL (x::real). (\<lfloor>x\<rfloor> = \<lceil>x\<rceil> = (x = real \<lfloor>x\<rfloor>))"
  5780 apply mir
  5822 apply mir
  5781 done
  5823 done
  5782 
  5824 
  5783 lemma "ALL (x::real). real (2::int)*x - (real (1::int)) < real \<lfloor>x\<rfloor> + real \<lceil>x\<rceil> \<and> real \<lfloor>x\<rfloor> + real \<lceil>x\<rceil>  \<le> real (2::int)*x + (real (1::int))"
  5825 lemma "ALL (x::real). real (2::int)*x - (real (1::int)) < real \<lfloor>x\<rfloor> + real \<lceil>x\<rceil> \<and> real \<lfloor>x\<rfloor> + real \<lceil>x\<rceil>  \<le> real (2::int)*x + (real (1::int))"
  5786 
  5828 
  5787 lemma "ALL (x::real). 2*\<lfloor>x\<rfloor> \<le> \<lfloor>2*x\<rfloor> \<and> \<lfloor>2*x\<rfloor> \<le> 2*\<lfloor>x+1\<rfloor>"
  5829 lemma "ALL (x::real). 2*\<lfloor>x\<rfloor> \<le> \<lfloor>2*x\<rfloor> \<and> \<lfloor>2*x\<rfloor> \<le> 2*\<lfloor>x+1\<rfloor>"
  5788 apply mir 
  5830 apply mir 
  5789 done
  5831 done
  5790 
  5832 
  5791 
       
  5792 lemma "ALL (x::real). \<exists>y \<le> x. (\<lfloor>x\<rfloor> = \<lceil>y\<rceil>)"
  5833 lemma "ALL (x::real). \<exists>y \<le> x. (\<lfloor>x\<rfloor> = \<lceil>y\<rceil>)"
  5793 apply mir
  5834 apply mir
  5794 done
  5835 done
       
  5836 
  5795 ML "reset Toplevel.timing"
  5837 ML "reset Toplevel.timing"
  5796 
  5838 
  5797 end
  5839 end