src/HOL/Tools/Groebner_Basis/groebner.ML
changeset 33039 5018f6a76b3f
parent 33035 15eab423e573
parent 33038 8f9594c31de4
child 33042 ddf1f03a9ad9
child 33049 c38f02fdf35d
equal deleted inserted replaced
33036:c61fe520602b 33039:5018f6a76b3f
   346         let val lis = resolve_proof vars lin in
   346         let val lis = resolve_proof vars lin in
   347             map (fn (n,p) => (n,grob_cmul pol p)) lis end
   347             map (fn (n,p) => (n,grob_cmul pol p)) lis end
   348   | Add(lin1,lin2) =>
   348   | Add(lin1,lin2) =>
   349         let val lis1 = resolve_proof vars lin1
   349         let val lis1 = resolve_proof vars lin1
   350             val lis2 = resolve_proof vars lin2
   350             val lis2 = resolve_proof vars lin2
   351             val dom = distinct (op =) ((map fst lis1) union (map fst lis2))
   351             val dom = distinct (op =) (union (op =) (map fst lis1, map fst lis2))
   352         in
   352         in
   353             map (fn n => let val a = these (AList.lookup (op =) lis1 n)
   353             map (fn n => let val a = these (AList.lookup (op =) lis1 n)
   354                              val b = these (AList.lookup (op =) lis2 n)
   354                              val b = these (AList.lookup (op =) lis2 n)
   355                          in (n,grob_add a b) end) dom end;
   355                          in (n,grob_add a b) end) dom end;
   356 
   356 
   882   end
   882   end
   883 
   883 
   884  fun isolate_monomials vars tm =
   884  fun isolate_monomials vars tm =
   885  let 
   885  let 
   886   val (cmons,vmons) =
   886   val (cmons,vmons) =
   887     List.partition (fn m => null (gen_inter op aconvc (frees m, vars)))
   887     List.partition (fn m => null (inter op aconvc (frees m, vars)))
   888                    (striplist ring_dest_add tm)
   888                    (striplist ring_dest_add tm)
   889   val cofactors = map (fn v => find_multipliers v vmons) vars
   889   val cofactors = map (fn v => find_multipliers v vmons) vars
   890   val cnc = if null cmons then zero_tm
   890   val cnc = if null cmons then zero_tm
   891              else Thm.capply ring_neg_tm
   891              else Thm.capply ring_neg_tm
   892                     (list_mk_binop ring_add_tm cmons) 
   892                     (list_mk_binop ring_add_tm cmons)