Index: Singular/iparith.cc
===================================================================
--- Singular/iparith.cc	(revision 711e26e8e44ee1e7919f92468e0e401554543926)
+++ Singular/iparith.cc	(revision 1187538f48f52e8f271d5b5d0ef0c4c672292679)
@@ -80,5 +80,5 @@
 #ifdef HAVE_PLURAL
   #include <kernel/ratgring.h>
-  #include <kernel/sca.h>
+  #include <polys/nc/sca.h>
   #define ALLOW_PLURAL     1
   #define NO_PLURAL        0
@@ -1698,5 +1698,5 @@
   poly p = pInit();
   int i;
-  for (i=1; i<=pVariables; i++)
+  for (i=1; i<=currRing->N; i++)
   {
     pSetExp(p, i, 1);
@@ -1720,5 +1720,5 @@
   int i;
   for(i=IDELEMS(I);i>=0;i--) d=si_max(d,(int)pDegW(I->m[i],iv));
-  omFreeSize((ADDRESS)iv,(pVariables+1)*sizeof(short));
+  omFreeSize((ADDRESS)iv,(currRing->N+1)*sizeof(short));
   res->data = (char *)((long)d);
   return FALSE;
@@ -1731,5 +1731,5 @@
     short *iv=iv2array((intvec *)v->Data());
     int d=(int)pDegW(p,iv);
-    omFreeSize((ADDRESS)iv,(pVariables+1)*sizeof(short));
+    omFreeSize((ADDRESS)iv,(currRing->N+1)*sizeof(short));
     res->data = (char *)(long(d));
   }
@@ -2062,5 +2062,5 @@
       }
     }
-    if ((iiOp!=FETCH_CMD) || (r->N!=pVariables) || (rPar(r)!=rPar(currRing)))
+    if ((iiOp!=FETCH_CMD) || (r->N!=currRing->N) || (rPar(r)!=rPar(currRing)))
     {
       perm=(int *)omAlloc0((r->N+1)*sizeof(int));
@@ -2070,6 +2070,6 @@
       if (iiOp==IMAP_CMD)
       {
-        maFindPerm(r->names,       r->N,       r->parameter,        r->P,
-                   currRing->names,currRing->N,currRing->parameter, currRing->P,
+        maFindPerm(r->names,       r->N,       rParameter(r),        r->P,
+                   currRing->names,currRing->N,rParameter(currRing), currRing->P,
                    perm,par_perm, currRing->ch);
       }
@@ -2079,5 +2079,5 @@
         if (par_perm_size!=0)
           for(i=si_min(rPar(r),rPar(currRing))-1;i>=0;i--) par_perm[i]=-(i+1);
-        for(i=si_min(r->N,pVariables);i>0;i--) perm[i]=i;
+        for(i=si_min(r->N,currRing->N);i>0;i--) perm[i]=i;
       }
     }
@@ -2085,5 +2085,5 @@
     {
       int i;
-      for(i=0;i<si_min(r->N,pVariables);i++)
+      for(i=0;i<si_min(r->N,currRing->N);i++)
       {
         Print("// var nr %d: %s -> %s\n",i,r->names[i],currRing->names[i]);
@@ -2092,5 +2092,5 @@
       {
         Print("// par nr %d: %s -> %s\n",
-              i,r->parameter[i],currRing->parameter[i]);
+              i,rParameter(r)[i],rParameter(currRing)[i]);
       }
     }
@@ -2528,5 +2528,5 @@
   int i,e;
   BOOLEAN err=FALSE;
-  for(i=si_min(pVariables,iv->length()); i>0; i--)
+  for(i=si_min(currRing->N,iv->length()); i>0; i--)
   {
     e=(*iv)[i-1];
@@ -2534,8 +2534,8 @@
     else err=TRUE;
   }
