Index: kernel/ring.cc
===================================================================
--- kernel/ring.cc	(revision 7efd3caffaf4f30f1464d6160c4257b82947837c)
+++ kernel/ring.cc	(revision 7d15743bd10336dc332c654782d7743221069b63)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: ring.cc,v 1.59 2007-05-24 07:53:42 Singular Exp $ */
+/* $Id: ring.cc,v 1.60 2007-05-24 13:42:17 Singular Exp $ */
 
 /*
@@ -59,4 +59,5 @@
   "L", //ringorder_L,
   "aa", //ringorder_aa
+  "rs", //ringorder_rs,
   " _" //ringorder_unspec
 };
@@ -1475,6 +1476,7 @@
   {
     if (r2->order[i] == 0) return 0;
-    if ((r1->order[i] != r2->order[i]) ||
-        (r1->block0[i] != r2->block0[i]) || (r2->block0[i] != r1->block0[i]))
+    if ((r1->order[i] != r2->order[i])
+    || (r1->block0[i] != r2->block0[i])
+    || (r2->block0[i] != r1->block0[i]))
       return 0;
     if (r1->wvhdl[i] != NULL)
@@ -1536,5 +1538,6 @@
   if (rHasSimpleOrder(r))
   {
-    if ((r->order[1] == ringorder_c) || (r->order[1] == ringorder_C))
+    if ((r->order[1] == ringorder_c)
+    || (r->order[1] == ringorder_C))
     {
       switch(r->order[0])
@@ -1546,5 +1549,6 @@
           case ringorder_ls:
           case ringorder_unspec:
-            if (r->order[1] == ringorder_C ||  r->order[0] == ringorder_unspec)
+            if (r->order[1] == ringorder_C
+	    ||  r->order[0] == ringorder_unspec)
               return rOrderType_ExpComp;
             return rOrderType_Exp;
@@ -1552,5 +1556,5 @@
           default:
             assume(r->order[0] == ringorder_lp ||
-                   r->order[0] == ringorder_rp ||
+                   r->order[0] == ringorder_rs ||
                    r->order[0] == ringorder_Dp ||
                    r->order[0] == ringorder_Wp ||
@@ -1579,8 +1583,11 @@
   if (blocks == 1) return TRUE;
   if (blocks > 2)  return FALSE;
-  if (r->order[0] != ringorder_c && r->order[0] != ringorder_C &&
-      r->order[1] != ringorder_c && r->order[1] != ringorder_C)
+  if ((r->order[0] != ringorder_c)
+  && (r->order[0] != ringorder_C)
+  && (r->order[1] != ringorder_c)
+  && i(r->order[1] != ringorder_C))
     return FALSE;
-  if (r->order[1] == ringorder_M || r->order[0] == ringorder_M)
+  if i((r->order[1] == ringorder_M)
+  || (r->order[0] == ringorder_M))
     return FALSE;
   return TRUE;
@@ -1634,15 +1641,15 @@
 {
   int blocks = rBlocks(r) - 1;
-  if (blocks > 3 || blocks < 2) return FALSE;
+  if ((blocks > 3) || (blocks < 2)) return FALSE;
   if (blocks == 3)
   {
-    return ((r->order[0] == ringorder_aa && r->order[1] != ringorder_M &&
-             (r->order[2] == ringorder_c || r->order[2] == ringorder_C)) ||
-            ((r->order[0] == ringorder_c || r->order[0] == ringorder_C) &&
-             r->order[1] == ringorder_aa && r->order[2] != ringorder_M));
+    return (((r->order[0] == ringorder_aa) && (r->order[1] != ringorder_M) &&
+             ((r->order[2] == ringorder_c) || (r->order[2] == ringorder_C))) ||
+            (((r->order[0] == ringorder_c) || (r->order[0] == ringorder_C)) &&
+             (r->order[1] == ringorder_aa) && (r->order[2] != ringorder_M)));
   }
   else
   {
-    return (r->order[0] == ringorder_aa && r->order[1] != ringorder_M);
+    return ((r->order[0] == ringorder_aa) && (r->order[1] != ringorder_M));
   }
 }
@@ -1657,5 +1664,5 @@
     {
       sro_ord* o=&(r->typ[pos]);
-      if (o->ord_typ == ro_syzcomp || o->ord_typ == ro_syz) return TRUE;
+      if ((o->ord_typ == ro_syzcomp) || (o->ord_typ == ro_syz)) return TRUE;
     }
   }
@@ -1702,5 +1709,5 @@
         case ringorder_a64: /* assume: all weight are non-negative!*/
         case ringorder_lp:
-        case ringorder_rp:
+        case ringorder_rs:
         case ringorder_dp:
         case ringorder_Dp:
