Index: kernel/kbuckets.cc
===================================================================
--- kernel/kbuckets.cc	(revision 6d6383bff4329213dfc31400e874a9a1ae140664)
+++ kernel/kbuckets.cc	(revision d772c3a7fde8da702386b51d66296d48b7be5edf)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: kbuckets.cc,v 1.33 2007-05-11 10:48:03 wienand Exp $ */
+/* $Id: kbuckets.cc,v 1.34 2008-01-30 09:01:36 wienand Exp $ */
 
 #include "mod2.h"
@@ -595,11 +595,4 @@
       {
         bucket->coef[i] = p_Mult_nn(bucket->coef[i],n,r);
-#ifdef HAVE_RING2TOM_OLD
-        if (r->cring == 1 && (long) bucket->coef[i] == 0) {
-          bucket->coef[i] = NULL;
-          bucket->buckets[i] = NULL;
-          bucket->buckets_length[i] = 0;
-        }
-#endif
       }
       else
@@ -621,7 +614,4 @@
 #else
   bucket->p = p_Mult_nn(bucket->p, n, bucket->bucket_ring);
-#ifdef HAVE_RING2TOM_OLD
-  if (r->cring == 1) bucket->buckets_length[i] = pLength(bucket->buckets[i]);
-#endif
 #endif
 }
