equal
deleted
inserted
replaced
459 fun sign_conv pos_th neg_th ss t = |
459 fun sign_conv pos_th neg_th ss t = |
460 let val T = fastype_of t; |
460 let val T = fastype_of t; |
461 val zero = Const(@{const_name Groups.zero}, T); |
461 val zero = Const(@{const_name Groups.zero}, T); |
462 val less = Const(@{const_name Orderings.less}, [T,T] ---> HOLogic.boolT); |
462 val less = Const(@{const_name Orderings.less}, [T,T] ---> HOLogic.boolT); |
463 val pos = less $ zero $ t and neg = less $ t $ zero |
463 val pos = less $ zero $ t and neg = less $ t $ zero |
|
464 val thy = Proof_Context.theory_of (Simplifier.the_context ss) |
464 fun prove p = |
465 fun prove p = |
465 Option.map Eq_True_elim (Lin_Arith.simproc ss p) |
466 SOME (Eq_True_elim (Simplifier.asm_rewrite ss (Thm.cterm_of thy p))) |
466 handle THM _ => NONE |
467 handle THM _ => NONE |
467 in case prove pos of |
468 in case prove pos of |
468 SOME th => SOME(th RS pos_th) |
469 SOME th => SOME(th RS pos_th) |
469 | NONE => (case prove neg of |
470 | NONE => (case prove neg of |
470 SOME th => SOME(th RS neg_th) |
471 SOME th => SOME(th RS neg_th) |