src/HOL/Decision_Procs/Dense_Linear_Order.thy
changeset 69597 ff784d5a5bfb
parent 67565 e13378b304dd
child 69605 a96320074298
equal deleted inserted replaced
69596:c8a2755bf220 69597:ff784d5a5bfb
   714 declaration \<open>
   714 declaration \<open>
   715 let
   715 let
   716   fun simps phi = map (Morphism.thm phi) [@{thm "not_less"}, @{thm "not_le"}]
   716   fun simps phi = map (Morphism.thm phi) [@{thm "not_less"}, @{thm "not_le"}]
   717   fun generic_whatis phi =
   717   fun generic_whatis phi =
   718     let
   718     let
   719       val [lt, le] = map (Morphism.term phi) [@{term "(\<sqsubset>)"}, @{term "(\<sqsubseteq>)"}]
   719       val [lt, le] = map (Morphism.term phi) [\<^term>\<open>(\<sqsubset>)\<close>, \<^term>\<open>(\<sqsubseteq>)\<close>]
   720       fun h x t =
   720       fun h x t =
   721         case Thm.term_of t of
   721         case Thm.term_of t of
   722           Const(@{const_name HOL.eq}, _)$y$z =>
   722           Const(\<^const_name>\<open>HOL.eq\<close>, _)$y$z =>
   723             if Thm.term_of x aconv y then Ferrante_Rackoff_Data.Eq
   723             if Thm.term_of x aconv y then Ferrante_Rackoff_Data.Eq
   724             else Ferrante_Rackoff_Data.Nox
   724             else Ferrante_Rackoff_Data.Nox
   725        | @{term "Not"}$(Const(@{const_name HOL.eq}, _)$y$z) =>
   725        | \<^term>\<open>Not\<close>$(Const(\<^const_name>\<open>HOL.eq\<close>, _)$y$z) =>
   726             if Thm.term_of x aconv y then Ferrante_Rackoff_Data.NEq
   726             if Thm.term_of x aconv y then Ferrante_Rackoff_Data.NEq
   727             else Ferrante_Rackoff_Data.Nox
   727             else Ferrante_Rackoff_Data.Nox
   728        | b$y$z => if Term.could_unify (b, lt) then
   728        | b$y$z => if Term.could_unify (b, lt) then
   729                      if Thm.term_of x aconv y then Ferrante_Rackoff_Data.Lt
   729                      if Thm.term_of x aconv y then Ferrante_Rackoff_Data.Lt
   730                      else if Thm.term_of x aconv z then Ferrante_Rackoff_Data.Gt
   730                      else if Thm.term_of x aconv z then Ferrante_Rackoff_Data.Gt
   899     else if earlier vs (x, y) then LESS
   899     else if earlier vs (x, y) then LESS
   900     else GREATER;
   900     else GREATER;
   901 
   901 
   902 fun dest_frac ct =
   902 fun dest_frac ct =
   903   case Thm.term_of ct of
   903   case Thm.term_of ct of
   904     Const (@{const_name Rings.divide},_) $ a $ b=>
   904     Const (\<^const_name>\<open>Rings.divide\<close>,_) $ a $ b=>
   905       Rat.make (snd (HOLogic.dest_number a), snd (HOLogic.dest_number b))
   905       Rat.make (snd (HOLogic.dest_number a), snd (HOLogic.dest_number b))
   906   | Const(@{const_name inverse}, _)$a => Rat.make(1, HOLogic.dest_number a |> snd)
   906   | Const(\<^const_name>\<open>inverse\<close>, _)$a => Rat.make(1, HOLogic.dest_number a |> snd)
   907   | t => Rat.of_int (snd (HOLogic.dest_number t))
   907   | t => Rat.of_int (snd (HOLogic.dest_number t))
   908 
   908 
   909 fun whatis x ct = case Thm.term_of ct of
   909 fun whatis x ct = case Thm.term_of ct of
   910   Const(@{const_name Groups.plus}, _)$(Const(@{const_name Groups.times},_)$_$y)$_ =>
   910   Const(\<^const_name>\<open>Groups.plus\<close>, _)$(Const(\<^const_name>\<open>Groups.times\<close>,_)$_$y)$_ =>
   911      if y aconv Thm.term_of x then ("c*x+t",[(funpow 2 Thm.dest_arg1) ct, Thm.dest_arg ct])
   911      if y aconv Thm.term_of x then ("c*x+t",[(funpow 2 Thm.dest_arg1) ct, Thm.dest_arg ct])
   912      else ("Nox",[])
   912      else ("Nox",[])
   913 | Const(@{const_name Groups.plus}, _)$y$_ =>
   913 | Const(\<^const_name>\<open>Groups.plus\<close>, _)$y$_ =>
   914      if y aconv Thm.term_of x then ("x+t",[Thm.dest_arg ct])
   914      if y aconv Thm.term_of x then ("x+t",[Thm.dest_arg ct])
   915      else ("Nox",[])
   915      else ("Nox",[])
   916 | Const(@{const_name Groups.times}, _)$_$y =>
   916 | Const(\<^const_name>\<open>Groups.times\<close>, _)$_$y =>
   917      if y aconv Thm.term_of x then ("c*x",[Thm.dest_arg1 ct])
   917      if y aconv Thm.term_of x then ("c*x",[Thm.dest_arg1 ct])
   918      else ("Nox",[])
   918      else ("Nox",[])
   919 | t => if t aconv Thm.term_of x then ("x",[]) else ("Nox",[]);
   919 | t => if t aconv Thm.term_of x then ("x",[]) else ("Nox",[]);
   920 
   920 
   921 fun xnormalize_conv ctxt [] ct = Thm.reflexive ct
   921 fun xnormalize_conv ctxt [] ct = Thm.reflexive ct
   922 | xnormalize_conv ctxt (vs as (x::_)) ct =
   922 | xnormalize_conv ctxt (vs as (x::_)) ct =
   923    case Thm.term_of ct of
   923    case Thm.term_of ct of
   924    Const(@{const_name Orderings.less},_)$_$Const(@{const_name Groups.zero},_) =>
   924    Const(\<^const_name>\<open>Orderings.less\<close>,_)$_$Const(\<^const_name>\<open>Groups.zero\<close>,_) =>
   925     (case whatis x (Thm.dest_arg1 ct) of
   925     (case whatis x (Thm.dest_arg1 ct) of
   926     ("c*x+t",[c,t]) =>
   926     ("c*x+t",[c,t]) =>
   927        let
   927        let
   928         val cr = dest_frac c
   928         val cr = dest_frac c
   929         val clt = Thm.dest_fun2 ct
   929         val clt = Thm.dest_fun2 ct
   930         val cz = Thm.dest_arg ct
   930         val cz = Thm.dest_arg ct
   931         val neg = cr < @0
   931         val neg = cr < @0
   932         val cthp = Simplifier.rewrite ctxt
   932         val cthp = Simplifier.rewrite ctxt
   933                (Thm.apply @{cterm "Trueprop"}
   933                (Thm.apply \<^cterm>\<open>Trueprop\<close>
   934                   (if neg then Thm.apply (Thm.apply clt c) cz
   934                   (if neg then Thm.apply (Thm.apply clt c) cz
   935                     else Thm.apply (Thm.apply clt cz) c))
   935                     else Thm.apply (Thm.apply clt cz) c))
   936         val cth = Thm.equal_elim (Thm.symmetric cthp) TrueI
   936         val cth = Thm.equal_elim (Thm.symmetric cthp) TrueI
   937         val th = Thm.implies_elim (Thm.instantiate' [SOME (Thm.ctyp_of_cterm x)] (map SOME [c,x,t])
   937         val th = Thm.implies_elim (Thm.instantiate' [SOME (Thm.ctyp_of_cterm x)] (map SOME [c,x,t])
   938              (if neg then @{thm neg_prod_sum_lt} else @{thm pos_prod_sum_lt})) cth
   938              (if neg then @{thm neg_prod_sum_lt} else @{thm pos_prod_sum_lt})) cth
   951         val cr = dest_frac c
   951         val cr = dest_frac c
   952         val clt = Thm.dest_fun2 ct
   952         val clt = Thm.dest_fun2 ct
   953         val cz = Thm.dest_arg ct
   953         val cz = Thm.dest_arg ct
   954         val neg = cr < @0
   954         val neg = cr < @0
   955         val cthp = Simplifier.rewrite ctxt
   955         val cthp = Simplifier.rewrite ctxt
   956                (Thm.apply @{cterm "Trueprop"}
   956                (Thm.apply \<^cterm>\<open>Trueprop\<close>
   957                   (if neg then Thm.apply (Thm.apply clt c) cz
   957                   (if neg then Thm.apply (Thm.apply clt c) cz
   958                     else Thm.apply (Thm.apply clt cz) c))
   958                     else Thm.apply (Thm.apply clt cz) c))
   959         val cth = Thm.equal_elim (Thm.symmetric cthp) TrueI
   959         val cth = Thm.equal_elim (Thm.symmetric cthp) TrueI
   960         val th = Thm.implies_elim (Thm.instantiate' [SOME (Thm.ctyp_of_cterm x)] (map SOME [c,x])
   960         val th = Thm.implies_elim (Thm.instantiate' [SOME (Thm.ctyp_of_cterm x)] (map SOME [c,x])
   961              (if neg then @{thm neg_prod_lt} else @{thm pos_prod_lt})) cth
   961              (if neg then @{thm neg_prod_lt} else @{thm pos_prod_lt})) cth
   962         val rth = th
   962         val rth = th
   963       in rth end
   963       in rth end
   964     | _ => Thm.reflexive ct)
   964     | _ => Thm.reflexive ct)
   965 
   965 
   966 
   966 
   967 |  Const(@{const_name Orderings.less_eq},_)$_$Const(@{const_name Groups.zero},_) =>
   967 |  Const(\<^const_name>\<open>Orderings.less_eq\<close>,_)$_$Const(\<^const_name>\<open>Groups.zero\<close>,_) =>
   968    (case whatis x (Thm.dest_arg1 ct) of
   968    (case whatis x (Thm.dest_arg1 ct) of
   969     ("c*x+t",[c,t]) =>
   969     ("c*x+t",[c,t]) =>
   970        let
   970        let
   971         val T = Thm.typ_of_cterm x
   971         val T = Thm.typ_of_cterm x
   972         val cT = Thm.ctyp_of_cterm x
   972         val cT = Thm.ctyp_of_cterm x
   973         val cr = dest_frac c
   973         val cr = dest_frac c
   974         val clt = Thm.cterm_of ctxt (Const (@{const_name ord_class.less}, T --> T --> @{typ bool}))
   974         val clt = Thm.cterm_of ctxt (Const (\<^const_name>\<open>ord_class.less\<close>, T --> T --> \<^typ>\<open>bool\<close>))
   975         val cz = Thm.dest_arg ct
   975         val cz = Thm.dest_arg ct
   976         val neg = cr < @0
   976         val neg = cr < @0
   977         val cthp = Simplifier.rewrite ctxt
   977         val cthp = Simplifier.rewrite ctxt
   978                (Thm.apply @{cterm "Trueprop"}
   978                (Thm.apply \<^cterm>\<open>Trueprop\<close>
   979                   (if neg then Thm.apply (Thm.apply clt c) cz
   979                   (if neg then Thm.apply (Thm.apply clt c) cz
   980                     else Thm.apply (Thm.apply clt cz) c))
   980                     else Thm.apply (Thm.apply clt cz) c))
   981         val cth = Thm.equal_elim (Thm.symmetric cthp) TrueI
   981         val cth = Thm.equal_elim (Thm.symmetric cthp) TrueI
   982         val th = Thm.implies_elim (Thm.instantiate' [SOME cT] (map SOME [c,x,t])
   982         val th = Thm.implies_elim (Thm.instantiate' [SOME cT] (map SOME [c,x,t])
   983              (if neg then @{thm neg_prod_sum_le} else @{thm pos_prod_sum_le})) cth
   983              (if neg then @{thm neg_prod_sum_le} else @{thm pos_prod_sum_le})) cth
   994     | ("c*x",[c]) =>
   994     | ("c*x",[c]) =>
   995        let
   995        let
   996         val T = Thm.typ_of_cterm x
   996         val T = Thm.typ_of_cterm x
   997         val cT = Thm.ctyp_of_cterm x
   997         val cT = Thm.ctyp_of_cterm x
   998         val cr = dest_frac c
   998         val cr = dest_frac c
   999         val clt = Thm.cterm_of ctxt (Const (@{const_name ord_class.less}, T --> T --> @{typ bool}))
   999         val clt = Thm.cterm_of ctxt (Const (\<^const_name>\<open>ord_class.less\<close>, T --> T --> \<^typ>\<open>bool\<close>))
  1000         val cz = Thm.dest_arg ct
  1000         val cz = Thm.dest_arg ct
  1001         val neg = cr < @0
  1001         val neg = cr < @0
  1002         val cthp = Simplifier.rewrite ctxt
  1002         val cthp = Simplifier.rewrite ctxt
  1003                (Thm.apply @{cterm "Trueprop"}
  1003                (Thm.apply \<^cterm>\<open>Trueprop\<close>
  1004                   (if neg then Thm.apply (Thm.apply clt c) cz
  1004                   (if neg then Thm.apply (Thm.apply clt c) cz
  1005                     else Thm.apply (Thm.apply clt cz) c))
  1005                     else Thm.apply (Thm.apply clt cz) c))
  1006         val cth = Thm.equal_elim (Thm.symmetric cthp) TrueI
  1006         val cth = Thm.equal_elim (Thm.symmetric cthp) TrueI
  1007         val th = Thm.implies_elim (Thm.instantiate' [SOME (Thm.ctyp_of_cterm x)] (map SOME [c,x])
  1007         val th = Thm.implies_elim (Thm.instantiate' [SOME (Thm.ctyp_of_cterm x)] (map SOME [c,x])
  1008              (if neg then @{thm neg_prod_le} else @{thm pos_prod_le})) cth
  1008              (if neg then @{thm neg_prod_le} else @{thm pos_prod_le})) cth
  1009         val rth = th
  1009         val rth = th
  1010       in rth end
  1010       in rth end
  1011     | _ => Thm.reflexive ct)
  1011     | _ => Thm.reflexive ct)
  1012 
  1012 
  1013 |  Const(@{const_name HOL.eq},_)$_$Const(@{const_name Groups.zero},_) =>
  1013 |  Const(\<^const_name>\<open>HOL.eq\<close>,_)$_$Const(\<^const_name>\<open>Groups.zero\<close>,_) =>
  1014    (case whatis x (Thm.dest_arg1 ct) of
  1014    (case whatis x (Thm.dest_arg1 ct) of
  1015     ("c*x+t",[c,t]) =>
  1015     ("c*x+t",[c,t]) =>
  1016        let
  1016        let
  1017         val T = Thm.ctyp_of_cterm x
  1017         val T = Thm.ctyp_of_cterm x
  1018         val cr = dest_frac c
  1018         val cr = dest_frac c
  1019         val ceq = Thm.dest_fun2 ct
  1019         val ceq = Thm.dest_fun2 ct
  1020         val cz = Thm.dest_arg ct
  1020         val cz = Thm.dest_arg ct
  1021         val cthp = Simplifier.rewrite ctxt
  1021         val cthp = Simplifier.rewrite ctxt
  1022             (Thm.apply @{cterm "Trueprop"}
  1022             (Thm.apply \<^cterm>\<open>Trueprop\<close>
  1023              (Thm.apply @{cterm "Not"} (Thm.apply (Thm.apply ceq c) cz)))
  1023              (Thm.apply \<^cterm>\<open>Not\<close> (Thm.apply (Thm.apply ceq c) cz)))
  1024         val cth = Thm.equal_elim (Thm.symmetric cthp) TrueI
  1024         val cth = Thm.equal_elim (Thm.symmetric cthp) TrueI
  1025         val th = Thm.implies_elim
  1025         val th = Thm.implies_elim
  1026                  (Thm.instantiate' [SOME T] (map SOME [c,x,t]) @{thm nz_prod_sum_eq}) cth
  1026                  (Thm.instantiate' [SOME T] (map SOME [c,x,t]) @{thm nz_prod_sum_eq}) cth
  1027         val rth = Conv.fconv_rule (Conv.arg_conv (Conv.binop_conv
  1027         val rth = Conv.fconv_rule (Conv.arg_conv (Conv.binop_conv
  1028                    (Semiring_Normalizer.semiring_normalize_ord_conv ctxt (earlier_ord vs)))) th
  1028                    (Semiring_Normalizer.semiring_normalize_ord_conv ctxt (earlier_ord vs)))) th
  1039         val T = Thm.ctyp_of_cterm x
  1039         val T = Thm.ctyp_of_cterm x
  1040         val cr = dest_frac c
  1040         val cr = dest_frac c
  1041         val ceq = Thm.dest_fun2 ct
  1041         val ceq = Thm.dest_fun2 ct
  1042         val cz = Thm.dest_arg ct
  1042         val cz = Thm.dest_arg ct
  1043         val cthp = Simplifier.rewrite ctxt
  1043         val cthp = Simplifier.rewrite ctxt
  1044             (Thm.apply @{cterm "Trueprop"}
  1044             (Thm.apply \<^cterm>\<open>Trueprop\<close>
  1045              (Thm.apply @{cterm "Not"} (Thm.apply (Thm.apply ceq c) cz)))
  1045              (Thm.apply \<^cterm>\<open>Not\<close> (Thm.apply (Thm.apply ceq c) cz)))
  1046         val cth = Thm.equal_elim (Thm.symmetric cthp) TrueI
  1046         val cth = Thm.equal_elim (Thm.symmetric cthp) TrueI
  1047         val rth = Thm.implies_elim
  1047         val rth = Thm.implies_elim
  1048                  (Thm.instantiate' [SOME T] (map SOME [c,x]) @{thm nz_prod_eq}) cth
  1048                  (Thm.instantiate' [SOME T] (map SOME [c,x]) @{thm nz_prod_eq}) cth
  1049       in rth end
  1049       in rth end
  1050     | _ => Thm.reflexive ct);
  1050     | _ => Thm.reflexive ct);
  1051 
  1051 
  1052 local
  1052 local
  1053   val less_iff_diff_less_0 = mk_meta_eq @{thm "less_iff_diff_less_0"}
  1053   val less_iff_diff_less_0 = mk_meta_eq @{thm "less_iff_diff_less_0"}
  1054   val le_iff_diff_le_0 = mk_meta_eq @{thm "le_iff_diff_le_0"}
  1054   val le_iff_diff_le_0 = mk_meta_eq @{thm "le_iff_diff_le_0"}
  1055   val eq_iff_diff_eq_0 = mk_meta_eq @{thm "eq_iff_diff_eq_0"}
  1055   val eq_iff_diff_eq_0 = mk_meta_eq @{thm "eq_iff_diff_eq_0"}
  1056   val ss = simpset_of @{context}
  1056   val ss = simpset_of \<^context>
  1057 in
  1057 in
  1058 fun field_isolate_conv phi ctxt vs ct = case Thm.term_of ct of
  1058 fun field_isolate_conv phi ctxt vs ct = case Thm.term_of ct of
  1059   Const(@{const_name Orderings.less},_)$a$b =>
  1059   Const(\<^const_name>\<open>Orderings.less\<close>,_)$a$b =>
  1060    let val (ca,cb) = Thm.dest_binop ct
  1060    let val (ca,cb) = Thm.dest_binop ct
  1061        val T = Thm.ctyp_of_cterm ca
  1061        val T = Thm.ctyp_of_cterm ca
  1062        val th = Thm.instantiate' [SOME T] [SOME ca, SOME cb] less_iff_diff_less_0
  1062        val th = Thm.instantiate' [SOME T] [SOME ca, SOME cb] less_iff_diff_less_0
  1063        val nth = Conv.fconv_rule
  1063        val nth = Conv.fconv_rule
  1064          (Conv.arg_conv (Conv.arg1_conv
  1064          (Conv.arg_conv (Conv.arg1_conv
  1065               (Semiring_Normalizer.semiring_normalize_ord_conv (put_simpset ss ctxt) (earlier_ord vs)))) th
  1065               (Semiring_Normalizer.semiring_normalize_ord_conv (put_simpset ss ctxt) (earlier_ord vs)))) th
  1066        val rth = Thm.transitive nth (xnormalize_conv ctxt vs (Thm.rhs_of nth))
  1066        val rth = Thm.transitive nth (xnormalize_conv ctxt vs (Thm.rhs_of nth))
  1067    in rth end
  1067    in rth end
  1068 | Const(@{const_name Orderings.less_eq},_)$a$b =>
  1068 | Const(\<^const_name>\<open>Orderings.less_eq\<close>,_)$a$b =>
  1069    let val (ca,cb) = Thm.dest_binop ct
  1069    let val (ca,cb) = Thm.dest_binop ct
  1070        val T = Thm.ctyp_of_cterm ca
  1070        val T = Thm.ctyp_of_cterm ca
  1071        val th = Thm.instantiate' [SOME T] [SOME ca, SOME cb] le_iff_diff_le_0
  1071        val th = Thm.instantiate' [SOME T] [SOME ca, SOME cb] le_iff_diff_le_0
  1072        val nth = Conv.fconv_rule
  1072        val nth = Conv.fconv_rule
  1073          (Conv.arg_conv (Conv.arg1_conv
  1073          (Conv.arg_conv (Conv.arg1_conv
  1074               (Semiring_Normalizer.semiring_normalize_ord_conv (put_simpset ss ctxt) (earlier_ord vs)))) th
  1074               (Semiring_Normalizer.semiring_normalize_ord_conv (put_simpset ss ctxt) (earlier_ord vs)))) th
  1075        val rth = Thm.transitive nth (xnormalize_conv ctxt vs (Thm.rhs_of nth))
  1075        val rth = Thm.transitive nth (xnormalize_conv ctxt vs (Thm.rhs_of nth))
  1076    in rth end
  1076    in rth end
  1077 
  1077 
  1078 | Const(@{const_name HOL.eq},_)$a$b =>
  1078 | Const(\<^const_name>\<open>HOL.eq\<close>,_)$a$b =>
  1079    let val (ca,cb) = Thm.dest_binop ct
  1079    let val (ca,cb) = Thm.dest_binop ct
  1080        val T = Thm.ctyp_of_cterm ca
  1080        val T = Thm.ctyp_of_cterm ca
  1081        val th = Thm.instantiate' [SOME T] [SOME ca, SOME cb] eq_iff_diff_eq_0
  1081        val th = Thm.instantiate' [SOME T] [SOME ca, SOME cb] eq_iff_diff_eq_0
  1082        val nth = Conv.fconv_rule
  1082        val nth = Conv.fconv_rule
  1083          (Conv.arg_conv (Conv.arg1_conv
  1083          (Conv.arg_conv (Conv.arg1_conv
  1084               (Semiring_Normalizer.semiring_normalize_ord_conv (put_simpset ss ctxt) (earlier_ord vs)))) th
  1084               (Semiring_Normalizer.semiring_normalize_ord_conv (put_simpset ss ctxt) (earlier_ord vs)))) th
  1085        val rth = Thm.transitive nth (xnormalize_conv ctxt vs (Thm.rhs_of nth))
  1085        val rth = Thm.transitive nth (xnormalize_conv ctxt vs (Thm.rhs_of nth))
  1086    in rth end
  1086    in rth end
  1087 | @{term "Not"} $(Const(@{const_name HOL.eq},_)$a$b) => Conv.arg_conv (field_isolate_conv phi ctxt vs) ct
  1087 | \<^term>\<open>Not\<close> $(Const(\<^const_name>\<open>HOL.eq\<close>,_)$a$b) => Conv.arg_conv (field_isolate_conv phi ctxt vs) ct
  1088 | _ => Thm.reflexive ct
  1088 | _ => Thm.reflexive ct
  1089 end;
  1089 end;
  1090 
  1090 
  1091 fun classfield_whatis phi =
  1091 fun classfield_whatis phi =
  1092  let
  1092  let
  1093   fun h x t =
  1093   fun h x t =
  1094    case Thm.term_of t of
  1094    case Thm.term_of t of
  1095      Const(@{const_name HOL.eq}, _)$y$z =>
  1095      Const(\<^const_name>\<open>HOL.eq\<close>, _)$y$z =>
  1096       if Thm.term_of x aconv y then Ferrante_Rackoff_Data.Eq
  1096       if Thm.term_of x aconv y then Ferrante_Rackoff_Data.Eq
  1097       else Ferrante_Rackoff_Data.Nox
  1097       else Ferrante_Rackoff_Data.Nox
  1098    | @{term "Not"}$(Const(@{const_name HOL.eq}, _)$y$z) =>
  1098    | \<^term>\<open>Not\<close>$(Const(\<^const_name>\<open>HOL.eq\<close>, _)$y$z) =>
  1099       if Thm.term_of x aconv y then Ferrante_Rackoff_Data.NEq
  1099       if Thm.term_of x aconv y then Ferrante_Rackoff_Data.NEq
  1100       else Ferrante_Rackoff_Data.Nox
  1100       else Ferrante_Rackoff_Data.Nox
  1101    | Const(@{const_name Orderings.less},_)$y$z =>
  1101    | Const(\<^const_name>\<open>Orderings.less\<close>,_)$y$z =>
  1102        if Thm.term_of x aconv y then Ferrante_Rackoff_Data.Lt
  1102        if Thm.term_of x aconv y then Ferrante_Rackoff_Data.Lt
  1103        else if Thm.term_of x aconv z then Ferrante_Rackoff_Data.Gt
  1103        else if Thm.term_of x aconv z then Ferrante_Rackoff_Data.Gt
  1104        else Ferrante_Rackoff_Data.Nox
  1104        else Ferrante_Rackoff_Data.Nox
  1105    | Const (@{const_name Orderings.less_eq},_)$y$z =>
  1105    | Const (\<^const_name>\<open>Orderings.less_eq\<close>,_)$y$z =>
  1106        if Thm.term_of x aconv y then Ferrante_Rackoff_Data.Le
  1106        if Thm.term_of x aconv y then Ferrante_Rackoff_Data.Le
  1107        else if Thm.term_of x aconv z then Ferrante_Rackoff_Data.Ge
  1107        else if Thm.term_of x aconv z then Ferrante_Rackoff_Data.Ge
  1108        else Ferrante_Rackoff_Data.Nox
  1108        else Ferrante_Rackoff_Data.Nox
  1109    | _ => Ferrante_Rackoff_Data.Nox
  1109    | _ => Ferrante_Rackoff_Data.Nox
  1110  in h end;
  1110  in h end;