Fixed Bug in instantiation of Groebner Bases to field: dest_const used to raise TERM where the tactic handles ERROR
authorchaieb
Sun, 21 Oct 2007 12:33:12 +0200
changeset 25128 962e4f4142fa
parent 25127 afb5e602ce9d
child 25129 de54445dc82c
Fixed Bug in instantiation of Groebner Bases to field: dest_const used to raise TERM where the tactic handles ERROR
src/HOL/Arith_Tools.thy
--- a/src/HOL/Arith_Tools.thy	Sun Oct 21 02:49:16 2007 +0200
+++ b/src/HOL/Arith_Tools.thy	Sun Oct 21 12:33:12 2007 +0200
@@ -584,10 +584,11 @@
  | Const (@{const_name "HOL.uminus"},_)$t => numeral_is_const (Thm.dest_arg ct)
  | t => can HOLogic.dest_number t
 
-fun dest_const ct = case term_of ct of
+fun dest_const ct = ((case term_of ct of
    Const (@{const_name "HOL.divide"},_) $ a $ b=>
     Rat.rat_of_quotient (snd (HOLogic.dest_number a), snd (HOLogic.dest_number b))
- | t => Rat.rat_of_int (snd (HOLogic.dest_number t))
+ | t => Rat.rat_of_int (snd (HOLogic.dest_number t))) 
+   handle TERM _ => error "ring_dest_const")
 
 fun mk_const phi cT x =
  let val (a, b) = Rat.quotient_of_rat x