Index: kernel/ideals.cc
===================================================================
--- kernel/ideals.cc	(revision b7cfaff1d9a4ec8364a64a54d2b7e009f91418e2)
+++ kernel/ideals.cc	(revision 86152998894ac968561dfca4ba268464c73e7b74)
@@ -274,14 +274,14 @@
   rChangeCurrRing(r);
   // create 1-t, t
-  poly omt=pOne();
-  pSetExp(omt,r->N,1);
-  poly t=pCopy(omt);
-  pSetm(omt);
-  omt=pNeg(omt);
-  omt=pAdd(omt,pOne());
+  poly omt=p_One(currRing);
+  p_SetExp(omt,r->N,1,currRing);
+  poly t=p_Copy(omt,currRing);
+  p_Setm(omt,currRing);
+  omt=p_Neg(omt,currRing);
+  omt=p_Add_q(omt,pOne(),currRing);
   // compute (1-t)*h1
-  h1=(ideal)mpMultP((matrix)h1,omt);
+  h1=(ideal)mp_MultP((matrix)h1,omt,currRing);
   // compute t*h2
-  h2=(ideal)mpMultP((matrix)h2,pCopy(t));
+  h2=(ideal)mp_MultP((matrix)h2,pCopy(t),currRing);
   // (1-t)h1 + t*h2
   h=idInit(IDELEMS(h1)+IDELEMS(h2),1);
@@ -347,5 +347,6 @@
 
   ring orig_ring=currRing;
-  ring syz_ring=rCurrRingAssure_SyzComp();
+  ring syz_ring=rAssure_SyzComp(orig_ring,TRUE);
+  rChangeCurrRing(syz_ring);
   rSetSyzComp(length, syz_ring);
 
@@ -360,9 +361,9 @@
         temp->m[k] = pCopy(first->m[i]);
       else
-        temp->m[k] = prCopyR(first->m[i], orig_ring);
+        temp->m[k] = prCopyR(first->m[i], orig_ring, syz_ring);
       q = pOne();
       pSetComp(q,i+1+length);
       pSetmComp(q);
-      if (flength==0) pShift(&(temp->m[k]),1);
+      if (flength==0) p_Shift(&(temp->m[k]),1,currRing);
       p = temp->m[k];
       while (pNext(p)!=NULL) pIter(p);
@@ -378,6 +379,6 @@
         temp->m[k] = pCopy(second->m[i]);
       else
-        temp->m[k] = prCopyR(second->m[i], orig_ring);
-      if (slength==0) pShift(&(temp->m[k]),1);
+        temp->m[k] = prCopyR(second->m[i], orig_ring,currRing);
+      if (slength==0) p_Shift(&(temp->m[k]),1,currRing);
       k++;
     }
@@ -486,5 +487,6 @@
 
   ring orig_ring=currRing;
-  ring syz_ring=rCurrRingAssure_SyzComp();
+  ring syz_ring=rAssure_SyzComp(orig_ring,TRUE);
+  rChangeCurrRing(syz_ring);
   rSetSyzComp(syzComp, syz_ring);
 
@@ -515,6 +517,6 @@
             bigmat->m[i] = pCopy(arg[j]->m[l]);
           else
-            bigmat->m[i] = prCopyR(arg[j]->m[l], orig_ring);
-          pShift(&(bigmat->m[i]),k*maxrk+isIdeal);
+            bigmat->m[i] = prCopyR(arg[j]->m[l], orig_ring,currRing);
+          p_Shift(&(bigmat->m[i]),k*maxrk+isIdeal,currRing);
           i++;
         }
@@ -542,5 +544,5 @@
       else
         p = prCopyR(tempstd->m[j], syz_ring);
-      pShift(&p,-syzComp-isIdeal);
+      p_Shift(&p,-syzComp-isIdeal,currRing);
       result->m[k] = p;
       k++;
@@ -578,5 +580,5 @@
   if (k == 0)
   {
-    for (j=0; j<=i; j++) pShift(&(h2->m[j]),1);
+    for (j=0; j<=i; j++) p_Shift(&(h2->m[j]),1,currRing);
     k = 1;
   }
@@ -678,10 +680,10 @@
   {
     ideal result=idFreeModule(idElemens_h1/*IDELEMS(h1)*/);
-    int curr_syz_limit=rGetCurrSyzLimit();
+    int curr_syz_limit=rGetCurrSyzLimit(currRing);
     if (curr_syz_limit>0)
     for (ii=0;ii<idElemens_h1/*IDELEMS(h1)*/;ii++)
     {
       if (h1->m[ii]!=NULL)
-        pShift(&h1->m[ii],curr_syz_limit);
+        p_Shift(&h1->m[ii],curr_syz_limit,currRing);
     }
     return result;
@@ -692,5 +694,6 @@
   assume(currRing != NULL);
   ring orig_ring=currRing;
-  ring syz_ring=rCurrRingAssure_SyzComp();
+  ring syz_ring=rAssure_SyzComp(orig_ring.TRUE);
+  rChangeCurrRing(syz_ring);
 
   if (setSyzComp)
@@ -723,5 +726,5 @@
       {
         if (p_MinComp(s_h3->m[j],syz_ring) > k)
-          pShift(&s_h3->m[j], -k);
+          p_Shift(&s_h3->m[j], -k,currRing);
         else
           pDelete(&s_h3->m[j]);
@@ -814,5 +817,6 @@
   assume(currRing != NULL);
   ring orig_ring=currRing;
-  ring syz_ring=rCurrRingAssure_SyzComp();
+  ring syz_ring=rAssure_SyzComp(orig_ring,TRUE);
+  rChangeCurrRing(syz_ring);
 
   rSetSyzComp(k,syz_ring);
@@ -869,10 +873,10 @@
     {
       *syz=idFreeModule(IDELEMS(h1));
-      int curr_syz_limit=rGetCurrSyzLimit();
+      int curr_syz_limit=rGetCurrSyzLimit(currRing);
       if (curr_syz_limit>0)
       for (int ii=0;ii<IDELEMS(h1);ii++)
       {
         if (h1->m[ii]!=NULL)
-          pShift(&h1->m[ii],curr_syz_limit);
+          p_Shift(&h1->m[ii],curr_syz_limit,currRing);
       }
     }
@@ -887,5 +891,6 @@
 
   ring orig_ring = currRing;
-  ring syz_ring = rCurrRingAssure_SyzComp();
+  ring syz_ring = rAssure_SyzComp(orig_ring,TRUE);
+  rChangeCurrRing(syz_ring);
   rSetSyzComp(k,syz_ring);
 
@@ -930,5 +935,5 @@
           }
         }