-  if (iv->length()==(pVariables+1))
+  if (iv->length()==(currRing->N+1))
   {
     res->rtyp=VECTOR_CMD;
-    e=(*iv)[pVariables];
+    e=(*iv)[currRing->N];
     if (e>=0) pSetComp(p,e);
     else err=TRUE;
@@ -2560,7 +2560,7 @@
   int p=0;
   if ((0<i)
-  && (IDRING(h)->parameter!=NULL)
+  && (rParameter(IDRING(h))!=NULL)
   && (i<=(p=rPar(IDRING(h)))))
-    res->data=omStrDup(IDRING(h)->parameter[i-1]);
+    res->data=omStrDup(rParameter(IDRING(h))[i-1]);
   else
   {
@@ -2821,5 +2821,5 @@
   if ((maxl==-1) /*&& (iiOp!=MRES_CMD)*/)
   {
-    maxl = pVariables-1+2*(iiOp==MRES_CMD);
+    maxl = currRing->N-1+2*(iiOp==MRES_CMD);
     if (currQuotient!=NULL)
     {
@@ -2938,5 +2938,5 @@
   if ((maxl==-1) /*&& (iiOp!=MRES_CMD)*/)
   {
-    maxl = pVariables-1+2*(iiOp==MRES_CMD);
+    maxl = currRing->N-1+2*(iiOp==MRES_CMD);
     if (currQuotient!=NULL)
     {
@@ -4087,8 +4087,8 @@
 static BOOLEAN jjJACOB_P(leftv res, leftv v)
 {
-  ideal i=idInit(pVariables,1);
+  ideal i=idInit(currRing->N,1);
   int k;
   poly p=(poly)(v->Data());
-  for (k=pVariables;k>0;k--)
+  for (k=currRing->N;k>0;k--)
   {
     i->m[k-1]=pDiff(p,k);
@@ -4099,5 +4099,5 @@
 /*2
  * compute Jacobi matrix of a module/matrix
- * Jacobi(M) := ( diff(Mt,var(1))|, ... ,| diff(Mt,var(pVariables))  ),
+ * Jacobi(M) := ( diff(Mt,var(1))|, ... ,| diff(Mt,var(currRing->N))  ),
  * where Mt := transpose(M)
  * Note that this is consistent with the current conventions for jacob in Singular,
@@ -4110,8 +4110,8 @@
   int W = IDELEMS(id);
 
-  ideal result = idInit(W * pVariables, id->rank);
+  ideal result = idInit(W * currRing->N, id->rank);
   poly *p = result->m;
 
-  for( int v = 1; v <= pVariables; v++ )
+  for( int v = 1; v <= currRing->N; v++ )
   {
     poly* q = id->m;
@@ -4163,15 +4163,15 @@
 {
   poly p=(poly)v->Data();
-  int s=pVariables;
+  int s=currRing->N;
   if (v->Typ()==VECTOR_CMD) s++;
   intvec *iv=new intvec(s);
   if (p!=NULL)
   {
-    for(int i = pVariables;i;i--)
+    for(int i = currRing->N;i;i--)
     {
       (*iv)[i-1]=pGetExp(p,i);
     }
-    if (s!=pVariables)
-      (*iv)[pVariables]=pGetComp(p);
+    if (s!=currRing->N)
+      (*iv)[currRing->N]=pGetComp(p);
   }
   res->data=(char *)iv;
@@ -4408,6 +4408,6 @@
   int i=(int)(long)v->Data();
   int p=0;
-  if ((0<i) && (currRing->parameter!=NULL) && (i<=(p=rPar(currRing))))
-    res->data=omStrDup(currRing->parameter[i-1]);
+  if ((0<i) && (rParameter(currRing)!=NULL) && (i<=(p=rPar(currRing))))
+    res->data=omStrDup(rParameter(currRing)[i-1]);
   else
   {
@@ -5508,8 +5508,8 @@
 {
   intvec *wdegree=(intvec*)w->Data();
-  if (wdegree->length()!=pVariables)
+  if (wdegree->length()!=currRing->N)
   {
     Werror("weight vector must have size %d, not %d",
-           pVariables,wdegree->length());
+           currRing->N,wdegree->length());
     return TRUE;
   }
@@ -5626,5 +5626,5 @@
   short *iw=iv2array((intvec *)w->Data());
   res->data = (char *)ppJetW((poly)u->Data(),(int)(long)v->Data(),iw);
-  omFreeSize((ADDRESS)iw,(pVariables+1)*sizeof(short));
+  omFreeSize((ADDRESS)iw,(currRing->N+1)*sizeof(short));
   return FALSE;
 }
@@ -6202,5 +6202,5 @@
   maxl--;
   if ((maxl==-1) && (iiOp!=MRES_CMD))
-    maxl = pVariables-1;
+    maxl = currRing->N-1;
   if ((iiOp == RES_CMD) || (iiOp == MRES_CMD))
   {
@@ -6382,5 +6382,5 @@
     w=iv2array((intvec *)v4->Data());
     short *w0=w+1;
-    int i=pVariables;
+    int i=currRing->N;
     while(i>0&&*w0>0)
     {