Index: kernel/kstd2.cc
===================================================================
--- kernel/kstd2.cc	(revision 6d6383bff4329213dfc31400e874a9a1ae140664)
+++ kernel/kstd2.cc	(revision d772c3a7fde8da702386b51d66296d48b7be5edf)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: kstd2.cc,v 1.56 2007-11-06 16:30:20 Singular Exp $ */
+/* $Id: kstd2.cc,v 1.57 2008-01-30 09:01:36 wienand Exp $ */
 /*
 *  ABSTRACT -  Kernel: alg. of Buchberger
@@ -146,77 +146,4 @@
 
 #ifdef HAVE_RING2TOM
-/*        Obsolute since changes to pLmDiv
-// return -1 if no divisor is found
-//        number of first divisor, otherwise
-int kRingFindDivisibleByInT(const TSet &T, const unsigned long* sevT,
-                        const int tl, const LObject* L, const int start)
-{
-  unsigned long not_sev = ~L->sev;
-  int j = start;
-  poly p;
-  ring r;
-  L->GetLm(p, r);
-
-  pAssume(~not_sev == p_GetShortExpVector(p, r));
-
-  {
-    loop
-    {
-      if (j > tl) return -1;
-#if defined(PDEBUG) || defined(PDIV_DEBUG)
-      if (p_LmRingShortDivisibleBy(T[j].p, sevT[j],
-                               p, not_sev, r))
-        return j;
-#else
-      if ( !(sevT[j] & not_sev) &&
-           p_LmRingDivisibleBy(T[j].p, p, r) )
-        return j;
-#endif
-      j++;
-    }
-  }
-  return -1;
-}
-
-// same as above, only with set S
-int kRingFindDivisibleByInS(const polyset &S, const unsigned long* sev, const int sl, LObject* L)
-{
-  unsigned long not_sev = ~L->sev;
-  poly p = L->GetLmCurrRing();
-  int j = 0;
-  //PrintS("FindDiv: p="); wrp(p); PrintLn();
-  pAssume(~not_sev == p_GetShortExpVector(p, currRing));
-  loop
-  {
-    //PrintS("FindDiv: S[j]="); wrp(S[j]); PrintLn();
-    if (j > sl) return -1;
-#if defined(PDEBUG) || defined(PDIV_DEBUG)
-    if (p_LmRingShortDivisibleBy(S[j], sev[j],
-                             p, not_sev, currRing))
-        return j;
-#else
-    if ( !(sev[j] & not_sev) &&
-         p_LmRingDivisibleBy(S[j], p, currRing) )
-      return j;
-#endif
-    j++;
-  }
-}
-*/
-
-/* now in kutil.cc
-long twoPow(long arg)
-{
-  long t = arg;
-  long result = 1;
-  while (t > 0)
-  {
-    result = 2 * result;
-    t--;
-  }
-  return result;
-}
-*/
-
 NATNUMBER factorial(NATNUMBER arg)
 {
@@ -1011,14 +938,5 @@
   loop
   {
-/* Obsolete since change in pLmDiv
-#ifdef HAVE_RING2TOM
-    if (currRing->cring == 1)
-    {
-      j=kRingFindDivisibleByInS(strat->S,strat->sevS,strat->sl,&P);
-    }
-    else
-#endif
-*/
-      j=kFindDivisibleByInS(strat,&max_ind,&P);
+    j=kFindDivisibleByInS(strat,&max_ind,&P);
     if (j>=0)
     {
Index: kernel/kutil.cc
===================================================================
--- kernel/kutil.cc	(revision 6d6383bff4329213dfc31400e874a9a1ae140664)
+++ kernel/kutil.cc	(revision d772c3a7fde8da702386b51d66296d48b7be5edf)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: kutil.cc,v 1.71 2007-11-09 11:31:53 Singular Exp $ */
+/* $Id: kutil.cc,v 1.72 2008-01-30 09:01:36 wienand Exp $ */
 /*
 * ABSTRACT: kernel: utils for kStd
@@ -2757,5 +2757,5 @@
   int j=pos;
 
-#ifdef HAVE_RING2TOM
+#ifdef HAVE_RINGS
   assume (!rField_is_Ring(currRing));
 #endif
@@ -4079,77 +4079,4 @@
   }
 }
-/*
-#ifdef HAVE_RING2TOM
-TObject*
-kRingFindDivisibleByInS(kStrategy strat, int pos, LObject* L, TObject *T,
-                    long ecart)
-{
-  int j = 0;
-  const unsigned long not_sev = ~L->sev;
-  const unsigned long* sev = strat->sevS;
-  poly p;
-  ring r;
-  L->GetLm(p, r);
-
-  assume(~not_sev == p_GetShortExpVector(p, r));
-
-  if (r == currRing)
-  {
-    loop
-    {
-      if (j > pos) return NULL;
-#if defined(PDEBUG) || defined(PDIV_DEBUG)
-      if (p_LmRingShortDivisibleBy(strat->S[j], sev[j], p, not_sev, r) &&
-          (ecart== LONG_MAX || ecart>= strat->ecartS[j]))
-        break;
-#else
-      if (!(sev[j] & not_sev) &&
-          (ecart== LONG_MAX || ecart>= strat->ecartS[j]) &&
-          p_LmRingDivisibleBy(strat->S[j], p, r))
-        break;
-
-#endif
-      j++;
-    }
-    // if called from NF, T objects do not exist:
-    if (strat->tl < 0 || strat->S_2_R[j] == -1)
-    {
-      T->Set(strat->S[j], r, strat->tailRing);
-      return T;
-    }
-    else
-    {
-      assume (j >= 0 && j <= strat->tl && strat->S_2_T(j) != NULL &&
-              strat->S_2_T(j)->p == strat->S[j]);
-      return strat->S_2_T(j);
-    }
-  }
-  else
-  {
-    TObject* t;
-    loop
-    {
-      if (j > pos) return NULL;
-      assume(strat->S_2_R[j] != -1);
-#if defined(PDEBUG) || defined(PDIV_DEBUG)
-      t = strat->S_2_T(j);
-      assume(t != NULL && t->t_p != NULL && t->tailRing == r);
-      if (p_LmRingShortDivisibleBy(t->t_p, sev[j], p, not_sev, r) &&
-          (ecart== LONG_MAX || ecart>= strat->ecartS[j]))
-        return t;
-#else
-      if (! (sev[j] & not_sev) && (ecart== LONG_MAX || ecart>= strat->ecartS[j]))
-      {
-        t = strat->S_2_T(j);
-        assume(t != NULL && t->t_p != NULL && t->tailRing == r && t->p == strat->S[j]);
-        if (p_LmRingDivisibleBy(t->t_p, p, r)) return t;
-      }
-#endif
-      j++;
-    }
-  }
-}
-#endif
-*/
 
 poly redtail (LObject* L, int pos, kStrategy strat)
@@ -4504,5 +4431,5 @@
   if ((strat->sl>=0)
 #ifdef HAVE_RINGS
-       && !rField_is_Ring(currRing)
+       && nIsUnit(pGetCoef(strat->L[strat->Ll].p)
 #endif
        && pIsConstant(strat->S[0]))
@@ -4600,5 +4527,10 @@
   }
   /*- test, if a unit is in F -*/
-  if ((strat->Ll>=0) && pIsConstant(strat->L[strat->Ll].p))
+
+  if ((strat->Ll>=0) 
+#ifdef HAVE_RINGS
+       && nIsUnit(pGetCoef(strat->L[strat->Ll].p)
+#endif
+       && pIsConstant(strat->L[strat->Ll].p))
   {
     while (strat->Ll>0) deleteInL(strat->L,&strat->Ll,strat->Ll-1,strat);
@@ -4860,10 +4792,5 @@
   while (j <= maxIndex)
   {
-#ifdef HAVE_RING2TOM_OLD
-    if ((currRing->cring == 1 && pLmRingShortDivisibleBy(strat->S[j],strat->sevS[j], h, not_sev)) ||
-        (currRing->cring == 0 && pLmShortDivisibleBy(strat->S[j],strat->sevS[j], h, not_sev)))
-#else
     if (pLmShortDivisibleBy(strat->S[j],strat->sevS[j], h, not_sev))
-#endif
     {
       h = ksOldSpolyRed(strat->S[j],h,strat->kNoetherTail());
Index: kernel/kutil.h
===================================================================
--- kernel/kutil.h	(revision 6d6383bff4329213dfc31400e874a9a1ae140664)
+++ kernel/kutil.h	(revision d772c3a7fde8da702386b51d66296d48b7be5edf)
@@ -4,5 +4,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: kutil.h,v 1.28 2007-11-09 11:31:53 Singular Exp $ */
+/* $Id: kutil.h,v 1.29 2008-01-30 09:01:37 wienand Exp $ */
 /*
 * ABSTRACT: kernel: utils for kStd
@@ -280,7 +280,4 @@
   BOOLEAN * NotUsedAxis;
   BOOLEAN * pairtest;/*used for enterOnePair*/
-#ifdef HAVE_RING2TOM
-//  unsigned int * lmcomp;/*used for enterOnePairRing and chainCritRing*/
-#endif
   poly tail;
   leftv kIdeal;
@@ -456,18 +453,4 @@
                     long ecart = LONG_MAX);
 
-/*Obsolete since changes to pLmDiv
-#ifdef HAVE_RING2TOM
-// same for rings
-int kRingFindDivisibleByInT(const TSet &T, const unsigned long* sevT,
-                        const int tl, const LObject* L, const int start=0);
-int kRingFindDivisibleByInS(const polyset &S, const unsigned long* sev,
-                        const int sl, LObject* L);
-
-
-TObject*
-kRingFindDivisibleByInS(kStrategy strat, int pos, LObject* L, TObject *T,
-                    long ecart = LONG_MAX);
-#endif
-*/
 /***************************************************************
  *
@@ -556,13 +539,4 @@
                  kStrategy strat = NULL);
 
-#ifdef HAVE_RING2TOM_OLD
-// same for rings
-int ksRingReducePoly(LObject* PR,
-                 TObject* PW,
-                 poly spNoether = NULL,
-                 number *coef = NULL,
-                 kStrategy strat = NULL);
-#endif
-
 // Reduces PR at Current->next with PW
 // Assumes PR != NULL, Current contained in PR
Index: kernel/pInline1.h
===================================================================
--- kernel/pInline1.h	(revision 6d6383bff4329213dfc31400e874a9a1ae140664)
+++ kernel/pInline1.h	(revision d772c3a7fde8da702386b51d66296d48b7be5edf)
@@ -7,5 +7,5 @@
  *  Author:  obachman (Olaf Bachmann)
  *  Created: 8/00
- *  Version: $Id: pInline1.h,v 1.13 2007-05-24 10:02:43 wienand Exp $
+ *  Version: $Id: pInline1.h,v 1.14 2008-01-30 09:01:37 wienand Exp $
  *******************************************************************/
 #ifndef PINLINE1_H
@@ -20,7 +20,4 @@
 #include "structs.h"
 #include "numbers.h"
-#ifdef HAVE_RINGMODN
-// #include "febase.h"
-#endif
 
 #if PDEBUG > 0 || defined(NO_PINLINE1)
@@ -399,35 +396,4 @@
 }
 
-#ifdef HAVE_RING2TOM_OLD
-/***************************************************************
- *
- * divisibility for rings (considers coefficients)
- *
- ***************************************************************/
-// return: FALSE, if there exists i, such that a->exp[i] > b->exp[i]
-//         TRUE, otherwise
-// (1) Consider long vars, instead of single exponents
-// (2) Clearly, if la > lb, then FALSE
-// (3) Suppose la <= lb, and consider first bits of single exponents in l:
-//     if TRUE, then value of these bits is la ^ lb
-//     if FALSE, then la-lb causes an "overflow" into one of those bits, i.e.,
-//               la ^ lb != la - lb
-static inline BOOLEAN _p_LmRingDivisibleByNoComp(poly a, poly b, ring r)
-{
-  BOOLEAN mDiv = _p_LmDivisibleByNoComp(a, b, r);
-  if (mDiv) {
-    long lside = (long) p_GetCoeff(a,r);
-    long rside = (long) p_GetCoeff(b,r);
-    // Später durch bitvergleiche viel schneller  TODO OLIVER
-    while (lside%2 == 0 && rside%2 == 0) {
-      lside = lside / 2;
-      rside = rside / 2;
-    }
-    return (lside%2 != 0);     // Is lside, i.e. LC(a), a unit?
-  }
-  return FALSE;
-}
-#endif
-
 static inline BOOLEAN _p_LmDivisibleByNoComp(poly a, ring r_a, poly b, ring r_b)
 {
@@ -448,22 +414,4 @@
 #endif
 }
-
-#ifdef HAVE_RING2TOM_OLD
-static inline BOOLEAN _p_LmRingDivisibleByNoComp(poly a, ring r_a, poly b, ring r_b)
-{
-  BOOLEAN mDiv = _p_LmDivisibleByNoComp(a, r_a, b, r_b);
-  if (mDiv) {
-    long lside = (long) p_GetCoeff(a, r_a);
-    long rside = (long) p_GetCoeff(b, r_b);
-    // Später durch bitvergleiche viel schneller TODO OLIVER
-    while (lside%2 == 0 && rside%2 == 0) {
-      lside = lside / 2;
-      rside = rside / 2;
-    }
-    return (lside%2 != 0);
-  }
-  return FALSE;
-}
-#endif
 
 static inline BOOLEAN _p_LmDivisibleBy(poly a, poly b, ring r)
@@ -494,15 +442,4 @@
 }
 
-#ifdef HAVE_RING2TOM_OLD
-PINLINE1 BOOLEAN p_LmRingDivisibleBy(poly a, poly b, ring r)
-{
-  p_LmCheckPolyRing1(b, r);
-  pIfThen1(a != NULL, p_LmCheckPolyRing1(b, r));
-  if (p_GetComp(a, r) == 0 || p_GetComp(a,r) == p_GetComp(b,r))
-    return _p_LmRingDivisibleByNoComp(a, b, r);
-  return FALSE;
-}
-#endif
-
 PINLINE1 BOOLEAN p_DivisibleBy(poly a, poly b, ring r)
 {
@@ -548,26 +485,4 @@
 #endif
 }
-
-#ifdef HAVE_RING2TOM_OLD
-PINLINE1 BOOLEAN p_LmRingShortDivisibleBy(poly a, unsigned long sev_a,
-                                          poly b, unsigned long not_sev_b, ring r)
-{
-  p_LmCheckPolyRing1(a, r);
-  p_LmCheckPolyRing1(b, r);
-#ifndef PDIV_DEBUG
-  _pPolyAssume2(p_GetShortExpVector(a, r) == sev_a, a, r);
-  _pPolyAssume2(p_GetShortExpVector(b, r) == ~ not_sev_b, b, r);
-
-  if (sev_a & not_sev_b)
-  {
-    pAssume1(_p_LmRingDivisibleByNoComp(a, b, r) == FALSE);
-    return FALSE;
-  }
-  return p_LmRingDivisibleBy(a, b, r);
-#else
-  return pDebugLmShortDivisibleBy(a, sev_a, r, b, not_sev_b, r);
-#endif
-}
-#endif
 
 PINLINE1 BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, ring r_a,
Index: kernel/p_Numbers.h
===================================================================
--- kernel/p_Numbers.h	(revision 6d6383bff4329213dfc31400e874a9a1ae140664)
+++ kernel/p_Numbers.h	(revision d772c3a7fde8da702386b51d66296d48b7be5edf)
@@ -4,8 +4,8 @@
 /***************************************************************
  *  File:    p_Numbers.h
- *  Purpose: macros/inline functions for number oerations
+ *  Purpose: macros/inline functions for number operations
  *  Author:  obachman (Olaf Bachmann)
  *  Created: 8/00
- *  Version: $Id: p_Numbers.h,v 1.2 2007-05-10 08:12:42 wienand Exp $
+ *  Version: $Id: p_Numbers.h,v 1.3 2008-01-30 09:01:37 wienand Exp $
  *******************************************************************/
 #ifndef P_NUMBERS_H
Index: kernel/p_Procs_Impl.h
===================================================================
--- kernel/p_Procs_Impl.h	(revision 6d6383bff4329213dfc31400e874a9a1ae140664)
+++ kernel/p_Procs_Impl.h	(revision d772c3a7fde8da702386b51d66296d48b7be5edf)
@@ -7,5 +7,5 @@
  *  Author:  obachman (Olaf Bachmann)
  *  Created: 12/00
- *  Version: $Id: p_Procs_Impl.h,v 1.7 2007-05-10 08:12:42 wienand Exp $
+ *  Version: $Id: p_Procs_Impl.h,v 1.8 2008-01-30 09:01:38 wienand Exp $
  *******************************************************************/
 #ifndef P_PROCS_IMPL_H
@@ -89,8 +89,8 @@
 
 // Predicate which returns true if alloc/copy/free of numbers is
-// like that of Zp
+// like that of Zp (rings should use GMP in future)
 #ifdef HAVE_RINGS
 #define ZP_COPY_FIELD(field) \
-  (field == FieldZp || field == FieldGF || field == FieldR || field == RingGeneral)
+  (field == FieldZp || field == FieldGF || field == FieldR)
 #else
 #define ZP_COPY_FIELD(field) \
Index: kernel/polys.h
===================================================================
--- kernel/polys.h	(revision 6d6383bff4329213dfc31400e874a9a1ae140664)
+++ kernel/polys.h	(revision d772c3a7fde8da702386b51d66296d48b7be5edf)
@@ -4,5 +4,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: polys.h,v 1.14 2007-11-16 17:25:10 Singular Exp $ */
+/* $Id: polys.h,v 1.15 2008-01-30 09:01:38 wienand Exp $ */
 /*
 * ABSTRACT - all basic methods to manipulate polynomials of the
@@ -252,13 +252,4 @@
 #define   pIsVector(p)      (pGetComp(p)>0)
 #define   pGetVariables(p,e)  p_GetVariables(p, e, currRing)
-
-#ifdef HAVE_RINGS
-/*
- * Test stuff for dev OLIVER
- */
- 
-// number nGetUnit(number k);
-#endif
-
 
 /***************************************************************
Index: kernel/polys1.cc
===================================================================
--- kernel/polys1.cc	(revision 6d6383bff4329213dfc31400e874a9a1ae140664)
+++ kernel/polys1.cc	(revision d772c3a7fde8da702386b51d66296d48b7be5edf)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: polys1.cc,v 1.29 2007-06-20 09:39:24 wienand Exp $ */
+/* $Id: polys1.cc,v 1.30 2008-01-30 09:01:38 wienand Exp $ */
 
 /*
@@ -482,5 +482,6 @@
 {
 #ifdef HAVE_RINGS
-  if (rField_is_Ring(currRing)) {
+  if (rField_is_Ring(currRing)) 
+  {
     if ((ph!=NULL) && rField_has_Units(currRing))
     {
@@ -498,7 +499,6 @@
         nDelete(&k);
       }
-     return;
-    }
-    return;  //TODO OLIVER
+    }
+    return;
   }
 #endif
Index: kernel/ring.cc
===================================================================
--- kernel/ring.cc	(revision 6d6383bff4329213dfc31400e874a9a1ae140664)
+++ kernel/ring.cc	(revision d772c3a7fde8da702386b51d66296d48b7be5edf)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: ring.cc,v 1.70 2007-11-09 11:29:44 Singular Exp $ */
+/* $Id: ring.cc,v 1.71 2008-01-30 09:01:38 wienand Exp $ */
 
 /*
@@ -269,4 +269,22 @@
     }
   }
+#ifdef HAVE_RINGS
+  else if (rField_is_Ring(r))
+  {
+    PrintS("//   coeff. ring is : ");
+#ifdef HAVE_RINGZ
+    if (rField_is_Ring_Z(r)) PrintS("Integers\n");
+#endif
+#ifdef HAVE_RINGMODN
+    if (rField_is_Ring_ModN(r)) Print("Z/%d\n", r->ringflaga);
+#endif
+#ifdef HAVE_RING2TOM
+    if (rField_is_Ring_2toM(r)) Print("Z/2^%d\n", r->ringflagb);
+#endif
+#ifdef HAVE_RINGPTOM
+    if (rField_is_Ring_PtoM(r)) Print("Z/%d^%d\n", r->ringflaga, r->ringflagb);
+#endif
+  }
+#endif
   else
   {