-        if (!inputIsIdeal) pShift(&(s_h3->m[j]), -1);
+        if (!inputIsIdeal) p_Shift(&(s_h3->m[j]), -1,currRing);
       }
       else
@@ -937,5 +942,5 @@
         if (lift3)
         {
-          pShift(&s_h3->m[j], -k);
+          p_Shift(&s_h3->m[j], -k,currRing);
           (*syz)->m[j]=s_h3->m[j];
           s_h3->m[j]=NULL;
@@ -1094,5 +1099,6 @@
 
   ring orig_ring=currRing;
-  ring syz_ring=rCurrRingAssure_SyzComp();
+  ring syz_ring=rAssure_SyzComp(orig_ring,TRUE);
+  rChangeCurrRing(syz_ring);
   rSetSyzComp(k,syz_ring);
 
@@ -1132,5 +1138,5 @@
     {
       if (s_temp->m[j-1]!=NULL)
-        pShift(&(s_temp->m[j-1]),1);
+        p_Shift(&(s_temp->m[j-1]),1,currRing);
     }
   }
@@ -1185,5 +1191,5 @@
         }
       }
-      pShift(&(s_result->m[j]),-k);
+      p_Shift(&(s_result->m[j]),-k,currRing);
       pNeg(s_result->m[j]);
     }
@@ -1195,5 +1201,5 @@
       if (s_rest->m[j-1]!=NULL)
       {
-        pShift(&(s_rest->m[j-1]),-1);
+        p_Shift(&(s_rest->m[j-1]),-1,currRing);
         s_rest->m[j-1] = s_rest->m[j-1];
       }
@@ -1245,5 +1251,5 @@
         }
       }
-      pShift(&s_result->m[i],-comps_to_add);
+      p_Shift(&s_result->m[i],-comps_to_add,currRing);
     }
   }
@@ -1351,7 +1357,7 @@
       p = pCopy(h2->m[i]);
       if (k2 == 0)
-        pShift(&p,j*k+1);
+        p_Shift(&p,j*k+1,currRing);
       else
-        pShift(&p,j*k);
+        p_Shift(&p,j*k,currRing);
       q = pAdd(q,p);
       j++;
@@ -1381,5 +1387,5 @@
       {
         p = pCopy_noCheck(h4->m[i-1]);
-        pShift(&p,1);
+        p_Shift(&p,1,currRing);
         h4->m[i] = p;
       }
@@ -1397,7 +1403,7 @@
         p = pCopy(temph1->m[l]);
         if (k1 == 0)
-          pShift(&p,ll*k+1);
+          p_Shift(&p,ll*k+1,currRing);
         else
-          pShift(&p,ll*k);
+          p_Shift(&p,ll*k,currRing);
         if (kkk >= IDELEMS(h4))
         {
@@ -1454,5 +1460,6 @@
 
   ring orig_ring=currRing;
-  ring syz_ring=rCurrRingAssure_SyzComp();
+  ring syz_ring=rAssure_SyzComp(orig_ring.TRUE);
+  rChangeCurrRing(syz_ring);
   rSetSyzComp(kmax-1,syz_ring);
   if (orig_ring!=syz_ring)
@@ -1495,7 +1502,7 @@
     {
       if (resultIsIdeal)
-        pShift(&s_h3->m[i],-kmax);
+        p_Shift(&s_h3->m[i],-kmax,currRing);
       else
-        pShift(&s_h3->m[i],-kmax+1);
+        p_Shift(&s_h3->m[i],-kmax+1,currRing);
     }
     else
@@ -2138,5 +2145,5 @@
     else
     {
-      pShift(&(temp1->m[i]),-length);
+      p_Shift(&(temp1->m[i]),-length,currRing);
     }
   }
@@ -2199,5 +2206,5 @@
     if(temp->m[i]!=NULL)
     {
-      if (slength==0) pShift(&(temp->m[i]),1);
+      if (slength==0) p_Shift(&(temp->m[i]),1,currRing);
       p = temp->m[i];
       while (pNext(p)!=NULL) pIter(p);
@@ -2217,5 +2224,5 @@
       {
         temp->m[k] = pCopy(h1->m[i]);
-        if (flength==0) pShift(&(temp->m[k]),1);
+        if (flength==0) p_Shift(&(temp->m[k]),1,currRing);
         k++;
       }
@@ -2224,5 +2231,6 @@
 
   ring orig_ring=currRing;
-  ring syz_ring=rCurrRingAssure_SyzComp();
+  ring syz_ring=rAssure_SyzComp(orig_ring.TRUE);
+  rChangeCurrRing(syz_ring);
   rSetSyzComp(length, syz_ring);
   ideal s_temp;
@@ -2259,5 +2267,5 @@
     else
     {
-      pShift(&(s_temp1->m[i]),-length);
+      p_Shift(&(s_temp1->m[i]),-length,currRing);
     }
   }