@@ -2245,5 +2252,5 @@
         else
         {
-          order[j]=ringorder_rp;
+          order[j]=ringorder_rs;
           need_other_ring=TRUE;
           omit_degree=FALSE;
@@ -2500,4 +2507,5 @@
       break;
     case ringorder_ls:
+    case ringorder_rs:
     case ringorder_ds:
     case ringorder_Ds:
@@ -2536,7 +2544,10 @@
   r->firstBlockEnds=block1[i];
   r->firstwv = wvhdl[i];
-  if ((order[i]== ringorder_ws) || (order[i]==ringorder_Ws)
-  || (order[i]== ringorder_wp) || (order[i]==ringorder_Wp)
-  || (order[i]== ringorder_a) /*|| (order[i]==ringorder_A)*/)
+  if ((order[i]== ringorder_ws)
+  || (order[i]==ringorder_Ws)
+  || (order[i]== ringorder_wp) 
+  || (order[i]==ringorder_Wp)
+  || (order[i]== ringorder_a)
+   /*|| (order[i]==ringorder_A)*/)
   {
     int j;
@@ -2619,11 +2630,18 @@
       r->ComponentOrder=-1;
     if (r->OrdSgn == -1) r->pLDeg = pLDeg0c;
-    if ((order[0] == ringorder_lp) || (order[0] == ringorder_ls) || order[0] == ringorder_rp)
+    if ((order[0] == ringorder_lp)
+    || (order[0] == ringorder_ls)
+    || (order[0] == ringorder_rp)
+    || (order[0] == ringorder_rs))
     {
       r->LexOrder=TRUE;
       r->pLDeg = pLDeg1c;
-    }
-    if (order[0] == ringorder_wp || order[0] == ringorder_Wp ||
-        order[0] == ringorder_ws || order[0] == ringorder_Ws)
+      r->pFDeg = pTotaldegree;
+    }
+    if ((order[0] == ringorder_a) 
+    || (order[0] == ringorder_wp) 
+    || (order[0] == ringorder_Wp) 
+    || (order[0] == ringorder_ws) 
+    || (order[0] == ringorder_Ws))
       r->pFDeg = pWFirstTotalDegree;
     r->firstBlockEnds=block1[0];
@@ -2641,13 +2659,20 @@
         order[0]==ringorder_s)
       r->ComponentOrder=-1;
-    if ((order[1] == ringorder_lp) || (order[1] == ringorder_ls) || order[1] == ringorder_rp)
+    if ((order[1] == ringorder_lp)
+    || (order[1] == ringorder_ls)
+    || (order[1] == ringorder_rp)
+    || order[1] == ringorder_rs)
     {
       r->LexOrder=TRUE;
       r->pLDeg = pLDeg1c;
+      r->pFDeg = pTotaldegree;
     }
     r->firstBlockEnds=block1[1];
     r->firstwv = wvhdl[1];
-    if (order[1] == ringorder_wp || order[1] == ringorder_Wp ||
-        order[1] == ringorder_ws || order[1] == ringorder_Ws)
+    if ((order[1] == ringorder_a) 
+    || (order[1] == ringorder_wp) 
+    || (order[1] == ringorder_Wp) 
+    || (order[1] == ringorder_ws) 
+    || (order[1] == ringorder_Ws))
       r->pFDeg = pWFirstTotalDegree;
   }
@@ -2829,4 +2854,9 @@
       case ringorder_ls:
         rO_LexVars_neg(j, j_bits, r->block0[i],r->block1[i], prev_ordsgn,
+                       tmp_ordsgn,v, bits, -1);
+        break;
+
+      case ringorder_rs:
+        rO_LexVars_neg(j, j_bits, r->block1[i],r->block0[i], prev_ordsgn,
                        tmp_ordsgn,v, bits, -1);
         break;
@@ -3936,4 +3966,5 @@
       // not yet done:
       case ringorder_ls:
+      case ringorder_rs:
       case ringorder_ds:
       case ringorder_Ds:
Index: kernel/ring.h
===================================================================
--- kernel/ring.h	(revision 7efd3caffaf4f30f1464d6160c4257b82947837c)
+++ kernel/ring.h	(revision 7d15743bd10336dc332c654782d7743221069b63)
@@ -7,5 +7,5 @@
 * ABSTRACT - the interpreter related ring operations
 */
-/* $Id: ring.h,v 1.20 2007-05-11 10:48:05 wienand Exp $ */
+/* $Id: ring.h,v 1.21 2007-05-24 13:42:17 Singular Exp $ */
 
 /* includes */
@@ -286,4 +286,5 @@
   // the following are only used internally
   ringorder_aa, // for idElimination, like a, except pFDeg, pWeigths ignore it
+  ringorder_rs,
   ringorder_unspec
 } rRingOrder_t;
