src/HOL/Tools/Groebner_Basis/groebner.ML
changeset 29800 f73a68c9d810
parent 29269 5c25a2012975
child 30866 dd5117e2d73e
equal deleted inserted replaced
29792:c566b63ce76a 29800:f73a68c9d810
   710 fun neq_rule n th = [prove_nz n, th] MRS neq_thm;
   710 fun neq_rule n th = [prove_nz n, th] MRS neq_thm;
   711 fun mk_add th1 = combination(arg_cong_rule ring_add_tm th1);
   711 fun mk_add th1 = combination(arg_cong_rule ring_add_tm th1);
   712 
   712 
   713 fun refute tm =
   713 fun refute tm =
   714  if tm aconvc false_tm then assume_Trueprop tm else
   714  if tm aconvc false_tm then assume_Trueprop tm else
   715   let
   715  ((let
   716    val (nths0,eths0) = List.partition (is_neg o concl) (HOLogic.conj_elims (assume_Trueprop tm))
   716    val (nths0,eths0) = List.partition (is_neg o concl) (HOLogic.conj_elims (assume_Trueprop tm))
   717    val  nths = filter (is_eq o dest_arg o concl) nths0
   717    val  nths = filter (is_eq o dest_arg o concl) nths0
   718    val eths = filter (is_eq o concl) eths0
   718    val eths = filter (is_eq o concl) eths0
   719   in
   719   in
   720    if null eths then
   720    if null eths then
   765     val (l,r) = dest_eq(dest_arg(concl th4))
   765     val (l,r) = dest_eq(dest_arg(concl th4))
   766    in implies_intr (mk_comb cTrp tm)
   766    in implies_intr (mk_comb cTrp tm)
   767                         (equal_elim (arg_cong_rule cTrp (eqF_intr th4))
   767                         (equal_elim (arg_cong_rule cTrp (eqF_intr th4))
   768                    (reflexive l |> mk_object_eq))
   768                    (reflexive l |> mk_object_eq))
   769    end
   769    end
   770   end
   770   end) handle ERROR _ => raise CTERM ("Gorbner-refute: unable to refute",[tm]))
   771 
   771 
   772 fun ring tm =
   772 fun ring tm =
   773  let
   773  let
   774   fun mk_forall x p =
   774   fun mk_forall x p =
   775       mk_comb (cterm_rule (instantiate' [SOME (ctyp_of_term x)] []) @{cpat "All:: (?'a => bool) => _"}) (cabs x p)
   775       mk_comb (cterm_rule (instantiate' [SOME (ctyp_of_term x)] []) @{cpat "All:: (?'a => bool) => _"}) (cabs x p)