Changeset ce70e6 in git for Singular


Ignore:
Timestamp:
Dec 17, 2013, 1:23:10 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
a1e807a999ad81c88502c684ee93531e7840ea82
Parents:
81f4bd5c5a8887cb6c7de707703727b6435fcbd84c13414601e276ca17f4e13f1d191e558fb2ef91
Message:
Merge pull request #443 from surface-smoothers/fixOptionModificationByAccident.primdec.lib

Fix option modification by accident in primdec.lib
Location:
Singular
Files:
2 added
23 edited
1 moved

Legend:

Unmodified
Added
Removed
  • Singular/LIB/COPYING

    r4c1341 rce70e6  
    134134paramet.lib     Thomas Keilen                   keilen@mathematik.uni-kl.de
    135135perron.lib      Oleksandr Motsak                motsak at mathematik dot uni minus kl dot de
    136 phindex.lib 
     136phindex.lib
    137137pointid.lib     Stefan Steidel                  steidel@mathematik.uni-kl.de
    138138poly.lib        Olaf Bachmann                   obachman@mathematik.uni-kl.de
    139139                Gert-Martin Greuel              greuel@mathematik.uni-kl.de
    140140                Anne Fruehbis-Krueger           anne@mathematik.uni-kl.de
    141 oldpolymake.lib Thomas Markwig                  keilen@mathematik.uni-kl.de
     141polymake.lib    Thomas Markwig                  keilen@mathematik.uni-kl.de
    142142presolve.lib    Gert-Martin Greuel              greuel@mathematik.uni-kl.de
    143143primdec.lib     Gerhard Pfister                 pfister@mathematik.uni-kl.de
  • Singular/LIB/grobcov.lib

    r4c1341 rce70e6  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="version grobcov.lib 4.0.0.0 Jun_2013 "; // $Id$
     2version="version grobcov.lib 4-0-0-0 Dec_2013 ";
    33category="General purpose";
    44info="
     
    1515          The locus algorithm and definitions will be
    1616          published in a forthcoming paper by Abanades, Botana, Montes, Recio:
    17           \''Geometrical locus of points using the Groebner cover\''.
    18 
     17          \''An Algebraic Taxonomy for Locus Computation in Dynamic Geometry\''.
    1918
    2019          The central routine is grobcov. Given a parametric
     
    6968PROCEDURES:
    7069
    71 grobcov(F);        Is the basic routine giving the canonical
     70grobcov(F);  Is the basic routine giving the canonical
    7271                   Groebner cover of the parametric ideal F.
    7372                   This routine accepts many options, that
     
    7574                   computation does not finish in reasonable time.
    7675
    77 cgsdr(F);          Is the procedure for obtaining a first disjoint,
     76cgsdr(F);      Is the procedure for obtaining a first disjoint,
    7877                   reduced Comprehensive Groebner System that
    79                    is used in grobcov, but that can be used
     78                   is used in grobcov, that can also be used
    8079                   independently if only the CGS is required.
    8180                   It is a more efficient routine than buildtree
     
    8685                   respectively the rings Q[a][x], Q[a], Q[x,a].
    8786                   It is called inside each of the fundamental routines
    88                    of the library: grobcov, cgsdr and killed before
     87                   of the library: grobcov, cgsdr, locus, locusdg and killed before
    8988                   the output.
    90                    If the user want to use some other internal routine,
    91                    then setglobalrings() is to be called before, as
    92                    the rings @R, @P and @RP are needed in most of them.
    93                    globally, and more internal routines can be used, but
    94                    these rings are killed by the call to any of the
    95                    basic routines.
     89                   So, if the user want to use some other internal routine,
     90                   then setglobalrings() is to be called before, as most of them use
     91                   these rings.
    9692
    9793pdivi(f,F);     Performs a pseudodivision of a parametric polynomial
    9894                   by a parametric ideal.
     95                   Can be used without calling presiouly setglobalrings(),
    9996
    10097pnormalf(f,E,N);   Reduces a parametric polynomial f over V(E) \ V(N)
    10198                   E is the null ideal and N the non-null ideal
    10299                   over the parameters.
     100                   Can be used without calling presiouly setglobalrings(),
     101
     102Prep(N,M);   Computes the P-representation of V(N) \ V(M).
     103                   Can be used without calling previously setglobalrings().
    103104
    104105extend(GC); When the grobcov of an ideal has been computed
     
    110111                   the bases are computed, and one can obtain the full
    111112                   representation using extend.
    112 
    113 locus(G):   Special routine for determining the locus of points
     113                   Can be used without calling presiouly setglobalrings(),
     114
     115locus(G);     Special routine for determining the locus of points
    114116                   of  objects. Given a parametric ideal J with
    115117                   parameters (a_1,..a_m) and variables (x_1,..,xn),
     
    126128                   The description of the algorithm and definitions will be
    127129                   given in a forthcoming paper by Abanades, Botana, Montes, Recio:
    128                    ''Geometrical locus of points using the Groebner cover''
    129 
    130 locusdg(G):  Is a special routine for computing the locus in dinamical geometry.
     130                   ''An Algebraic Taxonomy for Locus Computation in Dynamic Geometry''.
     131                   Can be used without calling presiouly setglobalrings(),
     132
     133locusdg(G);  Is a special routine for computing the locus in dinamical geometry.
    131134                    It detects automatically a possible point that is to be avoided by the mover,
    132135                    whose coordinates must be the last two coordinates in the definition of the ring.
     
    134137                    depending on the point that is to be avoided.
    135138                    Then it calls locus.
    136 
    137 locusto(L):  Transforms the output of locus to a string that
     139                    Can be used without calling presiouly setglobalrings(),
     140
     141locusto(L);  Transforms the output of locus to a string that
    138142                  can be reed from different computational systems.
     143                  Can be used without calling presiouly setglobalrings(),
     144
     145addcons(L); Given a disjoint set of locally closed subsets in P-representation,
     146                  it returns the canonical P-representation of the constructible set
     147                  formed by the union of them.
     148                  Can be used without calling presiouly setglobalrings(),
    139149
    140150SEE ALSO: compregb_lib
     
    154164// Initial data: 6-9-2009
    155165// Final data: 25-10-2011
    156 // Release 3: (this release, public)
     166// Release 3:
    157167// Initial data: 1-7-2012
    158168// Final data: 4-9-2012
     169// Release 4: (this release, public)
     170// Initial data: 4-9-2012
     171// Final data: 21-11-2013
    159172// basering Q[a][x];
    160173
     
    166179RETURN:   After its call the rings @R=Q[a][x], @P=Q[a], @RP=Q[x,a] are
    167180          defined as global variables.
    168 NOTE:     It is called internally by the fundamental routines of the
    169           library grobcov, cgsdr, extend, pdivi, pnormalf, locus, locusto,
     181NOTE: It is called internally by the fundamental routines of the
     182          library grobcov, cgsdr, extend, pdivi, pnormalf, locus, locusdg, locusto,
    170183          and killed before the output.
    171184          The user does not need to call it, except when it is interested
     
    210223}
    211224
    212 //*************Auxilliary routines**************
     225//*************Auxiliary routines**************
    213226
    214227// cld : clears denominators of an ideal and normalizes to content 1
    215 //       can be used in @R or @P or @RP
     228//        can be used in @R or @P or @RP
    216229// input:
    217 //    ideal J (J can be also poly), but the output is an ideal;
     230//        ideal J (J can be also poly), but the output is an ideal;
    218231// output:
    219 //    ideal Jc (the new form of ideal J without denominators and
    220 //       normalized to content 1)
     232//        ideal Jc (the new form of ideal J without denominators and
     233//        normalized to content 1)
    221234proc cld(ideal J)
    222235{
     
    369382//"USAGE:   subset(J,K);
    370383//          (J,K)  expected (ideal,ideal)
    371 //                   or     (list, list)
     384//                  or     (list, list)
    372385//RETURN:   1 if all the elements of J are in K, 0 if not.
    373386//EXAMPLE:  subset; shows an example;"
     
    419432}
    420433
    421 // pdivi : pseudodivision of a poly f by a parametric ideal F in Q[a][x].
     434// pdivi : pseudodivision of a parametric polynomial f by a parametric ideal F in Q[a][x].
    422435// input:
    423 //   poly  f (in the parametric ring @R)
    424 //   ideal F (in the parametric ring @R)
     436//   poly  f
     437//   ideal F
    425438// output:
    426439//   list (poly r, ideal q, poly mu)
     
    438451EXAMPLE:  pdivi; shows an example"
    439452{
     453  int i;
     454  int j;
     455//  string("T_f=",f);
     456  poly v=1;
     457  for(i=1;i<=nvars(basering);i++){v=v*var(i);}
    440458  int te=0;
     459  def R=basering;
    441460  if (defined(@P)==1){te=1;}
    442461  else{setglobalrings();}
    443   def R=basering;
    444   int i;
    445   int j;
    446462  poly r=0;
    447463  poly mu=1;
     
    476492        rho=qlc[1]*qlm;
    477493        p=nu*p-rho*F[i];
     494//        string("i=",i,"  coef(p,v)=",coef(p,v));
    478495        r=nu*r;
    479496        for (j=1;j<=size(F);j++){q[j]=nu*q[j];}
     
    487504      r=r+lcp*lpp;
    488505      p=p-lcp*lpp;
     506//      string("pasa al rem p=",p);
    489507    }
    490508  }
     
    845863{
    846864  int i;
     865  int nt;
     866  if (typeof(F)=="ideal"){nt=ncols(F);}
     867  else{nt=size(F);}
     868
    847869  def FF=F;
    848870  FF=F[1];
    849   for (i=2;i<=ncols(F);i++)
     871  for (i=2;i<=nt;i++)
    850872  {
    851873    if (not(memberpos(F[i],FF)[1]))
     
    9791001  poly g; int i;
    9801002  ideal Nb; ideal Na=N;
    981 
    982   // begins incquotient
    9831003  if (size(Na)==1)
    9841004  {
     
    10551075}
    10561076
     1077// Auxiliary routine to define an order for ideals
     1078// Returns 1 if the ideal a is shoud precede ideal b by sorting them in idbefid order
     1079//             2 if the the contrary happen
     1080//             0 if the order is not relevant
    10571081proc idbefid(ideal a, ideal b)
    10581082{
     
    10861110}
    10871111
     1112// sort a list of ideals using idbefid
    10881113proc sortlistideals(list L)
    10891114{
     
    11391164//    the Prep of V(N)\V(M)
    11401165// Assumed to work in the ring @P of the parameters
     1166// Can be used without calling previously setglobalrings().
    11411167proc Prep(ideal N, ideal M)
    11421168{
     1169  int te;
    11431170  if (N[1]==1)
    11441171  {
     
    11461173  }
    11471174  def RR=basering;
     1175  if(defined(@P)){te=1;}
     1176  else{te=0; setglobalrings();}
    11481177  setring(@P);
    11491178  ideal Np=imap(RR,N);
     
    11751204  if (size(prep)==0){prep=list(list(ideal(1),list(ideal(1))));}
    11761205  setring(RR);
    1177   return(imap(@P,prep));
     1206  def pprep=imap(@P,prep);
     1207  if(te==0){kill @P; kill @R; kill @RP;}
     1208  return(pprep);
    11781209}
    11791210
     
    11871218//    the C-representaion of V(N)\V(M) = V(ida)\V(idb)
    11881219// Assumed to work in the ring @P of the parameters
     1220// If the routine is to be called from the top, a previous call to
     1221// setglobalrings() is needed.
    11891222proc PtoCrep(list L)
    11901223{
     
    12931326EXAMPLE:  cgsdr; shows an example"
    12941327{
     1328  int te;
    12951329  def RR=basering;
    1296   setglobalrings();
     1330  if(defined(@P)){te=1;}
     1331  else{te=0; setglobalrings();}
    12971332  // INITIALIZING OPTIONS
    12981333  int i; int j;
     
    14521487    }
    14531488  }
    1454   if(defined(@P)){kill @P; kill @R; kill @RP;}
     1489  if(te==0){kill @P; kill @R; kill @RP;}
    14551490  return(GS);
    14561491}
     
    14691504
    14701505// input:  internal routine called by cgsdr at the end to group the
    1471 //         lpp segments and improve the output
     1506//            lpp segments and improve the output
    14721507// output: grouped segments by lpp obtained in cgsdr
    14731508proc grsegments(list T)
     
    15051540// input: ideal p, ideal q
    15061541// output: 1 if p contains q,  0 otherwise
     1542// If the routine is to be called from the top, a previous call to
     1543// setglobalrings() is needed.
    15071544proc idcontains(ideal p, ideal q)
    15081545{
     
    15301567// input: L (list of ideals)
    15311568// output: the list of integers corresponding to the minimal ideals in L
     1569// If the routine is to be called from the top, a previous call to
     1570// setglobalrings() is needed.
    15321571proc selectminideals(list L)
    15331572{
     
    15681607
    15691608// LCUnion
    1570 // Given a list of the P-representations of locally closed segments
     1609// Given a list of the P-representations of disjoint locally closed segments
    15711610// for which we know that the union is also locally closed
    15721611// it returns the P-representation of its union
     
    15761615// output: P-representation of the union
    15771616//       ((P_j,(P_j1,...,P_jk_j | j=1..t)))
     1617// If the routine is to be called from the top, a previous call to
     1618// setglobalrings() is needed.
     1619// Auxiliary routine called by grobcov and addcons
     1620// A previous call to setglobarings() is needed if it is to be used at the top.
    15781621proc LCUnion(list LL)
    15791622{
    15801623  def RR=basering;
    15811624  setring(@P);
     1625  int care;
    15821626  def L=imap(RR,LL);
    15831627  int i; int j; int k; list H; list C; list T;
    1584   list L0; list P0; list P; list Q0; list Q;
     1628  list L0; list P0; list P; list Q0; list Q;  intvec Qi;
     1629  if(not(defined(@Q2))){list @Q2;}
     1630  else{kill @Q2; list @Q2;}
     1631  exportto(Top,@Q2);
    15851632  for (i=1;i<=size(L);i++)
    15861633  {
     
    15921639  }
    15931640  Q0=selectminideals(P0);
     1641  //"T_3Q0="; Q0;
     1642  kill P; list P;
    15941643  for (i=1;i<=size(Q0);i++)
    15951644  {
    1596     Q[i]=L0[Q0[i]];
    1597     P[i]=L[Q[i][1]][Q[i][2]];
     1645    Qi=L0[Q0[i]];
     1646    Q[size(Q)+1]=Qi;
     1647      P[size(P)+1]=L[Qi[1]][Qi[2]];
     1648  }
     1649  @Q2=Q;
     1650  if(size(P)==0)
     1651  {
     1652    setring(RR);
     1653    list TT;
     1654    return(TT);
    15981655  }
    15991656  // P is the list of the maximal components of the union
     
    16111668        {
    16121669          C[size(C)+1]=L[i][j];
     1670          C[size(C)][3]=intvec(i,j);
    16131671        }
    16141672      }
    16151673    }
    1616     T[size(T)+1]=list(Q[k],P[k][1],addpart(H,C));
    1617   }
     1674    if(size(P[k])>=3){T[size(T)+1]=list(Q[k],P[k][1],addpart(H,C),P[k][3]);}
     1675    else{T[size(T)+1]=list(Q[k],P[k][1],addpart(H,C));}
     1676  }
     1677  @Q2=sortpairs(@Q2);
    16181678  setring(RR);
    16191679  def TT=imap(@P,T);
     
    16211681}
    16221682
    1623 // Called by LCUnion to modify the holes of a primepart of the union
     1683// Auxiliary routine
     1684// called by LCUnion to modify the holes of a primepart of the union
    16241685// by the addition of the segments that do not correspond to that part
    16251686// Works on @P ring.
     
    16271688//   H=(p_i1,..,p_is) the holes of a component to be transformed by the addition of
    16281689//        the segments C that do not correspond to that component
    1629 //   C=((q_1,(q_11,..,q_1l_1)),..,(q_k,(q_k1,..,q_kl_k)))
     1690//   C=((q_1,(q_11,..,q_1l_1),pos1),..,(q_k,(q_k1,..,q_kl_k),posk))
     1691// posi=(i,j) position of the component
    16301692//        the list of segments to be added to the holes
    16311693proc addpart(list H, list C)
     
    16331695  list Q; int i; int j; int k; int l; int t; int t1;
    16341696  Q=H; intvec notQ; list QQ; list addq;
     1697  // @Q2=list of (i,j) positions of the components that have been aded to some hole of the maximal ideals
     1698  //          plus those of the components added to the holes.
    16351699  ideal q;
    16361700  i=1;
     
    16451709        if (equalideals(q,C[j][1]))
    16461710        {
     1711          @Q2[size(@Q2)+1]=C[j][3];
    16471712          t=0;
    16481713          for (k=1;k<=size(C[j][2]);k++)
     
    16661731            {
    16671732              addq[size(addq)+1]=C[j][2][k];
     1733              @Q2[size(@Q2)+1]=C[j][3];
    16681734            }
    16691735          }
     
    16971763}
    16981764
    1699 // Called by addpart to finish the modification of the holes of a primepart
     1765// Auxiliary routine called by addpart to finish the modification of the holes of a primepart
    17001766// of the union by the addition of the segments that do not correspond to
    17011767// that part.
     
    17871853}
    17881854
    1789 // specswellCrep
    1790 // input:
    1791 //   given two corresponding polynomials g1 and g2 with the same lpp
    1792 //   g1 belonging to the basis in the segment ida1,idb1
    1793 //   g2 belonging to the basis in the segment ida2,idb2
    1794 // output:
    1795 //   1 if g1 spezializes well to g2 on the whole (ida2,idb2) segment
    1796 //   0 if not
    1797 proc specswellCrep(poly g1, poly g2, ideal ida2)
    1798 {
    1799   poly S;
    1800   S=leadcoef(g2)*g1-leadcoef(g1)*g2;
    1801   def RR=basering;
    1802   setring(@RPt);
    1803   def SR=imap(RR,S);
    1804   def ida2R=imap(RR,ida2);
    1805   attrib(ida2R,"isSB",1);
    1806   poly S2R=reduce(SR,ida2R);
    1807   setring(RR);
    1808   def S2=imap(@RPt,S2R);
    1809   if (S2==0){return(1);}   // and (nonnullCrep(leadcoef(g1),ida2,idb2))
    1810   else {return(0);}
    1811 }
    1812 
     1855// Auxiliary routine for grobcov: ideal F is assumed to be homogeneous
    18131856// gcover
    18141857// input: ideal F: a generating set of a homogeneous ideal in Q[a][x]
     
    18811924    LCU=LCUnion(pairspP);
    18821925    kill prep; list prep;
     1926    kill crep; list crep;
    18831927    for(k=1;k<=size(LCU);k++)
    18841928    {
     
    19451989    for(j=1;j<=size(B);j++)
    19461990    {
    1947       B[j]=pnormalf(B[j],crep[1],N);
     1991      B[j]=pnormalf(B[j],crep[1],crep[2]);
    19481992    }
    19491993    S[i]=list(lpp,B,prep,crep,lpph);
     
    20152059                each point of the segment. With option (\"ext\",1) the
    20162060                full representation of the bases is computed (possible
    2017                 shaves) and sometimes a simpler result is obtained.
     2061                sheaves) and sometimes a simpler result is obtained.
    20182062            \"rep\",0-1-2: The default is (\"rep\",0) and then the segments
    20192063                are given in canonical P-representation. Option (\"rep\",1)
     
    22042248}
    22052249
    2206 // input. GC the grobcov of an ideal in generic representation of the
     2250// Input. GC the grobcov of an ideal in generic representation of the
    22072251//        bases computed with option option ("rep",2).
    2208 // output The grobcov in full representation.
    2209 // option ("comment",1) shows the time.
     2252// Output The grobcov in full representation.
     2253// Option ("comment",1) shows the time.
     2254// Can be called from the top
    22102255proc extend(list GC, list #);
    22112256"USAGE:   extend(GC); When the grobcov of an ideal has been computed
     
    23942439}
    23952440
    2396 
     2441// Auxiliary routine
    23972442// nonzerodivisor
    23982443// input:
     
    24352480}
    24362481
     2482// Auxiliary routine
    24372483// deltai
    24382484// input:
     
    24752521}
    24762522
     2523// Auxiliary routine
    24772524// combine
    24782525// input: a list of pairs ((p1,P1),..,(pr,Pr)) where
     
    24982545}
    24992546
     2547// Auxiliary routine
    25002548// elimconstfac: eliminate the factors in the polynom f that are in K[a]
    25012549// input:
     
    25232571};
    25242572
     2573//Auxiliary routine
    25252574// nullin
    25262575// input:
     
    25442593}
    25452594
     2595// Auxiliary routine
    25462596// monoms
     2597// Input: A polynomial f
     2598// Output: The list of leading terms
    25472599proc monoms(poly f)
    25482600{
     
    25632615}
    25642616
     2617// Auxiliary routine called by extend
    25652618// extend0
    25662619// input:
     
    26222675}
    26232676
     2677// Auxiliary routine
    26242678// findindexpolys
    26252679// input:
     
    26702724}
    26712725
     2726// Auxiliary routine
    26722727// extendcoef: given Q,P in K[a] where P/Q specializes on an open and dense subset
    26732728//      of the whole V(p1 int...int pr), it returns a basis of the module
     
    26982753}
    26992754
     2755// Auxiliary routine
    27002756// selectregularfun
    27012757// input:
     
    27552811}
    27562812
     2813// Auxiliary routine
    27572814// searchinlist
    27582815// input:
     
    27762833}
    27772834
     2835// Auxiliary routine
    27782836// comb: the list of combinations of elements (1,..n) of order p
    27792837proc comb(int n, int p)
     
    28122870}
    28132871
     2872// Auxiliary routine
    28142873// selectminsheaves
    28152874// Input: L=((v_11,..,v_1k_1),..,(v_s1,..,v_sk_s))
     
    28342893}
    28352894
     2895// Auxiliary routine
    28362896// smsheaves
    28372897// Input:
     
    28682928}
    28692929
     2930// Auxiliary routine
    28702931// allsheaves
    28712932// Input: L=((v_11,..,v_1k_1),..,(v_s1,..,v_sk_s))
     
    29102971}
    29112972
     2973// Auxiliary routine
    29122974// numones
    29132975// Input:
     
    29262988}
    29272989
     2990// Auxiliary routine
    29282991// pos
    29292992// Input:  intvec p of zeros and ones
     
    29403003}
    29413004
     3005// Auxiliary routine
    29423006// actualize: actualizes zeroes of p
    29433007// Input:
     
    29573021}
    29583022
     3023// Auxiliary routine
    29593024// combrep
    29603025// Input: V=(n_1,..,n_i)
     
    29903055}
    29913056
     3057// Auxiliary routine
    29923058proc reducemodN(poly f,ideal E)
    29933059{
     
    30053071}
    30063072
     3073// Auxiliary routine
    30073074// intersp: computes the intersection of the ideals in S in @P
    30083075proc intersp(list S)
     
    30173084}
    30183085
     3086// Auxiliary routine
    30193087// radicalmember
    30203088proc radicalmember(poly f,ideal ida)
     
    30393107}
    30403108
     3109// Auxiliary routine
    30413110// NonNull: returns 1 if the poly f is nonnull on V(E)\V(N), 0 otherwise.
    30423111proc NonNull(poly f, ideal E, ideal N)
     
    30593128}
    30603129
     3130// Auxiliary routine
    30613131// selectextendcoef
    30623132// input:
     
    31173187}
    31183188
     3189// Auxiliary routine
    31193190// input:
    31203191//   ideal E1: in some basering (depends only on the parameters)
     
    31333204}
    31343205
     3206// Auxiliary routine
    31353207// reform
    31363208// input:
     
    32163288}
    32173289
     3290// Auxiliary routine
    32183291// nonnullCrep
    32193292proc nonnullCrep(poly f0,ideal ida0,ideal idb0)
     
    32383311}
    32393312
     3313// Auxiliary routine
    32403314// precombint
    32413315// input:  L: list of ideals (works in @P)
     
    32843358}
    32853359
    3286 // precombinediscussion
    3287 // not used, can be deleted
    3288 // input:  list L: the LCU segment with bases for each pi component
    3289 // output: intvec vv:  vv[1]=(1 if the generic polynomial of the vv[2]
    3290 //                     component already specializes well,
    3291 //                     0 if combine is to be used)
    3292 //                     vv[2]=selind, the index for which the generic basis
    3293 //                     already specializes well if combine is not to be used (vv[1]=1).
    3294 proc precombinediscussion(L,crep)
    3295 {
    3296   int tes=1; int selind; int i1; int j1; poly p; poly lcp; intvec vv;
    3297   if (size(L)==1){vv=1,1; return(vv);}
    3298   for (i1=1;i1<=size(L);i1++)
    3299   {
    3300     tes=1;
    3301     p=L[i1][2];
    3302     lcp=leadcoef(p);
    3303 
    3304 
    3305     if(nonnullCrep(lcp,crep[1],crep[2]))
    3306     {
    3307       for(j1=1;j1<=size(L);j1++)
    3308       {
    3309         if(i1!=j1)
    3310         {
    3311           if(specswellCrep(p,L[j1][2],L[j1][1])==0){tes=0; break;}
    3312         }
    3313       }
    3314     }
    3315     else{tes=0;}
    3316     if(tes){selind=i1; break;}
    3317   }
    3318   vv=tes,selind;
    3319   return(vv);
    3320 }
    3321 
     3360
     3361// Auxiliary routine
    33223362// minAssGTZ eliminating denominators
    33233363proc minGTZ(ideal N);
     
    33373377//********************* Begin KapurSunWang *************************
    33383378
     3379// Auxiliary routine
    33393380// inconsistent
    33403381// Input:
     
    33723413}
    33733414
     3415// Auxiliary routine
    33743416// MDBasis: Minimal Dickson Basis
    33753417proc MDBasis(ideal G)
     
    33973439}
    33983440
     3441// Auxiliary routine
    33993442// primepartZ
    34003443proc primepartZ(poly f);
     
    34973540}
    34983541
     3542// Auxiliary routine
    34993543// sqf
    35003544// This is for releases of Singular before 3-5-1
     
    35163560// }
    35173561
     3562// Auxiliary routine
    35183563// sqf
    35193564proc sqf(poly f)
     
    35293574
    35303575
     3576// Auxiliary routine
    35313577// KSW0: Kapur-Sun-Wang algorithm for computing a CGS, called by KSW
    35323578// Input:
     
    35753621  {
    35763622    if(comment>1){"Basis 1 is found"; E; N;}
    3577     return(E0,N0,ideal(1));
    3578   }
     3623    list KK; KK[1]=list(E0,N0,ideal(1));
     3624    return(KK);
     3625   }
    35793626  ideal Gr; ideal Gm; ideal GM;
    35803627  for (i=1;i<=size(G);i++)
     
    36543701}
    36553702
     3703// Auxiliary routine
    36563704// KSWtocgsdr
    36573705proc KSWtocgsdr(list L)
     
    36723720}
    36733721
     3722// Auxiliary routine
    36743723// KtoPrep
    36753724// Computes the P-representaion of a K-representation (N,W) of a set
     
    37203769}
    37213770
     3771// Auxiliary routine
    37223772// groupKSWsegments
    37233773// input:  the list of vertices of KSW
     
    37543804
    37553805//******************** Begin locus ******************************
    3756 
    37573806
    37583807// indepparameters
     
    37773826}
    37783827
    3779 
    3780 // dimP0: Auxiliar routine
     3828// dimP0: Auxiliary routine
    37813829// if the dimension in @P of an ideal in the parameters has dimension 0 then it returns 0
    37823830// else it retuns 1
     
    37943842}
    37953843
    3796 // Auxiliar routine.
     3844// Auxiliary routine.
    37973845// input:    ideals E and F (assumed in ring @P
    37983846// returns: 1 if ideal E is contained in ideal F (assumed F is std basis)
     
    38173865}
    38183866
    3819 // AddCons: given a set of locally closed components of a selection of
    3820 //       segments of the Grobner cover, it builds the canonical P-representation
    3821 //       of the corresponding constructible set, including levels it they are
    3822 // input: a list L of a selection of segments of the Groebner cover
    3823 //       given a a set of components of the form
    3824 //       ( (p_1,(p_11,..,p_1k_1).. (p_s,(p_s1,..,p_sk_s))
    3825 // output: The canonical P-representation of adding the given components.
    3826 proc AddCons(list L)
    3827 {
    3828   // First step: Selecting the top varieties
    3829   list L1; list L2; list LL; int i; int j; int t;
    3830   list Lend;
     3867// addcons: given a set of locally closed sets given in P-representation,
     3868//       (particularly a subset of components of a selection of segments
     3869//       of the Grobner cover), it builds the canonical P-representation
     3870//       of the corresponding constructible set, of its union, including levels it they are.
     3871// input: a list L of disjoint segments (for exmple a selection of segments of the Groebner cover)
     3872//       of the form
     3873//       ( ( (p1_1,(p1_11,..,p1_1k_1).. (p1_s,(p1_s1,..,p1_sk_s)),..,
     3874//         ( (pn_1,(pn_11,..,pn_1j_1).. (pn_s,(pn_s1,..,pn_sj_s))   )
     3875// output: The canonical P-representation of the  constructible set resulting by
     3876//       adding the given components.
     3877//       The first element of each component can be ignored. It is only for internal use.
     3878//       The fifth element of each component is the level of the constructible set
     3879//       of the component.
     3880//       It is no need a previous call to setglobalrings()
     3881proc addcons(list L)
     3882"USAGE:   addcons(  ( ( (p1_1,(p1_11,..,p1_1k_1).. (p1_s,(p1_s1,..,p1_sk_s)),..,
     3883  ( (pn_1,(pn_11,..,pn_1j_1).. (pn_s,(pn_s1,..,pn_sj_s))   )   )
     3884  a list L of locally closed sets in P-representation
     3885RETURN: the canonical P-representation of the constructible set of the union.
     3886NOTE:   It is called internally by the routines locus, locusdg,
     3887
     3888KEYWORDS: P-representation, constructible set
     3889EXAMPLE:  adccons; shows an example"
     3890{
     3891  int te;
     3892  if(defined(@P)){te=1;}
     3893  else{setglobalrings();}
     3894  list notadded; list P0;
     3895  int i; int j; int k; int l;
     3896  intvec v; intvec v1; intvec v0;
     3897  ideal J; list K;
    38313898  for(i=1;i<=size(L);i++)
    38323899  {
    3833     t=1;
    3834     for(j=1;j<=size(L);j++)
    3835     {
    3836       if(i!=j)
    3837       {
    3838         if(containedideal(L[j][1],L[i][1])==1)
    3839         {t=0;
    3840          // "the ideal "; L[j][1]; "is contained in ideal "; L[i][1];
    3841           j=size(L);
    3842         }
    3843       }
    3844     }
    3845     if(t==1){L1[size(L1)+1]=L[i];}
    3846     else{L2[size(L2)+1]=L[i];}
    3847   }
    3848   // Second step: Adding segments to obtain a locally closed sets for each level
    3849   int lev=1;
    3850   if(size(L2)==0)
    3851   {
    3852      for(i=1;i<=size(L1);i++)
     3900    for(j=1;j<=size(L[i]);j++)
     3901    {
     3902        v=i,j;
     3903        notadded[size(notadded)+1]=v;
     3904    }
     3905  }
     3906  //"T_notadded="; notadded;
     3907  int level=1;
     3908  list P=L;
     3909  list LL;
     3910  list Ln;
     3911  //int cont=0;
     3912  while(size(notadded)>0)
     3913  {
     3914    kill notadded; list notadded;
     3915    for(i=1;i<=size(P);i++)
     3916    {
     3917      for(j=1;j<=size(P[i]);j++)
     3918      {
     3919          v=i,j;
     3920          notadded[size(notadded)+1]=v;
     3921      }
     3922    }
     3923    //"T_notadded="; notadded;
     3924     //cont++;
     3925     P0=P;
     3926     Ln=LCUnion(P);
     3927     //"T_Ln="; Ln;
     3928     notadded=minuselements(notadded,@Q2);
     3929     //"T_@Q2="; @Q2;
     3930     //"T_notadded="; notadded;
     3931     for(i=1;i<=size(Ln);i++)
    38533932     {
    3854        if(size(L1[i])>=3)
    3855        {L1[i][3]=string(string(L1[i][3]),",",lev);}
    3856        else{L1[i][3]=string(lev);}
     3933       //Ln[i][4]=  ; JA HAURIA DE VENIR DE LCUnion
     3934       Ln[i][5]=level;
     3935       LL[size(LL)+1]=Ln[i];
    38573936     }
    3858    return(L1);
    3859   }
    3860    while(size(L2)>0)
    3861    {
    3862      LL=addtolocalclosed(L1,L2);
    3863      for(i=1;i<=size(LL[1]);i++)
     3937     i=0;j=0;
     3938     v=0,0;
     3939     v0=0,0;
     3940     kill P; list P;
     3941     for(l=1;l<=size(notadded);l++)
    38643942     {
    3865        if(size(LL[1][i])>=3)
    3866        {LL[1][i][3]=string(string(LL[1][i][3]),",",lev);}
    3867        else{LL[1][i][3]=string(lev);}
    3868        Lend[size(Lend)+1]=LL[1][i];
     3943       v1=notadded[l];
     3944       if(v1[1]<>v0[1]){i++;j=1; P[i]=K;} // list P[i];
     3945       else
     3946       {
     3947         if(v1[2]<>v0[2])
     3948         {
     3949           j=j+1;
     3950         }
     3951       }
     3952       v=i,j;
     3953       //"T_v1="; v1;
     3954       P[i][j]=K; P[i][j][1]=J; P[i][j][2]=K;
     3955       P[i][j][1]=P0[v1[1]][v1[2]][1];
     3956       //"T_P0[v1[1]][v1[2]][2]="; P0[v1[1]][v1[2]][2];
     3957       //"T_size(P0[v1[1]][v1[2]][2])="; size(P0[v1[1]][v1[2]][2]);
     3958       for(k=1;k<=size(P0[v1[1]][v1[2]][2]);k++)
     3959       {
     3960         P[i][j][2][k]=P0[v1[1]][v1[2]][2][k];
     3961         //string("T_P[",i,"][",j,"][2][",k,"]="); P[i][j][2][k];
     3962       }
     3963       v0=v1;
     3964       //"T_P_1="; P;
    38693965     }
    3870      L2=LL[2];
    3871      lev++;
    3872    }
    3873    return(Lend);
    3874 }
    3875 
    3876 // input: Two lists of P-components to be added.
    3877 //           L1 contains the top components, and L2 the remaining components
    3878 //           each of the form ( (p_1,(p_11,..,p_1k_1).. (p_s,(p_s1,..,p_sk_s))
    3879 // output: A list of two lists:
    3880 //           The first one contains the P-representation of the top components added
    3881 //           The second contains the components that have not yet been added when
    3882 //           the total subset is not locally closed. If so addtolocalclosed is to be called
    3883 //           at new after separating the new top and remaining components in order
    3884 //           to compute the next level of the constructible set.
    3885 //           The input and the output must be in the ring @P of parameters.
    3886 proc  addtolocalclosed(list L1,list L2)
    3887 {
    3888    // Second step: Adding segments to obtain a locally closed set
    3889    // L1 contains the top components (ideals and descendants)
    3890    // L2 contains the nontop components (ideals and descendants)
    3891    list LL; int i; int j; int t; intvec Added; int mesvoltes=1; intvec alreadyadded; list LN;
    3892    int k; int l; int m; ideal top; ideal hole; ideal nhole; intvec nottoadd; int t0; list h;
    3893    LL=L1;
    3894    LN=L2;
    3895    while(mesvoltes)
    3896    {
    3897      //"volta";
    3898      for(i=1;i<=size(L1);i++)
    3899      {
    3900         Added=Added,alreadyadded;
    3901         Added=sort(elimrepeatedvl(Added))[1];
    3902         kill alreadyadded; intvec alreadyadded;
    3903         top=LL[i][1][1];
    3904         j=1;
    3905         while(j<=size(LL[i][2]))
    3906         {
    3907            kill nottoadd; intvec nottoadd;
    3908            hole=LL[i][2][j];
    3909            t0=1;
    3910            k=1;
    3911            while(t0 and k<=size(LN))
    3912            {
    3913               if (equalideals(hole,LN[k][1])==1)
    3914               {
    3915                  t0=0;
    3916                   if(alreadyadded==intvec(0)){alreadyadded[1]=k;}
    3917                  else{alreadyadded[size(alreadyadded)+1]=k;}
    3918                  LL[i][2]=elimfromlist(LL[i][2],j);
    3919                  j=j-1;
    3920                  for(l=1;l<=size(LN[k][2]);l++)
    3921                  {
    3922                    nhole=LN[k][2][l],LL[i][1];
    3923                    nhole=std(nhole);
    3924                    t=1; m=1;
    3925                     while(t and m<=size(LL[i][2]))
    3926                     {
    3927                        if(containedideal(LL[i][2][m],nhole)==1)
    3928                        {
    3929                          t=0;
    3930                        }
    3931                        m++;
    3932                     }
    3933                     if(t==0){nottoadd[size(nottoadd)+1]=l;}
    3934                   }
    3935                  for(m=1;m<=size(LN[k][2]);m++)
    3936                  {
    3937                      if(memberpos(m,nottoadd)[1]==0)
    3938                     {
    3939                        LL[i][2][size(LL[i][2])+1]=LN[k][2][m];
    3940                     }
    3941                  }
    3942               }
    3943               k++;
    3944 
    3945            }
    3946            j++;
    3947         }
    3948         if(size(LL[i][2])==0 and size(LL[i][1])>0){LL[i][2][1]=ideal(1);}
    3949      }
    3950      h=1,1;
    3951      while((h[1]==1) and (alreadyadded!=intvec(0)))
    3952      {
    3953        h=memberpos(0,alreadyadded);
    3954        if(h[1]==1){alreadyadded=elimfromlist(alreadyadded,h[2]);}
    3955      }
    3956      if(alreadyadded!=intvec(0))
    3957      {alreadyadded=sort(elimrepeatedvl(alreadyadded))[1];}
    3958      if(Added==intvec(0)){Added=alreadyadded;}
    3959      else{
    3960        Added=Added,alreadyadded;
    3961        Added=sort(elimrepeatedvl(Added))[1];
    3962      }
    3963      h=1,1;
    3964      while((h[1]==1) and (Added!=intvec(0)))
    3965      {
    3966        h=memberpos(0,Added);
    3967        if(h[1]==1){Added=elimfromlist(Added,h[2]);}
    3968      }
    3969      if (alreadyadded==intvec(0))
    3970      {
    3971        mesvoltes=0;
    3972      }
    3973   }
    3974   if(Added!=intvec(0)){Added=sort(elimrepeatedvl(Added))[1]; }
    3975   if(Added!=intvec(0))
    3976   {
    3977     for(i=1;i<=size(Added);i++)
    3978     {
    3979       if(size(LN)>0){LN=elimfromlist(LN,Added[size(Added)+1-i]);}
    3980     }
    3981   }
    3982   for (i=1;i<=size(LL);i++)
    3983   {
    3984     for(j=1;j<=size(LL[i][2]);j++)
    3985     {
    3986       hole=LL[i][2][j];
    3987       for (k=1;k<=size(LL);k++)
    3988       {
    3989         if(k!=i)
    3990         {
    3991           if(containedideal(LL[k][1],hole))
    3992           {
    3993             LL[i][2]=elimfromlist(LL[i][2],j);
    3994             for(l=1;l<=size(LL[k][2]);l++)
    3995             {
    3996               nhole=hole,LL[k][2][l];
    3997               nhole=std(nhole);
    3998               if(equalideals(nhole,ideal(1))==0)
    3999               {
    4000                 m=1; t=1;
    4001                 while(t and m<size(LL[i][2]))
    4002                 {
    4003                   if(containedideal(LL[i][2][m],nhole)){t=0;}
    4004                   m++;
    4005                 }
    4006                 if(t==1){LL[i][2][size(LL[i][2])+1]=nhole;}
    4007               }
    4008             }
    4009           }
    4010         }
    4011       }
    4012     }
    4013   }
    4014   LL[1]=LL; LL[2]=LN;
     3966     //"T_P="; P;
     3967     level++;
     3968     //if(cont>3){break;}
     3969     //kill notadded; list notadded;
     3970  }
     3971  if(defined(@Q2)){kill @Q2;}
     3972  if(te==0){kill @P; kill @R; kill @RP;}
     3973  //"T_LL_sortida addcons="; LL; "Fi sortida";
    40153974  return(LL);
    40163975}
    4017 
    4018 // locus(G):  Special routine for determining the locus of points
    4019 //                of  objects. Given a parametric ideal J with
    4020 //                parameters (a_1,..a_m) and variables (x_1,..,xn),
    4021 //                representing the system determining
    4022 //                the locus of points (a_1,..,a_m)) who verify certain
    4023 //                properties, computing the grobcov G of
    4024 //                J and applying to it locus, determines the different
    4025 //                classes of locus components. They can be
    4026 //                Normal, Special, Accumulation point, Degenerate.
    4027 //                The output are the components given in P-canonical form
    4028 //                of at most 4 constructible sets: Normal, Special, Accumulation,
    4029 //                Degenerate.
    4030 //                The description of the algorithm and definitions will be
    4031 //                given in a forthcoming paper by Abanades, Botana, Montes Recio.
    4032 
    4033 // input:      The output G of the grobcov (in generic representation, which is the default)
     3976example
     3977{
     3978  "EXAMPLE:"; echo = 2;
     3979   ring R=(0,a,b),(x1,y1,x2,y2,p,r),dp;
     3980   ideal S93=(a+1)^2+b^2-(p+1)^2,
     3981                    (a-1)^2+b^2-(1-r)^2,
     3982                    a*y1-b*x1-y1+b,
     3983                    a*y2-b*x2+y2-b,
     3984                    -2*y1+b*x1-(a+p)*y1+b,
     3985                    2*y2+b*x2-(a+r)*y2-b,
     3986                    (x1+1)^2+y1^2-(x2-1)^2-y2^2;
     3987  short=0;
     3988  "System S93="; S93; " ";
     3989  def GC93=grobcov(S93);
     3990  "grobcov(S93)="; GC93; " ";
     3991  int i;
     3992  list H;
     3993  for(i=1;i<=size(GC93);i++){H[i]=GC93[i][3];}
     3994  "H="; H;
     3995  "addcons(H)="; addcons(H);
     3996}
     3997
     3998// Takes a list of intvec and sorts it and eliminates repeated elements.
     3999// Auxiliary routine used in addcons
     4000proc sortpairs(L)
     4001{
     4002  def L1=sort(L);
     4003  def L2=elimrepeated(L1[1]);
     4004  return(L2);
     4005}
     4006
     4007// Eliminates the pairs of L1 that are also in L2.
     4008// Auxiliary routine used in addcons
     4009proc minuselements(list L1,list L2)
     4010{
     4011  int i;
     4012  list L3;
     4013  for (i=1;i<=size(L1);i++)
     4014  {
     4015    if(not(memberpos(L1[i],L2)[1])){L3[size(L3)+1]=L1[i];}
     4016  }
     4017  return(L3);
     4018}
     4019
     4020// locus0(G): Private routine used by locus (the public routine), that
     4021//                builds the diferent components.
     4022// input:      The output G of the grobcov (in generic representation, which is the default option)
    40344023// output:
    40354024//         list, the canonical P-representation of the Normal and Non-Normal locus:
    40364025//              The Normal locus has two kind of components: Normal and Special.
    40374026//              The Non-normal locus has two kind of components: Accumulation and Degenerate.
    4038 //              Normal components: for each point in the component,
    4039 //              the number of solutions in the variables is finite, and
    4040 //              the solutions depend on the point in the component if the component is not 0-dimensional.
    4041 //              Special components:  for each point in the component,
    4042 //              the number of solutions in the variables is finite,
    4043 //              the component is not 0-dimensional, but the solutions do not depend on the
    4044 //              values of the parameters in the component.
    4045 //              Accumlation points: are 0-dimensional components for which it exist
    4046 //              an infinite number of solutions.
    4047 //              Degenerate components: are components of dimension greater than 0 for which
    4048 //              for every point in the component there exist infinite solutions.
     4027//              This routine is compemented by locus that calls it in order to eliminate problems
     4028//              with degenerate points of the mover.
    40494029//         The output components are given as
    40504030//              ((p1,(p11,..p1s_1),type_1,level_1),..,(pk,(pk1,..pks_k),type_k,level_k)
     
    40524032//              If all levels of a class of locus are 1, then the set is locally closed. Otherwise the level
    40534033//              gives the depth of the component.
    4054 proc locus(list GG, list #)
    4055 "USAGE:   locus(G);
    4056                The input must be the grobcov  of a parametrical ideal
    4057 RETURN:  The  locus.
    4058                The output are the components of two constructible subsets of the locus
    4059                of the parametrical system.: Normal and Non-normal.
    4060                These components are
    4061                given as a list of  (pi,(pi1,..pis_i),type_i,level_i) varying i,
    4062                where the p's are prime ideals, the type can be: Normal, Special,
    4063                Accumulation, Degenerate.
    4064 NOTE:      It can only be called after computing the grobcov of the
    4065                parametrical ideal in generic representation ('ext',0),
    4066                which is the default.
    4067                The basering R, must be of the form Q[a_1,..,a_m][x_1,..,x_n].
    4068 KEYWORDS: geometrical locus, locus, loci.
    4069 EXAMPLE:  locus; shows an example"
     4034proc locus0(list GG, list #)
    40704035{
    40714036  int t1=1; int t2=1;
    40724037  def R=basering;
    40734038  int moverdim=nvars(R);
     4039  list HHH;
     4040  if (GG[1][1][1]==1 and GG[1][2][1]==1 and GG[1][3][1][1][1]==0 and GG[1][3][1][2][1]==1){return(HHH);}
    40744041  list Lop=#;
    40754042  if(size(Lop)>0){moverdim=Lop[1];}
     
    40774044  list G1; list G2;
    40784045  def G=GG;
     4046  list Q1; list Q2;
    40794047  int i; int d; int j; int k;
    40804048  t1=1;
     
    40824050  {
    40834051    attrib(G[i][1],"IsSB",1);
    4084     //d=dim(std(G[i][1]));
    4085     // ULL
    40864052    d=locusdim(G[i][2],moverdim);
    40874053    if(d==0){G1[size(G1)+1]=G[i];}
     
    41314097          P1[i][3][j]=P1[i][3][j]*h[k];
    41324098        }
    4133         //P1[i][3][j]=normalize(P1[i][3][j]);
    41344099      }
    41354100    }
    41364101  }
    41374102  else{list P1;}
     4103  ideal BB;
    41384104  for(i=1;i<=size(P1);i++)
    41394105  {
     
    41494115    }
    41504116  }
     4117  list l;
     4118  for(i=1;i<=size(P1);i++){Q1[i]=l; Q1[i][1]=P1[i];} P1=Q1;
     4119  for(i=1;i<=size(P2);i++){Q2[i]=l; Q2[i][1]=P2[i];} P2=Q2;
     4120
    41514121  setring @P;
    4152   // CANVIAR
     4122  ideal J;
    41534123  if(t1==1)
    41544124  {
    41554125    def C1=imap(R,P1);
    4156     def L1=AddCons(C1);
     4126    def L1=addcons(C1);
    41574127   }
    41584128  else{list C1; list L1; kill P1; list P1;}
     
    41604130  {
    41614131    def C2=imap(R,P2);
    4162     def L2=AddCons(C2);
     4132    def L2=addcons(C2);
    41634133  }
    41644134  else{list L2; list C2; kill P2; list P2;}
    41654135    for(i=1;i<=size(L2);i++)
    41664136    {
    4167       d=dim(std(L2[i][1]));
     4137      J=std(L2[i][2]);
     4138      d=dim(J); // AQUI
    41684139      if(d==0)
    41694140      {
    4170         L2[i][3]=string("Accumulation,",L2[i][3]);
    4171       }
    4172       else{L2[i][3]=string("Degenerate,",L2[i][3]);}
     4141        L2[i][4]=string("Accumulation",L2[i][4]);
     4142      }
     4143      else{L2[i][4]=string("Degenerate",L2[i][4]);}
    41734144    }
    41744145  list LN;
     
    41854156  for(i=1;i<=size(L);i++){if(size(L[i][2])==0){L[i][2]=ideal(1);}}
    41864157  kill @R; kill @RP; kill @P;
    4187   return(L);
    4188 }
    4189 example
    4190 {"EXAMPLE:"; echo = 2;
    4191   ring R=(0,a,b),(x,y),dp;
    4192   short=0;
    4193   "Concoid";
    4194   ideal S96=x^2+y^2-4,(b-2)*x-a*y+2*a,(a-x)^2+(b-y)^2-1;
    4195   "System="; S96; " ";
    4196   locus(grobcov(S96));
    4197 }
    4198 
    4199 
    4200 // locusto: Transforms the output of locus to a string that
    4201 //      can be read by different computational systems.
    4202 // input:
    4203 //     list L: The output of locus
     4158  list LL;
     4159  for(i=1;i<=size(L);i++)
     4160  {
     4161    LL[i]=l;
     4162    LL[i]=elimfromlist(L[i],1);
     4163  }
     4164  return(LL);
     4165}
     4166
     4167// locus0dg(G): Private routine used by locusdg (the public routine), that
     4168//                builds the diferent components used in Dynamical Geometry
     4169// input:      The output G of the grobcov (in generic representation, which is the default option)
    42044170// output:
    4205 //     string s: The output of locus converted to a string readable by other programs
    4206 proc locusto(list L)
    4207 "USAGE:   locusto(G);
    4208           The argument must be the output of locus of a parametrical ideal
    4209           It transforms the output into a string in standard form
    4210           readable in many languages (Geogebra).
    4211 
    4212 RETURN: The locus in string standard form
    4213 NOTE:     It can only be called after computing the locus(grobcov(F)) of the
    4214               parametrical ideal.
    4215               The basering R, must be of the form Q[a,b,..][x,y,..].
    4216 KEYWORDS: geometrical locus, locus, loci.
    4217 EXAMPLE:  locusto; shows an example"
    4218 {
    4219   int i; int j; int k;
    4220   string s;
    4221   s="[";
    4222   ideal p;
    4223   ideal q;
     4171//         list, the canonical P-representation of the Relevant components of the locus in Dynamical Geometry,
     4172//              i.e. the Normal and Accumulation components.
     4173//              This routine is compemented by locusdg that calls it in order to eliminate problems
     4174//              with degenerate points of the mover.
     4175//         The output components are given as
     4176//              ((p1,(p11,..p1s_1),type_1,level_1),..,(pk,(pk1,..pks_k),type_k,level_k)
     4177//              whwre type_i is always "Relevant".
     4178//         The components are given in canonical P-representation of the subset.
     4179//              If all levels of a class of locus are 1, then the set is locally closed. Otherwise the level
     4180//              gives the depth of the component.
     4181proc locus0dg(list GG, list #)
     4182{
     4183  int t1=1; int t2=1; int ojo;
     4184  def R=basering;
     4185  int moverdim=nvars(R);
     4186  list HHH;
     4187  if (GG[1][1][1]==1 and GG[1][2][1]==1 and GG[1][3][1][1][1]==0 and GG[1][3][1][2][1]==1){return(HHH);}
     4188  list Lop=#;
     4189  if(size(Lop)>0){moverdim=Lop[1];}
     4190  setglobalrings();
     4191  list G1; list G2;
     4192  def G=GG;
     4193  list Q1; list Q2;
     4194  int i; int d; int j; int k;
     4195  t1=1;
     4196  for(i=1;i<=size(G);i++)
     4197  {
     4198    attrib(G[i][1],"IsSB",1);
     4199    d=locusdim(G[i][2],moverdim);
     4200    if(d==0){G1[size(G1)+1]=G[i];}
     4201    else
     4202    {
     4203      if(d>0){G2[size(G2)+1]=G[i];}
     4204    }
     4205  }
     4206  if(size(G1)==0){t1=0;}
     4207  if(size(G2)==0){t2=0;}
     4208  setring(@RP);
     4209  if(t1)
     4210  {
     4211    list G1RP=imap(R,G1);
     4212  }
     4213  else {list G1RP;}
     4214  list P1RP;
     4215  ideal B;
     4216  for(i=1;i<=size(G1RP);i++)
     4217  {
     4218     kill B;
     4219     ideal B;
     4220     for(k=1;k<=size(G1RP[i][3]);k++)
     4221     {
     4222       attrib(G1RP[i][3][k][1],"IsSB",1);
     4223       G1RP[i][3][k][1]=std(G1RP[i][3][k][1]);
     4224       for(j=1;j<=size(G1RP[i][2]);j++)
     4225       {
     4226         B[j]=reduce(G1RP[i][2][j],G1RP[i][3][k][1]);
     4227       }
     4228       P1RP[size(P1RP)+1]=list(G1RP[i][3][k][1],G1RP[i][3][k][2],B);
     4229     }
     4230  }
     4231  setring(R);
     4232  ideal h;
     4233  if(t1)
     4234  {
     4235    def P1=imap(@RP,P1RP);
     4236    for(i=1;i<=size(P1);i++)
     4237    {
     4238      for(j=1;j<=size(P1[i][3]);j++)
     4239      {
     4240        h=factorize(P1[i][3][j],1);
     4241        P1[i][3][j]=h[1];
     4242        for(k=2;k<=size(h);k++)
     4243        {
     4244          P1[i][3][j]=P1[i][3][j]*h[k];
     4245        }
     4246      }
     4247    }
     4248  }
     4249  else{list P1;}
     4250  ideal BB;
     4251  for(i=1;i<=size(P1);i++)
     4252  {
     4253    if (indepparameters(P1[i][3])==1){P1[i][3]="Special";}
     4254    else{P1[i][3]="Relevant";}
     4255  }
     4256  list P2;
     4257  for(i=1;i<=size(G2);i++)
     4258  {
     4259    for(k=1;k<=size(G2[i][3]);k++)
     4260    {
     4261      P2[size(P2)+1]=list(G2[i][3][k][1],G2[i][3][k][2]);
     4262    }
     4263  }
     4264  list l;
     4265  for(i=1;i<=size(P1);i++){Q1[i]=l; Q1[i][1]=P1[i];} P1=Q1;
     4266  for(i=1;i<=size(P2);i++){Q2[i]=l; Q2[i][1]=P2[i];} P2=Q2;
     4267
     4268  setring @P;
     4269  ideal J;
     4270  if(t1==1)
     4271  {
     4272    def C1=imap(R,P1);
     4273    def L1=addcons(C1);
     4274   }
     4275  else{list C1; list L1; kill P1; list P1;}
     4276  if(t2==1)
     4277  {
     4278    def C2=imap(R,P2);
     4279    def L2=addcons(C2);
     4280  }
     4281  else{list L2; list C2; kill P2; list P2;}
     4282    for(i=1;i<=size(L2);i++)
     4283    {
     4284      J=std(L2[i][2]);
     4285      d=dim(J); // AQUI
     4286      if(d==0)
     4287      {
     4288        L2[i][4]=string("Relevant",L2[i][4]);
     4289      }
     4290      else{L2[i][4]=string("Degenerate",L2[i][4]);}
     4291    }
     4292  list LN;
     4293  list ll; list l0;
     4294  if(t1==1)
     4295  {
     4296    for(i=1;i<=size(L1);i++)
     4297    {
     4298      if(L1[i][4]=="Relevant")
     4299      {
     4300       LN[size(LN)+1]=l0;
     4301       LN[size(LN)][1]=L1[i];
     4302     }
     4303    }
     4304  }
     4305  if(t2==1)
     4306  {
     4307    for(i=1;i<=size(L2);i++)
     4308    {
     4309      if(L2[i][4]=="Relevant")
     4310      {
     4311        LN[size(LN)+1]=l0;
     4312        LN[size(LN)][1]=L2[i];
     4313      }
     4314    }
     4315  }
     4316  list LNN;
     4317  kill ll; list ll; list lll; list llll;
     4318  for(i=1;i<=size(LN);i++)
     4319  {
     4320      LNN[size(LNN)+1]=l0;
     4321      ll=LN[i][1]; lll[1]=ll[2]; lll[2]=ll[3]; lll[3]=ll[4]; LNN[size(LNN)][1]=lll;
     4322  }
     4323  kill LN; list LN;
     4324  LN=addcons(LNN);
     4325  if(size(LN)==0){ojo=1;}
     4326  setring(R);
     4327  if(ojo==1){list L;}
     4328  else
     4329  {
     4330    def L=imap(@P,LN);
     4331    for(i=1;i<=size(L);i++){if(size(L[i][2])==0){L[i][2]=ideal(1);}}
     4332  }
     4333  kill @R; kill @RP; kill @P;
     4334  list LL;
    42244335  for(i=1;i<=size(L);i++)
    42254336  {
    4226     s=string(s,"[[");
    4227     for (j=1;j<=size(L[i][1]);j++)
    4228     {
    4229       s=string(s,L[i][1][j],",");
    4230     }
    4231     s[size(s)]="]";
    4232     s=string(s,",[");
    4233     for(j=1;j<=size(L[i][2]);j++)
    4234     {
    4235       s=string(s,"[");
    4236       for(k=1;k<=size(L[i][2][j]);k++)
    4237       {
    4238         s=string(s,L[i][2][j][k],",");
    4239       }
    4240       s[size(s)]="]";
    4241       s=string(s,",");
    4242     }
    4243     s[size(s)]="]";
    4244     s=string(s,"]");
    4245     if(size(L[i])>=3)
    4246     {
    4247       s[size(s)]=",";
    4248       s=string(s,string(L[i][3]),"]");
    4249     }
    4250     if(size(L[i])>=4)
    4251     {
    4252       s[size(s)]=",";
    4253       s=string(s,string(L[i][4]),"],");
    4254     }
    4255     s[size(s)]="]";
    4256     s=string(s,",");
    4257   }
    4258   s[size(s)]="]";
    4259   return(s);
    4260 }
    4261 example
    4262 {"EXAMPLE:"; echo = 2;
    4263   ring R=(0,a,b),(x,y),dp;
    4264   short=0;
    4265   ideal S96=x^2+y^2-4,(b-2)*x-a*y+2*a,(a-x)^2+(b-y)^2-1;
    4266   "System="; S96; " ";
    4267   locusto(locus(grobcov(S96)));
    4268 }
    4269 
    4270 // locusdg is the routine for computing the locus in dinamical geometry.
    4271 //    It detects automatically a possible point that is to be avoided by the mover,
    4272 //    whose coordinates must be the last coordinates in the definition of the ring (2 last by default,
    4273 //    or the dd last if the option locusdg(G,dd) is specified).
    4274 //    If such a point is detected, then it eliminates the segments of the grobcov that
    4275 //    have this point as solution.
    4276 //    Then it calls locus.
    4277 proc locusdg(list GG,list #)
    4278 "USAGE:  locusdg(GG) ;
    4279           The argument must be the output of grobcov
    4280 RETURN:  The  components of the locus of points in dinamical geometry
    4281 NOTE:  The basering R, must be of the form Q[a][x], a=parameters,
    4282           x=variables, and the mover coordinates must be the two last variables in the
    4283           definition of the ring.
    4284 KEYWORDS: ring, locus, grobcov
    4285 EXAMPLE:  locusdg(GG); shows an example"
     4337    LL[i]=l;
     4338    LL[i]=elimfromlist(L[i],1);
     4339  }
     4340  return(LL);
     4341}
     4342
     4343
     4344//  locus(G):  Special routine for determining the locus of points
     4345//                 of  geometrical constructions. Given a parametric ideal J with
     4346//                 parameters (a_1,..a_m) and variables (x_1,..,xn),
     4347//                 representing the system determining
     4348//                 the locus of points (a_1,..,a_m) who verify certain
     4349//                 properties, computing the grobcov G of
     4350//                 J and applying to it locus, determines the different
     4351//                 classes of locus components. The components can be
     4352//                 Normal, Special, Accumulation, Degenerate.
     4353//                 The output are the components given in P-canonical form
     4354//                 of at most 4 constructible sets: Normal, Special, Accumulation,
     4355//                 Degenerate.
     4356//                 The description of the algorithm and definitions is
     4357//                 given in a forthcoming paper by Abanades, Botana, Montes, Recio.
     4358//                 Usually locus problems have mover coordinates, variables and tracer coordinates.
     4359//                 The mover coordinates are to be placed as the last variables, and by default,
     4360//                 its number is 2. If one consider locus problems in higer dimensions, the number of
     4361//                 mover coordinates (placed as the last variables) is to be given as an option.
     4362//
     4363//  input:      The output G of the grobcov (in generic representation, which is the default option for grobcov)
     4364//  output:
     4365//          list, the canonical P-representation of the Normal and Non-Normal locus:
     4366//               The Normal locus has two kind of components: Normal and Special.
     4367//               The Non-normal locus has two kind of components: Accumulation and Degenerate.
     4368//               Normal components: for each point in the component,
     4369//               the number of solutions in the variables is finite, and
     4370//               the solutions depend on the point in the component if the component is not 0-dimensional.
     4371//               Special components:  for each point in the component,
     4372//               the number of solutions in the variables is finite,
     4373//               the component is not 0-dimensional, but the solutions do not depend on the
     4374//               values of the parameters in the component.
     4375//               Accumlation points: are 0-dimensional components for which it exist
     4376//               an infinite number of solutions.
     4377//               Degenerate components: are components of dimension greater than 0 for which
     4378//               for every point in the component there exist infinite solutions.
     4379//          The output components are given as
     4380//               ((p1,(p11,..p1s_1),type_1,level_1),..,(pk,(pk1,..pks_k),type_k,level_k)
     4381//          The components are given in canonical P-representation of the subset.
     4382//               If all levels of a class of locus are 1, then the set is locally closed. Otherwise the level
     4383//               gives the depth of the component of the constructible set.
     4384proc locus(list GG, list #)
     4385  "USAGE:   locus(G);
     4386                 The input must be the grobcov  of a parametrical ideal
     4387  RETURN:  The  locus.
     4388                 The output are the components of four constructible subsets of the locus
     4389                 of the parametrical system: Normal , Special, Accumulation and Degenerate.
     4390                 These components are
     4391                 given as a list of  (pi,(pi1,..pis_i),type_i,level_i) varying i,
     4392                 where the p's are prime ideals, the type can be: Normal, Special,
     4393                 Accumulation, Degenerate.
     4394  NOTE:      It can only be called after computing the grobcov of the
     4395                 parametrical ideal in generic representation ('ext',0),
     4396                 which is the default.
     4397                 The basering R, must be of the form Q[a_1,..,a_m][x_1,..,x_n].
     4398  KEYWORDS: geometrical locus, locus, loci.
     4399  EXAMPLE:  locus; shows an example"
    42864400{
    42874401  def R=basering;
     
    42944408  if (equalideals(B0,ideal(1)))
    42954409  {
    4296     return(locus(GG));
     4410    return(locus0(GG));
    42974411  }
    42984412  else
     
    43254439    if(te)
    43264440    {
    4327       string("locusdg detected that the mover must avoid point (",N,") in order to obtain the locus");
    4328       // eliminate segments of GG where N is contained in the basis
     4441      string("locus detected that the mover must avoid point (",N,") in order to obtain the correct locus");
     4442      // eliminates segments of GG where N is contained in the basis
    43294443      list nGP;
    43304444      def GP=GG;
     
    43434457   }
    43444458  }
    4345   //"T_nGP="; nGP;
    43464459  kill @RP; kill @P; kill @R;
    4347   return(locus(nGP,dd));
    4348 }
    4349 //      // Now eliminate components for which the basis has dim>0, and all elements non reducing to 0
    4350 //      // modulo N do not contain the mover coordinates
    4351 //      list nnGP; poly r;
    4352 //      for(j=1; j<=size(nGP);j++)
    4353 //      {
    4354 //        if(not(indepparameters(nGP[j][2])))
    4355 //        {
    4356 //          if(dim(std(nGP[j][1]))==0){nnGP[size(nnGP)+1]=nGP[j];}
    4357 //          else
    4358 //          {
    4359 //            te=1; k=1;
    4360 //            while(te and k<=size(nGP[2]))
    4361 //            {
    4362 //              r=pdivi(nGP[j][2][k],N)[1];
    4363 //              if(r==0){k++;}
    4364 //              else
    4365 //              {
    4366 //                if(not(subset(variables(nGP[j][2][k]),vmov )))
    4367 //                {
    4368 //                  te=0;
    4369 //                }
    4370 //                else{k++;}
    4371 //              }
    4372 //            }
    4373 //            if(te==1){nnGP[size(nnGP)+1]=nGP[j];}
    4374 //          }
    4375 //        }
    4376 //      }
    4377 //
    4378 //    }
    4379 //    kill @RP; kill @P; kill @R;
    4380 //    return(locus(nnGP));
    4381 //  }
    4382 //}
     4460  return(locus0(nGP,dd));
     4461}
    43834462example
    43844463{"EXAMPLE:"; echo = 2;
     
    43904469             (a-x1)^2+(b-x2)^2-(x1-x3)^2-(x2-x4)^2;
    43914470  short=0;
    4392   locusdg(grobcov(S));
    4393 }
    4394 
     4471  locus(grobcov(S)); " ";
     4472  kill R;
     4473  ring R=(0,a,b),(x,y),dp;
     4474  short=0;
     4475  "Concoid";
     4476  ideal S96=x^2+y^2-4,(b-2)*x-a*y+2*a,(a-x)^2+(b-y)^2-1;
     4477  "System="; S96; " ";
     4478  locus(grobcov(S96));
     4479  kill R; ring R=(0,x,y),(x1,x2),dp;
     4480  ideal S=-(x - 5)*(x1 - 1) - (x2 - 2)*(y - 2),
     4481              (x1 - 5)^2 + (x2 - 2)^2 - 4,
     4482              -2*(x - 5)*(x2 - 2) + 2*(x1 - 5)*(y - 2);
     4483 "System="; S;
     4484  locus(grobcov(S)); " ";
     4485  ideal S1=-(x - x1)*(x1 - 4) + (x2 - y)*(x2 - 4),
     4486                (x1 - 4)^2 + (x2 - 2)^2 - 4,
     4487                -2*(x1 - 4)*(2*x2 - y - 4) - 2*(x - 2*x1 + 4)*(x2 - 2);
     4488 "System="; S1;
     4489  locus(grobcov(S1));
     4490}
     4491
     4492//  locusdg(G):  Special routine for determining the locus of points
     4493//                 of  geometrical constructions. Given a parametric ideal J with
     4494//                 parameters (a_1,..a_m) and variables (x_1,..,xn),
     4495//                 representing the system determining
     4496//                 the locus of points (a_1,..,a_m) who verify certain
     4497//                 properties, computing the grobcov G of
     4498//                 J and applying to it locus, determines the different
     4499//                 classes of locus components. The components can be
     4500//                 Normal, Special, Accumulation point, Degenerate.
     4501//                 The output are the components given in P-canonical form
     4502//                 of at most 4 constructible sets: Normal, Special, Accumulation,
     4503//                 Degenerate.
     4504//                 The description of the algorithm and definitions is
     4505//                 given in a forthcoming paper by Abanades, Botana, Montes, Recio.
     4506//                 Usually locus problems have mover coordinates, variables and tracer coordinates.
     4507//                 The mover coordinates are to be placed as the last variables, and by default,
     4508//                 its number is 2. If onw consider locus problems in higer dimensions, the number of
     4509//                 mover coordinates (placed as the last variables) is to be given as an option.
     4510//
     4511//  input:      The output G of the grobcov (in generic representation, which is the default option for grobcov)
     4512//  output:
     4513//          list, the canonical P-representation of the Normal and Non-Normal locus:
     4514//               The Normal locus has two kind of components: Normal and Special.
     4515//               The Non-normal locus has two kind of components: Accumulation and Degenerate.
     4516//               Normal components: for each point in the component,
     4517//               the number of solutions in the variables is finite, and
     4518//               the solutions depend on the point in the component if the component is not 0-dimensional.
     4519//               Special components:  for each point in the component,
     4520//               the number of solutions in the variables is finite,
     4521//               the component is not 0-dimensional, but the solutions do not depend on the
     4522//               values of the parameters in the component.
     4523//               Accumlation points: are 0-dimensional components for which it exist
     4524//               an infinite number of solutions.
     4525//               Degenerate components: are components of dimension greater than 0 for which
     4526//               for every point in the component there exist infinite solutions.
     4527//          The output components are given as
     4528//               ((p1,(p11,..p1s_1),type_1,level_1),..,(pk,(pk1,..pks_k),type_k,level_k)
     4529//          The components are given in canonical P-representation of the subset.
     4530//               If all levels of a class of locus are 1, then the set is locally closed. Otherwise the level
     4531//               gives the depth of the component of the constructible set.
     4532proc locusdg(list GG, list #)
     4533  "USAGE:   locus(G);
     4534                 The input must be the grobcov  of a parametrical ideal
     4535  RETURN:  The  locus.
     4536                 The output are the components of two constructible subsets of the locus
     4537                 of the parametrical system.: Normal and Non-normal.
     4538                 These components are
     4539                 given as a list of  (pi,(pi1,..pis_i),type_i,level_i) varying i,
     4540                 where the p's are prime ideals, the type can be: Normal, Special,
     4541                 Accumulation, Degenerate.
     4542  NOTE:      It can only be called after computing the grobcov of the
     4543                 parametrical ideal in generic representation ('ext',0),
     4544                 which is the default.
     4545                 The basering R, must be of the form Q[a_1,..,a_m][x_1,..,x_n].
     4546  KEYWORDS: geometrical locus, locus, loci.
     4547  EXAMPLE:  locusdg; shows an example"
     4548{
     4549  def R=basering;
     4550  int dd=2; int comment=0;
     4551  list DD=#;
     4552  if (size(DD)>1){comment=1;}
     4553  if(size(DD)>0){dd=DD[1];}
     4554  int i; int j; int k;
     4555  def B0=GG[1][2];
     4556  if (equalideals(B0,ideal(1)))
     4557  {
     4558    return(locus0dg(GG));
     4559  }
     4560  else
     4561  {
     4562    int n=nvars(R);
     4563    ideal vmov=var(n-1),var(n);
     4564    ideal N;
     4565    intvec xw; intvec yw;
     4566    for(i=1;i<=n-1;i++){xw[i]=0;}
     4567    xw[n]=1;
     4568    for(i=1;i<=n;i++){yw[i]=0;}
     4569    yw[n-1]=1;
     4570    poly px; poly py;
     4571    int te=1;
     4572    i=1;
     4573    while( te and i<=size(B0))
     4574    {
     4575      if((deg(B0[i],xw)==1) and (deg(B0[i])==1)){px=B0[i]; te=0;}
     4576      i++;
     4577    }
     4578    i=1; te=1;
     4579    while( te and i<=size(B0))
     4580    {
     4581      if((deg(B0[i],yw)==1) and (deg(B0[i])==1)){py=B0[i]; te=0;}
     4582      i++;
     4583    }
     4584    N=px,py;
     4585    setglobalrings();
     4586    te=indepparameters(N);
     4587    if(te)
     4588    {
     4589      string("locus detected that the mover must avoid point (",N,") in order to obtain the correct locus");
     4590      // eliminates segments of GG where N is contained in the basis
     4591      list nGP;
     4592      def GP=GG;
     4593      ideal BP;
     4594      for(j=1;j<=size(GP);j++)
     4595      {
     4596        te=1; k=1;
     4597        BP=GP[j][2];
     4598        while((te==1) and (k<=size(N)))
     4599        {
     4600          if(pdivi(N[k],BP)[1]!=0){te=0;}
     4601          k++;
     4602        }
     4603        if(te==0){nGP[size(nGP)+1]=GP[j];}
     4604      }
     4605   }
     4606  }
     4607  //"T_nGP="; nGP;
     4608  kill @RP; kill @P; kill @R;
     4609  return(locus0dg(nGP,dd));
     4610}
     4611example
     4612{"EXAMPLE:"; echo = 2;
     4613  ring R=(0,a,b),(x4,x3,x2,x1),dp;
     4614  ideal S=(x1-3)^2+(x2-1)^2-9,
     4615             (4-x2)*(x3-3)+(x1-3)*(x4-1),
     4616             (3-x1)*(x3-x1)+(4-x2)*(x4-x2),
     4617             (4-x4)*a+(x3-3)*b+3*x4-4*x3,
     4618             (a-x1)^2+(b-x2)^2-(x1-x3)^2-(x2-x4)^2;
     4619  short=0;
     4620  locus(grobcov(S)); " ";
     4621  kill R;
     4622  ring R=(0,a,b),(x,y),dp;
     4623  short=0;
     4624  "Concoid";
     4625  ideal S96=x^2+y^2-4,(b-2)*x-a*y+2*a,(a-x)^2+(b-y)^2-1;
     4626  "System="; S96; " ";
     4627  locusdg(grobcov(S96));
     4628  kill R; ring R=(0,x,y),(x1,x2),dp;
     4629  ideal S=-(x - 5)*(x1 - 1) - (x2 - 2)*(y - 2),
     4630              (x1 - 5)^2 + (x2 - 2)^2 - 4,
     4631              -2*(x - 5)*(x2 - 2) + 2*(x1 - 5)*(y - 2);
     4632 "System="; S;
     4633  locusdg(grobcov(S)); " ";
     4634  ideal S1=-(x - x1)*(x1 - 4) + (x2 - y)*(x2 - 4),
     4635                (x1 - 4)^2 + (x2 - 2)^2 - 4,
     4636                -2*(x1 - 4)*(2*x2 - y - 4) - 2*(x - 2*x1 + 4)*(x2 - 2);
     4637 "System="; S1;
     4638  locusdg(grobcov(S1));
     4639}
     4640
     4641// locusto: Transforms the output of locus to a string that
     4642//      can be read by different computational systems.
     4643// input:
     4644//     list L: The output of locus
     4645// output:
     4646//     string s: The output of locus converted to a string readable by other programs
     4647proc locusto(list L)
     4648"USAGE:   locusto(L);
     4649          The argument must be the output of locus of a parametrical ideal
     4650          It transforms the output into a string in standard form
     4651          readable in many languages (Geogebra).
     4652RETURN: The locus in string standard form
     4653NOTE:     It can only be called after computing the locus(grobcov(F)) of the
     4654              parametrical ideal.
     4655              The basering R, must be of the form Q[a,b,..][x,y,..].
     4656KEYWORDS: geometrical locus, locus, loci.
     4657EXAMPLE:  locusto; shows an example"
     4658{
     4659  int i; int j; int k;
     4660  string s="["; string sf="]"; string st=s+sf;
     4661  if(size(L)==0){return(st);}
     4662  ideal p;
     4663  ideal q;
     4664  for(i=1;i<=size(L);i++)
     4665  {
     4666    s=string(s,"[[");
     4667    for (j=1;j<=size(L[i][1]);j++)
     4668    {
     4669      s=string(s,L[i][1][j],",");
     4670    }
     4671    s[size(s)]="]";
     4672    s=string(s,",[");
     4673    for(j=1;j<=size(L[i][2]);j++)
     4674    {
     4675      s=string(s,"[");
     4676      for(k=1;k<=size(L[i][2][j]);k++)
     4677      {
     4678        s=string(s,L[i][2][j][k],",");
     4679      }
     4680      s[size(s)]="]";
     4681      s=string(s,",");
     4682    }
     4683    s[size(s)]="]";
     4684    s=string(s,"]");
     4685    if(size(L[i])>=3)
     4686    {
     4687      s[size(s)]=",";
     4688      s=string(s,string(L[i][3]),"]");
     4689    }
     4690    if(size(L[i])>=4)
     4691    {
     4692      s[size(s)]=",";
     4693      s=string(s,string(L[i][4]),"],");
     4694    }
     4695    s[size(s)]="]";
     4696    s=string(s,",");
     4697  }
     4698  s[size(s)]="]";
     4699  return(s);
     4700}
     4701example
     4702{"EXAMPLE:"; echo = 2;
     4703  ring R=(0,a,b),(x,y),dp;
     4704  short=0;
     4705  ideal S96=x^2+y^2-4,(b-2)*x-a*y+2*a,(a-x)^2+(b-y)^2-1;
     4706  "System="; S96; " ";
     4707  locusto(locus(grobcov(S96)));
     4708}
     4709
     4710// Auxiliary routione
    43954711// locusdim
    43964712// input:
     
    44374753}
    44384754
     4755// locusdgto: Transforms the output of locus to a string that
     4756//      can be read by different computational systems.
     4757// input:
     4758//     list L: The output of locus
     4759// output:
     4760//     string s: The output of locus converted to a string readable by other programs
     4761//                   Outputs only the relevant dynamical geometry components.
     4762//                   Without unnecessary parenthesis
     4763proc locusdgto(list LL)
     4764{
     4765  def RR=basering;
     4766  int i; int j; int k; int short0=short; int ojo;
     4767  int te=0;
     4768  if(defined(@P)){te=1;}
     4769  else{setglobalrings();}
     4770  setring @P;
     4771  short=0;
     4772  if(size(LL)==0){ojo=1; list L;}
     4773  else
     4774  {
     4775    def L=imap(RR,LL);
     4776  }
     4777  string s="["; string sf="]"; string st=s+sf;
     4778  if(size(L)==0){return(st);}
     4779  ideal p;
     4780  ideal q;
     4781  for(i=1;i<=size(L);i++)
     4782  {
     4783    if(L[i][3]=="Relevant")
     4784    {
     4785      s=string(s,"[[");
     4786      for (j=1;j<=size(L[i][1]);j++)
     4787      {
     4788        s=string(s,L[i][1][j],",");
     4789      }
     4790      s[size(s)]="]";
     4791      s=string(s,",[");
     4792      for(j=1;j<=size(L[i][2]);j++)
     4793      {
     4794        s=string(s,"[");
     4795        for(k=1;k<=size(L[i][2][j]);k++)
     4796        {
     4797          s=string(s,L[i][2][j][k],",");
     4798        }
     4799        s[size(s)]="]";
     4800        s=string(s,",");
     4801      }
     4802      s[size(s)]="]";
     4803      s=string(s,"]");
     4804      s[size(s)]="]";
     4805      s=string(s,",");
     4806    }
     4807  }
     4808  if(s=="["){s="[]";}
     4809  else{s[size(s)]="]";}
     4810  setring(RR);
     4811  short=short0;
     4812  if(te==0){kill @P; kill @R; kill @RP;}
     4813  return(s);
     4814}
    44394815
    44404816//********************* End locus ****************************
  • Singular/LIB/modnormal.lib

    r4c1341 rce70e6  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="version modnormal.lib 4.0.0.0 Jun_2013 "; // $Id$
     2version="version modnormal.lib 4.0.0.0 Dec_2013 "; // $Id$
    33category = "Commutative Algebra";
    44info="
     
    314314        modarguments[j-(k-1)*n2-sh] = list(I, L[j], condu, printTimings, #);
    315315      }
    316       modresults = parallelWaitAll("modpNormal", modarguments,
    317         list(list(list(ncores))));
     316      modresults = parallelWaitAll("modpNormal", modarguments, 0, ncores);
    318317      for(j = (k-1)*n2+1+sh; j <= k*n2+1; j++)
    319318      {
  • Singular/LIB/modstd.lib

    r4c1341 rce70e6  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="version modstd.lib 4.0.0.0 Jun_2013 "; // $Id$
     2version="version modstd.lib 4.0.0.0 Dec_2013 "; // $Id$
    33category = "Commutative Algebra";
    44info="
     
    3333static proc mod_init()
    3434{
    35    newstruct("ideal_primeTest", "ideal Ideal");
     35   newstruct("idealPrimeTest", "ideal Ideal");
    3636}
    3737
     
    487487      list arguments;
    488488      int neededPrimes = neededSize-size(L);
    489       ideal_primeTest Id;
     489      idealPrimeTest Id;
    490490      Id.Ideal = I;
    491491      export(Id);
     
    500500            arguments[i] = list("Id", p);
    501501         }
    502          parallelResults = parallelWaitAll("primeTest", arguments,
    503             list(list(list(ncores))));
     502         parallelResults = parallelWaitAll("primeTest", arguments, 0, ncores);
    504503         for(i = size(arguments); i > 0; i--)
    505504         {
     
    511510         neededPrimes = neededSize-size(L);
    512511      }
     512      kill Id;
    513513      if(size(L) > neededSize)
    514514      {
     
    12391239            arguments_farey[i] = list(ideal(H[i]), N);
    12401240         }
    1241          results_farey = parallelWaitAll("farey", arguments_farey,
    1242                                          list(list(list(n1))));
     1241         results_farey = parallelWaitAll("farey", arguments_farey, 0, n1);
    12431242         for(i = ncols(H); i > 0; i--)
    12441243         {
  • Singular/LIB/normal.lib

    r4c1341 rce70e6  
    21562156
    21572157proc genus(ideal I,list #)
    2158 "USAGE:   genus(i) or genus(i,1); I a 1-dimensional ideal
     2158"USAGE:   genus(I) or genus(I,<option>); I a 1-dimensional ideal
    21592159RETURN:  an integer, the geometric genus p_g = p_a - delta of the projective
    21602160         curve defined by i, where p_a is the arithmetic genus.
     
    21622162         i.e. dim(R'/R), R' the normalization of the local ring R of the
    21632163         singularity. @*
    2164          genus(i,1) uses the normalization to compute delta. Usually genus(i,1)
    2165          is slower than genus(i) but sometimes not.
     2164         genus(I,"nor") uses the normalization to compute delta. Usually genus(I,"nor")
     2165         is slower than genus(I) but sometimes not. @*
     2166         genus(I,"pri") starts with a primary decompsition.
    21662167EXAMPLE: example genus; shows an example
    21672168"
     
    21692170   int w = printlevel-voice+2;  // w=printlevel (default: w=0)
    21702171
     2172   int ono,rpr,ll;
     2173   if(size(#)>0)
     2174   {
     2175     if(typeof(#[1])=="string")
     2176     {
     2177        if(#[1]=="nor"){ono=1;}
     2178        if(#[1]=="pri"){rpr=1;}
     2179     }
     2180     else { ERROR("invalid option for genus");}
     2181   }
    21712182   def R0=basering;
    2172    if(char(basering)>0)
     2183   if((char(basering)>0)||(ono))
    21732184   {
    21742185     def R1=changeord(list(list("dp",1:nvars(basering))));
     
    21982209       J=std(J);
    21992210     }
    2200      int pa=1-hilbPoly(J)[1];
    2201      pa=pa-deltaP(J);
     2211
     2212     list LL=normal(J,"prim");
     2213     int pa,i;
     2214     for(i=1;i<=size(LL[1]);i++)
     2215     {
     2216        def T=LL[1][i];
     2217        setring T;
     2218        pa=pa-hilbPoly(std(norid))[1];
     2219        setring S;
     2220        kill T;
     2221     }
     2222     pa=pa+1;
    22022223     setring R0;
    22032224     return(pa);
     2225   }
     2226   if(!rpr)
     2227   {
     2228      list LZ=minAssGTZ(I);
     2229      if(size(LZ)>1)
     2230      {
     2231         int p_g;
     2232         for(ll=1;ll<=size(LZ);ll++)
     2233         {
     2234            p_g=p_g+genus(LZ[ll],"pri")-1;
     2235         }
     2236         return(p_g+1);
     2237      }
     2238      else
     2239      {
     2240         I=LZ[1];
     2241      }
    22042242   }
    22052243   I=std(I);
     
    24322470   map sigma=S,var(1),var(2),1;
    24332471   ideal I=sigma(F);
    2434 
    2435    if(size(#)!=0)
    2436    {                              //uses the normalization to compute delta
    2437       list nor=normal(I);
    2438       delt=nor[size(nor)][2];
    2439       genus=genus-delt-deltainf;
    2440       setring R0;
    2441       return(genus);
    2442    }
    24432472
    24442473   ideal I1=jacob(I);
     
    44164445        printlevel = printlevel + 1;
    44174446        ideal JDefault = 0; // Now it uses the default J;
    4418         list nor1 = normalM(Id1, decomp, withDelta, denomOption, JDefault, JDefault)[1];
    4419         list nor2 = normalM(Id2, decomp, withDelta, denomOption, JDefault, JDefault)[1];
     4447        list nor1 = normalM(Id1, decomp, withDelta, denomOption, JDefault, JDefault);
     4448        list nor2 = normalM(Id2, decomp, withDelta, denomOption, JDefault, JDefault);
    44204449        printlevel = printlevel - 1;
    44214450        option(set,save_opt);
    4422         return(list(nor1, nor2));
     4451        list res = nor1 + nor2;
     4452        return(res);
    44234453      }
    44244454    }
     
    45394569
    45404570      ideal JDefault = 0;  // Now it uses the default J;
    4541       list nor1 = normalM(Id1, decomp, withDelta, denomOption, JDefault, JDefault)[1];
    4542       list nor2 = normalM(Id2, decomp, withDelta, denomOption, JDefault, JDefault)[1];
     4571      list nor1 = normalM(Id1, decomp, withDelta, denomOption, JDefault, JDefault);
     4572      list nor2 = normalM(Id2, decomp, withDelta, denomOption, JDefault, JDefault);
    45434573      printlevel = printlevel - 1;
    45444574      option(set,save_opt);
    4545       return(list(nor1, nor2));
     4575      list res = nor1 + nor2;
     4576      return(res);
    45464577    }
    45474578  }
  • Singular/LIB/parallel.lib

    r4c1341 rce70e6  
    1 ///////////////////////////////////////////////////////////////////
    2 version="version parallel.lib 4.0.0.0 Jun_2013 "; // $Id$
     1////////////////////////////////////////////////////////////////////
     2version="version parallel.lib 4.0.0.0 Dec_2013 "; // $Id$
    33category="General purpose";
    44info="
    5 LIBRARY:   parallel.lib  Tools for Parallelization
     5LIBRARY:   parallel.lib  An abstraction layer for parallel skeletons
     6
    67AUTHOR:    Andreas Steenpass, e-mail: steenpass@mathematik.uni-kl.de
    78
    89OVERVIEW:
    9 This library provides tools to do several computations in parallel. They
    10 are aimed at ordinary Singular users as well as authors of Singular
    11 libraries.
    12 @* Even without this library, it is possible to do execute self-defined
    13 Singular commands in parallel using @ref{link}, but the handling of
    14 such links can be quite tedious. With the pocedures described below,
    15 this can be done by one-line commands.
    16 @* There are many parallel 'skeletons' (i.e. ways in which parallel
    17 tasks rely upon and interact with each other). A few of them are already
    18 implemented. Future plans include an abstraction layer for modular
    19 techniques, 'worker farms', and parallel tests.
    20 
    21 SEE ALSO:  link, modstd_lib, assprimeszerodim_lib
    22 
    23 KEYWORDS:  parallel.lib; Parallelization; Links, user interface;
    24            Skeletons for parallelization; Distributed computing
     10This library provides implementations of several parallel 'skeletons' (i.e.
     11ways in which parallel tasks rely upon and interact with each other). It is
     12based on the library tasks.lib and aims at both ordinary Singular users as well
     13as authors of Singular libraries.
     14
     15KEYWORDS:  parallelization; parallel skeletons; distributed computing
     16
     17SEE ALSO:  resources_lib, tasks_lib, modstd_lib, modnormal_lib
    2518
    2619PROCEDURES:
    27   parallelWaitN(...)     execute several jobs in parallel,
    28                          wait for N of them to finish
    29   parallelWaitFirst(...) execute several jobs in parallel,
    30                          wait for the first to finish
    31   parallelWaitAll(...)   execute several jobs in parallel,
    32                          wait for all of them to finish
     20  parallelWaitN();      execute several jobs in parallel
     21                        and wait for N of them to finish
     22  parallelWaitFirst();  execute several jobs in parallel
     23                        and wait for the first to finish
     24  parallelWaitAll();    execute several jobs in parallel
     25                        and wait for all of them to finish
     26  parallelTestAND();    run several tests in parallel
     27                        and determine if they all succeed
     28  parallelTestOR();     run several tests in parallel
     29                        and determine if any of them succeeds
    3330";
    3431
    35 proc parallelWaitN(list commands, list args, int N, list #)
    36 "USAGE:  parallelWaitN(commands, args, N[, timeout, linktype, servers,
    37          maxmemory]); commands list, args list, N int, timeout int,
    38          linktype string, servers list, maxmemory intvec
    39 RETURN:  a list, containing the results of commands[i] applied to arg[i],
    40          i = 1, ..., size(commands).
    41          @* The procedure waits for N jobs to finish.
    42 
    43          @* OPTIONAL PARAMETERS:
    44 
    45             An optional timeout in ms can be provided. Default is 0 which
    46             disables the timeout.
    47 
    48             Supported linktypes are up to now \"ssi\" and \"mp\", see
    49             @ref{Ssi links}.
    50 
    51             Servers:
    52          @* Each server is given by a list containing the address of the server,
    53             the number of cores to use on this server and the command to start
    54             Singular.
    55          @* If the address is \"localhost\", the processes will be generated on
    56             the same machine using forks. If the command to start Singular is
    57             \"\" (the empty string), \"Singular\" will be used.
    58          @* Default is @code{list(\"localhost\", system(\"cpu\"), \"\")}.
    59          @* There are some obvious shortcuts for servers, e.g. \"myserver\" is
    60             a shortcut for
    61             @code{list(\"myserver\", [nb. of cores on myserver], \"\")}, or 3
    62             for @code{list(\"localhost\", 3, \"\")}.
    63 
    64             Memory limits:
    65          @* If an intvec maxmemory of size @code{size(commands)} is given, the
    66             i-th job will be killed if it uses more than maxmemory[i] MB of
    67             memory. If maxmemory[i] is 0, there will be no restraint for the
    68             i-th job. Default is @code{0:size(commands)}.
    69 NOTE:       The entries of the list commands must be strings.
    70          @* The entries of the list args must be lists.
    71          @* The returned list may contain more than N results if several jobs
    72             finished \"at the same time\". It may contain less than N results in
    73             the case of timeout or errors occurring.
    74          @* The check whether the jobs exceed the memory sizes given by
    75             maxmemory is only done from time to time. This feature is
    76             experimental and should be used with care.
    77 SEE ALSO: Ssi links, waitfirst, waitall
    78 KEYWORDS: parallelWaitN; Parallelization; Links, user interface;
    79           Skeletons for parallelization; Distributed computing
    80 EXAMPLE:  @code{example parallelWaitN;} shows an example."
    81 {
    82   // initialize the timer
    83   int oldtimerresolution = system("--ticks-per-sec");
    84   system("--ticks-per-sec", 1000);
    85   int t = rtimer;
    86 
    87   // auxiliary variables
    88   int i, j, m, tt;
    89 
    90   // read optional parameters
    91   list defaultserver = list("localhost", system("cpu"), "");
    92   list defaults = list(0, "ssi", list(defaultserver), 0:size(commands));
    93   for(i = 1; i <= size(defaults); i++)
    94   {
    95     if(typeof(#[i]) != typeof(defaults[i]))
    96     {
    97       # = insert(#, defaults[i], i-1);
    98     }
    99   }
    100   if(size(#) != size(defaults))
    101   {
    102     ERROR("wrong optional parameters");
    103   }
    104   for(j = size(#[3]); j > 0; j--)
    105   {
    106     if(typeof(#[3][j][1]) != typeof(defaultserver[1]))
    107     {
    108       #[3][j] = insert(#[3][j], defaultserver[1], 0);
    109     }
    110     defaultserver[3] = "";
    111     // only for ssi:tcp links, the default program is system("Singular")
    112     if(#[2] == "ssi" && #[3][j][1] != "localhost")
    113     {
    114       defaultserver[3] = system("Singular");
    115     }
    116     for(i = 2; i <= size(defaultserver); i++)
    117     {
    118       if(typeof(#[3][j][i]) != typeof(defaultserver[i]))
    119       {
    120         #[3][j] = insert(#[3][j], defaultserver[i], i-1);
    121       }
    122     }
    123     if(size(#[3][j]) != size(defaultserver))
    124     {
    125       ERROR("wrong declaration for server no. "+string(j));
    126     }
    127   }
    128   int timeout = #[1];
    129   string linktype = #[2];
    130   list servers = #[3];
    131   intvec maxmems = #[4];
    132 
    133   // error checking
    134   int njobs = size(commands);
    135   if(njobs != size(args))
    136   {
    137     ERROR("The number of commands does not match the number of lists"
    138          +newline+"of arguments.");
    139   }
    140   if(njobs == 0)
    141   {
    142     ERROR("no commands specified");
    143   }
    144   for(i = 1; i <= njobs; i++)
    145   {
    146     if(typeof(commands[i]) != "string")
    147     {
    148       ERROR("The first argument is not a list of strings.");
    149     }
    150     if(typeof(args[i]) != "list")
    151     {
    152       ERROR("The second argument is not a list of lists.");
    153     }
    154   }
    155   if(N < 0)
    156   {
    157     ERROR("The number of jobs which you want to wait for is negative.");
    158   }
    159   if(N > njobs)
    160   {
    161     ERROR("The number of jobs which you wnat to wait for is greater"
    162          +newline+"than the number of jobs itself.");
    163   }
    164   if(timeout < 0)
    165   {
    166     ERROR("The given timeout is negative.");
    167   }
    168   if(linktype != "ssi" && linktype != "mp")
    169   {
    170     ERROR("The given linktype is not recognized.");
    171   }
    172   int nservers = size(servers);
    173   if(nservers <= 0)
    174   {
    175     ERROR("no server specified");
    176   }
    177   for(i = 1; i <= nservers; i++)
    178   {
    179     if(servers[i][1] != "localhost")
    180     {
    181       if(system("sh", "ssh "+servers[i][1]+" exit"))
    182       {
    183         ERROR("Could not connect to server \""+servers[i][1]+"\"");
    184       }
    185     }
    186     if(servers[i][2] < 0)
    187     {
    188       ERROR("The number of cores to be used on server \""+servers[i][1]+"\""
    189            +newline+" is negative.");
    190     }
    191     if(servers[i][1] == "localhost")
    192     {
    193       int ncpus(i) = system("cpu");
    194     }
    195     else
    196     {
    197       //if(linktype == "ssi")
    198       //{
    199         link lcpu(i) = "ssi:tcp "+servers[i][1]+":"+servers[i][3];
    200       //}
    201       open(lcpu(i));
    202       write(lcpu(i), quote(system("cpu")));
    203       int ncpus(i) = read(lcpu(i));
    204       close(lcpu(i));
    205       kill lcpu(i);
    206     }
    207     if(servers[i][2] == 0)
    208     {
    209       servers[i][2] = ncpus(i);
    210     }
    211     else
    212     {
    213       if(servers[i][2] > ncpus(i))
    214       {
    215         ERROR("The number of cores to use on server \""+servers[i][1]+"\""
    216              +newline+"is greater than the number of available cores");
    217       }
    218     }
    219     if(servers[i][1] != "localhost")
    220     {
    221       if(system("sh", "ssh "+servers[i][1]+
    222                       " 'test -e `which "+servers[i][3]+"`'"))
    223       {
    224         ERROR("\""+servers[i][3]+"\" was not found on"
    225              +"\""+servers[i][1]+"\".");
    226       }
    227     }
    228   }
    229   if(size(maxmems) != njobs)
    230   {
    231     ERROR("The size of the intvec which specifies the maximal amount of memory"
    232          +newline+"to be used for each job does not match the number of jobs.");
    233   }
    234   int havemaxmem;
    235   for(i = 1; i <= njobs; i++)
    236   {
    237     if(maxmems[i] < 0)
    238     {
    239       ERROR("The maximal amount of memory to be used for job no. "+string(i)
    240            +"is negative.");
    241     }
    242     havemaxmem = havemaxmem+maxmems[i];
    243   }
    244 
    245   // skip those cores which won't be needed
    246   int nlinks;
    247   for(i = 1; i <= nservers; i++)
    248   {
    249     if(nlinks+servers[i][2] <= njobs)
    250     {
    251       nlinks = nlinks+servers[i][2];
    252     }
    253     else
    254     {
    255       if(nlinks == njobs)
    256       {
    257         servers = list(servers[1..(i-1)]);
    258       }
    259       else
    260       {
    261         servers = list(servers[1..i]);
    262         servers[i][2] = njobs-nlinks;
    263         nlinks = njobs;
    264       }
    265       nservers = size(servers);
    266     }
    267   }
    268 
    269   // open the links
    270   string server;
    271   int ncores;
    272   string program;
    273   int k = 1;   // the index of the link
    274   for(i = 1; i <= nservers; i++)
    275   {
    276     server = servers[i][1];
    277     ncores = servers[i][2];
    278     program = servers[i][3];
    279     for(j = 1; j <= ncores; j++)
    280     {
    281       if(server == "localhost")
    282       {
    283         //if(linktype == "ssi")
    284         //{
    285           link l(k) = "ssi:fork";
    286         //}
    287       }
    288       else
    289       {
    290         //if(linktype == "ssi")
    291         //{
    292           link l(k) = "ssi:tcp "+server+":"+program;
    293         //}
    294       }
    295       open(l(k));
    296       k++;
    297     }
    298   }
    299   list links = list(l(1..nlinks));
    300 
    301   // start a memory watchdog if needed
    302   if(havemaxmem)
    303   {
    304     //if(linktype == "ssi")
    305     //{
    306       link mempatrol = "ssi:fork";
    307     //}
    308     open(mempatrol);
    309     write(mempatrol, quote(watchlinks()));
    310     links = insert(links, mempatrol, nlinks);
    311   }
    312   int nkilled;   // the number of jobs killed by the mempatrol
    313 
    314   // distribute work to the links
    315   k = 1; // from here on, k is the index of the next job which must be
    316          // distributed to some link
    317   intvec assignment = 0:nlinks;  // link number i is currently doing
    318                                  // job number assignment[i]
    319   int pid;
    320   for(i = 1; i <= nlinks; i++)
    321   {
    322     write(l(i), quote(execute("option(noredefine);")));
    323     read(l(i));
    324     write(l(i), quote(execute("def result;")));
    325     read(l(i));
    326     write(l(i), quote(execute("list currentargs;")));
    327     read(l(i));
    328     if(status(l(i), "mode", "fork"))
    329     {
    330       write(l(i), quote(currentargs = args[eval(k)]));
    331     }
    332     else
    333     {
    334       write(l(i), quote(currentargs = eval(args[k])));
    335     }
    336     read(l(i));
    337     if(maxmems[k] > 0)
    338     {
    339       m = i;
    340       for(j = 1; j <= nservers; j++)
    341       {
    342         if(servers[j][2] > m)
    343         {
    344           server = servers[j][1];
    345           break;
    346         }
    347         else
    348         {
    349           m = m-servers[j][2];
    350         }
    351       }
    352       write(l(i), quote(system("pid")));
    353       pid = read(l(i));
    354       write(mempatrol, list(server, pid, i, maxmems[k]));
    355     }
    356     write(l(i), quote(execute("result = "+eval(commands[k])
    357       +"("+argsToString("currentargs", size(currentargs))+");")));
    358     assignment[i] = k;
    359     k++;
    360   }
    361 
    362   // distribute the rest of the work
    363   list results;
    364   for(i = njobs; i > 0; i--)
    365   {
    366     results[i] = list();  // TODO: What if the result of one of the commands is
    367                           // list()?
    368   }
    369   int nfinished;  // the number of finished jobs
    370   int wait;   // the index of the link which is finished, or 0 for timeout
    371   while(k <= njobs && nfinished < N-1)
    372   {
    373     if(timeout == 0)
    374     {
    375       wait = waitfirst(links);
    376     }
    377     else
    378     {
    379       tt = timeout-(rtimer-t);
    380       if(tt < 0)
    381       {
    382         wait = waitfirst(links, 0);
    383         wait = 0;
    384       }
    385       else
    386       {
    387         wait = waitfirst(links, tt);
    388       }
    389     }
    390     if(wait == -1)
    391     {
    392       ERROR("All links crashed.");
    393     }
    394     if(wait)
    395     {
    396       if(wait == nlinks+1)
    397       {
    398         wait = read(mempatrol);
    399         close(l(wait));
    400         open(l(wait));
    401         results[assignment[wait]] = "out of memory";
    402         nkilled++;
    403       }
    404       else
    405       {
    406         read(l(wait));
    407         write(l(wait), quote(result));
    408         results[assignment[wait]] = read(l(wait));
    409         if(maxmems[assignment[wait]] > 0)
    410         {
    411           write(mempatrol, assignment[wait]);
    412         }
    413         nfinished++;
    414       }
    415       if(status(l(wait), "mode", "fork"))
    416       {
    417         write(l(wait), quote(currentargs = args[eval(k)]));
    418       }
    419       else
    420       {
    421         write(l(wait), quote(currentargs = eval(args[k])));
    422       }
    423       read(l(wait));
    424       if(maxmems[k] > 0)
    425       {
    426         m = wait;
    427         for(j = 1; j <= nservers; j++)
    428         {
    429           if(servers[j][2] > m)
    430           {
    431             server = servers[j][1];
    432             break;
    433           }
    434           else
    435           {
    436             m = m-servers[j][2];
    437           }
    438         }
    439         write(l(wait), quote(system("pid")));
    440         pid = read(l(wait));
    441         write(mempatrol, list(server, pid, wait, maxmems[k]));
    442       }
    443       write(l(wait), quote(execute("def result = "+eval(commands[k])
    444         +"("+argsToString("currentargs", size(currentargs))+");")));
    445       assignment[wait] = k;
    446       k++;
    447     }
    448     else
    449     {
    450       break;
    451     }
    452   }
    453 
    454   // collect the rest of the results
    455   while(nfinished < N && nfinished+nkilled < njobs)
    456   {
    457     if(timeout == 0)
    458     {
    459       wait = waitfirst(links);
    460     }
    461     else
    462     {
    463       tt = timeout-(rtimer-t);
    464       if(tt < 0)
    465       {
    466         wait = waitfirst(links, 0);
    467         wait = 0;
    468       }
    469       else
    470       {
    471         wait = waitfirst(links, tt);
    472       }
    473     }
    474     if(wait == -1)
    475     {
    476       ERROR("All links crashed.");
    477     }
    478     if(wait)
    479     {
    480       if(wait == nlinks+1)
    481       {
    482         wait = read(mempatrol);
    483         close(l(wait));
    484         results[assignment[wait]] = "out of memory";
    485         nkilled++;
    486       }
    487       else
    488       {
    489         read(l(wait));
    490         write(l(wait), quote(result));
    491         results[assignment[wait]] = read(l(wait));
    492         if(maxmems[assignment[wait]] > 0)
    493         {
    494           write(mempatrol, assignment[wait]);
    495         }
    496         nfinished++;
    497       }
    498     }
    499     else
    500     {
    501       break;
    502     }
    503   }
    504 
    505   //close all links
    506   for(i = 1; i <= nlinks; i++)
    507   {
    508     if(status(l(i), "read", "ready"))
    509     {
    510       read(l(i));
    511       write(l(i), quote(result));
    512       results[assignment[i]] = read(l(i));
    513     }
    514     close(l(i));
    515   }
    516   if(havemaxmem)
    517   {
    518     close(mempatrol);
    519   }
    520 
    521   system("--ticks-per-sec", oldtimerresolution);
    522   return(results);
    523 }
    524 example
    525 {
    526   "EXAMPLE:"; echo = 2;
    527   LIB "primdec.lib";
    528   ring r = 0, (x,y,z), lp;
    529   ideal i = z8+z6+4z5+4z3+4z2+4, y-z2;
    530   ideal j = 3x3y+x3+xy3+y2z2, 2x3z-xy-xz3-y4-z2, 2x2yz-2xy2+xz2-y4;
    531   list commands = list("std", "primdecGTZ", "primdecSY",
    532                        "std", "primdecGTZ", "primdecSY");
    533   list args = list(list(i), list(i), list(i), list(j), list(j), list(j));
    534   parallelWaitN(commands, args, 3);
    535 }
    536 
    537 proc parallelWaitFirst(list commands, list args, list #)
    538 "USAGE:  parallelWaitFirst(commands, args[, timeout, linktype, servers,
    539          maxmemory]); commands list, args list, timeout int, linktype string,
    540          servers list, maxmemory intvec
    541 RETURN:  a list, containing at least one (if no timeout occurs) of the results
    542          of commands[i] applied to arg[i], i = 1, ..., size(commands).
    543          @* The command
    544          @code{parallelWaitFirst(list commands, list args, list #)} is
    545          synonymous to
    546          @code{parallelWaitN(list commands, list args, 1, list #)}. See
    547          @ref{parallelWaitN} for details on optional arguments and other
    548          remarks.
    549 SEE ALSO: Ssi links, waitfirst
    550 KEYWORDS: parallelWaitFirst; Parallelization; Links, user interface;
    551           Skeletons for parallelization; Distributed computing
    552 EXAMPLE:  @code{example parallelWaitFirst;} shows an example."
    553 {
    554   return(parallelWaitN(commands, args, 1, #));
    555 }
    556 example
    557 {
    558   "EXAMPLE:"; echo = 2;
    559   LIB "primdec.lib";
    560   ring r = 0, (x,y,z), lp;
    561   ideal i = z8+z6+4z5+4z3+4z2+4, y-z2;
    562   list commands = list("primdecGTZ", "primdecSY");
    563   list args = list(list(i), list(i));
    564   parallelWaitFirst(commands, args);
    565 }
    566 
    567 proc parallelWaitAll(def commands, list args, list #)
    568 "USAGE:  parallelWaitAll(commands, args[, timeout, linktype, servers,
    569          maxmemory]); commands list or string, args list, timeout int,
    570          linktype string, servers list, maxmemory intvec
    571 RETURN:  a list, containing the results of commands[i] applied to arg[i],
    572          i = 1, ..., size(commands).
    573          @* The command
    574          @code{parallelWaitAll(list commands, list args, list #)} is
    575          synonymous to
    576          @code{parallelWaitN(list commands, list args, size(args), list #)}. See
    577          @ref{parallelWaitN} for details on optional arguments and other
    578          remarks.
    579          If commands is of type string, this is a shortcut for a list of size
    580          @code{size(args)} whose entries are just this string.
    581 SEE ALSO: Ssi links, waitall
    582 KEYWORDS: parallelWaitAll; Parallelization; Links, user interface;
    583           Skeletons for parallelization; Distributed computing
    584 EXAMPLE:  @code{example parallelWaitAll;} shows an example."
    585 {
    586   if(typeof(commands) != "list" && typeof(commands) != "string")
    587   {
    588     ERROR("invalid type of first argument");
    589   }
    590   if(typeof(commands) == "list")
    591   {
    592     return(parallelWaitN(commands, args, size(args), #));
    593   }
    594   else
    595   {
    596     list cmds;
    597     for(int i = size(args); i > 0; i--)
    598     {
    599       cmds[i] = commands;
    600     }
    601     return(parallelWaitN(cmds, args, size(args), #));
    602   }
    603 }
    604 example
    605 {
    606   "EXAMPLE:"; echo = 2;
    607   ring r = 0, (x,y,z), dp;
    608   ideal i1 = z8+z6+4z5+4z3+4z2+4, y-z2;
    609   ideal i2 = x10+x9y2, y8-x2y7;
    610   ideal i3 = x3-2xy, x2y-2y2+x;
    611   string command = "std";
    612   list args = list(list(i1), list(i2), list(i3));
    613   parallelWaitAll(command, args);
    614 }
    615 
    616 // TODO
    617 /// http://arxiv.org/abs/1005.5663v2
    618 static proc doModular(command, args, proc deleteUnlucksPrimes, proc testInChar0)
    619 {
    620 }
    621 
    622 // TODO
    623 /* worker farm */
    624 static proc Create() {}
    625 
    626 /* auxiliary procedures */
    627 static proc watchlinks()
    628 {
    629   list parent = list(mempatrol);
    630   list watchedlinks;
    631   int wait;
    632   int i, sys;
    633   while(1)
    634   {
    635     if(size(watchedlinks) == 0)
    636     {
    637       wait = waitall(parent);
    638     }
    639     else
    640     {
    641       wait = waitall(parent, 10000);
    642     }
    643     if(wait == -1)
    644     {
    645       ERROR("The main process crashed.");
    646     }
    647     if(wait)
    648     {
    649       def query = read(mempatrol);
    650       if(typeof(query) == "list")
    651       {
    652         watchedlinks = insert(watchedlinks, query);
    653       }
    654       else // in this case, typeof(query) is assumed to be "int", the
    655            // index of the link
    656       {
    657         for(i = size(watchedlinks); i > 0; i--)
    658         {
    659           if(watchedlinks[i][3] == query)
    660           {
    661             watchedlinks = delete(watchedlinks, i);
    662             break;
    663           }
    664         }
    665       }
    666     }
    667     for(i = size(watchedlinks); i > 0; i--)
    668     {
    669       if(getusedmemory(watchedlinks[i][1], watchedlinks[i][2])
    670            > watchedlinks[i][4])
    671       {
    672         if(watchedlinks[i][1] == "localhost")
    673         {
    674           sys = system("sh", "kill "+string(watchedlinks[i][2]));
    675         }
    676         else
    677         {
    678           sys = system("sh", "ssh "+watchedlinks[i][1]+" kill "
    679                              +string(watchedlinks[i][2]));
    680         }
    681         write(mempatrol, watchedlinks[i][3]);
    682         watchedlinks = delete(watchedlinks, i);
    683       }
    684     }
    685   }
    686 }
    687 
    688 static proc getusedmemory(string server, int pid)
    689 {
    690   string s;
    691   if(server == "localhost")
    692   {
    693     s = read("|: grep VmSize /proc/"+string(pid)+"/status "+
    694              "| awk '{ print $2; }'");
    695   }
    696   else
    697   {
    698     s = read("|: ssh "+server+" grep VmSize /proc/"+string(pid)+"/status "+
    699              "| awk '{ print $2; }'");
    700   }
    701   bigint b;
    702   execute("b = "+s+";");
    703   int i = int(b/1000);
    704   return(i);
    705 }
    706 
    707 static proc argsToString(string name, int length)
    708 {
    709   string arglist;
    710   if(length > 0) {
    711     arglist = name+"[1]";
    712   }
    713   int i;
    714   for(i = 2; i <= length; i++) {
    715     arglist = arglist+", "+name+"["+string(i)+"]";
    716   }
    717   return(arglist);
    718 }
     32LIB "tasks.lib";
     33
     34proc parallelWaitN(alias list commands, alias list args, int N, list #)
     35"USAGE:   parallelWaitN(commands, arguments, N[, timeout]); commands list,
     36          arguments list, N int, timeout int
     37RETURN:   a list, containing the results of commands[i] applied to
     38          arguments[i], i = 1, ..., size(arguments).
     39       @* The procedure waits for N jobs to finish.
     40       @* An optional timeout in ms can be provided. Default is 0 which
     41          disables the timeout.
     42NOTE:     The entries of the list commands must be strings. The entries of the
     43          list arguments must be lists.
     44       @* The type of any entry of the returned list whose corresponding task
     45          did not finish (due to timeout or error) is \"none\".
     46       @* The returned list may contain more than N results if several jobs
     47          finished \"at the same time\". It may contain less than N results in
     48          the case of timeout or errors occurring.
     49SEE ALSO: parallelWaitAll, parallelWaitFirst, tasks_lib
     50EXAMPLE:  example parallelWaitN; shows an example"
     51{
     52    // auxiliary variables
     53    int i;
     54
     55    // read optional parameters
     56    int timeout;
     57    int ncores;   // obsolete, but kept for compatibility with old libraries
     58    if (size(#) > 0) {
     59        if (typeof(#[1]) != "int") {
     60            ERROR("wrong optional parameters");
     61        }
     62        timeout = #[1];
     63        if (size(#) > 1) {
     64            if (size(#) > 2 || typeof(#[2]) != "int") {
     65                ERROR("wrong optional parameters");
     66            }
     67            ncores = #[2];
     68        }
     69    }
     70
     71    // apply wrapper for obsolete optional parameter ncores
     72    if (ncores) {
     73        list semaphore_save = Resources::setcores_subtree(ncores);
     74    }
     75
     76    // error checking
     77    int njobs = size(commands);
     78    if (njobs != size(args)) {
     79        ERROR("The number of commands does not match the number of lists"
     80            +newline+"of arguments.");
     81    }
     82    if (njobs == 0) {
     83        ERROR("no commands specified");
     84    }
     85    for (i = 1; i <= njobs; i++) {
     86        if (typeof(commands[i]) != "string") {
     87            ERROR("The first argument is not a list of strings.");
     88        }
     89        if (typeof(args[i]) != "list") {
     90            ERROR("The second argument is not a list of lists.");
     91        }
     92    }
     93
     94    // compute the tasks
     95    for (i = 1; i <= njobs; i++) {
     96        task t(i) = commands[i], args[i];
     97    }
     98    startTasks(t(1..njobs));
     99    list indices = waitTasks(list(t(1..njobs)), N, timeout);
     100
     101    // wrap back to saved semaphore
     102    if (ncores) {
     103        Resources::resetcores_subtree(semaphore_save);
     104    }
     105
     106    // return results
     107    list results;
     108    for (i = size(indices); i > 0; i--) {
     109        results[indices[i]] = getResult(t(indices[i]));
     110    }
     111    for (i = 1; i <= njobs; i++) {
     112        killTask(t(i));
     113    }
     114    return(results);
     115}
     116example
     117{
     118    "EXAMPLE:";
     119    echo = 2;
     120    ring R = 0, (x,y,z), lp;
     121    ideal I = 3x3y+x3+xy3+y2z2, 2x3z-xy-xz3-y4-z2, 2x2yz-2xy2+xz2-y4;
     122    ideal J = x10+x9y2, x2y7-y8;
     123    list commands = list("std", "std");
     124    list arguments = list(list(I), list(J));
     125    parallelWaitN(commands, arguments, 1);
     126}
     127
     128proc parallelWaitFirst(alias list commands, alias list args, list #)
     129"USAGE:   parallelWaitFirst(commands, args[, timeout]); commands list,
     130          arguments list, timeout int
     131RETURN:   a list, containing at least one (if no timeout occurs) of the results
     132          of commands[i] applied to arguments[i], i = 1, ..., size(arguments).
     133       @* The command @code{parallelWaitFirst(commands, arguments[, timeout])}
     134          is synonymous to
     135          @code{parallelWaitN(commands, arguments, 1[, timeout])}. See
     136          @ref{parallelWaitN} for details on optional arguments and other
     137          remarks.
     138SEE ALSO: parallelWaitN, parallelWaitAll, tasks_lib
     139EXAMPLE:  example parallelWaitFirst; shows an example"
     140{
     141    return(parallelWaitN(commands, args, 1, #));
     142}
     143example
     144{
     145    "EXAMPLE:";
     146    echo = 2;
     147    ring R = 0, (x,y,z), lp;
     148    ideal I = 3x3y+x3+xy3+y2z2, 2x3z-xy-xz3-y4-z2, 2x2yz-2xy2+xz2-y4;
     149    ideal J = x10+x9y2, x2y7-y8;
     150    list commands = list("std", "std");
     151    list arguments = list(list(I), list(J));
     152    parallelWaitFirst(commands, arguments);
     153}
     154
     155proc parallelWaitAll(def commands, alias list args, list #)
     156"USAGE:   parallelWaitAll(commands, arguments[, timeout]); commands list or
     157          string, arguments list, timeout int
     158RETURN:   a list, containing the results of commands[i] applied to
     159          arguments[i], i = 1, ..., size(arguments).
     160       @* The command @code{parallelWaitAll(commands, arguments[, timeout])} is
     161          synonymous to @code{parallelWaitN(commands, arguments,
     162          size(arguments)[, timeout])}. See @ref{parallelWaitN} for details on
     163          optional arguments and other remarks.
     164NOTE:     As a shortcut, @code{commands} can be a string. This is synonymous to
     165          providing a list of @code{size(arguments)} copies of this string.
     166SEE ALSO: parallelWaitFirst, parallelWaitN, tasks_lib
     167EXAMPLE:  example parallelWaitAll; shows an example"
     168{
     169    if (typeof(commands) != "list" && typeof(commands) != "string") {
     170        ERROR("invalid type of first argument");
     171    }
     172    if (typeof(commands) == "list") {
     173        return(parallelWaitN(commands, args, size(args), #));
     174    }
     175    else {
     176        list cmds;
     177        for (int i = size(args); i > 0; i--) {
     178            cmds[i] = commands;
     179        }
     180        return(parallelWaitN(cmds, args, size(args), #));
     181    }
     182}
     183example
     184{
     185    "EXAMPLE:";
     186    echo = 2;
     187    ring R = 0, (x,y,z), dp;
     188    ideal I1 = z8+z6+4z5+4z3+4z2+4, -z2+y;
     189    ideal I2 = x9y2+x10, x2y7-y8;
     190    ideal I3 = x3-2xy, x2y-2y2+x;
     191    string command = "std";
     192    list arguments = list(list(I1), list(I2), list(I3));
     193    parallelWaitAll(command, arguments);
     194}
     195
     196proc parallelTestAND(def commands, alias list args, list #)
     197"USAGE:   parallelTestAND(commands, arguments[, timeout]); commands list or
     198          string, arguments list, timeout int
     199RETURN:   1, if commands[i] applied to arguments[i] is not equal to zero for
     200          all i = 1, ..., size(arguments);
     201          0, otherwise.
     202       @* An optional timeout in ms can be provided. Default is 0 which
     203          disables the timeout. In case of timeout, -1 is returned.
     204NOTE:     The entries of the list commands must be strings. The entries of the
     205          list arguments must be lists.
     206       @* commands[i] applied to arguments[i] must evaluate to an integer for
     207          i = 1, ..., size(arguments).
     208       @* As a shortcut, @code{commands} can be a string. This is synonymous to
     209          providing a list of @code{size(arguments)} copies of this string.
     210SEE ALSO: parallelTestOR, tasks_lib
     211EXAMPLE:  example parallelTestAND; shows an example"
     212{
     213    // note: this can be improved
     214    list results = parallelWaitAll(commands, args, #);
     215    int i;
     216    for (i = size(args); i > 0; i--) {
     217        if (typeof(results[i]) != "int" && typeof(results[i]) != "none") {
     218            ERROR("result no. "+string(i)+" not of type int");
     219        }
     220    }
     221    for (i = size(args); i > 0; i--) {
     222        if (typeof(results[i]) == "none") {   // timeout
     223            return(-1);
     224        }
     225    }
     226    for (i = size(results); i > 0; i--) {
     227        if (!results[i]) {
     228            return(0);
     229        }
     230    }
     231    return(1);
     232}
     233example
     234{
     235    "EXAMPLE:";
     236    echo = 2;
     237    ring R = 0, (x,y,z), dp;
     238    ideal I = x, y, z;
     239    intvec v = 0:3;
     240    list l = list(I, v);
     241    module m1 = x*gen(1);
     242    module m2;
     243    string command = "size";
     244    list arguments1 = list(list(I), list(v), list(l), list(m1));
     245    list arguments2 = list(list(I), list(v), list(l), list(m2));
     246    // test if all the arguments have non-zero size
     247    parallelTestAND(command, arguments1);
     248    parallelTestAND(command, arguments2);
     249}
     250
     251proc parallelTestOR(def commands, alias list args, list #)
     252"USAGE:   parallelTestOR(commands, arguments[, timeout]); commands list or
     253          string, arguments list, timeout int
     254RETURN:   1, if commands[i] applied to arguments[i] is not equal to zero for
     255          any i = 1, ..., size(arguments);
     256          0, otherwise.
     257       @* An optional timeout in ms can be provided. Default is 0 which
     258          disables the timeout. In case of timeout, -1 is returned.
     259NOTE:     The entries of the list commands must be strings. The entries of the
     260          list arguments must be lists.
     261       @* commands[i] applied to arguments[i] must evaluate to an integer for
     262          i = 1, ..., size(arguments).
     263       @* As a shortcut, @code{commands} can be a string. This is synonymous to
     264          providing a list of @code{size(arguments)} copies of this string.
     265SEE ALSO: parallelTestAND, tasks_lib
     266EXAMPLE:  example parallelTestAND; shows an example"
     267{
     268    // note: this can be improved
     269    list results = parallelWaitAll(commands, args, #);
     270    int i;
     271    for (i = size(args); i > 0; i--) {
     272        if (typeof(results[i]) != "int" && typeof(results[i]) != "none") {
     273            ERROR("result no. "+string(i)+" not of type int");
     274        }
     275    }
     276    for (i = size(args); i > 0; i--) {
     277        if (typeof(results[i]) == "none") {   // timeout
     278            return(-1);
     279        }
     280    }
     281    for (i = size(results); i > 0; i--) {
     282        if (results[i]) {
     283            return(1);
     284        }
     285    }
     286    return(0);
     287}
     288example
     289{
     290    "EXAMPLE:";
     291    echo = 2;
     292    ring R = 0, (x,y,z), dp;
     293    ideal I;
     294    string s;
     295    list l;
     296    module m1 = x*gen(1);
     297    module m2;
     298    string command = "size";
     299    list arguments1 = list(list(I), list(s), list(l), list(m1));
     300    list arguments2 = list(list(I), list(s), list(l), list(m2));
     301    // test if any of the arguments has non-zero size
     302    parallelTestOR(command, arguments1);
     303    parallelTestOR(command, arguments2);
     304}
     305
  • Singular/LIB/polymake.lib

    r4c1341 rce70e6  
    1 ////
    2 version="version oldpolymake.lib 4.0.0.0 Jun_2013 "; // $Id$
     1version="version polymake.lib 4.0.0.0 Jun_2013 ";
    32category="Tropical Geometry";
    43info="
    5 LIBRARY:   oldpolymake.lib  Computations with polytopes and fans,
    6                             interface to polymake and TOPCOM
     4LIBRARY:   polymake.lib    Computations with polytopes and fans,
     5                           interface to polymake and TOPCOM
    76AUTHOR:    Thomas Markwig,  email: keilen@mathematik.uni-kl.de
    87
     
    109   Most procedures will not work unless polymake or topcom is installed and
    1110   if so, they will only work with the operating system LINUX!
    12    For more detailed information see the following note or consult the
     11   For more detailed information see IMPORTANT NOTE respectively consult the
    1312   help string of the procedures.
    1413
    15 NOTE:
     14   The conventions used in this library for polytopes and fans, e.g. the
     15   length and labeling of their vertices resp. rays, differs from the conventions
     16   used in polymake and thus from the conventions used in the polymake
     17   extension polymake.so of Singular. We recommend to use the newer polymake.so
     18   whenever possible.
     19
     20IMPORTANT NOTE:
    1621   Even though this is a Singular library for computing polytopes and fans
    1722   such as the Newton polytope or the Groebner fan of a polynomial, most of
     
    1924@* - polymake by Ewgenij Gawrilow, TU Berlin and Michael Joswig, TU Darmstadt
    2025@*   (see http://www.math.tu-berlin.de/polymake/),
    21 @* respectively (only in the procedure triangularions) by the program
    22 @* - topcom by Joerg Rambau, Universitaet Bayreuth (see http://www.uni-bayreuth.de/
    23      departments/wirtschaftsmathematik/rambau/TOPCOM);
    24 @*   This library should rather be seen as an interface which allows to use a
     26@* respectively (only in the procedure triangulations) by the program
     27@* - topcom by Joerg Rambau, Universitaet Bayreuth (see
     28@*   http://www.uni-bayreuth.de/departments/wirtschaftsmathematik/rambau/TOPCOM);
     29@*   this library should rather be seen as an interface which allows to use a
    2530     (very limited) number of options which polymake respectively topcom offers
    2631     to compute with polytopes and fans and to make the results available in
     
    3237     independent of both, polymake and topcom.
    3338
    34 PROCEDURES:
    35   polymakePolytope()   computes the vertices of a polytope using polymake
    36   newtonPolytopeP()     computes the Newton polytope of a polynomial
    37   newtonPolytopeLP()   computes the lattice points of the Newton polytope
    38   normalFan()          computes the normal fan of a polytope
    39   groebnerFan()        computes the Groebner fan of a polynomial
    40   intmatToPolymake()   transforms an integer matrix into polymake format
    41   polymakeToIntmat()   transforms polymake output into an integer matrix
    42 
    43   triangulations()     computes all triangulations of a marked polytope
    44   secondaryPolytope()  computes the secondary polytope of a marked polytope
    45 
    46   secondaryFan()       computes the secondary fan of a marked polytope
    47 
    48   cycleLength()      computes the cycleLength of cycle
    49   splitPolygon()     splits a marked polygon into vertices, facets, interior points
    50   eta()              computes the eta-vector of a triangulation
    51   findOrientedBoundary()    computes the boundary of a convex hull
    52   cyclePoints()      computes lattice points connected to some lattice point
    53   latticeArea()      computes the lattice area of a polygon
    54   picksFormula()     computes the ingrediants of Pick's formula for a polygon
    55   ellipticNF()       computes the normal form of an elliptic polygon
    56   ellipticNFDB()     displays the 16 normal forms of elliptic polygons
    57 
    58   polymakeKeepTmpFiles()  determines if the files created in /tmp should be kept
     39PROCEDURES USING POLYMAKE:
     40  polymakePolytope()  computes the vertices of a polytope using polymake
     41  newtonPolytopeP()    computes the Newton polytope of a polynomial
     42  newtonPolytopeLP()  computes the lattice points of the Newton polytope
     43  normalFanL()         computes the normal fan of a polytope
     44  groebnerFan()       computes the Groebner fan of a polynomial
     45
     46PROCEDURES USING TOPCOM:
     47  triangulations()    computes all triangulations of a marked polytope
     48  secondaryPolytope() computes the secondary polytope of a marked polytope
     49
     50PROCEDURES USING POLYMAKE AND TOPCOM:
     51  secondaryFan()      computes the secondary fan of a marked polytope
     52
     53PROCEDURES CONERNED WITH PLANAR POLYGONS:
     54  cycleLength()    computes the cycleLength of cycle
     55  splitPolygon()   splits a marked polygon into vertices, facets, interior points
     56  eta()            computes the eta-vector of a triangulation
     57  findOrientedBoundary()  computes the boundary of a convex hull
     58  cyclePoints()    computes lattice points connected to some lattice point
     59  latticeArea()    computes the lattice area of a polygon
     60  picksFormula()   computes the ingrediants of Pick's formula for a polygon
     61  ellipticNF()     computes the normal form of an elliptic polygon
     62  ellipticNFDB()   displays the 16 normal forms of elliptic polygons
    5963
    6064KEYWORDS:    polytope; fan; secondary fan; secondary polytope; polymake;
     
    8589////////////////////////////////////////////////////////////////////////////////
    8690
     91static proc mod_init ()
     92{
     93  LIB "gfanlib.so";
     94  LIB "polymake.so";
     95}
    8796
    8897/////////////////////////////////////////////////////////////////////////////
     
    9099/////////////////////////////////////////////////////////////////////////////
    91100
    92 proc polymakePolytope (intmat polytop,list #)
    93 "USAGE:  polymakePolytope(polytope[,#]);   polytope list, # string
    94 ASSUME:  each row of polytope gives the coordinates of a lattice point of a
     101proc polymakePolytope (intmat points)
     102"USAGE:  polymakePolytope(points);   polytope intmat
     103ASSUME:  each row of points gives the coordinates of a lattice point of a
    95104         polytope with their affine coordinates as given by the output of
    96105         secondaryPolytope
    97106PURPOSE: the procedure calls polymake to compute the vertices of the polytope
    98107         as well as its dimension and information on its facets
    99 RETURN:  list L with four entries
     108RETURN:  list, L with four entries
    100109@*            L[1] : an integer matrix whose rows are the coordinates of vertices
    101110                     of the polytope
    102111@*            L[2] : the dimension of the polytope
    103 @*            L[3] : a list whose i-th entry explains to which vertices the
     112@*            L[3] : a list whose ith entry explains to which vertices the
    104113                     ith vertex of the Newton polytope is connected
    105114                     -- i.e. L[3][i] is an integer vector and an entry k in
    106115                        there means that the vertex L[1][i] is connected to the
    107116                        vertex L[1][k]
    108 @*            L[4] : an integer matrix whose rows mulitplied by
     117@*            L[4] : an matrix of type bigintmat whose rows mulitplied by
    109118                     (1,var(1),...,var(nvar)) give a linear system of equations
    110119                     describing the affine hull of the polytope,
     
    118127         convention which starts indexing its vertices by zero while we start
    119128         with one !
    120 @*    -  the procedure creates the file  /tmp/polytope.polymake which contains
    121          the polytope in polymake format; if you wish to use this for further
    122          computations with polymake, you have to use the procedure
    123          polymakeKeepTmpFiles in before
    124 @*    -  moreover, the procedure creates the file /tmp/polytope.output which
    125          it deletes again before ending
    126 @*    -  it is possible to provide an optional second argument a string
    127          which then will be used instead of 'polytope' in the name of the
    128          polymake output file
    129129EXAMPLE: example polymakePolytope;   shows an example"
    130130{
    131   // the header for the file secendarypolytope.polymake
    132   string sp="_application polytope
    133 _version 2.2
    134 _type RationalPolytope
    135 
    136 POINTS
    137 ";
     131  // add a first column to polytope as homogenising coordinate
     132  points=intmatAddFirstColumn(points,"points");
     133  polytope polytop=polytopeViaPoints(points);
     134  list graph=vertexAdjacencyGraph(polytop)[2];
    138135  int i,j;
    139   // set the name for the polymake output file
    140   if (size(#)>0)
    141   {
    142     if (typeof(#[1])=="string")
    143     {
    144       string dateiname=#[1];
    145     }
    146     else
    147     {
    148       string dateiname="polytope";
    149     }
    150   }
    151   else
    152   {
    153     string dateiname="polytope";
    154   }
    155   // create the lattice point list for polymake
    156   sp=sp+intmatToPolymake(polytop,"points");
    157   // initialise dateiname.polymake and compute the vertices
    158   write(":w /tmp/"+dateiname+".polymake",sp);
    159   system("sh","cd /tmp; polymake "+dateiname+".polymake VERTICES > "+dateiname+".output");
    160   string vertices=read("/tmp/"+dateiname+".output");
    161   system("sh","/bin/rm /tmp/"+dateiname+".output");
    162   intmat np=polymakeToIntmat(vertices,"affine");
    163   // compute the dimension
    164   system("sh","cd /tmp; polymake "+dateiname+".polymake DIM > "+dateiname+".output");
    165   string pdim=read("/tmp/"+dateiname+".output");
    166   system("sh","/bin/rm /tmp/"+dateiname+".output");
    167   pdim=pdim[5,size(pdim)-6];
    168   execute("int nd="+pdim+";");
    169   // compute the vertex-edge graph
    170   system("sh","cd /tmp; polymake "+dateiname+".polymake GRAPH > "+dateiname+".output");
    171   string vertexedgegraph=read("/tmp/"+dateiname+".output");
    172   system("sh","/bin/rm /tmp/"+dateiname+".output");
    173   vertexedgegraph=vertexedgegraph[7,size(vertexedgegraph)-8];
    174   string newveg;
    175   for (i=1;i<=size(vertexedgegraph);i++)
    176   {
    177     if (vertexedgegraph[i]=="{")
    178     {
    179       newveg=newveg+"intvec(";
    180     }
    181     else
    182     {
    183       if (vertexedgegraph[i]=="}")
    184       {
    185         newveg=newveg+"),";
    186       }
    187       else
    188       {
    189         if (vertexedgegraph[i]==" ")
    190         {
    191           newveg=newveg+",";
    192         }
    193         else
    194         {
    195           newveg=newveg+vertexedgegraph[i];
    196         }
    197       }
    198     }
    199   }
    200   newveg=newveg[1,size(newveg)-1];
    201   execute("list nveg="+newveg+";");
    202   // raise each entry in nveg by one
    203   for (i=1;i<=size(nveg);i++)
    204   {
    205     for (j=1;j<=size(nveg[i]);j++)
    206     {
    207       nveg[i][j]=nveg[i][j]+1;
    208     }
    209   }
    210   // compute the affine hull
    211   system("sh","cd /tmp; polymake "+dateiname+".polymake AFFINE_HULL > "+dateiname+".output");
    212   string equations=read("/tmp/"+dateiname+".output");
    213   system("sh","/bin/rm /tmp/"+dateiname+".output");
    214   if (size(equations)>14)
    215   {
    216     intmat neq=polymakeToIntmat(equations,"cleardenom");
    217   }
    218   else
    219   {
    220     intmat neq[1][ncols(polytop)+1];
    221   }
    222   // delete the tmp-files, if polymakekeeptmpfiles is not set
    223   if (defined(polymakekeeptmpfiles)==0)
    224   {
    225     system("sh","/bin/rm /tmp/"+dateiname+".polymake");
    226   }
    227   // return the files
    228   return(list(np,nd,nveg,neq));
     136  for (i=1;i<=size(graph);i++)
     137  {
     138    for (j=1;j<=size(graph[i]);j++)
     139    {
     140      graph[i][j]=graph[i][j]+1;
     141    }
     142  }
     143  return(list(intmatcoldelete(vertices(polytop),1),dimension(polytop),graph,equations(polytop)));
    229144}
    230145example
     
    247162   ring r=0,x(1..4),dp;
    248163   matrix M[5][1]=1,x(1),x(2),x(3),x(4);
    249    np[4]*M;
     164   intmat(np[4])*M;
    250165}
    251166
    252167/////////////////////////////////////////////////////////////////////////////
    253168
    254 proc newtonPolytopeP (poly f,list #)
    255 "USAGE: newtonPolytopeP(f[,#]);  f poly, # string
    256 RETURN: list L with four entries
     169proc newtonPolytopeP (poly f)
     170"USAGE: newtonPolytopeP(f);  f poly
     171RETURN: list, L with four entries
    257172@*            L[1] : an integer matrix whose rows are the coordinates of vertices
    258173                     of the Newton polytope of f
     
    263178                        there means that the vertex L[1][i] is
    264179                        connected to the vertex L[1][k]
    265 @*            L[4] : an integer matrix whose rows mulitplied by
     180@*            L[4] : an matrix of type bigintmat whose rows mulitplied by
    266181                     (1,var(1),...,var(nvar)) give a linear system of equations
    267182                     describing the affine hull of the Newton polytope, i.e. the
     
    269184NOTE: -  if we replace the first column of L[4] by zeros, i.e. if we move
    270185         the affine hull to the origin, then we get the equations for the
    271          orthogonal comploment of the linearity space of the normal fan dual
     186         orthogonal complement of the linearity space of the normal fan dual
    272187         to the Newton polytope, i.e. we get the EQUATIONS that
    273188         we need as input for polymake when computing the normal fan
     
    275190         TU Berlin and Michael Joswig, so it only works if polymake is installed;
    276191         see http://www.math.tu-berlin.de/polymake/
    277 @*    -  the procedure creates the file  /tmp/newtonPolytope.polymake which
    278          contains the polytope in polymake format and which can be used for
    279          further computations with polymake
    280 @*    -  moreover, the procedure creates the file /tmp/newtonPolytope.output
    281          and deletes it again before ending
    282 @*    -  it is possible to give as an optional second argument a string
    283          which then will be used instead of 'newtonPolytope' in the name of
    284          the polymake output file
    285192EXAMPLE: example newtonPolytopeP;   shows an example"
    286193{
     
    296203    f=f-lead(f);
    297204  }
    298   if (size(#)==0)
    299   {
    300     #[1]="newtonPolytope";
    301   }
    302205  // call polymakePolytope with exponents
    303   return(polymakePolytope(exponents,#));
     206  return(polymakePolytope(exponents));
    304207}
    305208example
     
    330233   // the Newton polytope is contained in the affine space given
    331234   //     by the equations
    332    np[4]*M;
     235   intmat(np[4])*M;
    333236}
    334237
     
    339242RETURN: list, the exponent vectors of the monomials occuring in f,
    340243              i.e. the lattice points of the Newton polytope of f
    341 EXAMPLE: example normalFan;   shows an example"
     244EXAMPLE: example newtonPolytopeLP;   shows an example"
    342245{
    343246  list np;
     
    363266/////////////////////////////////////////////////////////////////////////////
    364267
    365 proc normalFan (intmat vertices,intmat affinehull,list graph,int er,list #)
    366 "USAGE:  normalFan (vert,aff,graph,rays,[,#]);   vert,aff intmat,  graph list, rays int, # string
     268proc normalFanL (def vertices, def affinehull,list graph,int er,list #)
     269"USAGE:  normalFanL (vert,aff,graph,rays,[,#]);   vert,aff intmat,  graph list, rays int, # string
    367270ASSUME:  - vert is an integer matrix whose rows are the coordinate of
    368271           the vertices of a convex lattice polytope;
     
    396299@*       - in the optional argument # it is possible to hand over other names
    397300           for the variables to be used -- be careful, the format must be correct
    398            which is not tested, e.g. if you want the variable names to be
    399            u00,u10,u01,u11 then you must hand over the string 'u11,u10,u01,u11'
    400 EXAMPLE: example normalFan;   shows an example"
    401 {
     301           and that is not tested, e.g. if you want the variable names to be
     302           u00,u10,u01,u11 then you must hand over the string u11,u10,u01,u11
     303EXAMPLE: example normalFanL;   shows an example"
     304{
     305  if (typeof(affinehull) != "intmat" && typeof (affinehull) != "bigintmat")
     306  {
     307    ERROR("normalFanL: input affinehull has to be either intmat or bigintmat");
     308    list L;
     309    return (L);
     310  }
    402311  list ineq; // stores the inequalities of the cones
    403312  int i,j,k;
     
    431340    list pp;  // contain strings representing the inequalities
    432341              // describing the normal cone
    433     intmat ie[size(graph[i])][ncols(vertices)]; // contains the inequalities
    434                                                 // as rows
     342    if (typeof (vertices) == "intmat")
     343    {
     344      intmat ie[size(graph[i])][ncols(vertices)]; // contains the inequalities
     345    }                                             // as rows
     346    if (typeof (vertices) == "bigintmat")
     347    {
     348      bigintmat ie[size(graph[i])][ncols(vertices)]; // contains the inequalities
     349    }                                                // as rows
    435350    // consider all the vertices to which the ith vertex in the
    436351    // polytope is connected by an edge
     
    469384  }
    470385  // remove the first column of affine hull to compute the linearity space
    471   intmat linearity=intmatcoldelete(affinehull,1);
     386  bigintmat linearity[1][ncols(vertices)];
     387  if (nrows(affinehull)>0)
     388  {
     389    linearity=intmatcoldelete(affinehull,1);
     390  }
    472391  //////////////////////////////////////////////////////////////////
    473392  // Compute next the extreme rays of the cones
     
    476395  {
    477396    list extremerays; // keeps the result
    478     string polymake; // keeps polymake output
    479     // the header for ineq.polymake
    480     string head="_application polytope
    481 _version 2.2
    482 _type RationalPolytope
    483 
    484 INEQUALITIES
    485 ";
    486     // the tail for both polymake files
    487     string tail="
    488 EQUATIONS
    489 ";
    490     tail=tail+intmatToPolymake(linearity,"rays");
    491     string ungleichungen; // keeps the inequalities for the polymake code
     397    cone kegel;
     398    bigintmat linearspan=intmatAddFirstColumn(linearity,"rays");
    492399    intmat M; // the matrix keeping the inequalities
    493     // create the file ineq.output
    494     write(":w /tmp/ineq.output","");
    495     int dimension; // keeps the dimension of the intersection the
    496                    // bad cones with the u11tobeseencone
    497400    for (i=1;i<=size(ineq);i++)
    498401    {
    499       i,". Cone of ",nrows(vertices); // indicate how many
    500                                       // vertices have been dealt with
    501       ungleichungen=intmatToPolymake(ineq[i][1],"rays");
    502       // write the inequalities to ineq.polymake and call polymake
    503       write(":w /tmp/ineq.polymake",head+ungleichungen+tail);
    504       ungleichungen=""; // clear ungleichungen
    505       system("sh","cd /tmp; /bin/rm ineq.output; polymake ineq.polymake VERTICES > ineq.output");
    506       // read the result of polymake
    507       polymake=read("/tmp/ineq.output");
    508       intmat VERT=polymakeToIntmat(polymake,"affine");
    509       extremerays[i]=VERT;
    510       kill VERT;
     402      kegel=coneViaInequalities(intmatAddFirstColumn(ineq[i][1],"rays"),linearspan);
     403      extremerays[i]=intmatcoldelete(rays(kegel),1);
    511404    }
    512405    for (i=1;i<=size(ineq);i++)
     
    514407      ineq[i]=ineq[i]+list(extremerays[i]);
    515408    }
    516   }
    517   // delete the tmp-files, if polymakekeeptmpfiles is not set
    518   if (defined(polymakekeeptmpfiles)==0)
    519   {
    520     system("sh","/bin/rm /tmp/ineq.polymake");
    521     system("sh","/bin/rm /tmp/ineq.output");
    522409  }
    523410  // get the linearity space
     
    534421   list np=newtonPolytopeP(f);
    535422   // the Groebner fan of f, i.e. the normal fan of the Newton polytope
    536    list gf=normalFan(np[1],np[4],np[3],1,"x,y,z");
     423   list gf=normalFanL(np[1],np[4],np[3],1,"x,y,z");
    537424   // the number of cones in the Groebner fan of f is:
    538425   size(gf[1]);
     
    549436/////////////////////////////////////////////////////////////////////////////
    550437
    551 proc groebnerFan (poly f,list #)
    552 "USAGE:  groebnerFan(f[,#]);  f poly, # string
     438proc groebnerFan (poly f)
     439"USAGE:  groebnerFan(f);  f poly
    553440RETURN:  list, the ith entry of L[1] contains information about the ith cone
    554441               in the Groebner fan dual to the ith vertex in the Newton
     
    564451                      in each cone
    565452@*             L[3] = the Newton polytope of f in the format of the procedure
    566                       newtonPolytope
    567 @*             L[4] = integer matrix where each row represents the exponet
     453                      newtonPolytopeP
     454@*             L[4] = integer matrix where each row represents the exponent
    568455                      vector of one monomial occuring in the input polynomial
    569456NOTE: - if you have already computed the Newton polytope of f then you might want
    570         to use the procedure normalFan instead in order to avoid doing costly
     457        to use the procedure normalFanL instead in order to avoid doing costly
    571458        computation twice
    572459@*    - the procedure calls for its computation polymake by Ewgenij Gawrilow,
    573460        TU Berlin and Michael Joswig, so it only works if polymake is installed;
    574461        see http://www.math.tu-berlin.de/polymake/
    575 @*    - the procedure creates the file  /tmp/newtonPolytope.polymake which
    576         contains the Newton polytope of f in polymake format and which can
    577         be used for further computations with polymake
    578 @*    - it is possible to give as an optional second argument as string which
    579         then will be used instead of 'newtonPolytope' in the name of the
    580         polymake output file
    581462EXAMPLE: example groebnerFan;   shows an example"
    582463{
     
    591472    f=f-lead(f);
    592473  }
    593   if (size(#)==0)
    594   {
    595     #[1]="newtonPolytope";
    596   }
    597474  // call polymakePolytope with exponents
    598   list newtonp=polymakePolytope(exponents,"newtonPolytope");
     475  list newtonp=polymakePolytope(exponents);
    599476  // get the variables as string
    600477  string variablen;
     
    604481  }
    605482  variablen=variablen[1,size(variablen)-1];
    606   // call normalFan in order to compute the Groebner fan
    607   list gf=normalFan(newtonp[1],newtonp[4],newtonp[3],1,variablen);
     483  // call normalFanL in order to compute the Groebner fan
     484  list gf=normalFanL(newtonp[1],newtonp[4],newtonp[3],1,variablen);
    608485  // append newtonp to gf
    609486  gf[3]=newtonp;
     
    642519
    643520
    644 /////////////////////////////////////////////////////////////////////////////
    645 
    646 proc intmatToPolymake (intmat M,string art)
    647 "USAGE:  intmatToPolymake(M,art);  M intmat, art string
    648 ASSUME:  - M is an integer matrix which should be transformed into polymake
    649            format;
    650 @*       - art is one of the following strings:
    651 @*           + 'rays'   : indicating that a first column of 0's should be added
    652 @*           + 'points' : indicating that a first column of 1's should be added
    653 RETURN:  string, the matrix is transformed in a string and a first column has
    654                  been added
    655 EXAMPLE: example intmatToPolymake;   shows an example"
    656 {
    657   if (art=="rays")
    658   {
    659     string anf="0 ";
    660   }
    661   else
    662   {
    663     string anf="1 ";
    664   }
    665   string sp;
    666   int i,j;
    667   // create the lattice point list for polymake
    668   for (i=1;i<=nrows(M);i++)
    669   {
    670     sp=sp+anf;
    671     for (j=1;j<=ncols(M);j++)
    672     {
    673       sp=sp+string(M[i,j])+" ";
    674       if (j==ncols(M))
    675       {
    676         sp=sp+"
    677 ";
    678       }
    679     }
    680   }
    681   return(sp);
    682 }
    683 example
    684 {
    685    "EXAMPLE:";
    686    echo=2;
    687    intmat M[3][4]=1,2,3,4,5,6,7,8,9,10,11,12;
    688    intmatToPolymake(M,"rays");
    689    intmatToPolymake(M,"points");
    690 }
    691 
    692 /////////////////////////////////////////////////////////////////////////////
    693 
    694 proc polymakeToIntmat (string pm,string art)
    695 "USAGE:  polymakeToIntmat(pm,art);  pm, art string
    696 ASSUME:  pm is the result of calling polymake with one 'argument' like
    697          VERTICES, AFFINE_HULL, etc., so that the first row of the string is
    698          the name of the corresponding 'argument' and the further rows contain
    699          the result which consists of vectors either over the integers
    700          or over the rationals
    701 RETURN:  intmat, the rows of the matrix are basically the vectors in pm, starting
    702                  from the second row, where each row has been multiplied with the
    703                  lowest common multiple of the denominators of its entries as if
    704                  it is an integer matrix; moreover, if art=='affine', then
    705                  the first column is omitted since we only want affine
    706                  coordinates
    707 EXAMPLE: example polymakeToIntmat;   shows an example"
    708 {
    709   // we need a line break
    710   string zeilenumbruch="
    711 ";
    712   // remove the 'argment' name, i.e. the first row of pm
    713   while (pm[1]!=zeilenumbruch)
    714   {
    715     pm=stringdelete(pm,1);
    716   }
    717   pm=stringdelete(pm,1);
    718   // find out how many entries each vector has, namely one more
    719   // than 'spaces' in a row
    720   int i=1;
    721   int s=1;
    722   int z=1;
    723   while (pm[i]!=zeilenumbruch)
    724   {
    725     if (pm[i]==" ")
    726     {
    727       s++;
    728     }
    729     i++;
    730   }
    731   // if we want to have affine coordinates
    732   if (art=="affine")
    733   {
    734     s--; // then there is one column less
    735     // and the entry of the first column (in the first row) has to be removed
    736     while (pm[1]!=" ")
    737     {
    738       pm=stringdelete(pm,1);
    739     }
    740     pm=stringdelete(pm,1);
    741   }
    742   // we add two line breaks at the end in order to have this as
    743   // a stopping criterion
    744   pm=pm+zeilenumbruch+zeilenumbruch;
    745   // we now have to work through each row
    746   for (i=1;i<=size(pm);i++)
    747   {
    748     // if there are two consecutive line breaks we are done
    749     if ((pm[i]==zeilenumbruch) and (pm[i+1]==zeilenumbruch))
    750     {
    751       i=size(pm)+1;
    752     }
    753     else
    754     {
    755       // a line break has to be replaced by a comma
    756       if (pm[i]==zeilenumbruch)
    757       {
    758         z++;
    759         pm[i]=",";
    760         // if we want to have affine coordinates,
    761         // then we have to delete the first entry in each row
    762         if (art=="affine")
    763         {
    764          while (pm[i+1]!=" ")
    765          {
    766            pm=stringdelete(pm,i+1);
    767          }
    768          pm=stringdelete(pm,i+1);
    769         }
    770       }
    771       // a space has to be replaced by a comma
    772       if (pm[i]==" ")
    773       {
    774         pm[i]=",";
    775       }
    776     }
    777   }
    778   // if we have introduced superflous commata at the end, they should be removed
    779   while (pm[size(pm)]==",")
    780   {
    781     pm=stringdelete(pm,size(pm));
    782   }
    783   // since the matrix could be over the rationals,
    784   // we need a ring with rational coefficients
    785   ring zwischering=0,x,lp;
    786   // create the matrix with the elements of pm as entries
    787   execute("matrix mm["+string(z)+"]["+string(s)+"]="+pm+";");
    788   // transform this into an integer matrix
    789   matrix M[1][ncols(mm)]; // takes a row of mm
    790   int cm;  // takes a lowest common multiple
    791   // multiply each row by an integer such that its entries are integers
    792   for (int j=1;j<=nrows(mm);j++)
    793   {
    794     M=mm[j,1..ncols(mm)];
    795     cm=commondenominator(M);
    796     for (i=1;i<=ncols(mm);i++)
    797     {
    798       mm[j,i]=cm*mm[j,i];
    799     }
    800   }
    801   // transform the matrix mm into an integer matrix
    802   execute("intmat im["+string(z)+"]["+string(s)+"]="+string(mm)+";");
    803   return(im);
    804 }
    805 example
    806 {
    807    "EXAMPLE:";
    808    echo=2;
    809    // this is the usual output of some polymake computation
    810    string pm="VERTICES
    811 0 1 3 5/3 1/3 -1 -23/3 -1/3 5/3 1/3 1
    812 0 1 3 -23/3 5/3 1 5/3 1/3 1/3 -1/3 -1
    813 0 1 1 1/3 -1/3 -1 5/3 1/3 -23/3 5/3 3
    814 0 1 1 5/3 -23/3 3 1/3 5/3 -1/3 1/3 -1
    815 0 1 -1 1/3 5/3 3 -1/3 -23/3 1/3 5/3 1
    816 0 1 -1 -1/3 1/3 1 1/3 5/3 5/3 -23/3 3
    817 0 1 -1 1 3 -5 -1 3 -1 1 -1
    818 0 1 -1 -1 -1 -1 1 1 3 3 -5
    819 0 1 -5 3 1 -1 3 -1 1 -1 -1
    820 
    821 ";
    822    intmat PM=polymakeToIntmat(pm,"affine");
    823    // note that the first column has been removed, since we asked for
    824    // affine coordinates, and the denominators have been cleared
    825    print(PM);
    826 }
    827 
    828521///////////////////////////////////////////////////////////////////////////////
    829522/// PROCEDURES USING TOPCOM
    830523///////////////////////////////////////////////////////////////////////////////
    831524
    832 proc triangulations (list polygon)
    833 "USAGE:  triangulations(polygon); list polygon
     525proc triangulations (list polygon,list #)
     526"USAGE:  triangulations(polygon[,#]); list polygon, list #
    834527ASSUME:  polygon is a list of integer vectors of the same size representing
    835528         the affine coordinates of the lattice points
     
    846539       this  procedure; see
    847540@*     http://www.uni-bayreuth.de/departments/wirtschaftsmathematik/rambau/TOPCOM
     541@*   - if you only want to have the regular triangulations the procedure should
     542       be called with the string 'regular' as optional argument
    848543@*   - the procedure creates the files /tmp/triangulationsinput and
    849544       /tmp/triangulationsoutput;
     
    851546       output containing the triangulations of corresponding to points in the
    852547       format of points2triangs; if you wish to use this for further
    853        computations with topcom, you have to use the procedure
    854        polymakeKeepTmpFiles in before
     548       computations with topcom, you have to call the procedure with the
     549       string 'keepfiles' as optional argument
    855550@*   - note that an integer i in an integer vector representing a triangle
    856551       refers to the ith lattice point, i.e. polygon[i]; this convention is
     
    860555{
    861556  int i,j;
     557  // check for optional arguments
     558  int regular,keepfiles;
     559  if (size(#)>0)
     560  {
     561    for (i=1;i<=size(#);i++)
     562    {
     563      if (typeof(#[i])=="string")
     564      {
     565        if (#[i]=="keepfiles")
     566        {
     567          keepfiles=1;
     568        }
     569        if (#[i]=="regular")
     570        {
     571          regular=1;
     572        }
     573      }
     574    }
     575  }
    862576  // prepare the input for points2triangs by writing the input polygon in the
    863577  // necessary format
     
    875589  write(":w /tmp/triangulationsinput",spi);
    876590  // call points2triangs
    877   system("sh","cd /tmp; points2triangs < triangulationsinput > triangulationsoutput");
     591  if (regular==1) // compute only regular triangulations
     592  {
     593    system("sh","cd /tmp; points2triangs --regular < triangulationsinput > triangulationsoutput");
     594  }
     595  else // compute all triangulations
     596  {
     597    system("sh","cd /tmp; points2triangs < triangulationsinput > triangulationsoutput");
     598  }
    878599  string p2t=read("/tmp/triangulationsoutput"); // takes result of points2triangs
    879   // delete the tmp-files, if polymakekeeptmpfiles is not set
    880   if (defined(polymakekeeptmpfiles)==0)
     600  // delete the tmp-files, if no second argument is given
     601  if (keepfiles==0)
    881602  {
    882603    system("sh","cd /tmp; rm -f triangulationsinput; rm -f triangulationsoutput");
     
    953674            else
    954675            {
    955               np2t=np2t+p2t[i];
     676              if (p2t[i]=="[")
     677              {
     678                // in Topcom version 17.4 (and maybe also in earlier versions) the list
     679                // of triangulations is indexed starting with index 0, in Singular
     680                // we have to start with index 1
     681                np2t=np2t+p2t[i]+"1+";
     682              }
     683              else
     684              {
     685                np2t=np2t+p2t[i];
     686              }
    956687            }
    957688          }
     
    962693  list T;
    963694  execute(np2t);
     695  // depending on the version of Topcom, the list T has or has not an entry T[1]
     696  // if it has none, the entry should be removed
     697  while (typeof(T[1])=="none")
     698  {
     699    T=delete(T,1);
     700  }
    964701  // raise each index by one
    965702  for (i=1;i<=size(T);i++)
     
    1000737RETURN:  list, say L, such that:
    1001738@*             L[1] = intmat, each row gives the affine coordinates of a lattice
    1002                       point in the secondary polytope given by the marked polytope
    1003                       corresponding to polygon
     739                      point in the secondary polytope given by the marked
     740                      polytope corresponding to polygon
    1004741@*             L[2] = the list of corresponding triangulations
    1005742NOTE: if the triangluations are not handed over as optional argument the
     
    1114851       see http://www.math.tu-berlin.de/polymake/
    1115852@*   - in the optional argument # it is possible to hand over other names for
    1116        the variables to be used -- be careful, the format must be correct
    1117        which is not tested, e.g. if you want the variable names to be
     853       the variables to be used -- be careful, the format must be correct and
     854       that is not tested, e.g. if you want the variable names to be
    1118855       u00,u10,u01,u11 then you must hand over the string 'u11,u10,u01,u11'
    1119856@*   - if the triangluations are not handed over as optional argument the
     
    1135872  list sp=secondaryPolytope(polygon,triang);
    1136873  list spp=polymakePolytope(sp[1]);
    1137   list sf=normalFan(spp[1],spp[4],spp[3],1);
     874  list sf=normalFanL(spp[1],spp[4],spp[3],1);
    1138875  return(list(sf[1],sf[2],spp,triang));
    1139876}
     
    13781115@*       triang is a list of integer vectors all of size three describing a
    13791116         triangulation of the polygon described by polygon; if an entry of
    1380          triang is the vector (i,j,k) then the triangle is built from the vertices
     1117         triang is the vector (i,j,k) then the triangle is built by the vertices
    13811118         with indices i, j and k
    13821119RETURN:  intvec, the integer vector eta describing that vertex of the Newton
     
    19481685  // points and
    19491686  // the number b of boundary points are connected by the formula: A=b+2g-2
    1950   return(list(area,bdpts,(area-bdpts+2)/2));
     1687  return(list(area,bdpts,(area-bdpts+2) div 2));
    19511688}
    19521689example
     
    19731710"USAGE:  ellipticNF(polygon);   polygon list
    19741711ASSUME:  polygon is a list of integer vectors in the plane such that their
    1975          convex hull C has precisely one interior lattice point, i.e. C is the
     1712         convex hull C has precisely one interior lattice point; i.e. C is the
    19761713         Newton polygon of an elliptic curve
    19771714PURPOSE: compute the normal form of the polygon with respect to the unimodular
     
    19911728  int i;            // index
    19921729  intvec edge;      // stores the vector of an edge
    1993   intvec boundary;  // stores lattice lengths of the edges of the Newton cylce
     1730  intvec boundary;  // stores lattice lengths of the edges of the Newton cycle
    19941731  // find the vertices of the Newton cycle and order it clockwise
    19951732  list pg=findOrientedBoundary(polygon)[2];
     
    23022039
    23032040/////////////////////////////////////////////////////////////////////////////////
    2304 /// AUXILARY PROCEDURES
    2305 /////////////////////////////////////////////////////////////////////////////////
    2306 
    2307 proc polymakeKeepTmpFiles (int i)
    2308 "USAGE:  polymakeKeepTmpFiles(int i);   i int
    2309 PURPOSE: some procedures create files in the directory /tmp which are used for
    2310          computations with polymake respectively topcom; these will be removed
    2311          when the corresponding procedure is left; however, it might be
    2312          desireable to keep them for further computations with either polymake or
    2313          topcom; this can be achieved by this procedure; call the procedure as:
    2314 @*       - polymakeKeepTmpFiles(1); - then the files will be kept
    2315 @*       - polymakeKeepTmpFiles(0); - then files will be removed in the future
    2316 RETURN:  none"
    2317 {
    2318   if ((i==1) and (defined(polymakekeeptmpfiles)==0))
    2319   {
    2320     int polymakekeeptmpfiles;
    2321     export(polymakekeeptmpfiles);
    2322   }
    2323   if (i!=1)
    2324   {
    2325     if (defined(polymakekeeptmpfiles))
    2326     {
    2327       kill polymakekeeptmpfiles;
    2328     }
    2329   }
    2330 }
    2331 
    2332 
    2333 /////////////////////////////////////////////////////////////////////////////////
    23342041/////////////////////////////////////////////////////////////////////////////////
    23352042/// AUXILARY PROCEDURES, WHICH ARE DECLARED STATIC
     
    23642071}
    23652072
    2366 static proc intmatcoldelete (intmat w,int i)
     2073static proc intmatcoldelete (def w,int i)
    23672074"USAGE:      intmatcoldelete(w,i); w intmat, i int
    23682075RETURN:      intmat, the integer matrix w with the ith comlumn deleted
    2369 NOTE:        the procedure is called by intmatsort and normalFan"
    2370 {
    2371   if ((i<1) or (i>ncols(w)) or (ncols(w)==1))
    2372   {
    2373     return(w);
    2374   }
    2375   if (i==1)
    2376   {
    2377     intmat M[nrows(w)][ncols(w)-1]=w[1..nrows(w),2..ncols(w)];
    2378     return(M);
    2379   }
    2380   if (i==ncols(w))
    2381   {
    2382     intmat M[nrows(w)][ncols(w)-1]=w[1..nrows(w),1..ncols(w)-1];
    2383     return(M);
    2384   }
    2385   else
    2386   {
    2387     intmat M[nrows(w)][i-1]=w[1..nrows(w),1..i-1];
    2388     intmat N[nrows(w)][ncols(w)-i]=w[1..nrows(w),i+1..ncols(w)];
    2389     return(intmatconcat(M,N));
     2076NOTE:        the procedure is called by intmatsort and normalFanL"
     2077{
     2078  if (typeof(w)=="intmat")
     2079  {
     2080    if ((i<1) or (i>ncols(w)) or (ncols(w)==1))
     2081    {
     2082      return(w);
     2083    }
     2084    if (i==1)
     2085    {
     2086      intmat M[nrows(w)][ncols(w)-1]=w[1..nrows(w),2..ncols(w)];
     2087      return(M);
     2088    }
     2089    if (i==ncols(w))
     2090    {
     2091      intmat M[nrows(w)][ncols(w)-1]=w[1..nrows(w),1..ncols(w)-1];
     2092      return(M);
     2093    }
     2094    else
     2095    {
     2096      intmat M[nrows(w)][i-1]=w[1..nrows(w),1..i-1];
     2097      intmat N[nrows(w)][ncols(w)-i]=w[1..nrows(w),i+1..ncols(w)];
     2098      return(intmatconcat(M,N));
     2099    }
     2100  }
     2101  if (typeof(w)=="bigintmat")
     2102  {
     2103    if ((i<1) or (i>ncols(w)) or (ncols(w)==1))
     2104    {
     2105      return(w);
     2106    }
     2107    if (i==1)
     2108    {
     2109      bigintmat M[nrows(w)][ncols(w)-1]=w[1..nrows(w),2..ncols(w)];
     2110      return(M);
     2111    }
     2112    if (i==ncols(w))
     2113    {
     2114      bigintmat M[nrows(w)][ncols(w)-1]=w[1..nrows(w),1..ncols(w)-1];
     2115      return(M);
     2116    }
     2117    else
     2118    {
     2119      bigintmat MN[nrows(w)][ncols(w)-1];
     2120      MN[1..nrows(w),1..i-1]=w[1..nrows(w),1..i-1];
     2121      MN[1..nrows(w),i..ncols(w)-1]=w[1..nrows(w),i+1..ncols(w)];
     2122      return(MN);
     2123    }
     2124  } else
     2125  {
     2126    ERROR("intmatcoldelete: input matrix has to be of type intmat or bigintmat");
     2127    intmat M; return(M);
    23902128  }
    23912129}
     
    26832421  return(list(coord,coords,latex));
    26842422}
     2423
     2424static proc intmatAddFirstColumn (def M,string art)
     2425"USAGE:  intmatAddFirstColumn(M,art);  M intmat, art string
     2426ASSUME:  - M is an integer matrix where a first column of 0's or 1's should be added
     2427@*       - art is one of the following strings:
     2428@*         + 'rays'   : indicating that a first column of 0's should be added
     2429@*         + 'points' : indicating that a first column of 1's should be added
     2430RETURN:  intmat, a first column has been added to the matrix"
     2431{
     2432  if (typeof (M) == "intmat")
     2433  {
     2434    intmat N[nrows(M)][ncols(M)+1];
     2435    int i,j;
     2436    for (i=1;i<=nrows(M);i++)
     2437    {
     2438      if (art=="rays")
     2439      {
     2440        N[i,1]=0;
     2441      }
     2442      else
     2443      {
     2444        N[i,1]=1;
     2445      }
     2446      for (j=1;j<=ncols(M);j++)
     2447      {
     2448        N[i,j+1]=M[i,j];
     2449      }
     2450    }
     2451    return(N);
     2452  }
     2453  if (typeof (M) == "bigintmat")
     2454  {
     2455    bigintmat N[nrows(M)][ncols(M)+1];
     2456    int i,j;
     2457    for (i=1;i<=nrows(M);i++)
     2458    {
     2459      if (art=="rays")
     2460      {
     2461        N[i,1]=0;
     2462      }
     2463      else
     2464      {
     2465        N[i,1]=1;
     2466      }
     2467      for (j=1;j<=ncols(M);j++)
     2468      {
     2469        N[i,j+1]=M[i,j];
     2470      }
     2471    }
     2472    return(N);
     2473  }
     2474  else
     2475  {
     2476    ERROR ("intmatAddFirstColumn: input matrix has to be either intmat or bigintmat");
     2477    intmat N;
     2478    return (N);
     2479  }
     2480}
     2481
     2482
     2483
  • Singular/LIB/primdec.lib

    r81f4bd5 rce70e6  
    709709    return(l);
    710710  }
     711  def op = option(get);
    711712  def P=basering;
    712713  int i,j,k,m,q,d,o;
    713   int n=nvars(basering);
     714  int n = nvars(basering);
    714715  ideal s,t,u,sact;
    715716  poly ni;
     
    769770        {
    770771          setring RL;
     772
    771773          option(redSB);
    772774          t=std(t);
     
    785787          rp=delete(rp,1);
    786788          keep1=keep1+rp;
     789
    787790          option(noredSB);
    788791        }
     
    803806  }
    804807  l=l+keep1;
     808  option(set,op);
    805809  return(l);
    806810}
     
    18981902   list @res,empty;
    18991903   ideal ser;
    1900    option(redSB);
     1904   def op = option( get );
     1905   option( redSB );
    19011906   list @pr=facstd(i);
    19021907   //if(size(@pr)==1)
     
    19231928//      }
    19241929//   }
    1925     option(noredSB);
     1930   // option( noredSB );
     1931   option( set, op );
    19261932   int j,k,odim,ndim,count;
    19271933   attrib(@pr[1],"isSB",1);
     
    20962102  }
    20972103
    2098   if(dim(i) == -1){setring P0;return(ideal(1));}
    2099   if((dim(i) == 0) && (npars(P) == 0))
     2104  if( dim(i) == -1 )
     2105  { 
     2106    option( set,op );
     2107    setring P0;
     2108    return( ideal(1) );
     2109  }
     2110  if( (dim(i) == 0 ) && ( npars(P) == 0) )
    21002111  {
    21012112    int di = vdim(i);
     
    25462557   int n=nvars(R);
    25472558
     2559   def op = option(get);
     2560
    25482561//---Anfang Provisorium
    25492562   if((size(i)==2) && (w==2))
    25502563   {
    2551       option(redSB);
    2552       ideal J=std(i);
    2553       option(noredSB);
    2554       if((size(J)==2)&&(deg(J[1])==1))
     2564      option( redSB );
     2565      ideal J = std(i);
     2566      option( noredSB );
     2567      if ((size(J)==2)&&(deg(J[1])==1))
    25552568      {
    25562569         ideal keep;
     
    25772590            resu[j]=L;
    25782591         }
     2592         option( set, op );
    25792593         return(resu);
    25802594      }
     
    26522666      re=convList(pr);
    26532667   }
    2654    return(re);
     2668   option( set, op );
     2669   return( re );
    26552670}
    26562671///////////////////////////////////////////////////////////////////////////////
     
    70097024      primary=resu;
    70107025    }
     7026    option(set,op);
    70117027    if (intersectOption == "intersect")
    70127028    {
  • Singular/LIB/primdecint.lib

    r4c1341 rce70e6  
    12031203//=== this is needed because quotient(I,f) does not work properly, should be
    12041204//=== replaced by quotient later
     1205   if ( f==0 ) { return( ideal(1) ); }   
    12051206   def R=basering;
    12061207   int i;
     
    12271228//=== this is needed because quotient(I,J) does not work properly, should be
    12281229//=== replaced by quotient later
     1230   if ( size(J)==0 ) { return( ideal(1) ); }
    12291231   int i;
    12301232   ideal K=quotientOneZ(I,J[1]);
  • Singular/LIB/symodstd.lib

    r4c1341 rce70e6  
    11////////////////////////////////////////////////////////////////////////////
     2version="version symodstd.lib 4.0.0.0 Dec_2013 "; // $Id$
    23category = "Commutative Algebra";
    34info="
     
    723724            arguments[i] = list("I", p, k);
    724725         }
    725          parallelResults = parallelWaitAll("divPrimeTest", arguments,
    726             list(list(list(ncores))));
     726         parallelResults = parallelWaitAll("divPrimeTest", arguments, 0,
     727            ncores);
    727728         for(i = size(arguments); i > 0; i--)
    728729         {
     
    14361437            arguments_farey[i] = list(ideal(H[i]), N);
    14371438         }
    1438          results_farey = parallelWaitAll("farey", arguments_farey,
    1439                                          list(list(list(n1))));
     1439         results_farey = parallelWaitAll("farey", arguments_farey, 0, n1);
    14401440         for(i = ncols(H); i > 0; i--)
    14411441         {
  • Singular/LIB/tropical.lib

    r4c1341 rce70e6  
    1 ///////////////////////////////////////////////////////////
    2 version="version tropical.lib 4.0.0.0 Jun_2013 "; // $Id$
     1//
     2version="version tropical.lib 4.0.0.0 Dec_2013 ";
    33category="Tropical Geometry";
    44info="
     
    204204LIB "elim.lib";
    205205LIB "linalg.lib";
    206 LIB "oldpolymake.lib";
     206LIB "polymake.lib";
    207207LIB "primdec.lib";
    208208LIB "absfact.lib";
     
    650650          // pass first to a ring where a and @a
    651651          // are variables in order to use maps
    652           string @mp= string(minpoly);
     652          poly mp=minpoly;
    653653          ring INTERRING=char(LIFTRING),(t,@a,a),dp;
    654           execute("poly mp=" + @mp + ";");
     654          poly mp=imap(LIFTRING,mp);
    655655          ideal LIFT=imap(LIFTRING,LIFT);
    656656          kill LIFTRING;
     
    10121012  {
    10131013    def GLOBALRING=basering;
    1014     string @mp= string(minpoly);
     1014    number mp=minpoly;
    10151015    execute("ring LOCALRING=("+charstr(basering)+"),("+varstr(basering)+"),ds;");
    1016     execute("minpoly= " + @mp + ";");
    10171016    poly f=imap(GLOBALRING,f);
     1017    minpoly=imap(GLOBALRING,mp);
    10181018  }
    10191019  // check if a substitution is necessary
     
    10491049    if (minpoly!=0)
    10501050    {
    1051       string @mp= string(minpoly);
     1051      poly mp=minpoly;
    10521052      def OLDRING=basering;
    10531053      execute("ring NEWRING=0,("+varstr(basering)+","+parstr(basering)+"),ds;");
    1054       execute("ideal I = " + @mp + ";");
    1055       I = I,imap(OLDRING,f);
     1054      ideal I=imap(OLDRING,mp),imap(OLDRING,f);
    10561055    }
    10571056    else
     
    10651064      w=NewtP[jj]-NewtP[jj+1];
    10661065      ggteiler=gcd(w[1],w[2]);
    1067       zw=w[1]/ggteiler;
    1068       w[1]=w[2]/ggteiler;
     1066      zw=w[1] div ggteiler;
     1067      w[1]=w[2] div ggteiler;
    10691068      w[2]=zw;
    10701069      // if we have introduced a third variable for the parameter, then w needs a third component
     
    11341133    else
    11351134    {
    1136       string @mp= string(minpoly);
     1135      poly mp=minpoly;
    11371136      ring degreering=0,a,dp;
    1138       execute("poly mp=" + @mp + ";");
     1137      poly mp=imap(countring,mp);
    11391138      numberofbranchesfound=numberofbranchesfound+deg(mp);
    11401139      setring countring;
     
    11581157   ring r=0,(x,y),ds;
    11591158   poly f=x2-y4+x5y7;
    1160    puiseuxExpansion(puiseuxExpansion(f,3));
     1159   puiseuxExpansion(f,3,"subst");
     1160   displayPuiseuxExpansion(puiseuxExpansion(f,3));
    11611161}
    11621162
     
    15401540      ggt=gcd(normalvector[1],normalvector[2]);   // the gcd of the entries
    15411541      zw=normalvector[2];    // create the outward pointing normal vector
    1542       normalvector[2]=-normalvector[1]/ggt;
    1543       normalvector[1]=zw/ggt;
     1542      normalvector[2]=-normalvector[1] div ggt;
     1543      normalvector[1]=zw div ggt;
    15441544      if (size(#)==0) // we are computing w.r.t. minimum
    15451545      {
     
    27182718        if(k<>j)  // except the unit vector of the non-zero component
    27192719        {
    2720           intvec u; u[size(w)]=0; u[k]=1;
    2721           O[r,1..size(w)]=u; r=r+1;
     2720          intvec u;
     2721          u[size(w)]=0;
     2722          u[k]=1;
     2723          O[r,1..size(w)]=u;
     2724          r=r+1;
     2725          kill u;
    27222726        }
    27232727      }
     
    47084712        wneu=NewtP[1]-NewtP[2];
    47094713        int ggteiler=gcd(wneu[1],wneu[2]);
    4710         wneu[1]=-wneu[1]/ggteiler;
    4711         wneu[2]=wneu[2]/ggteiler;
     4714        wneu[1]=-wneu[1] div ggteiler;
     4715        wneu[2]=wneu[2] div ggteiler;
    47124716        if (wneu[1]>0)
    47134717        {
     
    48074811  for (jj=1;jj<=anzahlvariablen+numberdeletedvariables-1;jj++)
    48084812  {
    4809     PARA[jj]=(PARA[jj]+a[jj+1])*t^(tw[jj+1]*tweight/ww[1]);
     4813    PARA[jj]=(PARA[jj]+a[jj+1])*t^(tw[jj+1]*tweight div ww[1]);
    48104814  }
    48114815  // if we have reached the stop-level, i.e. either
     
    53535357    if (koeffizienten[j-ord(p)+1]!=0)
    53545358    {
    5355       if ((j-(N*wj)/w1)==0)
     5359      if ((j-(N*wj) div w1)==0)
    53565360      {
    53575361        dp=dp+displaycoef(koeffizienten[j-ord(p)+1]);
    53585362      }
    5359       if (((j-(N*wj)/w1)==1) and (N!=1))
     5363      if (((j-(N*wj) div w1)==1) and (N!=1))
    53605364      {
    53615365        dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*t^(1/"+string(N)+")";
    53625366      }
    5363       if (((j-(N*wj)/w1)==1) and (N==1))
     5367      if (((j-(N*wj) div w1)==1) and (N==1))
    53645368      {
    53655369        dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*t";
    53665370      }
    5367       if (((j-(N*wj)/w1)==-1) and (N==1))
     5371      if (((j-(N*wj) div w1)==-1) and (N==1))
    53685372      {
    53695373        dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*1/t";
    53705374      }
    5371       if (((j-(N*wj)/w1)==-1) and (N!=1))
     5375      if (((j-(N*wj) div w1)==-1) and (N!=1))
    53725376      {
    53735377        dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*1/t^(1/"+string(N)+")";
    53745378      }
    5375       if (((j-(N*wj)/w1)>1) and (N==1))
    5376       {
    5377         dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*t^"+string(j-(N*wj)/w1);
    5378       }
    5379       if (((j-(N*wj)/w1)>1) and (N!=1))
    5380       {
    5381         dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*t^("+string(j-(N*wj)/w1)+"/"+string(N)+")";
    5382       }
    5383       if (((j-(N*wj)/w1)<-1) and (N==1))
     5379      if (((j-(N*wj) div w1)>1) and (N==1))
     5380      {
     5381        dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*t^"+string(j-(N*wj) div w1);
     5382      }
     5383      if (((j-(N*wj) div w1)>1) and (N!=1))
     5384      {
     5385        dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*t^("+string(j-(N*wj) div w1)+"/"+string(N)+")";
     5386      }
     5387      if (((j-(N*wj) div w1)<-1) and (N==1))
    53845388      {
    53855389        dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*1/t^"+string(wj-j);
    53865390      }
    5387       if (((j-(N*wj)/w1)<-1) and (N!=1))
    5388       {
    5389         dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*1/t^("+string((N*wj)/w1-j)+"/"+string(N)+")";
     5391      if (((j-(N*wj) div w1)<-1) and (N!=1))
     5392      {
     5393        dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*1/t^("+string((N*wj) div w1-j)+"/"+string(N)+")";
    53905394      }
    53915395      if (j<deg(p))
     
    54955499    {
    54965500      setring LIFTRing;
    5497       string @mp= string(minpoly);
     5501      poly mp=minpoly;
    54985502      execute("ring TESTRing=("+charstr(LIFTRing)+"),("+varstr(BASERING)+"),dp;");
    5499       execute("minpoly= " + @mp + ";");
     5503      minpoly=number(imap(LIFTRing,mp));
    55005504      ideal i=imap(BASERING,i);
    55015505    }
     
    57695773              wneu=NewtP[jjj]-NewtP[jjj+1];
    57705774              int ggteiler=gcd(wneu[1],wneu[2]);
    5771               wneu[1]=-wneu[1]/ggteiler;
    5772               wneu[2]=wneu[2]/ggteiler;
     5775              wneu[1]=-wneu[1] div ggteiler;
     5776              wneu[2]=wneu[2] div ggteiler;
    57735777              if (wneu[1]>0)
    57745778              {
     
    58695873        {
    58705874          execute("ring PARARing=("+string(char(basering))+",@a),t,ls;");
    5871           minpoly=number(imap(PREGFANRING,m)); // ?
     5875          minpoly=number(imap(PREGFANRING,m));
    58725876        }
    58735877        else
     
    59085912        for (jjj=1;jjj<=anzahlvariablen+numberdeletedvariables-1;jjj++)
    59095913        {
    5910           PARA[jjj]=(PARA[jjj]+zeros[size(zeros)][jjj+1])*t^(ww[jjj+1]*tweight/ww[1]);
     5914          PARA[jjj]=(PARA[jjj]+zeros[size(zeros)][jjj+1])*t^(ww[jjj+1]*tweight div ww[1]);
    59115915        }
    59125916        // delete the last entry in zero, since that one has
     
    60336037    {
    60346038      I=subst(i,var(lastvar),0);
    6035       while (subst(I[1],t,0)==0)
     6039      while ((I[1]!=0) and (subst(I[1],t,0)==0))
    60366040      {
    60376041        I[1]=I[1]/t;
     
    78147818    poly denom=delta*hn^5;
    78157819    poly ggt=gcd(num,denom);
    7816     num=num/ggt;
    7817     denom=denom/ggt;
     7820    num=num div ggt;
     7821    denom=denom div ggt;
    78187822    setring BASERING;
    78197823    poly num=imap(TRING,num);
  • Singular/Makefile.am

    r4c1341 rce70e6  
    248248Singulard_LDFLAGS = ${AM_LDFLAGS} ${EMBED_PYOBJECT}
    249249
     250dist_bin_SCRIPTS = singularsurf
    250251
    251252#### ESingular
  • Singular/checklibs.c

    r4c1341 rce70e6  
    219219    {
    220220      p=buf;
    221       while(*p==' ') p++;
    222       if (*p=='@') { p++; texinfo+=(isalpha(*p)); }
     221      if (strchr(buf,'@')!=NULL)
     222      { texinfo++; printf("%s",buf); }
    223223    }
    224224    get_next(); (*l)++;
     
    253253    if (texinfo>0)
    254254    {
    255       printf("warning: %d texinfo commands %d header lines: should be used very rarely!\n",texinfo,header);
     255      printf("warning: %d texinfo commands in %d header lines: should be used very rarely!\n",texinfo,header);
    256256    }
    257257}
  • Singular/grammar.cc

    r4c1341 rce70e6  
    245245
    246246/* Line 189 of yacc.c  */
    247 #line 252 "grammar.cc"
     247#line 248 "grammar.cc"
    248248
    249249/* Enabling traces.  */
     
    387387     PROC_DEF = 371,
    388388     APPLY = 372,
    389      BREAK_CMD = 373,
    390      CONTINUE_CMD = 374,
    391      ELSE_CMD = 375,
    392      EVAL = 376,
    393      QUOTE = 377,
    394      FOR_CMD = 378,
    395      IF_CMD = 379,
    396      SYS_BREAK = 380,
    397      WHILE_CMD = 381,
    398      RETURN = 382,
    399      PARAMETER = 383,
    400      SYSVAR = 384,
    401      UMINUS = 385
     389     ASSUME_CMD = 373,
     390     BREAK_CMD = 374,
     391     CONTINUE_CMD = 375,
     392     ELSE_CMD = 376,
     393     EVAL = 377,
     394     QUOTE = 378,
     395     FOR_CMD = 379,
     396     IF_CMD = 380,
     397     SYS_BREAK = 381,
     398     WHILE_CMD = 382,
     399     RETURN = 383,
     400     PARAMETER = 384,
     401     SYSVAR = 385,
     402     UMINUS = 386
    402403   };
    403404#endif
     
    416417
    417418/* Line 264 of yacc.c  */
    418 #line 423 "grammar.cc"
     419#line 420 "grammar.cc"
    419420
    420421#ifdef short
     
    631632#define YYFINAL  2
    632633/* YYLAST -- Last index in YYTABLE.  */
    633 #define YYLAST   2454
     634#define YYLAST   2536
    634635
    635636/* YYNTOKENS -- Number of terminals.  */
    636 #define YYNTOKENS  149
     637#define YYNTOKENS  150
    637638/* YYNNTS -- Number of nonterminals.  */
    638 #define YYNNTS  44
     639#define YYNNTS  45
    639640/* YYNRULES -- Number of rules.  */
    640 #define YYNRULES  170
     641#define YYNRULES  172
    641642/* YYNRULES -- Number of states.  */
    642 #define YYNSTATES  386
     643#define YYNSTATES  393
    643644
    644645/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
    645646#define YYUNDEFTOK  2
    646 #define YYMAXUTOK   385
     647#define YYMAXUTOK   386
    647648
    648649#define YYTRANSLATE(YYX)                                                \
     
    655656       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    656657       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    657        2,     2,     2,     2,     2,     2,     2,     2,   141,     2,
    658      145,   146,   143,   133,   139,   134,   147,   135,     2,     2,
    659        2,     2,     2,     2,     2,     2,     2,     2,   142,   140,
    660      131,   130,   132,     2,     2,     2,     2,     2,     2,     2,
     658       2,     2,     2,     2,     2,     2,     2,     2,   142,     2,
     659     146,   147,   144,   134,   140,   135,   148,   136,     2,     2,
     660       2,     2,     2,     2,     2,     2,     2,     2,   143,   141,
     661     132,   131,   133,     2,     2,     2,     2,     2,     2,     2,
    661662       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    662663       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    663        2,   136,     2,   137,   138,     2,   148,     2,     2,     2,
     664       2,   137,     2,   138,   139,     2,   149,     2,     2,     2,
    664665       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    665666       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     
    690691     105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
    691692     115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
    692      125,   126,   127,   128,   129,   144
     693     125,   126,   127,   128,   129,   130,   145
    693694};
    694695
     
    706707     216,   221,   230,   235,   244,   249,   253,   255,   257,   259,
    707708     263,   270,   275,   282,   289,   296,   303,   310,   317,   321,
    708      327,   328,   334,   337,   339,   342,   345,   349,   353,   357,
    709      361,   365,   369,   373,   377,   381,   385,   388,   391,   394,
    710      397,   399,   403,   406,   409,   412,   415,   424,   427,   431,
    711      434,   436,   438,   444,   446,   448,   453,   455,   459,   461,
    712      465,   467,   469,   471,   473,   474,   479,   483,   486,   490,
    713      493,   496,   500,   505,   510,   515,   520,   525,   530,   535,
    714      540,   547,   554,   561,   568,   575,   582,   589,   593,   595,
    715      604,   607,   610,   612,   614,   617,   620,   622,   628,   631,
    716      637,   639,   641,   645,   651,   655,   659,   664,   667,   670,
    717      675
     709     327,   333,   334,   340,   343,   346,   348,   351,   354,   358,
     710     362,   366,   370,   374,   378,   382,   386,   390,   394,   397,
     711     400,   403,   406,   408,   412,   415,   418,   421,   424,   433,
     712     436,   440,   443,   445,   447,   453,   455,   457,   462,   464,
     713     468,   470,   474,   476,   478,   480,   482,   483,   488,   492,
     714     495,   499,   502,   505,   509,   514,   519,   524,   529,   534,
     715     539,   544,   549,   556,   563,   570,   577,   584,   591,   598,
     716     602,   604,   613,   616,   619,   621,   623,   626,   629,   631,
     717     637,   640,   646,   648,   650,   654,   660,   664,   668,   673,
     718     676,   679,   684
    718719};
    719720
     
    721722static const yytype_int16 yyrhs[] =
    722723{
    723      150,     0,    -1,    -1,   150,   151,    -1,   152,    -1,   154,
    724      140,    -1,   165,   140,    -1,   192,    -1,   125,    -1,   140,
    725       -1,     1,   140,    -1,   187,    -1,   188,    -1,   153,    -1,
    726      189,    -1,   190,    -1,   174,    -1,   176,    -1,   177,    -1,
    727      103,   112,    -1,   155,    -1,   178,    -1,   179,    -1,   180,
    728       -1,   191,    -1,   182,    -1,   183,    -1,   185,    -1,   186,
    729       -1,   163,   157,    -1,   115,    -1,   164,    -1,   156,    11,
    730      156,    -1,   158,   147,   156,    -1,   156,   145,   146,    -1,
    731      156,   145,   157,   146,    -1,   136,   157,   137,    -1,   113,
    732       -1,   129,    -1,   166,    -1,    15,   145,   158,   146,    -1,
    733       99,   145,   158,   146,    -1,   100,   145,   157,   146,    -1,
    734      100,   145,   146,    -1,   101,   145,   158,   146,    -1,   102,
    735      145,   157,   146,    -1,   102,   145,   146,    -1,    91,   145,
    736      158,   146,    -1,    94,   145,   158,   146,    -1,    95,   145,
    737      158,   146,    -1,    97,   145,   158,   146,    -1,    92,   145,
    738      158,   139,   158,   146,    -1,    94,   145,   158,   139,   158,
    739      146,    -1,    96,   145,   158,   139,   158,   146,    -1,    97,
    740      145,   158,   139,   158,   146,    -1,    93,   145,   158,   139,
    741      158,   139,   158,   146,    -1,    95,   145,   158,   139,   158,
    742      139,   158,   146,    -1,    96,   145,   158,   139,   158,   139,
    743      158,   146,    -1,    97,   145,   158,   139,   158,   139,   158,
    744      146,    -1,    98,   145,   146,    -1,    98,   145,   157,   146,
    745       -1,   173,   145,   158,   139,   158,   139,   158,   146,    -1,
    746      173,   145,   158,   146,    -1,    16,   145,   167,   139,   167,
    747      139,   171,   146,    -1,    16,   145,   158,   146,    -1,   157,
    748      139,   158,    -1,   158,    -1,   162,    -1,   156,    -1,   145,
    749      157,   146,    -1,   158,   136,   158,   139,   158,   137,    -1,
    750      158,   136,   158,   137,    -1,   117,   145,   158,   139,    91,
    751      146,    -1,   117,   145,   158,   139,    94,   146,    -1,   117,
    752      145,   158,   139,    95,   146,    -1,   117,   145,   158,   139,
    753       97,   146,    -1,   117,   145,   158,   139,    98,   146,    -1,
    754      117,   145,   158,   139,   158,   146,    -1,   160,   158,   161,
    755       -1,   160,   158,   130,   158,   161,    -1,    -1,   121,   145,
    756      159,   158,   146,    -1,   122,   145,    -1,   146,    -1,   158,
    757       10,    -1,   158,     7,    -1,   158,   133,   158,    -1,   158,
    758      134,   158,    -1,   158,   135,   158,    -1,   158,   138,   158,
    759       -1,   158,   131,   158,    -1,   158,   141,   158,    -1,   158,
    760        9,   158,    -1,   158,     4,   158,    -1,   158,     3,   158,
    761       -1,   158,   142,   158,    -1,     8,   158,    -1,   134,   158,
    762       -1,   165,   172,    -1,   157,   130,    -1,   114,    -1,   148,
    763      158,   148,    -1,    99,   156,    -1,   100,   156,    -1,   101,
    764      156,    -1,   102,   156,    -1,   173,   156,   136,   158,   137,
    765      136,   158,   137,    -1,   173,   156,    -1,   165,   139,   156,
    766       -1,    15,   156,    -1,   111,    -1,   158,    -1,   145,   158,
    767      139,   157,   146,    -1,   114,    -1,   168,    -1,   168,   145,
    768      157,   146,    -1,   169,    -1,   169,   139,   170,    -1,   169,
    769       -1,   145,   170,   146,    -1,   130,    -1,    20,    -1,    14,
    770       -1,    13,    -1,    -1,   131,   166,   175,   140,    -1,   105,
    771      111,   140,    -1,   105,   140,    -1,   103,   111,   140,    -1,
    772      104,   157,    -1,   106,   156,    -1,   179,   139,   156,    -1,
    773      108,   145,    99,   146,    -1,   108,   145,   100,   146,    -1,
    774      108,   145,   101,   146,    -1,   108,   145,   102,   146,    -1,
    775      108,   145,    16,   146,    -1,   108,   145,   173,   146,    -1,
    776      108,   145,    15,   146,    -1,   108,   145,   156,   146,    -1,
    777      108,   145,   156,   139,    99,   146,    -1,   108,   145,   156,
    778      139,   100,   146,    -1,   108,   145,   156,   139,   101,   146,
    779       -1,   108,   145,   156,   139,   102,   146,    -1,   108,   145,
    780      156,   139,    16,   146,    -1,   108,   145,   156,   139,   173,
    781      146,    -1,   108,   145,   156,   139,    15,   146,    -1,   108,
    782      145,   146,    -1,    16,    -1,   181,   156,   172,   167,   139,
    783      167,   139,   171,    -1,   181,   156,    -1,   129,   166,    -1,
    784      109,    -1,    40,    -1,   184,   158,    -1,   110,   158,    -1,
    785      157,    -1,   124,   145,   158,   146,   112,    -1,   120,   112,
    786       -1,   124,   145,   158,   146,   118,    -1,   118,    -1,   119,
    787       -1,   126,   111,   112,    -1,   123,   111,   111,   111,   112,
    788       -1,    15,   164,   112,    -1,   116,   111,   112,    -1,   116,
    789      111,   111,   112,    -1,   128,   165,    -1,   128,   158,    -1,
    790      127,   145,   157,   146,    -1,   127,   145,   146,    -1
     724     151,     0,    -1,    -1,   151,   152,    -1,   153,    -1,   155,
     725     141,    -1,   167,   141,    -1,   194,    -1,   126,    -1,   141,
     726      -1,     1,   141,    -1,   189,    -1,   190,    -1,   154,    -1,
     727     191,    -1,   192,    -1,   176,    -1,   178,    -1,   179,    -1,
     728     103,   112,    -1,   156,    -1,   180,    -1,   181,    -1,   182,
     729      -1,   193,    -1,   184,    -1,   185,    -1,   187,    -1,   188,
     730      -1,   165,   158,    -1,   115,    -1,   166,    -1,   157,    11,
     731     157,    -1,   159,   148,   157,    -1,   157,   146,   147,    -1,
     732     157,   146,   158,   147,    -1,   137,   158,   138,    -1,   113,
     733      -1,   130,    -1,   168,    -1,    15,   146,   159,   147,    -1,
     734      99,   146,   159,   147,    -1,   100,   146,   158,   147,    -1,
     735     100,   146,   147,    -1,   101,   146,   159,   147,    -1,   102,
     736     146,   158,   147,    -1,   102,   146,   147,    -1,    91,   146,
     737     159,   147,    -1,    94,   146,   159,   147,    -1,    95,   146,
     738     159,   147,    -1,    97,   146,   159,   147,    -1,    92,   146,
     739     159,   140,   159,   147,    -1,    94,   146,   159,   140,   159,
     740     147,    -1,    96,   146,   159,   140,   159,   147,    -1,    97,
     741     146,   159,   140,   159,   147,    -1,    93,   146,   159,   140,
     742     159,   140,   159,   147,    -1,    95,   146,   159,   140,   159,
     743     140,   159,   147,    -1,    96,   146,   159,   140,   159,   140,
     744     159,   147,    -1,    97,   146,   159,   140,   159,   140,   159,
     745     147,    -1,    98,   146,   147,    -1,    98,   146,   158,   147,
     746      -1,   175,   146,   159,   140,   159,   140,   159,   147,    -1,
     747     175,   146,   159,   147,    -1,    16,   146,   169,   140,   169,
     748     140,   173,   147,    -1,    16,   146,   159,   147,    -1,   158,
     749     140,   159,    -1,   159,    -1,   164,    -1,   157,    -1,   146,
     750     158,   147,    -1,   159,   137,   159,   140,   159,   138,    -1,
     751     159,   137,   159,   138,    -1,   117,   146,   159,   140,    91,
     752     147,    -1,   117,   146,   159,   140,    94,   147,    -1,   117,
     753     146,   159,   140,    95,   147,    -1,   117,   146,   159,   140,
     754      97,   147,    -1,   117,   146,   159,   140,    98,   147,    -1,
     755     117,   146,   159,   140,   159,   147,    -1,   161,   159,   163,
     756      -1,   161,   159,   131,   159,   163,    -1,   162,   159,   140,
     757     159,   163,    -1,    -1,   122,   146,   160,   159,   147,    -1,
     758     123,   146,    -1,   118,   146,    -1,   147,    -1,   159,    10,
     759      -1,   159,     7,    -1,   159,   134,   159,    -1,   159,   135,
     760     159,    -1,   159,   136,   159,    -1,   159,   139,   159,    -1,
     761     159,   132,   159,    -1,   159,   142,   159,    -1,   159,     9,
     762     159,    -1,   159,     4,   159,    -1,   159,     3,   159,    -1,
     763     159,   143,   159,    -1,     8,   159,    -1,   135,   159,    -1,
     764     167,   174,    -1,   158,   131,    -1,   114,    -1,   149,   159,
     765     149,    -1,    99,   157,    -1,   100,   157,    -1,   101,   157,
     766      -1,   102,   157,    -1,   175,   157,   137,   159,   138,   137,
     767     159,   138,    -1,   175,   157,    -1,   167,   140,   157,    -1,
     768      15,   157,    -1,   111,    -1,   159,    -1,   146,   159,   140,
     769     158,   147,    -1,   114,    -1,   170,    -1,   170,   146,   158,
     770     147,    -1,   171,    -1,   171,   140,   172,    -1,   171,    -1,
     771     146,   172,   147,    -1,   131,    -1,    20,    -1,    14,    -1,
     772      13,    -1,    -1,   132,   168,   177,   141,    -1,   105,   111,
     773     141,    -1,   105,   141,    -1,   103,   111,   141,    -1,   104,
     774     158,    -1,   106,   157,    -1,   181,   140,   157,    -1,   108,
     775     146,    99,   147,    -1,   108,   146,   100,   147,    -1,   108,
     776     146,   101,   147,    -1,   108,   146,   102,   147,    -1,   108,
     777     146,    16,   147,    -1,   108,   146,   175,   147,    -1,   108,
     778     146,    15,   147,    -1,   108,   146,   157,   147,    -1,   108,
     779     146,   157,   140,    99,   147,    -1,   108,   146,   157,   140,
     780     100,   147,    -1,   108,   146,   157,   140,   101,   147,    -1,
     781     108,   146,   157,   140,   102,   147,    -1,   108,   146,   157,
     782     140,    16,   147,    -1,   108,   146,   157,   140,   175,   147,
     783      -1,   108,   146,   157,   140,    15,   147,    -1,   108,   146,
     784     147,    -1,    16,    -1,   183,   157,   174,   169,   140,   169,
     785     140,   173,    -1,   183,   157,    -1,   130,   168,    -1,   109,
     786      -1,    40,    -1,   186,   159,    -1,   110,   159,    -1,   158,
     787      -1,   125,   146,   159,   147,   112,    -1,   121,   112,    -1,
     788     125,   146,   159,   147,   119,    -1,   119,    -1,   120,    -1,
     789     127,   111,   112,    -1,   124,   111,   111,   111,   112,    -1,
     790      15,   166,   112,    -1,   116,   111,   112,    -1,   116,   111,
     791     111,   112,    -1,   129,   167,    -1,   129,   159,    -1,   128,
     792     146,   158,   147,    -1,   128,   146,   147,    -1
    791793};
    792794
     
    794796static const yytype_uint16 yyrline[] =
    795797{
    796        0,   370,   370,   372,   406,   407,   409,   411,   415,   420,
    797      422,   473,   474,   475,   476,   477,   478,   479,   480,   484,
    798      487,   488,   489,   490,   491,   492,   493,   494,   495,   498,
    799      505,   510,   514,   518,   522,   526,   539,   567,   591,   597,
    800      603,   607,   611,   615,   619,   623,   627,   631,   635,   639,
    801      643,   647,   651,   655,   659,   663,   667,   671,   675,   679,
    802      683,   687,   691,   695,   699,   706,   717,   723,   728,   729,
    803      730,   734,   738,   742,   746,   750,   754,   758,   762,   766,
    804      784,   783,   801,   809,   818,   822,   826,   830,   834,   838,
    805      842,   846,   850,   854,   858,   862,   866,   873,   880,   881,
    806      900,   901,   913,   918,   923,   927,   931,   971,   997,  1018,
    807     1026,  1030,  1031,  1045,  1053,  1062,  1107,  1108,  1117,  1118,
    808     1124,  1131,  1133,  1135,  1145,  1144,  1152,  1157,  1164,  1172,
    809     1184,  1200,  1219,  1223,  1227,  1232,  1236,  1240,  1244,  1248,
    810     1253,  1259,  1265,  1271,  1277,  1283,  1289,  1301,  1308,  1312,
    811     1349,  1359,  1365,  1365,  1368,  1440,  1444,  1473,  1486,  1503,
    812     1512,  1517,  1525,  1537,  1556,  1566,  1585,  1608,  1614,  1626,
    813     1632
     798       0,   367,   367,   369,   403,   404,   406,   408,   412,   417,
     799     419,   470,   471,   472,   473,   474,   475,   476,   477,   481,
     800     484,   485,   486,   487,   488,   489,   490,   491,   492,   495,
     801     502,   507,   511,   515,   519,   523,   536,   564,   588,   594,
     802     600,   604,   608,   612,   616,   620,   624,   628,   632,   636,
     803     640,   644,   648,   652,   656,   660,   664,   668,   672,   676,
     804     680,   684,   688,   692,   696,   703,   714,   720,   725,   726,
     805     727,   731,   735,   739,   743,   747,   751,   755,   759,   763,
     806     780,   787,   786,   804,   812,   820,   829,   833,   837,   841,
     807     845,   849,   853,   857,   861,   865,   869,   873,   877,   884,
     808     891,   892,   911,   912,   924,   929,   934,   938,   942,   982,
     809    1008,  1029,  1037,  1041,  1042,  1056,  1064,  1073,  1118,  1119,
     810    1128,  1129,  1135,  1142,  1144,  1146,  1156,  1155,  1163,  1168,
     811    1175,  1183,  1195,  1211,  1230,  1234,  1238,  1243,  1247,  1251,
     812    1255,  1259,  1264,  1270,  1276,  1282,  1288,  1294,  1300,  1312,
     813    1319,  1323,  1360,  1370,  1376,  1376,  1379,  1451,  1455,  1484,
     814    1497,  1514,  1523,  1528,  1536,  1548,  1567,  1577,  1596,  1619,
     815    1625,  1637,  1643
    814816};
    815817#endif
     
    842844  "EXPORT_CMD", "HELP_CMD", "KILL_CMD", "LIB_CMD", "LISTVAR_CMD",
    843845  "SETRING_CMD", "TYPE_CMD", "STRINGTOK", "BLOCKTOK", "INT_CONST",
    844   "UNKNOWN_IDENT", "RINGVAR", "PROC_DEF", "APPLY", "BREAK_CMD",
    845   "CONTINUE_CMD", "ELSE_CMD", "EVAL", "QUOTE", "FOR_CMD", "IF_CMD",
    846   "SYS_BREAK", "WHILE_CMD", "RETURN", "PARAMETER", "SYSVAR", "'='", "'<'",
    847   "'>'", "'+'", "'-'", "'/'", "'['", "']'", "'^'", "','", "';'", "'&'",
    848   "':'", "'*'", "UMINUS", "'('", "')'", "'.'", "'`'", "$accept", "lines",
    849   "pprompt", "flowctrl", "example_dummy", "command", "assign", "elemexpr",
    850   "exprlist", "expr", "$@1", "quote_start", "quote_end", "expr_arithmetic",
    851   "left_value", "extendedid", "declare_ip_variable", "stringexpr", "rlist",
    852   "ordername", "orderelem", "OrderingList", "ordering", "cmdeq", "mat_cmd",
    853   "filecmd", "$@2", "helpcmd", "examplecmd", "exportcmd", "killcmd",
    854   "listcmd", "ringcmd1", "ringcmd", "scriptcmd", "setrings", "setringcmd",
    855   "typecmd", "ifcmd", "whilecmd", "forcmd", "proccmd", "parametercmd",
    856   "returncmd", 0
     846  "UNKNOWN_IDENT", "RINGVAR", "PROC_DEF", "APPLY", "ASSUME_CMD",
     847  "BREAK_CMD", "CONTINUE_CMD", "ELSE_CMD", "EVAL", "QUOTE", "FOR_CMD",
     848  "IF_CMD", "SYS_BREAK", "WHILE_CMD", "RETURN", "PARAMETER", "SYSVAR",
     849  "'='", "'<'", "'>'", "'+'", "'-'", "'/'", "'['", "']'", "'^'", "','",
     850  "';'", "'&'", "':'", "'*'", "UMINUS", "'('", "')'", "'.'", "'`'",
     851  "$accept", "lines", "pprompt", "flowctrl", "example_dummy", "command",
     852  "assign", "elemexpr", "exprlist", "expr", "$@1", "quote_start",
     853  "assume_start", "quote_end", "expr_arithmetic", "left_value",
     854  "extendedid", "declare_ip_variable", "stringexpr", "rlist", "ordername",
     855  "orderelem", "OrderingList", "ordering", "cmdeq", "mat_cmd", "filecmd",
     856  "$@2", "helpcmd", "examplecmd", "exportcmd", "killcmd", "listcmd",
     857  "ringcmd1", "ringcmd", "scriptcmd", "setrings", "setringcmd", "typecmd",
     858  "ifcmd", "whilecmd", "forcmd", "proccmd", "parametercmd", "returncmd", 0
    857859};
    858860#endif
     
    876878     365,   366,   367,   368,   369,   370,   371,   372,   373,   374,
    877879     375,   376,   377,   378,   379,   380,   381,   382,   383,   384,
    878       61,    60,    62,    43,    45,    47,    91,    93,    94,    44,
    879       59,    38,    58,    42,   385,    40,    41,    46,    96
     880     385,    61,    60,    62,    43,    45,    47,    91,    93,    94,
     881      44,    59,    38,    58,    42,   386,    40,    41,    46,    96
    880882};
    881883# endif
     
    884886static const yytype_uint8 yyr1[] =
    885887{
    886        0,   149,   150,   150,   151,   151,   151,   151,   151,   151,
    887      151,   152,   152,   152,   152,   152,   152,   152,   152,   153,
    888      154,   154,   154,   154,   154,   154,   154,   154,   154,   155,
    889      156,   156,   156,   156,   156,   156,   156,   156,   156,   156,
    890      156,   156,   156,   156,   156,   156,   156,   156,   156,   156,
    891      156,   156,   156,   156,   156,   156,   156,   156,   156,   156,
    892      156,   156,   156,   156,   156,   157,   157,   158,   158,   158,
    893      158,   158,   158,   158,   158,   158,   158,   158,   158,   158,
    894      159,   158,   160,   161,   162,   162,   162,   162,   162,   162,
    895      162,   162,   162,   162,   162,   162,   162,   162,   163,   163,
    896      164,   164,   165,   165,   165,   165,   165,   165,   165,   165,
    897      166,   167,   167,   168,   169,   169,   170,   170,   171,   171,
    898      172,   173,   173,   173,   175,   174,   176,   176,   177,   178,
    899      179,   179,   180,   180,   180,   180,   180,   180,   180,   180,
    900      180,   180,   180,   180,   180,   180,   180,   180,   181,   182,
    901      182,   183,   184,   184,   185,   186,   186,   187,   187,   187,
    902      187,   187,   188,   189,   190,   190,   190,   191,   191,   192,
    903      192
     888       0,   150,   151,   151,   152,   152,   152,   152,   152,   152,
     889     152,   153,   153,   153,   153,   153,   153,   153,   153,   154,
     890     155,   155,   155,   155,   155,   155,   155,   155,   155,   156,
     891     157,   157,   157,   157,   157,   157,   157,   157,   157,   157,
     892     157,   157,   157,   157,   157,   157,   157,   157,   157,   157,
     893     157,   157,   157,   157,   157,   157,   157,   157,   157,   157,
     894     157,   157,   157,   157,   157,   158,   158,   159,   159,   159,
     895     159,   159,   159,   159,   159,   159,   159,   159,   159,   159,
     896     159,   160,   159,   161,   162,   163,   164,   164,   164,   164,
     897     164,   164,   164,   164,   164,   164,   164,   164,   164,   164,
     898     165,   165,   166,   166,   167,   167,   167,   167,   167,   167,
     899     167,   167,   168,   169,   169,   170,   171,   171,   172,   172,
     900     173,   173,   174,   175,   175,   175,   177,   176,   178,   178,
     901     179,   180,   181,   181,   182,   182,   182,   182,   182,   182,
     902     182,   182,   182,   182,   182,   182,   182,   182,   182,   182,
     903     183,   184,   184,   185,   186,   186,   187,   188,   188,   189,
     904     189,   189,   189,   189,   190,   191,   192,   192,   192,   193,
     905     193,   194,   194
    904906};
    905907
     
    915917       4,     8,     4,     8,     4,     3,     1,     1,     1,     3,
    916918       6,     4,     6,     6,     6,     6,     6,     6,     3,     5,
    917        0,     5,     2,     1,     2,     2,     3,     3,     3,     3,
    918        3,     3,     3,     3,     3,     3,     2,     2,     2,     2,
    919        1,     3,     2,     2,     2,     2,     8,     2,     3,     2,
    920        1,     1,     5,     1,     1,     4,     1,     3,     1,     3,
    921        1,     1,     1,     1,     0,     4,     3,     2,     3,     2,
    922        2,     3,     4,     4,     4,     4,     4,     4,     4,     4,
    923        6,     6,     6,     6,     6,     6,     6,     3,     1,     8,
    924        2,     2,     1,     1,     2,     2,     1,     5,     2,     5,
    925        1,     1,     3,     5,     3,     3,     4,     2,     2,     4,
    926        3
     919       5,     0,     5,     2,     2,     1,     2,     2,     3,     3,
     920       3,     3,     3,     3,     3,     3,     3,     3,     2,     2,
     921       2,     2,     1,     3,     2,     2,     2,     2,     8,     2,
     922       3,     2,     1,     1,     5,     1,     1,     4,     1,     3,
     923       1,     3,     1,     1,     1,     1,     0,     4,     3,     2,
     924       3,     2,     2,     3,     4,     4,     4,     4,     4,     4,
     925       4,     4,     6,     6,     6,     6,     6,     6,     6,     3,
     926       1,     8,     2,     2,     1,     1,     2,     2,     1,     5,
     927       2,     5,     1,     1,     3,     5,     3,     3,     4,     2,
     928       2,     4,     3
    927929};
    928930
     
    932934static const yytype_uint8 yydefact[] =
    933935{
    934        2,     0,     1,     0,     0,   123,   122,     0,   148,   121,
    935      153,     0,     0,     0,     0,     0,     0,     0,     0,     0,
    936        0,     0,     0,     0,     0,     0,     0,     0,   152,     0,
    937      110,    37,   100,    30,     0,     0,   160,   161,     0,     0,
    938        0,     0,     0,     8,     0,     0,     0,    38,     0,     0,
    939        0,     9,     0,     0,     3,     4,    13,     0,    20,    68,
    940      156,    66,     0,    67,     0,    31,     0,    39,     0,    16,
    941       17,    18,    21,    22,    23,     0,    25,    26,     0,    27,
    942       28,    11,    12,    14,    15,    24,     7,    10,     0,     0,
    943        0,     0,     0,     0,    38,    96,     0,     0,    68,     0,
    944       31,     0,     0,     0,     0,     0,     0,     0,     0,     0,
    945        0,    68,     0,    68,     0,    68,     0,    68,     0,    19,
    946      129,     0,   127,    68,     0,   155,     0,     0,   158,    80,
    947       82,     0,     0,     0,     0,     0,   168,   167,   151,   124,
    948       97,     0,     0,     0,     5,     0,     0,    99,     0,     0,
    949        0,    85,     0,    84,     0,     0,     0,     0,     0,     0,
    950        0,     0,     0,     0,    29,   120,     0,     6,    98,     0,
    951       68,     0,    68,   154,     0,     0,     0,     0,     0,     0,
    952       66,   164,     0,   111,     0,     0,     0,     0,     0,     0,
    953        0,     0,    59,     0,    66,    43,     0,    66,    46,     0,
    954      128,   126,     0,     0,     0,     0,     0,     0,   147,    68,
    955        0,     0,   165,     0,     0,     0,     0,   162,   170,     0,
    956        0,    36,    69,   101,    32,    34,     0,    65,    94,    93,
    957       92,    90,    86,    87,    88,     0,    89,    91,    95,    33,
    958        0,    83,    78,    68,     0,     0,    68,     0,     0,     0,
    959        0,     0,     0,     0,    40,    66,    64,     0,    47,     0,
    960        0,     0,    48,     0,    49,     0,     0,    50,    60,    41,
    961       42,    44,    45,   138,   136,   132,   133,   134,   135,     0,
    962      139,   137,   166,     0,     0,     0,     0,   169,   125,    35,
    963       71,     0,     0,     0,    62,     0,   111,     0,    42,    45,
     936       2,     0,     1,     0,     0,   125,   124,     0,   150,   123,
     937     155,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     938       0,     0,     0,     0,     0,     0,     0,     0,   154,     0,
     939     112,    37,   102,    30,     0,     0,     0,   162,   163,     0,
     940       0,     0,     0,     0,     8,     0,     0,     0,    38,     0,
     941       0,     0,     9,     0,     0,     3,     4,    13,     0,    20,
     942      68,   158,    66,     0,     0,    67,     0,    31,     0,    39,
     943       0,    16,    17,    18,    21,    22,    23,     0,    25,    26,
     944       0,    27,    28,    11,    12,    14,    15,    24,     7,    10,
     945       0,     0,     0,     0,     0,     0,    38,    98,     0,     0,
     946      68,     0,    31,     0,     0,     0,     0,     0,     0,     0,
     947       0,     0,     0,    68,     0,    68,     0,    68,     0,    68,
     948       0,    19,   131,     0,   129,    68,     0,   157,     0,     0,
     949      84,   160,    81,    83,     0,     0,     0,     0,     0,   170,
     950     169,   153,   126,    99,     0,     0,     0,     5,     0,     0,
     951     101,     0,     0,     0,    87,     0,    86,     0,     0,     0,
     952       0,     0,     0,     0,     0,     0,     0,     0,    29,   122,
     953       0,     6,   100,     0,    68,     0,    68,   156,     0,     0,
     954       0,     0,     0,     0,    66,   166,     0,   113,     0,     0,
     955       0,     0,     0,     0,     0,     0,    59,     0,    66,    43,
     956       0,    66,    46,     0,   130,   128,     0,     0,     0,     0,
     957       0,     0,   149,    68,     0,     0,   167,     0,     0,     0,
     958       0,   164,   172,     0,     0,    36,    69,   103,    32,    34,
     959       0,    65,    96,    95,    94,    92,    88,    89,    90,     0,
     960      91,    93,    97,    33,     0,    85,    78,     0,    68,     0,
     961       0,    68,     0,     0,     0,     0,     0,     0,     0,    40,
     962      66,    64,     0,    47,     0,     0,     0,    48,     0,    49,
     963       0,     0,    50,    60,    41,    42,    44,    45,   140,   138,
     964     134,   135,   136,   137,     0,   141,   139,   168,     0,     0,
     965       0,     0,   171,   127,    35,    71,     0,     0,     0,     0,
     966      62,     0,   113,     0,    42,    45,     0,     0,     0,     0,
    964967       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
    965        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
    966        0,    81,   163,   157,   159,     0,    79,     0,     0,     0,
    967        0,     0,    51,     0,    52,     0,     0,    53,     0,    54,
    968      146,   144,   140,   141,   142,   143,   145,    72,    73,    74,
    969       75,    76,    77,    70,     0,     0,     0,   112,   113,     0,
    970      114,   118,     0,     0,     0,     0,     0,     0,     0,     0,
    971      116,     0,     0,    63,    55,    56,    57,    58,    61,   106,
    972      149,     0,   119,     0,   117,   115
     968       0,     0,     0,     0,     0,     0,     0,    82,   165,   159,
     969     161,     0,    79,    80,     0,     0,     0,     0,     0,    51,
     970       0,    52,     0,     0,    53,     0,    54,   148,   146,   142,
     971     143,   144,   145,   147,    72,    73,    74,    75,    76,    77,
     972      70,     0,     0,     0,   114,   115,     0,   116,   120,     0,
     973       0,     0,     0,     0,     0,     0,     0,   118,     0,     0,
     974      63,    55,    56,    57,    58,    61,   108,   151,     0,   121,
     975       0,   119,   117
    973976};
    974977
     
    976979static const yytype_int16 yydefgoto[] =
    977980{
    978       -1,     1,    54,    55,    56,    57,    58,    59,   142,    61,
    979      214,    62,   242,    63,    64,    65,    66,    67,   184,   360,
    980      361,   371,   362,   168,    96,    69,   220,    70,    71,    72,
    981       73,    74,    75,    76,    77,    78,    79,    80,    81,    82,
    982       83,    84,    85,    86
     981      -1,     1,    55,    56,    57,    58,    59,    60,   145,    62,
     982     218,    63,    64,   246,    65,    66,    67,    68,    69,   188,
     983     367,   368,   378,   369,   172,    98,    71,   224,    72,    73,
     984      74,    75,    76,    77,    78,    79,    80,    81,    82,    83,
     985      84,    85,    86,    87,    88
    983986};
    984987
    985988/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    986989   STATE-NUM.  */
    987 #define YYPACT_NINF -357
     990#define YYPACT_NINF -359
    988991static const yytype_int16 yypact[] =
    989992{
    990     -357,   296,  -357,  -118,  1780,  -357,  -357,  1838,   -94,  -357,
    991     -357,   -89,   -76,   -67,   -48,   -38,   -31,   -28,   -25,  1897,
    992     1955,  2014,  2072,  -103,  1780,  -106,  1780,   -21,  -357,  1780,
    993     -357,  -357,  -357,  -357,    41,    20,  -357,  -357,   -46,    23,
    994       25,    60,    42,  -357,    77,    44,  2131,    80,    80,  1780,
    995     1780,  -357,  1780,  1780,  -357,  -357,  -357,   -69,  -357,   -10,
    996     -109,  1287,  1780,  -357,  1780,  -357,  -120,  -357,  2189,  -357,
    997     -357,  -357,  -357,    53,  -357,  1780,  -357,  -357,  1780,  -357,
    998     -357,  -357,  -357,  -357,  -357,  -357,  -357,  -357,    51,   -94,
    999       55,    59,    69,    78,  -357,   130,    79,  1780,   210,  1287,
    1000      115,  2248,  1780,  1780,  1780,  1780,  1780,  1780,  1780,  1422,
    1001     1780,   347,  1487,   373,  1780,   417,  1546,   443,    88,  -357,
    1002       90,    93,  -357,    18,  1604,  1287,   -75,  1780,  -357,  -357,
    1003     -357,   119,  1780,   122,  1663,  1838,  1287,    96,  -357,  -357,
    1004      130,  -133,  -132,    84,  -357,  1780,  1721,  -357,  1780,  1780,
    1005     1780,  -357,  1780,  -357,  1780,  1780,  1780,  1780,  1780,  1780,
    1006     1780,  1780,  1780,   109,    90,  -357,  1780,  -357,  -357,  1780,
    1007      183,  1780,   449,  1287,  1780,  1780,  1487,  1780,  1546,  1780,
    1008      518,  -357,  1780,   535,    97,   571,   588,   616,     8,   317,
    1009      676,   334,  -357,  -104,   691,  -357,   -99,   729,  -357,   -98,
    1010     -357,  -357,  -107,   -70,   -65,   -63,   -61,   -56,  -357,    21,
    1011      -50,   125,  -357,   757,  1780,   137,   772,  -357,  -357,   -87,
    1012      101,  -357,  -357,  -357,  -357,  -357,   -85,  1287,  1337,  1060,
    1013     1060,   239,   195,   195,   130,   360,    17,  1352,   195,  -357,
    1014     1780,  -357,  -357,   460,   430,  1780,    68,  2248,   518,   691,
    1015      -84,   729,   -82,   430,  -357,   789,  -357,  2248,  -357,  1780,
    1016     1780,  1780,  -357,  1780,  -357,  1780,  1780,  -357,  -357,  -357,
    1017     -357,  -357,  -357,  -357,  -357,  -357,  -357,  -357,  -357,  1200,
    1018     -357,  -357,  -357,  2306,   832,   140,   -44,  -357,  -357,  -357,
    1019     -357,  1780,   849,  1780,  -357,   870,  1287,   118,  -357,  -357,
    1020     1780,   120,   930,   947,   990,  1011,   475,   501,   107,   108,
    1021      116,   117,   121,   124,   126,   -45,   -42,   -40,   -36,   -23,
    1022     1026,  -357,  -357,  -357,  -357,  1043,  -357,  1088,   138,  2248,
    1023      -79,  -112,  -357,  1780,  -357,  1780,  1780,  -357,  1780,  -357,
    1024     -357,  -357,  -357,  -357,  -357,  -357,  -357,  -357,  -357,  -357,
    1025     -357,  -357,  -357,  -357,  1780,  1780,   134,  -357,  -357,   146,
    1026      131,  -357,   129,  1103,  1131,  1179,  1196,  1244,  1272,  -112,
    1027      139,   133,  1780,  -357,  -357,  -357,  -357,  -357,  -357,  -357,
    1028     -357,   146,  -357,   -74,  -357,  -357
     993    -359,   303,  -359,  -115,  1827,  -359,  -359,  1887,  -107,  -359,
     994    -359,  -103,   -72,   -68,   -62,   -42,   -35,   -30,   -21,  1952,
     995    2012,  2077,  2137,   -90,  1827,  -104,  1827,    -3,  -359,  1827,
     996    -359,  -359,  -359,  -359,    50,    21,    53,  -359,  -359,    44,
     997      56,    63,    60,    64,  -359,   114,    85,  2202,   125,   125,
     998    1827,  1827,  -359,  1827,  1827,  -359,  -359,  -359,   108,  -359,
     999      -6,  -113,  1316,  1827,  1827,  -359,  1827,  -359,  -125,  -359,
     1000    2262,  -359,  -359,  -359,  -359,   110,  -359,  1827,  -359,  -359,
     1001    1827,  -359,  -359,  -359,  -359,  -359,  -359,  -359,  -359,  -359,
     1002     111,  -107,   113,   116,   117,   119,  -359,    18,   120,  1827,
     1003     115,  1316,   139,  2327,  1827,  1827,  1827,  1827,  1827,  1827,
     1004    1827,  1452,  1827,   127,  1512,   206,  1827,   404,  1577,   425,
     1005     129,  -359,   134,   135,  -359,    24,  1637,  1316,   -54,  1827,
     1006    -359,  -359,  -359,  -359,   143,  1827,   148,  1702,  1887,  1316,
     1007     138,  -359,  -359,    18,  -100,  -137,    10,  -359,  1827,  1762,
     1008    -359,  1827,  1827,  1827,  -359,  1827,  -359,  1827,  1827,  1827,
     1009    1827,  1827,  1827,  1827,  1827,  1827,    87,   529,   134,  -359,
     1010    1827,  -359,  -359,  1827,   161,  1827,    66,  1316,  1827,  1827,
     1011    1512,  1827,  1577,  1827,   544,  -359,  1827,   580,   140,   597,
     1012     625,   686,   105,   324,   701,   341,  -359,  -116,   739,  -359,
     1013    -106,   767,  -359,   -98,  -359,  -359,   -76,   -66,   -64,   -60,
     1014     -48,   -46,  -359,    22,   -40,   167,  -359,   784,  1827,   170,
     1015     799,  -359,  -359,   -88,   141,  -359,  -359,  -359,  -359,  -359,
     1016     -87,  1316,  1356,  1550,  1550,   918,    57,    57,    18,   370,
     1017       2,  1371,    57,  -359,  1827,  -359,  -359,  1827,   451,   438,
     1018    1827,    92,  2327,   544,   739,   -85,   767,   -84,   438,  -359,
     1019     843,  -359,  2327,  -359,  1827,  1827,  1827,  -359,  1827,  -359,
     1020    1827,  1827,  -359,  -359,  -359,  -359,  -359,  -359,  -359,  -359,
     1021    -359,  -359,  -359,  -359,   510,  -359,  -359,  -359,  2387,   858,
     1022     171,   -51,  -359,  -359,  -359,  -359,  1827,   881,   881,  1827,
     1023    -359,   941,  1316,   144,  -359,  -359,  1827,   146,   956,  1000,
     1024    1023,  1040,   483,   512,   147,   150,   152,   153,   159,   162,
     1025     163,   -28,   -26,   -24,    28,    45,  1055,  -359,  -359,  -359,
     1026    -359,  1098,  -359,  -359,  1113,   151,  2327,   -74,  -110,  -359,
     1027    1827,  -359,  1827,  1827,  -359,  1827,  -359,  -359,  -359,  -359,
     1028    -359,  -359,  -359,  -359,  -359,  -359,  -359,  -359,  -359,  -359,
     1029    -359,  1827,  1827,   168,  -359,  -359,   198,   169,  -359,   175,
     1030    1142,  1197,  1214,  1255,  1284,  1301,  -110,   174,   178,  1827,
     1031    -359,  -359,  -359,  -359,  -359,  -359,  -359,  -359,   198,  -359,
     1032     -71,  -359,  -359
    10291033};
    10301034
     
    10321036static const yytype_int16 yypgoto[] =
    10331037{
    1034     -357,  -357,  -357,  -357,  -357,  -357,  -357,   190,    -1,    24,
    1035     -357,  -357,   -12,  -357,  -357,   254,   236,   114,  -231,  -357,
    1036     -356,   -95,   -81,   123,    12,  -357,  -357,  -357,  -357,  -357,
    1037     -357,  -357,  -357,  -357,  -357,  -357,  -357,  -357,  -357,  -357,
    1038     -357,  -357,  -357,  -357
     1038    -359,  -359,  -359,  -359,  -359,  -359,  -359,   194,    -1,    25,
     1039    -359,  -359,  -359,  -205,  -359,  -359,   319,   282,   179,  -251,
     1040    -359,  -358,   -58,   -41,   160,     1,  -359,  -359,  -359,  -359,
     1041    -359,  -359,  -359,  -359,  -359,  -359,  -359,  -359,  -359,  -359,
     1042    -359,  -359,  -359,  -359,  -359
    10391043};
    10401044
     
    10431047   number is the opposite.  If zero, do what YYDEFACT says.
    10441048   If YYTABLE_NINF, syntax error.  */
    1045 #define YYTABLE_NINF -151
     1049#define YYTABLE_NINF -153
    10461050static const yytype_int16 yytable[] =
    10471051{
    1048       60,   145,   358,   370,   221,   121,   148,   148,   118,   119,
    1049      165,   149,   150,    68,   222,   151,   297,   152,   153,   166,
    1050      167,   147,    87,   120,   151,   370,   301,   153,    95,   145,
    1051      148,    99,   145,   359,   122,   148,   211,   212,   174,   273,
    1052      148,   148,   268,    99,    99,    99,    99,   270,   272,   141,
    1053       99,   101,   148,   125,   148,   148,   102,   148,    68,   287,
    1054      148,   289,   298,   164,   299,   148,   128,   357,   323,   103,
    1055      136,   144,   385,   140,   324,   101,   274,   143,   104,   145,
    1056      175,   275,   176,   276,   177,   277,   163,   149,   150,   178,
    1057      278,   151,    99,   152,   153,   179,   281,   105,   356,    99,
    1058      102,   347,   173,   105,   348,   106,   349,   106,   193,   108,
    1059      350,   196,   149,   150,   107,   199,   151,   108,   152,   153,
    1060      109,   180,   109,   351,   124,   183,   185,   186,   187,   188,
    1061      189,   190,   191,   219,   194,   146,   210,   151,   197,   154,
    1062      153,   155,   156,   157,   158,   226,   159,   261,    99,   160,
    1063      161,   213,   126,   158,   262,   162,   216,  -130,  -130,    99,
    1064      279,   138,   139,   146,   162,   127,   146,   280,   129,    99,
    1065      130,   131,   227,   228,   229,   250,   230,   252,   231,   232,
    1066      233,   234,   235,   236,   237,   238,    99,   132,   133,   134,
    1067       99,    30,   171,   244,   145,    99,   174,    98,   248,   249,
    1068      175,   251,   151,   253,   176,   153,   255,  -131,  -131,   111,
    1069      113,   115,   117,   146,   177,   154,   123,   155,   156,   157,
    1070      158,   145,   159,   178,   179,   160,   161,   181,   200,   148,
    1071      215,   162,   223,   201,   217,   166,   257,   282,   284,   240,
    1072      154,   288,   155,   156,   157,   158,   151,   159,   285,   153,
    1073      160,   161,   322,   340,   341,   241,   162,   329,   170,   331,
    1074      358,   100,   342,   343,   292,   172,   158,   344,   159,   295,
    1075      345,   296,   346,   369,   355,   373,   372,   162,   381,   382,
    1076      326,   296,   137,   302,   303,   304,   384,   305,   380,   306,
    1077      307,   314,     0,     0,     0,   247,     2,     3,     0,   330,
    1078        0,     0,     0,     0,     4,     0,     0,   320,     0,     5,
    1079        6,     7,     8,  -107,   209,   325,     9,   327,     0,   245,
    1080      149,   150,  -107,  -107,   151,    98,   152,   153,   146,     0,
    1081      157,   158,     0,   159,     0,   224,    10,   149,   150,     0,
    1082     -109,   151,   162,   152,   153,     0,     0,     0,     0,  -109,
    1083     -109,     0,   239,   296,     0,   146,   243,   363,   145,   364,
    1084      365,   246,   366,   149,   150,     0,     0,   151,     0,   152,
    1085      153,   383,   155,   156,   157,   158,     0,   159,   367,   368,
    1086        0,   161,     0,     0,   145,     0,   162,    11,    12,    13,
    1087       14,    15,    16,    17,    18,    19,    20,    21,    22,    23,
    1088       24,    25,    26,     0,    27,    28,    29,    30,     0,    31,
    1089       32,    33,    34,    35,    36,    37,    38,    39,    40,    41,
    1090       42,    43,    44,    45,    46,    47,     0,    48,   145,     0,
    1091       49,     0,    50,   149,   150,     0,    51,   151,     0,   152,
    1092      153,    52,     0,     0,    53,     0,     0,     0,   154,     0,
    1093      155,   156,   157,   158,   145,   159,   263,     0,   160,   161,
    1094      145,     0,     0,   264,   162,   154,     0,   155,   156,   157,
    1095      158,   145,   159,   266,     0,   160,   161,  -102,   149,   150,
    1096      267,   162,   151,     0,   152,   153,  -102,  -102,     0,     0,
    1097        0,   154,   146,   155,   156,   157,   158,   290,   159,   291,
    1098        0,   160,   161,  -103,   149,   150,     0,   162,   151,     0,
    1099      152,   153,  -103,  -103,     0,     0,     0,     0,   146,     0,
    1100        0,   149,   150,     0,     0,   151,     0,   152,   153,     0,
    1101        0,     0,     0,     0,     0,     0,     0,     0,   149,   150,
    1102        0,     0,   151,     0,   152,   153,     0,  -104,     0,     0,
    1103        0,     0,     0,     0,     0,     0,  -104,  -104,     0,     0,
    1104        0,   154,   146,   155,   156,   157,   158,     0,   159,   293,
    1105        0,   160,   161,  -105,   149,   150,   294,   162,   151,   165,
    1106      152,   153,  -105,  -105,     0,     0,     0,     0,   146,  -150,
    1107     -108,   149,   150,     0,   146,   151,     0,   152,   153,  -108,
    1108     -108,     0,     0,     0,     0,   146,   154,     0,   155,   156,
    1109      157,   158,     0,   159,   336,     0,   160,   161,     0,   149,
    1110      150,   337,   162,   151,     0,   152,   153,     0,     0,     0,
    1111        0,     0,   154,     0,   155,   156,   157,   158,     0,   159,
    1112      338,     0,   160,   161,     0,     0,     0,   339,   162,   154,
    1113        0,   155,   156,   157,   158,     0,   159,     0,     0,   160,
    1114      161,     0,     0,     0,   254,   162,   154,     0,   155,   156,
    1115      157,   158,     0,   159,     0,     0,   160,   161,     0,   149,
    1116      150,   256,   162,   151,     0,   152,   153,     0,     0,     0,
    1117        0,     0,     0,     0,   149,   150,     0,     0,   151,     0,
    1118      152,   153,   154,     0,   155,   156,   157,   158,     0,   159,
    1119        0,     0,   160,   161,     0,     0,     0,   258,   162,   154,
    1120        0,   155,   156,   157,   158,     0,   159,   259,     0,   160,
    1121      161,     0,   149,   150,     0,   162,   151,     0,   152,   153,
    1122        0,     0,     0,     0,     0,     0,     0,   154,     0,   155,
    1123      156,   157,   158,     0,   159,   260,     0,   160,   161,     0,
    1124      149,   150,     0,   162,   151,     0,   152,   153,     0,     0,
    1125        0,     0,     0,     0,     0,   149,   150,     0,     0,   151,
    1126        0,   152,   153,     0,     0,     0,     0,     0,     0,     0,
    1127        0,     0,   149,   150,     0,     0,   151,     0,   152,   153,
    1128        0,     0,     0,     0,     0,     0,     0,   154,     0,   155,
    1129      156,   157,   158,     0,   159,   265,     0,   160,   161,     0,
    1130        0,     0,   154,   162,   155,   156,   157,   158,     0,   159,
    1131        0,     0,   160,   161,     0,   149,   150,   269,   162,   151,
    1132        0,   152,   153,     0,     0,     0,     0,     0,     0,     0,
    1133        0,     0,   149,   150,     0,     0,   151,     0,   152,   153,
    1134      154,     0,   155,   156,   157,   158,     0,   159,     0,     0,
    1135      160,   161,     0,   149,   150,   271,   162,   151,     0,   152,
    1136      153,     0,     0,     0,     0,     0,     0,     0,   154,     0,
    1137      155,   156,   157,   158,     0,   159,   283,     0,   160,   161,
    1138        0,     0,     0,   154,   162,   155,   156,   157,   158,     0,
    1139      159,     0,     0,   160,   161,     0,     0,     0,   286,   162,
    1140      154,     0,   155,   156,   157,   158,     0,   159,   300,     0,
    1141      160,   161,     0,   149,   150,     0,   162,   151,     0,   152,
    1142      153,     0,     0,     0,     0,     0,     0,     0,     0,     0,
    1143      149,   150,     0,     0,   151,     0,   152,   153,     0,     0,
    1144        0,     0,     0,   154,     0,   155,   156,   157,   158,     0,
    1145      159,     0,     0,   160,   161,     0,     0,     0,   321,   162,
    1146      154,     0,   155,   156,   157,   158,     0,   159,     0,     0,
    1147      160,   161,     0,   149,   150,   241,   162,   151,     0,   152,
    1148      153,   154,     0,   155,   156,   157,   158,   328,   159,     0,
    1149        0,   160,   161,     0,   149,   150,     0,   162,   151,     0,
    1150      152,   153,     0,     0,     0,     0,     0,     0,     0,   149,
    1151      150,     0,     0,   151,     0,   152,   153,     0,     0,     0,
    1152        0,     0,     0,     0,     0,     0,   149,   150,     0,     0,
    1153      151,     0,   152,   153,     0,     0,     0,     0,     0,     0,
    1154        0,   154,     0,   155,   156,   157,   158,   151,   159,     0,
    1155      153,   160,   161,     0,     0,     0,   332,   162,   154,     0,
    1156      155,   156,   157,   158,     0,   159,   333,     0,   160,   161,
    1157        0,   149,   150,     0,   162,   151,     0,   152,   153,     0,
    1158        0,     0,     0,     0,     0,     0,   149,   150,     0,     0,
    1159      151,     0,   152,   153,     0,     0,     0,     0,     0,     0,
    1160        0,   154,     0,   155,   156,   157,   158,     0,   159,     0,
    1161        0,   160,   161,     0,   149,   150,   334,   162,   151,     0,
    1162      152,   153,   154,     0,   155,   156,   157,   158,     0,   159,
    1163      335,     0,   160,   161,     0,     0,     0,   154,   162,   155,
    1164      156,   157,   158,     0,   159,     0,     0,   160,   161,     0,
    1165        0,     0,   352,   162,   154,     0,   155,   156,   157,   158,
    1166      353,   159,   149,   150,   160,   161,   151,     0,   152,   153,
    1167      162,   154,     0,   155,   156,   157,   158,     0,   159,   149,
    1168      150,     0,   161,   151,     0,   152,   153,   162,     0,     0,
    1169        0,     0,     0,     5,     6,   308,   309,     0,     0,   154,
    1170        9,   155,   156,   157,   158,     0,   159,   354,     0,   160,
    1171      161,     0,     0,     0,   154,   162,   155,   156,   157,   158,
    1172        0,   159,     0,     0,   160,   161,     0,   149,   150,   374,
    1173      162,   151,     0,   152,   153,     0,     0,     0,     0,     0,
    1174        0,     0,   154,     0,   155,   156,   157,   158,     0,   159,
    1175        0,     0,   160,   161,     0,   149,   150,   375,   162,   151,
    1176        0,   152,   153,     0,     0,     0,     0,     0,     0,     0,
    1177      149,   150,     0,     0,   151,     0,   152,   153,     0,   310,
    1178      311,   312,   313,     0,     0,     0,     0,     0,     0,     0,
    1179      154,     0,   155,   156,   157,   158,     0,   159,     0,     0,
    1180      160,   161,     0,     0,     0,   376,   162,   154,     0,   155,
    1181      156,   157,   158,     0,   159,     0,     0,   160,   161,     0,
    1182     -151,   150,   377,   162,   151,     0,   152,   153,     0,     0,
    1183        0,     0,     0,     0,     0,     0,   150,     0,     0,   151,
    1184        0,   152,   153,     0,     0,     0,     0,     0,     0,     0,
    1185        0,     0,     0,     0,     0,   154,     0,   155,   156,   157,
    1186      158,     0,   159,     0,     0,   160,   161,     0,     0,     0,
    1187      378,   162,     0,     0,     0,     0,     0,     0,     0,     0,
    1188        0,     0,     0,   154,     0,   155,   156,   157,   158,   379,
    1189      159,     0,     0,   160,   161,     0,     0,     0,   154,   162,
    1190      155,   156,   157,   158,     0,   159,     0,     0,   160,   161,
    1191        4,     0,     0,     0,   162,     5,     6,    88,    89,     0,
     1052      61,   303,    70,   151,   365,   148,   169,   123,   377,   154,
     1053     226,   307,   156,   152,   153,   170,   171,   154,   150,   155,
     1054     156,   120,   121,   122,   151,   154,    89,   151,   156,    97,
     1055     377,   273,   101,   148,   151,   148,   366,   124,   225,   103,
     1056     151,   275,   151,   104,   101,   101,   101,   101,    70,   277,
     1057     144,   101,   151,   151,   127,   151,   151,   215,   216,   292,
     1058     294,   329,   304,   305,   154,   168,   151,   156,   330,   151,
     1059     178,   278,   139,   364,   105,   143,   392,   148,   106,   146,
     1060     103,   279,   179,   280,   107,   363,   180,   281,   166,   167,
     1061     152,   153,   332,   333,   154,   101,   155,   156,   181,   282,
     1062     182,   283,   101,   148,   108,   177,   183,   286,   152,   153,
     1063     197,   109,   154,   200,   155,   156,   110,   203,   104,   354,
     1064     107,   355,   108,   356,   184,   111,   148,   214,   187,   189,
     1065     190,   191,   192,   193,   194,   195,   223,   198,   148,   161,
     1066     149,   201,   157,   126,   158,   159,   160,   161,   230,   162,
     1067     165,   101,   163,   164,   217,   161,   131,   162,   165,   227,
     1068     220,   128,   284,   101,  -132,  -132,   165,   129,   149,   285,
     1069     149,   134,   148,   101,   110,   357,   231,   232,   233,   255,
     1070     234,   257,   235,   236,   237,   238,   239,   240,   241,   242,
     1071     101,   111,   358,   160,   161,   101,   162,   169,   249,   130,
     1072     101,   100,   132,   253,   254,   165,   256,  -152,   258,   133,
     1073     135,   260,   149,   113,   115,   117,   119,   148,   244,   157,
     1074     125,   158,   159,   160,   161,   136,   162,   141,   142,   163,
     1075     164,   137,  -133,  -133,   245,   165,    30,   157,   149,   158,
     1076     159,   160,   161,   289,   162,   266,  -111,   163,   164,   147,
     1077     175,   185,   267,   165,   219,  -111,  -111,   178,  -104,   179,
     1078     221,   149,   180,   181,   174,   182,   183,  -104,  -104,   297,
     1079     204,   176,   298,   149,   151,   301,   205,   302,   170,   287,
     1080     262,   290,   293,   328,   336,   320,   338,   302,   362,   308,
     1081     309,   310,  -109,   311,   347,   312,   313,   348,   250,   349,
     1082     350,  -109,  -109,     2,     3,   337,   351,   149,   376,   352,
     1083     353,     4,   365,   326,   388,   379,     5,     6,     7,     8,
     1084     213,   331,   380,     9,   334,   389,   102,   152,   153,   140,
     1085     391,   154,   100,   155,   156,   387,   252,  -105,     0,     0,
     1086       0,     0,   228,    10,   152,   153,  -105,  -105,   154,     0,
     1087     155,   156,   149,     0,     0,     0,     0,     0,     0,   243,
     1088       0,   302,     0,     0,   248,   370,     0,   371,   372,   251,
     1089     373,     0,     0,   152,   153,     0,     0,   154,   390,   155,
     1090     156,     0,     0,     0,     0,     0,   374,   375,     0,     0,
     1091       0,     0,     0,     0,    11,    12,    13,    14,    15,    16,
     1092      17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
     1093       0,    27,    28,    29,    30,   148,    31,    32,    33,    34,
     1094      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
     1095      45,    46,    47,    48,     0,    49,   148,     0,    50,     0,
     1096      51,   152,   153,     0,    52,   154,     0,   155,   156,    53,
     1097       0,     0,    54,     0,     0,     0,   157,     0,   158,   159,
     1098     160,   161,   148,   162,   268,     0,   163,   164,     0,     0,
     1099       0,   269,   165,   157,     0,   158,   159,   160,   161,     0,
     1100     162,   271,     0,   163,   164,     0,   152,   153,   272,   165,
     1101     154,     0,   155,   156,     0,     0,     0,     0,     0,     0,
     1102       0,     0,   157,     0,   158,   159,   160,   161,   295,   162,
     1103     296,     0,   163,   164,     0,   152,   153,     0,   165,   154,
     1104       0,   155,   156,     5,     6,   314,   315,     0,     0,     0,
     1105       9,     0,   152,   153,     0,  -106,   154,     0,   155,   156,
     1106       0,     0,     0,     0,  -106,  -106,     0,   152,   153,     0,
     1107     149,   154,     0,   155,   156,     0,  -107,     0,     0,     0,
     1108       0,     0,     0,     0,     0,  -107,  -107,     0,     0,     0,
     1109     157,   149,   158,   159,   160,   161,     0,   162,   299,     0,
     1110     163,   164,  -110,   152,   153,   300,   165,   154,     0,   155,
     1111     156,  -110,  -110,     0,     0,     0,     0,   149,     0,     0,
     1112     152,   153,     0,     0,   154,     0,   155,   156,     0,   316,
     1113     317,   318,   319,     0,     0,   157,     0,   158,   159,   160,
     1114     161,     0,   162,   343,     0,   163,   164,     0,   152,   153,
     1115     344,   165,   154,     0,   155,   156,     0,     0,     0,     0,
     1116       0,     0,     0,     0,   157,     0,   158,   159,   160,   161,
     1117       0,   162,   345,     0,   163,   164,     0,     0,     0,   346,
     1118     165,   157,     0,   158,   159,   160,   161,     0,   162,   247,
     1119       0,   163,   164,     0,     0,     0,   157,   165,   158,   159,
     1120     160,   161,     0,   162,     0,     0,   163,   164,     0,   152,
     1121     153,   259,   165,   154,     0,   155,   156,     0,     0,     0,
     1122       0,     0,     0,     0,   152,   153,     0,     0,   154,     0,
     1123     155,   156,   157,     0,   158,   159,   160,   161,     0,   162,
     1124       0,     0,   163,   164,     0,     0,     0,   261,   165,   157,
     1125       0,   158,   159,   160,   161,     0,   162,     0,     0,   163,
     1126     164,     0,   152,   153,   263,   165,   154,     0,   155,   156,
     1127       0,     0,     0,     0,     0,     0,     0,   157,     0,   158,
     1128     159,   160,   161,     0,   162,   264,     0,   163,   164,     0,
     1129     152,   153,     0,   165,   154,     0,   155,   156,     0,     0,
     1130       0,     0,     0,     0,     0,     0,     0,   152,   153,     0,
     1131       0,   154,     0,   155,   156,     0,     0,     0,     0,     0,
     1132       0,     0,   152,   153,     0,     0,   154,     0,   155,   156,
     1133       0,     0,     0,     0,     0,     0,     0,     0,   157,     0,
     1134     158,   159,   160,   161,     0,   162,   265,     0,   163,   164,
     1135       0,     0,     0,   157,   165,   158,   159,   160,   161,     0,
     1136     162,   270,     0,   163,   164,     0,   152,   153,     0,   165,
     1137     154,     0,   155,   156,     0,     0,     0,     0,     0,     0,
     1138       0,   152,   153,     0,     0,   154,     0,   155,   156,     0,
     1139       0,   157,     0,   158,   159,   160,   161,     0,   162,     0,
     1140       0,   163,   164,     0,   152,   153,   274,   165,   154,     0,
     1141     155,   156,     0,     0,     0,     0,     0,     0,     0,   157,
     1142       0,   158,   159,   160,   161,     0,   162,     0,     0,   163,
     1143     164,     0,     0,     0,   276,   165,   157,     0,   158,   159,
     1144     160,   161,     0,   162,   288,   154,   163,   164,   156,     0,
     1145       0,   157,   165,   158,   159,   160,   161,     0,   162,     0,
     1146       0,   163,   164,     0,   152,   153,   291,   165,   154,     0,
     1147     155,   156,     0,     0,     0,     0,     0,     0,     0,   152,
     1148     153,     0,     0,   154,     0,   155,   156,     0,     0,     0,
     1149       0,     0,     0,     0,     0,   157,     0,   158,   159,   160,
     1150     161,     0,   162,   306,     0,   163,   164,     0,     0,     0,
     1151     157,   165,   158,   159,   160,   161,     0,   162,     0,     0,
     1152     163,   164,     0,   152,   153,   327,   165,   154,     0,   155,
     1153     156,     0,     0,   157,     0,   158,   159,   160,   161,     0,
     1154     162,     0,     0,   163,   164,     0,   152,   153,   245,   165,
     1155     154,     0,   155,   156,     0,     0,     0,     0,     0,     0,
     1156       0,     0,     0,   152,   153,     0,     0,   154,     0,   155,
     1157     156,     0,   158,   159,   160,   161,     0,   162,   152,   153,
     1158       0,   164,   154,     0,   155,   156,   165,     0,     0,     0,
     1159       0,     0,     0,   157,     0,   158,   159,   160,   161,   335,
     1160     162,     0,     0,   163,   164,     0,     0,     0,   157,   165,
     1161     158,   159,   160,   161,     0,   162,     0,     0,   163,   164,
     1162       0,   152,   153,   339,   165,   154,     0,   155,   156,     0,
     1163       0,     0,     0,     0,     0,     0,   152,   153,     0,     0,
     1164     154,     0,   155,   156,     0,     0,     0,     0,     0,     0,
     1165       0,     0,   157,     0,   158,   159,   160,   161,     0,   162,
     1166     340,     0,   163,   164,     0,   152,   153,     0,   165,   154,
     1167       0,   155,   156,     0,     0,   157,     0,   158,   159,   160,
     1168     161,     0,   162,     0,     0,   163,   164,     0,     0,     0,
     1169     341,   165,   157,     0,   158,   159,   160,   161,     0,   162,
     1170     342,     0,   163,   164,     0,     0,     0,   157,   165,   158,
     1171     159,   160,   161,     0,   162,     0,     0,   163,   164,     0,
     1172     152,   153,   359,   165,   154,     0,   155,   156,     0,     0,
     1173       0,     0,     0,     0,     0,     0,     0,   152,   153,     0,
     1174       0,   154,     0,   155,   156,     0,     0,     0,     0,     0,
     1175     157,     0,   158,   159,   160,   161,   360,   162,     0,     0,
     1176     163,   164,     0,     0,     0,   157,   165,   158,   159,   160,
     1177     161,     0,   162,   361,     0,   163,   164,     0,   152,   153,
     1178       0,   165,   154,     0,   155,   156,     0,     0,     0,     0,
     1179       0,     0,     0,     0,   157,     0,   158,   159,   160,   161,
     1180       0,   162,     0,     0,   163,   164,     0,   152,   153,   381,
     1181     165,   154,     0,   155,   156,     0,     0,     0,     0,     0,
     1182       0,     0,     0,     0,   152,   153,     0,     0,   154,     0,
     1183     155,   156,     0,     0,     0,     0,     0,     0,     0,   152,
     1184     153,     0,     0,   154,     0,   155,   156,     0,     0,   157,
     1185       0,   158,   159,   160,   161,     0,   162,     0,     0,   163,
     1186     164,     0,     0,     0,   382,   165,   157,     0,   158,   159,
     1187     160,   161,     0,   162,     0,     0,   163,   164,     0,  -153,
     1188     153,   383,   165,   154,     0,   155,   156,     0,     0,     0,
     1189       0,     0,     0,     0,     0,   153,     0,     0,   154,     0,
     1190     155,   156,     0,     0,     0,     0,     0,   157,     0,   158,
     1191     159,   160,   161,     0,   162,     0,     0,   163,   164,     0,
     1192       0,     0,   384,   165,     0,     0,     0,     0,     0,     0,
     1193       0,     0,     0,     0,     0,     0,   157,     0,   158,   159,
     1194     160,   161,     0,   162,     0,     0,   163,   164,     0,     0,
     1195       0,   385,   165,   157,     0,   158,   159,   160,   161,   386,
     1196     162,     0,     0,   163,   164,     0,     0,     0,   157,   165,
     1197     158,   159,   160,   161,     0,   162,     0,     0,   163,   164,
     1198       4,     0,     0,     0,   165,     5,     6,    90,    91,     0,
    11921199       0,     0,     9,     0,     0,     0,     0,     0,     0,     0,
    1193        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
    1194        0,     0,     0,     0,     0,     0,     0,     0,   154,     0,
    1195      155,   156,   157,   158,     0,   159,     0,     0,   160,   161,
    1196        0,     0,     0,   154,   162,   155,   156,   157,   158,     0,
    1197      159,     0,     0,     0,   161,     4,     0,     0,     0,   162,
    1198        5,     6,    88,    89,     0,     0,     0,     9,     0,     0,
     1200       0,     0,     0,     0,     0,     0,     0,     0,   157,     0,
     1201     158,   159,   160,   161,     0,   162,     0,     0,   163,   164,
     1202       0,     0,     0,   157,   165,   158,   159,   160,   161,     0,
     1203     162,     0,     0,     0,   164,     0,     0,     0,     0,   165,
     1204       4,     0,     0,     0,     0,     5,     6,    90,    91,     0,
     1205       0,     0,     9,     0,     0,     0,     0,     0,     0,     0,
    11991206       0,     0,     0,    11,    12,    13,    14,    15,    16,    17,
    1200       18,    90,    91,    92,    93,     0,     0,     0,     0,     0,
     1207      18,    92,    93,    94,    95,     0,     0,   154,     0,     0,
     1208     156,     0,     0,    30,     0,    31,    32,    33,     0,    35,
     1209      36,     0,     0,     0,    40,    41,     0,     0,     0,     0,
     1210       0,     0,    96,     0,     0,     4,     0,    50,     0,    51,
     1211       5,     6,    90,    91,     0,     0,     0,     9,    53,   196,
     1212       0,    54,     0,    11,    12,    13,    14,    15,    16,    17,
     1213      18,    92,    93,    94,    95,     0,     0,     0,     0,     0,
    12011214       0,     0,     0,    30,     0,    31,    32,    33,     0,    35,
    1202        0,     0,     0,    39,    40,     0,     0,     0,     0,     0,
    1203        0,    94,     0,     0,     4,     0,    49,     0,    50,     5,
    1204        6,    88,    89,     0,     0,     0,     9,    52,   192,     0,
    1205       53,     0,     0,     0,     0,     0,     0,     0,    11,    12,
    1206       13,    14,    15,    16,    17,    18,    90,    91,    92,    93,
     1215      36,     0,     0,     0,    40,    41,     0,     0,     0,     0,
     1216       0,     0,    96,     0,     0,     4,     0,    50,     0,    51,
     1217       5,     6,   206,   207,     0,     0,     0,     9,    53,   199,
     1218       0,    54,     0,     0,     0,     0,     0,     0,    11,    12,
     1219      13,    14,    15,    16,    17,    18,    92,    93,    94,    95,
     1220       0,     0,   157,     0,   158,   159,   160,   161,    30,   162,
     1221      31,    32,    33,   164,    35,    36,     0,     0,   165,    40,
     1222      41,     0,     0,     0,     0,     0,     0,    96,     0,     0,
     1223       4,     0,    50,     0,    51,     5,     6,    90,    91,     0,
     1224       0,     0,     9,    53,   202,     0,    54,     0,    11,    12,
     1225      13,    14,    15,    16,    17,    18,   208,   209,   210,   211,
    12071226       0,     0,     0,     0,     0,     0,     0,     0,    30,     0,
    1208       31,    32,    33,     0,    35,     0,     0,     0,    39,    40,
    1209        0,     0,     4,     0,     0,     0,    94,     5,     6,   202,
    1210      203,    49,     0,    50,     9,     0,     0,     0,     0,     0,
    1211        0,     0,    52,   195,     0,    53,     0,    11,    12,    13,
    1212       14,    15,    16,    17,    18,    90,    91,    92,    93,     0,
    1213        0,     0,     0,     0,     0,     0,     0,    30,     0,    31,
    1214       32,    33,     0,    35,     0,     0,     0,    39,    40,     0,
    1215        0,     4,     0,     0,     0,    94,     5,     6,    88,    89,
    1216       49,     0,    50,     9,     0,     0,     0,     0,     0,     0,
    1217        0,    52,   198,     0,    53,    11,    12,    13,    14,    15,
    1218       16,    17,    18,   204,   205,   206,   207,     0,     0,     0,
    1219        0,     0,     0,     0,     0,    30,     0,    31,    32,    33,
    1220        0,    35,     0,     0,     0,    39,    40,     0,     0,     4,
    1221        0,     0,     0,    94,     5,     6,    88,    89,    49,     0,
    1222       50,     9,     0,     0,     0,     0,     0,     0,     0,    52,
    1223      208,     0,    53,     0,    11,    12,    13,    14,    15,    16,
    1224       17,    18,    90,    91,    92,    93,     0,     0,     0,     0,
    1225        0,     0,     0,     0,    30,     0,    31,    32,    33,     0,
    1226       35,     0,     0,     0,    39,    40,     0,     0,     4,     0,
    1227        0,     0,    94,     5,     6,    88,    89,    49,     0,    50,
    1228        9,     0,     0,     0,     0,     0,     0,     0,    52,   218,
    1229        0,    53,    11,    12,    13,    14,    15,    16,    17,    18,
    1230       90,    91,    92,    93,     0,     0,     0,     0,     0,     0,
    1231        0,     0,    30,     0,    31,    32,    33,     0,    35,     0,
    1232        0,     0,    39,    40,     0,     0,     4,     0,     0,     0,
    1233       94,     5,     6,    88,    89,    49,     0,    50,     9,     0,
    1234        0,     0,     0,     0,     0,     0,    52,   225,     0,    53,
    1235        0,    11,    12,    13,    14,    15,    16,    17,    18,    90,
    1236       91,    92,    93,     0,     0,     0,     0,     0,     0,     0,
    1237        0,    30,     0,    31,    32,    33,     0,    35,     0,     0,
    1238        0,    39,    40,     0,     0,     4,     0,     0,     0,    94,
    1239        5,     6,    88,    89,    49,     0,    50,     9,     0,     0,
    1240        0,     0,     0,     0,     0,    52,     0,     0,    53,    11,
    1241       12,    13,    14,    15,    16,    17,    18,    90,    91,    92,
    1242       93,     0,     0,     0,     0,     0,     0,     0,     0,    30,
    1243        0,    31,    32,    33,     0,    35,     0,     0,     0,    39,
    1244       40,     0,     0,     4,     0,     0,     0,    94,     5,     6,
    1245       88,    89,    49,     0,    50,     9,     0,     0,     0,     0,
    1246        0,     0,     0,    97,     0,     0,    53,     0,    11,    12,
    1247       13,    14,    15,    16,    17,    18,    90,    91,    92,    93,
     1227      31,    32,    33,     0,    35,    36,     0,     0,     0,    40,
     1228      41,     0,     0,     0,     0,     0,     0,    96,     0,     0,
     1229       4,     0,    50,     0,    51,     5,     6,    90,    91,     0,
     1230       0,     0,     9,    53,   212,     0,    54,     0,     0,     0,
     1231       0,     0,     0,    11,    12,    13,    14,    15,    16,    17,
     1232      18,    92,    93,    94,    95,     0,     0,     0,     0,     0,
     1233       0,     0,     0,    30,     0,    31,    32,    33,     0,    35,
     1234      36,     0,     0,     0,    40,    41,     0,     0,     0,     0,
     1235       0,     0,    96,     0,     0,     4,     0,    50,     0,    51,
     1236       5,     6,    90,    91,     0,     0,     0,     9,    53,   222,
     1237       0,    54,     0,    11,    12,    13,    14,    15,    16,    17,
     1238      18,    92,    93,    94,    95,     0,     0,     0,     0,     0,
     1239       0,     0,     0,    30,     0,    31,    32,    33,     0,    35,
     1240      36,     0,     0,     0,    40,    41,     0,     0,     0,     0,
     1241       0,     0,    96,     0,     0,     4,     0,    50,     0,    51,
     1242       5,     6,    90,    91,     0,     0,     0,     9,    53,   229,
     1243       0,    54,     0,     0,     0,     0,     0,     0,    11,    12,
     1244      13,    14,    15,    16,    17,    18,    92,    93,    94,    95,
    12481245       0,     0,     0,     0,     0,     0,     0,     0,    30,     0,
    1249       31,    32,    33,     0,    35,     0,     0,     0,    39,    40,
    1250        0,     0,     4,     0,     0,     0,    94,     5,     6,    88,
    1251       89,    49,     0,    50,     9,     0,     0,     0,     0,     0,
    1252        0,     0,   110,     0,     0,    53,    11,    12,    13,    14,
    1253       15,    16,    17,    18,    90,    91,    92,    93,     0,     0,
    1254        0,     0,     0,     0,     0,     0,    30,     0,    31,    32,
    1255       33,     0,    35,     0,     0,     0,    39,    40,     0,     0,
    1256        4,     0,     0,     0,    94,     5,     6,    88,    89,    49,
    1257        0,    50,     9,     0,     0,     0,     0,     0,     0,     0,
    1258      112,     0,     0,    53,     0,    11,    12,    13,    14,    15,
    1259       16,    17,    18,    90,    91,    92,    93,     0,     0,     0,
    1260        0,     0,     0,     0,     0,    30,     0,    31,    32,    33,
    1261        0,    35,     0,     0,     0,    39,    40,     0,     0,     4,
    1262        0,     0,     0,    94,     5,     6,   135,    89,    49,     0,
    1263       50,     9,     0,     0,     0,     0,     0,     0,     0,   114,
    1264        0,     0,    53,    11,    12,    13,    14,    15,    16,    17,
    1265       18,    90,    91,    92,    93,     0,     0,     0,     0,     0,
     1246      31,    32,    33,     0,    35,    36,     0,     0,     0,    40,
     1247      41,     0,     0,     0,     0,     0,     0,    96,     0,     0,
     1248       4,     0,    50,     0,    51,     5,     6,    90,    91,     0,
     1249       0,     0,     9,    53,     0,     0,    54,     0,    11,    12,
     1250      13,    14,    15,    16,    17,    18,    92,    93,    94,    95,
     1251       0,     0,     0,     0,     0,     0,     0,     0,    30,     0,
     1252      31,    32,    33,     0,    35,    36,     0,     0,     0,    40,
     1253      41,     0,     0,     0,     0,     0,     0,    96,     0,     0,
     1254       4,     0,    50,     0,    51,     5,     6,    90,    91,     0,
     1255       0,     0,     9,    99,     0,     0,    54,     0,     0,     0,
     1256       0,     0,     0,    11,    12,    13,    14,    15,    16,    17,
     1257      18,    92,    93,    94,    95,     0,     0,     0,     0,     0,
    12661258       0,     0,     0,    30,     0,    31,    32,    33,     0,    35,
    1267        0,     0,     0,    39,    40,     0,     0,     4,     0,     0,
    1268        0,    94,     5,     6,    88,    89,    49,     0,    50,     9,
    1269        0,     0,     0,     0,     0,     0,     0,   116,     0,     0,
    1270       53,     0,    11,    12,    13,    14,    15,    16,    17,    18,
    1271       19,    20,    21,    22,     0,     0,     0,     0,     0,     0,
    1272        0,     0,    30,     0,    31,    32,    33,     0,    35,     0,
    1273        0,     0,    39,    40,     0,     0,     4,     0,     0,     0,
    1274       94,     5,     6,    88,    89,    49,     0,    50,     9,     0,
    1275        0,     0,     0,     0,     0,     0,    52,     0,     0,    53,
    1276       11,    12,    13,    14,    15,    16,    17,    18,    90,    91,
    1277       92,    93,     0,     0,     0,     0,     0,     0,     0,     0,
    1278       30,     0,    31,    32,    33,     0,    35,     0,     0,     0,
    1279       39,    40,     0,     0,     4,     0,     0,     0,    94,     5,
    1280        6,    88,    89,    49,     0,    50,     9,     0,     0,     0,
    1281        0,     0,     0,     0,   169,     0,     0,    53,     0,    11,
    1282       12,    13,    14,    15,    16,    17,    18,    90,    91,    92,
    1283       93,     0,     0,     0,     0,     0,     0,     0,     0,    30,
    1284        0,    31,    32,    33,     0,    35,     0,     0,     0,    39,
    1285       40,     0,     0,     0,     0,     0,     0,    94,     0,     0,
    1286        0,     0,    49,     0,    50,     0,     0,     0,     0,     0,
    1287        0,     0,     0,   182,     0,     0,    53,   315,    12,    13,
    1288      316,   317,    16,   318,   319,    90,    91,    92,    93,     0,
    1289        0,     0,     0,     0,     0,     0,     0,    30,     0,    31,
    1290       32,    33,     0,    35,     0,     0,     0,    39,    40,     0,
    1291        0,     0,     0,     0,     0,    94,     0,     0,     0,     0,
    1292       49,     0,    50,     0,     0,     0,     0,     0,     0,     0,
    1293        0,    52,     0,     0,    53
     1259      36,     0,     0,     0,    40,    41,     0,     0,     0,     0,
     1260       0,     0,    96,     0,     0,     4,     0,    50,     0,    51,
     1261       5,     6,    90,    91,     0,     0,     0,     9,   112,     0,
     1262       0,    54,     0,    11,    12,    13,    14,    15,    16,    17,
     1263      18,    92,    93,    94,    95,     0,     0,     0,     0,     0,
     1264       0,     0,     0,    30,     0,    31,    32,    33,     0,    35,
     1265      36,     0,     0,     0,    40,    41,     0,     0,     0,     0,
     1266       0,     0,    96,     0,     0,     4,     0,    50,     0,    51,
     1267       5,     6,    90,    91,     0,     0,     0,     9,   114,     0,
     1268       0,    54,     0,     0,     0,     0,     0,     0,    11,    12,
     1269      13,    14,    15,    16,    17,    18,    92,    93,    94,    95,
     1270       0,     0,     0,     0,     0,     0,     0,     0,    30,     0,
     1271      31,    32,    33,     0,    35,    36,     0,     0,     0,    40,
     1272      41,     0,     0,     0,     0,     0,     0,    96,     0,     0,
     1273       4,     0,    50,     0,    51,     5,     6,   138,    91,     0,
     1274       0,     0,     9,   116,     0,     0,    54,     0,    11,    12,
     1275      13,    14,    15,    16,    17,    18,    92,    93,    94,    95,
     1276       0,     0,     0,     0,     0,     0,     0,     0,    30,     0,
     1277      31,    32,    33,     0,    35,    36,     0,     0,     0,    40,
     1278      41,     0,     0,     0,     0,     0,     0,    96,     0,     0,
     1279       4,     0,    50,     0,    51,     5,     6,    90,    91,     0,
     1280       0,     0,     9,   118,     0,     0,    54,     0,     0,     0,
     1281       0,     0,     0,    11,    12,    13,    14,    15,    16,    17,
     1282      18,    19,    20,    21,    22,     0,     0,     0,     0,     0,
     1283       0,     0,     0,    30,     0,    31,    32,    33,     0,    35,
     1284      36,     0,     0,     0,    40,    41,     0,     0,     0,     0,
     1285       0,     0,    96,     0,     0,     4,     0,    50,     0,    51,
     1286       5,     6,    90,    91,     0,     0,     0,     9,    53,     0,
     1287       0,    54,     0,    11,    12,    13,    14,    15,    16,    17,
     1288      18,    92,    93,    94,    95,     0,     0,     0,     0,     0,
     1289       0,     0,     0,    30,     0,    31,    32,    33,     0,    35,
     1290      36,     0,     0,     0,    40,    41,     0,     0,     0,     0,
     1291       0,     0,    96,     0,     0,     4,     0,    50,     0,    51,
     1292       5,     6,    90,    91,     0,     0,     0,     9,   173,     0,
     1293       0,    54,     0,     0,     0,     0,     0,     0,    11,    12,
     1294      13,    14,    15,    16,    17,    18,    92,    93,    94,    95,
     1295       0,     0,     0,     0,     0,     0,     0,     0,    30,     0,
     1296      31,    32,    33,     0,    35,    36,     0,     0,     0,    40,
     1297      41,     0,     0,     0,     0,     0,     0,    96,     0,     0,
     1298       0,     0,    50,     0,    51,     0,     0,     0,     0,     0,
     1299       0,     0,     0,   186,     0,     0,    54,     0,   321,    12,
     1300      13,   322,   323,    16,   324,   325,    92,    93,    94,    95,
     1301       0,     0,     0,     0,     0,     0,     0,     0,    30,     0,
     1302      31,    32,    33,     0,    35,    36,     0,     0,     0,    40,
     1303      41,     0,     0,     0,     0,     0,     0,    96,     0,     0,
     1304       0,     0,    50,     0,    51,     0,     0,     0,     0,     0,
     1305       0,     0,     0,    53,     0,     0,    54
    12941306};
    12951307
    12961308static const yytype_int16 yycheck[] =
    12971309{
    1298        1,    11,   114,   359,   137,   111,   139,   139,   111,   112,
    1299      130,     3,     4,     1,   146,     7,   247,     9,    10,   139,
    1300      140,   130,   140,    24,     7,   381,   257,    10,     4,    11,
    1301      139,     7,    11,   145,   140,   139,   111,   112,   145,   146,
    1302      139,   139,   146,    19,    20,    21,    22,   146,   146,    50,
    1303       26,   145,   139,    29,   139,   139,   145,   139,    46,   146,
    1304      139,   146,   146,    64,   146,   139,   112,   146,   112,   145,
    1305       46,   140,   146,    49,   118,   145,   146,    53,   145,    11,
    1306      145,   146,   145,   146,   145,   146,    62,     3,     4,   145,
    1307      146,     7,    68,     9,    10,   145,   146,   145,   329,    75,
    1308      145,   146,    78,   145,   146,   145,   146,   145,   109,   145,
    1309      146,   112,     3,     4,   145,   116,     7,   145,     9,    10,
    1310      145,    97,   145,   146,   145,   101,   102,   103,   104,   105,
    1311      106,   107,   108,   134,   110,   145,   124,     7,   114,   131,
    1312       10,   133,   134,   135,   136,   146,   138,   139,   124,   141,
    1313      142,   127,   111,   136,   146,   147,   132,   139,   140,   135,
    1314      139,    47,    48,   145,   147,   145,   145,   146,   145,   145,
    1315      145,   111,   148,   149,   150,   176,   152,   178,   154,   155,
    1316      156,   157,   158,   159,   160,   161,   162,   145,   111,   145,
    1317      166,   111,   139,   169,    11,   171,   145,     7,   174,   175,
    1318      145,   177,     7,   179,   145,    10,   182,   139,   140,    19,
    1319       20,    21,    22,   145,   145,   131,    26,   133,   134,   135,
    1320      136,    11,   138,   145,   145,   141,   142,   112,   140,   139,
    1321      111,   147,   148,   140,   112,   139,   139,   112,   214,   130,
    1322      131,   140,   133,   134,   135,   136,     7,   138,   111,    10,
    1323      141,   142,   112,   146,   146,   146,   147,   139,    68,   139,
    1324      114,     7,   146,   146,   240,    75,   136,   146,   138,   245,
    1325      146,   247,   146,   139,   136,   146,   145,   147,   139,   146,
    1326      292,   257,    46,   259,   260,   261,   381,   263,   369,   265,
    1327      266,   279,    -1,    -1,    -1,   172,     0,     1,    -1,   300,
    1328       -1,    -1,    -1,    -1,     8,    -1,    -1,   283,    -1,    13,
    1329       14,    15,    16,   130,   124,   291,    20,   293,    -1,   136,
    1330        3,     4,   139,   140,     7,   135,     9,    10,   145,    -1,
    1331      135,   136,    -1,   138,    -1,   145,    40,     3,     4,    -1,
    1332      130,     7,   147,     9,    10,    -1,    -1,    -1,    -1,   139,
    1333      140,    -1,   162,   329,    -1,   145,   166,   333,    11,   335,
    1334      336,   171,   338,     3,     4,    -1,    -1,     7,    -1,     9,
    1335       10,   372,   133,   134,   135,   136,    -1,   138,   354,   355,
    1336       -1,   142,    -1,    -1,    11,    -1,   147,    91,    92,    93,
    1337       94,    95,    96,    97,    98,    99,   100,   101,   102,   103,
    1338      104,   105,   106,    -1,   108,   109,   110,   111,    -1,   113,
    1339      114,   115,   116,   117,   118,   119,   120,   121,   122,   123,
    1340      124,   125,   126,   127,   128,   129,    -1,   131,    11,    -1,
    1341      134,    -1,   136,     3,     4,    -1,   140,     7,    -1,     9,
    1342       10,   145,    -1,    -1,   148,    -1,    -1,    -1,   131,    -1,
    1343      133,   134,   135,   136,    11,   138,   139,    -1,   141,   142,
    1344       11,    -1,    -1,   146,   147,   131,    -1,   133,   134,   135,
    1345      136,    11,   138,   139,    -1,   141,   142,   130,     3,     4,
    1346      146,   147,     7,    -1,     9,    10,   139,   140,    -1,    -1,
    1347       -1,   131,   145,   133,   134,   135,   136,   137,   138,   139,
    1348       -1,   141,   142,   130,     3,     4,    -1,   147,     7,    -1,
    1349        9,    10,   139,   140,    -1,    -1,    -1,    -1,   145,    -1,
     1310       1,   252,     1,   140,   114,    11,   131,   111,   366,     7,
     1311     147,   262,    10,     3,     4,   140,   141,     7,   131,     9,
     1312      10,   111,   112,    24,   140,     7,   141,   140,    10,     4,
     1313     388,   147,     7,    11,   140,    11,   146,   141,   138,   146,
     1314     140,   147,   140,   146,    19,    20,    21,    22,    47,   147,
     1315      51,    26,   140,   140,    29,   140,   140,   111,   112,   147,
     1316     147,   112,   147,   147,     7,    66,   140,    10,   119,   140,
     1317     146,   147,    47,   147,   146,    50,   147,    11,   146,    54,
     1318     146,   147,   146,   147,   146,   336,   146,   147,    63,    64,
     1319       3,     4,   297,   298,     7,    70,     9,    10,   146,   147,
     1320     146,   147,    77,    11,   146,    80,   146,   147,     3,     4,
     1321     111,   146,     7,   114,     9,    10,   146,   118,   146,   147,
     1322     146,   147,   146,   147,    99,   146,    11,   126,   103,   104,
     1323     105,   106,   107,   108,   109,   110,   137,   112,    11,   137,
     1324     146,   116,   132,   146,   134,   135,   136,   137,   149,   139,
     1325     148,   126,   142,   143,   129,   137,   112,   139,   148,   149,
     1326     135,   111,   140,   138,   140,   141,   148,   146,   146,   147,
     1327     146,   111,    11,   148,   146,   147,   151,   152,   153,   180,
     1328     155,   182,   157,   158,   159,   160,   161,   162,   163,   164,
     1329     165,   146,   147,   136,   137,   170,   139,   131,   173,   146,
     1330     175,     7,   146,   178,   179,   148,   181,   141,   183,   146,
     1331     146,   186,   146,    19,    20,    21,    22,    11,   131,   132,
     1332      26,   134,   135,   136,   137,   111,   139,    48,    49,   142,
     1333     143,   146,   140,   141,   147,   148,   111,   132,   146,   134,
     1334     135,   136,   137,   218,   139,   140,   131,   142,   143,   141,
     1335     140,   112,   147,   148,   111,   140,   141,   146,   131,   146,
     1336     112,   146,   146,   146,    70,   146,   146,   140,   141,   244,
     1337     141,    77,   247,   146,   140,   250,   141,   252,   140,   112,
     1338     140,   111,   141,   112,   140,   284,   140,   262,   137,   264,
     1339     265,   266,   131,   268,   147,   270,   271,   147,   137,   147,
     1340     147,   140,   141,     0,     1,   306,   147,   146,   140,   147,
     1341     147,     8,   114,   288,   140,   146,    13,    14,    15,    16,
     1342     126,   296,   147,    20,   299,   147,     7,     3,     4,    47,
     1343     388,     7,   138,     9,    10,   376,   176,   131,    -1,    -1,
     1344      -1,    -1,   148,    40,     3,     4,   140,   141,     7,    -1,
     1345       9,    10,   146,    -1,    -1,    -1,    -1,    -1,    -1,   165,
     1346      -1,   336,    -1,    -1,   170,   340,    -1,   342,   343,   175,
     1347     345,    -1,    -1,     3,     4,    -1,    -1,     7,   379,     9,
     1348      10,    -1,    -1,    -1,    -1,    -1,   361,   362,    -1,    -1,
     1349      -1,    -1,    -1,    -1,    91,    92,    93,    94,    95,    96,
     1350      97,    98,    99,   100,   101,   102,   103,   104,   105,   106,
     1351      -1,   108,   109,   110,   111,    11,   113,   114,   115,   116,
     1352     117,   118,   119,   120,   121,   122,   123,   124,   125,   126,
     1353     127,   128,   129,   130,    -1,   132,    11,    -1,   135,    -1,
     1354     137,     3,     4,    -1,   141,     7,    -1,     9,    10,   146,
     1355      -1,    -1,   149,    -1,    -1,    -1,   132,    -1,   134,   135,
     1356     136,   137,    11,   139,   140,    -1,   142,   143,    -1,    -1,
     1357      -1,   147,   148,   132,    -1,   134,   135,   136,   137,    -1,
     1358     139,   140,    -1,   142,   143,    -1,     3,     4,   147,   148,
     1359       7,    -1,     9,    10,    -1,    -1,    -1,    -1,    -1,    -1,
     1360      -1,    -1,   132,    -1,   134,   135,   136,   137,   138,   139,
     1361     140,    -1,   142,   143,    -1,     3,     4,    -1,   148,     7,
     1362      -1,     9,    10,    13,    14,    15,    16,    -1,    -1,    -1,
     1363      20,    -1,     3,     4,    -1,   131,     7,    -1,     9,    10,
     1364      -1,    -1,    -1,    -1,   140,   141,    -1,     3,     4,    -1,
     1365     146,     7,    -1,     9,    10,    -1,   131,    -1,    -1,    -1,
     1366      -1,    -1,    -1,    -1,    -1,   140,   141,    -1,    -1,    -1,
     1367     132,   146,   134,   135,   136,   137,    -1,   139,   140,    -1,
     1368     142,   143,   131,     3,     4,   147,   148,     7,    -1,     9,
     1369      10,   140,   141,    -1,    -1,    -1,    -1,   146,    -1,    -1,
     1370       3,     4,    -1,    -1,     7,    -1,     9,    10,    -1,    99,
     1371     100,   101,   102,    -1,    -1,   132,    -1,   134,   135,   136,
     1372     137,    -1,   139,   140,    -1,   142,   143,    -1,     3,     4,
     1373     147,   148,     7,    -1,     9,    10,    -1,    -1,    -1,    -1,
     1374      -1,    -1,    -1,    -1,   132,    -1,   134,   135,   136,   137,
     1375      -1,   139,   140,    -1,   142,   143,    -1,    -1,    -1,   147,
     1376     148,   132,    -1,   134,   135,   136,   137,    -1,   139,   140,
     1377      -1,   142,   143,    -1,    -1,    -1,   132,   148,   134,   135,
     1378     136,   137,    -1,   139,    -1,    -1,   142,   143,    -1,     3,
     1379       4,   147,   148,     7,    -1,     9,    10,    -1,    -1,    -1,
     1380      -1,    -1,    -1,    -1,     3,     4,    -1,    -1,     7,    -1,
     1381       9,    10,   132,    -1,   134,   135,   136,   137,    -1,   139,
     1382      -1,    -1,   142,   143,    -1,    -1,    -1,   147,   148,   132,
     1383      -1,   134,   135,   136,   137,    -1,   139,    -1,    -1,   142,
     1384     143,    -1,     3,     4,   147,   148,     7,    -1,     9,    10,
     1385      -1,    -1,    -1,    -1,    -1,    -1,    -1,   132,    -1,   134,
     1386     135,   136,   137,    -1,   139,   140,    -1,   142,   143,    -1,
     1387       3,     4,    -1,   148,     7,    -1,     9,    10,    -1,    -1,
     1388      -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,     4,    -1,
     1389      -1,     7,    -1,     9,    10,    -1,    -1,    -1,    -1,    -1,
     1390      -1,    -1,     3,     4,    -1,    -1,     7,    -1,     9,    10,
     1391      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   132,    -1,
     1392     134,   135,   136,   137,    -1,   139,   140,    -1,   142,   143,
     1393      -1,    -1,    -1,   132,   148,   134,   135,   136,   137,    -1,
     1394     139,   140,    -1,   142,   143,    -1,     3,     4,    -1,   148,
     1395       7,    -1,     9,    10,    -1,    -1,    -1,    -1,    -1,    -1,
    13501396      -1,     3,     4,    -1,    -1,     7,    -1,     9,    10,    -1,
    1351       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,     4,
    1352       -1,    -1,     7,    -1,     9,    10,    -1,   130,    -1,    -1,
    1353       -1,    -1,    -1,    -1,    -1,    -1,   139,   140,    -1,    -1,
    1354       -1,   131,   145,   133,   134,   135,   136,    -1,   138,   139,
    1355       -1,   141,   142,   130,     3,     4,   146,   147,     7,   130,
    1356        9,    10,   139,   140,    -1,    -1,    -1,    -1,   145,   140,
    1357      130,     3,     4,    -1,   145,     7,    -1,     9,    10,   139,
    1358      140,    -1,    -1,    -1,    -1,   145,   131,    -1,   133,   134,
    1359      135,   136,    -1,   138,   139,    -1,   141,   142,    -1,     3,
    1360        4,   146,   147,     7,    -1,     9,    10,    -1,    -1,    -1,
    1361       -1,    -1,   131,    -1,   133,   134,   135,   136,    -1,   138,
    1362      139,    -1,   141,   142,    -1,    -1,    -1,   146,   147,   131,
    1363       -1,   133,   134,   135,   136,    -1,   138,    -1,    -1,   141,
    1364      142,    -1,    -1,    -1,   146,   147,   131,    -1,   133,   134,
    1365      135,   136,    -1,   138,    -1,    -1,   141,   142,    -1,     3,
    1366        4,   146,   147,     7,    -1,     9,    10,    -1,    -1,    -1,
    1367       -1,    -1,    -1,    -1,     3,     4,    -1,    -1,     7,    -1,
    1368        9,    10,   131,    -1,   133,   134,   135,   136,    -1,   138,
    1369       -1,    -1,   141,   142,    -1,    -1,    -1,   146,   147,   131,
    1370       -1,   133,   134,   135,   136,    -1,   138,   139,    -1,   141,
    1371      142,    -1,     3,     4,    -1,   147,     7,    -1,     9,    10,
    1372       -1,    -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,   133,
    1373      134,   135,   136,    -1,   138,   139,    -1,   141,   142,    -1,
    1374        3,     4,    -1,   147,     7,    -1,     9,    10,    -1,    -1,
    1375       -1,    -1,    -1,    -1,    -1,     3,     4,    -1,    -1,     7,
    1376       -1,     9,    10,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    1377       -1,    -1,     3,     4,    -1,    -1,     7,    -1,     9,    10,
    1378       -1,    -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,   133,
    1379      134,   135,   136,    -1,   138,   139,    -1,   141,   142,    -1,
    1380       -1,    -1,   131,   147,   133,   134,   135,   136,    -1,   138,
    1381       -1,    -1,   141,   142,    -1,     3,     4,   146,   147,     7,
    1382       -1,     9,    10,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    1383       -1,    -1,     3,     4,    -1,    -1,     7,    -1,     9,    10,
    1384      131,    -1,   133,   134,   135,   136,    -1,   138,    -1,    -1,
    1385      141,   142,    -1,     3,     4,   146,   147,     7,    -1,     9,
    1386       10,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,
    1387      133,   134,   135,   136,    -1,   138,   139,    -1,   141,   142,
    1388       -1,    -1,    -1,   131,   147,   133,   134,   135,   136,    -1,
    1389      138,    -1,    -1,   141,   142,    -1,    -1,    -1,   146,   147,
    1390      131,    -1,   133,   134,   135,   136,    -1,   138,   139,    -1,
    1391      141,   142,    -1,     3,     4,    -1,   147,     7,    -1,     9,
    1392       10,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    1393        3,     4,    -1,    -1,     7,    -1,     9,    10,    -1,    -1,
    1394       -1,    -1,    -1,   131,    -1,   133,   134,   135,   136,    -1,
    1395      138,    -1,    -1,   141,   142,    -1,    -1,    -1,   146,   147,
    1396      131,    -1,   133,   134,   135,   136,    -1,   138,    -1,    -1,
    1397      141,   142,    -1,     3,     4,   146,   147,     7,    -1,     9,
    1398       10,   131,    -1,   133,   134,   135,   136,   137,   138,    -1,
    1399       -1,   141,   142,    -1,     3,     4,    -1,   147,     7,    -1,
     1397      -1,   132,    -1,   134,   135,   136,   137,    -1,   139,    -1,
     1398      -1,   142,   143,    -1,     3,     4,   147,   148,     7,    -1,
     1399       9,    10,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   132,
     1400      -1,   134,   135,   136,   137,    -1,   139,    -1,    -1,   142,
     1401     143,    -1,    -1,    -1,   147,   148,   132,    -1,   134,   135,
     1402     136,   137,    -1,   139,   140,     7,   142,   143,    10,    -1,
     1403      -1,   132,   148,   134,   135,   136,   137,    -1,   139,    -1,
     1404      -1,   142,   143,    -1,     3,     4,   147,   148,     7,    -1,
    14001405       9,    10,    -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,
    14011406       4,    -1,    -1,     7,    -1,     9,    10,    -1,    -1,    -1,
     1407      -1,    -1,    -1,    -1,    -1,   132,    -1,   134,   135,   136,
     1408     137,    -1,   139,   140,    -1,   142,   143,    -1,    -1,    -1,
     1409     132,   148,   134,   135,   136,   137,    -1,   139,    -1,    -1,
     1410     142,   143,    -1,     3,     4,   147,   148,     7,    -1,     9,
     1411      10,    -1,    -1,   132,    -1,   134,   135,   136,   137,    -1,
     1412     139,    -1,    -1,   142,   143,    -1,     3,     4,   147,   148,
     1413       7,    -1,     9,    10,    -1,    -1,    -1,    -1,    -1,    -1,
     1414      -1,    -1,    -1,     3,     4,    -1,    -1,     7,    -1,     9,
     1415      10,    -1,   134,   135,   136,   137,    -1,   139,     3,     4,
     1416      -1,   143,     7,    -1,     9,    10,   148,    -1,    -1,    -1,
     1417      -1,    -1,    -1,   132,    -1,   134,   135,   136,   137,   138,
     1418     139,    -1,    -1,   142,   143,    -1,    -1,    -1,   132,   148,
     1419     134,   135,   136,   137,    -1,   139,    -1,    -1,   142,   143,
     1420      -1,     3,     4,   147,   148,     7,    -1,     9,    10,    -1,
    14021421      -1,    -1,    -1,    -1,    -1,    -1,     3,     4,    -1,    -1,
    14031422       7,    -1,     9,    10,    -1,    -1,    -1,    -1,    -1,    -1,
    1404       -1,   131,    -1,   133,   134,   135,   136,     7,   138,    -1,
    1405       10,   141,   142,    -1,    -1,    -1,   146,   147,   131,    -1,
    1406      133,   134,   135,   136,    -1,   138,   139,    -1,   141,   142,
    1407       -1,     3,     4,    -1,   147,     7,    -1,     9,    10,    -1,
    1408       -1,    -1,    -1,    -1,    -1,    -1,     3,     4,    -1,    -1,
    1409        7,    -1,     9,    10,    -1,    -1,    -1,    -1,    -1,    -1,
    1410       -1,   131,    -1,   133,   134,   135,   136,    -1,   138,    -1,
    1411       -1,   141,   142,    -1,     3,     4,   146,   147,     7,    -1,
    1412        9,    10,   131,    -1,   133,   134,   135,   136,    -1,   138,
    1413      139,    -1,   141,   142,    -1,    -1,    -1,   131,   147,   133,
    1414      134,   135,   136,    -1,   138,    -1,    -1,   141,   142,    -1,
    1415       -1,    -1,   146,   147,   131,    -1,   133,   134,   135,   136,
    1416      137,   138,     3,     4,   141,   142,     7,    -1,     9,    10,
    1417      147,   131,    -1,   133,   134,   135,   136,    -1,   138,     3,
    1418        4,    -1,   142,     7,    -1,     9,    10,   147,    -1,    -1,
    1419       -1,    -1,    -1,    13,    14,    15,    16,    -1,    -1,   131,
    1420       20,   133,   134,   135,   136,    -1,   138,   139,    -1,   141,
    1421      142,    -1,    -1,    -1,   131,   147,   133,   134,   135,   136,
    1422       -1,   138,    -1,    -1,   141,   142,    -1,     3,     4,   146,
    1423      147,     7,    -1,     9,    10,    -1,    -1,    -1,    -1,    -1,
    1424       -1,    -1,   131,    -1,   133,   134,   135,   136,    -1,   138,
    1425       -1,    -1,   141,   142,    -1,     3,     4,   146,   147,     7,
    1426       -1,     9,    10,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    1427        3,     4,    -1,    -1,     7,    -1,     9,    10,    -1,    99,
    1428      100,   101,   102,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    1429      131,    -1,   133,   134,   135,   136,    -1,   138,    -1,    -1,
    1430      141,   142,    -1,    -1,    -1,   146,   147,   131,    -1,   133,
    1431      134,   135,   136,    -1,   138,    -1,    -1,   141,   142,    -1,
    1432        3,     4,   146,   147,     7,    -1,     9,    10,    -1,    -1,
    1433       -1,    -1,    -1,    -1,    -1,    -1,     4,    -1,    -1,     7,
    1434       -1,     9,    10,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    1435       -1,    -1,    -1,    -1,    -1,   131,    -1,   133,   134,   135,
    1436      136,    -1,   138,    -1,    -1,   141,   142,    -1,    -1,    -1,
    1437      146,   147,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    1438       -1,    -1,    -1,   131,    -1,   133,   134,   135,   136,   137,
    1439      138,    -1,    -1,   141,   142,    -1,    -1,    -1,   131,   147,
    1440      133,   134,   135,   136,    -1,   138,    -1,    -1,   141,   142,
    1441        8,    -1,    -1,    -1,   147,    13,    14,    15,    16,    -1,
     1423      -1,    -1,   132,    -1,   134,   135,   136,   137,    -1,   139,
     1424     140,    -1,   142,   143,    -1,     3,     4,    -1,   148,     7,
     1425      -1,     9,    10,    -1,    -1,   132,    -1,   134,   135,   136,
     1426     137,    -1,   139,    -1,    -1,   142,   143,    -1,    -1,    -1,
     1427     147,   148,   132,    -1,   134,   135,   136,   137,    -1,   139,
     1428     140,    -1,   142,   143,    -1,    -1,    -1,   132,   148,   134,
     1429     135,   136,   137,    -1,   139,    -1,    -1,   142,   143,    -1,
     1430       3,     4,   147,   148,     7,    -1,     9,    10,    -1,    -1,
     1431      -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,     4,    -1,
     1432      -1,     7,    -1,     9,    10,    -1,    -1,    -1,    -1,    -1,
     1433     132,    -1,   134,   135,   136,   137,   138,   139,    -1,    -1,
     1434     142,   143,    -1,    -1,    -1,   132,   148,   134,   135,   136,
     1435     137,    -1,   139,   140,    -1,   142,   143,    -1,     3,     4,
     1436      -1,   148,     7,    -1,     9,    10,    -1,    -1,    -1,    -1,
     1437      -1,    -1,    -1,    -1,   132,    -1,   134,   135,   136,   137,
     1438      -1,   139,    -1,    -1,   142,   143,    -1,     3,     4,   147,
     1439     148,     7,    -1,     9,    10,    -1,    -1,    -1,    -1,    -1,
     1440      -1,    -1,    -1,    -1,     3,     4,    -1,    -1,     7,    -1,
     1441       9,    10,    -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,
     1442       4,    -1,    -1,     7,    -1,     9,    10,    -1,    -1,   132,
     1443      -1,   134,   135,   136,   137,    -1,   139,    -1,    -1,   142,
     1444     143,    -1,    -1,    -1,   147,   148,   132,    -1,   134,   135,
     1445     136,   137,    -1,   139,    -1,    -1,   142,   143,    -1,     3,
     1446       4,   147,   148,     7,    -1,     9,    10,    -1,    -1,    -1,
     1447      -1,    -1,    -1,    -1,    -1,     4,    -1,    -1,     7,    -1,
     1448       9,    10,    -1,    -1,    -1,    -1,    -1,   132,    -1,   134,
     1449     135,   136,   137,    -1,   139,    -1,    -1,   142,   143,    -1,
     1450      -1,    -1,   147,   148,    -1,    -1,    -1,    -1,    -1,    -1,
     1451      -1,    -1,    -1,    -1,    -1,    -1,   132,    -1,   134,   135,
     1452     136,   137,    -1,   139,    -1,    -1,   142,   143,    -1,    -1,
     1453      -1,   147,   148,   132,    -1,   134,   135,   136,   137,   138,
     1454     139,    -1,    -1,   142,   143,    -1,    -1,    -1,   132,   148,
     1455     134,   135,   136,   137,    -1,   139,    -1,    -1,   142,   143,
     1456       8,    -1,    -1,    -1,   148,    13,    14,    15,    16,    -1,
    14421457      -1,    -1,    20,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    1443       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    1444       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,
    1445      133,   134,   135,   136,    -1,   138,    -1,    -1,   141,   142,
    1446       -1,    -1,    -1,   131,   147,   133,   134,   135,   136,    -1,
    1447      138,    -1,    -1,    -1,   142,     8,    -1,    -1,    -1,   147,
    1448       13,    14,    15,    16,    -1,    -1,    -1,    20,    -1,    -1,
     1458      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   132,    -1,
     1459     134,   135,   136,   137,    -1,   139,    -1,    -1,   142,   143,
     1460      -1,    -1,    -1,   132,   148,   134,   135,   136,   137,    -1,
     1461     139,    -1,    -1,    -1,   143,    -1,    -1,    -1,    -1,   148,
     1462       8,    -1,    -1,    -1,    -1,    13,    14,    15,    16,    -1,
     1463      -1,    -1,    20,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
     1464      -1,    -1,    -1,    91,    92,    93,    94,    95,    96,    97,
     1465      98,    99,   100,   101,   102,    -1,    -1,     7,    -1,    -1,
     1466      10,    -1,    -1,   111,    -1,   113,   114,   115,    -1,   117,
     1467     118,    -1,    -1,    -1,   122,   123,    -1,    -1,    -1,    -1,
     1468      -1,    -1,   130,    -1,    -1,     8,    -1,   135,    -1,   137,
     1469      13,    14,    15,    16,    -1,    -1,    -1,    20,   146,   147,
     1470      -1,   149,    -1,    91,    92,    93,    94,    95,    96,    97,
     1471      98,    99,   100,   101,   102,    -1,    -1,    -1,    -1,    -1,
     1472      -1,    -1,    -1,   111,    -1,   113,   114,   115,    -1,   117,
     1473     118,    -1,    -1,    -1,   122,   123,    -1,    -1,    -1,    -1,
     1474      -1,    -1,   130,    -1,    -1,     8,    -1,   135,    -1,   137,
     1475      13,    14,    15,    16,    -1,    -1,    -1,    20,   146,   147,
     1476      -1,   149,    -1,    -1,    -1,    -1,    -1,    -1,    91,    92,
     1477      93,    94,    95,    96,    97,    98,    99,   100,   101,   102,
     1478      -1,    -1,   132,    -1,   134,   135,   136,   137,   111,   139,
     1479     113,   114,   115,   143,   117,   118,    -1,    -1,   148,   122,
     1480     123,    -1,    -1,    -1,    -1,    -1,    -1,   130,    -1,    -1,
     1481       8,    -1,   135,    -1,   137,    13,    14,    15,    16,    -1,
     1482      -1,    -1,    20,   146,   147,    -1,   149,    -1,    91,    92,
     1483      93,    94,    95,    96,    97,    98,    99,   100,   101,   102,
     1484      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   111,    -1,
     1485     113,   114,   115,    -1,   117,   118,    -1,    -1,    -1,   122,
     1486     123,    -1,    -1,    -1,    -1,    -1,    -1,   130,    -1,    -1,
     1487       8,    -1,   135,    -1,   137,    13,    14,    15,    16,    -1,
     1488      -1,    -1,    20,   146,   147,    -1,   149,    -1,    -1,    -1,
    14491489      -1,    -1,    -1,    91,    92,    93,    94,    95,    96,    97,
    14501490      98,    99,   100,   101,   102,    -1,    -1,    -1,    -1,    -1,
    14511491      -1,    -1,    -1,   111,    -1,   113,   114,   115,    -1,   117,
    1452       -1,    -1,    -1,   121,   122,    -1,    -1,    -1,    -1,    -1,
    1453       -1,   129,    -1,    -1,     8,    -1,   134,    -1,   136,    13,
    1454       14,    15,    16,    -1,    -1,    -1,    20,   145,   146,    -1,
    1455      148,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    91,    92,
     1492     118,    -1,    -1,    -1,   122,   123,    -1,    -1,    -1,    -1,
     1493      -1,    -1,   130,    -1,    -1,     8,    -1,   135,    -1,   137,
     1494      13,    14,    15,    16,    -1,    -1,    -1,    20,   146,   147,
     1495      -1,   149,    -1,    91,    92,    93,    94,    95,    96,    97,
     1496      98,    99,   100,   101,   102,    -1,    -1,    -1,    -1,    -1,
     1497      -1,    -1,    -1,   111,    -1,   113,   114,   115,    -1,   117,
     1498     118,    -1,    -1,    -1,   122,   123,    -1,    -1,    -1,    -1,
     1499      -1,    -1,   130,    -1,    -1,     8,    -1,   135,    -1,   137,
     1500      13,    14,    15,    16,    -1,    -1,    -1,    20,   146,   147,
     1501      -1,   149,    -1,    -1,    -1,    -1,    -1,    -1,    91,    92,
    14561502      93,    94,    95,    96,    97,    98,    99,   100,   101,   102,
    14571503      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   111,    -1,
    1458      113,   114,   115,    -1,   117,    -1,    -1,    -1,   121,   122,
    1459       -1,    -1,     8,    -1,    -1,    -1,   129,    13,    14,    15,
    1460       16,   134,    -1,   136,    20,    -1,    -1,    -1,    -1,    -1,
    1461       -1,    -1,   145,   146,    -1,   148,    -1,    91,    92,    93,
    1462       94,    95,    96,    97,    98,    99,   100,   101,   102,    -1,
    1463       -1,    -1,    -1,    -1,    -1,    -1,    -1,   111,    -1,   113,
    1464      114,   115,    -1,   117,    -1,    -1,    -1,   121,   122,    -1,
    1465       -1,     8,    -1,    -1,    -1,   129,    13,    14,    15,    16,
    1466      134,    -1,   136,    20,    -1,    -1,    -1,    -1,    -1,    -1,
    1467       -1,   145,   146,    -1,   148,    91,    92,    93,    94,    95,
    1468       96,    97,    98,    99,   100,   101,   102,    -1,    -1,    -1,
    1469       -1,    -1,    -1,    -1,    -1,   111,    -1,   113,   114,   115,
    1470       -1,   117,    -1,    -1,    -1,   121,   122,    -1,    -1,     8,
    1471       -1,    -1,    -1,   129,    13,    14,    15,    16,   134,    -1,
    1472      136,    20,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   145,
    1473      146,    -1,   148,    -1,    91,    92,    93,    94,    95,    96,
    1474       97,    98,    99,   100,   101,   102,    -1,    -1,    -1,    -1,
    1475       -1,    -1,    -1,    -1,   111,    -1,   113,   114,   115,    -1,
    1476      117,    -1,    -1,    -1,   121,   122,    -1,    -1,     8,    -1,
    1477       -1,    -1,   129,    13,    14,    15,    16,   134,    -1,   136,
    1478       20,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   145,   146,
    1479       -1,   148,    91,    92,    93,    94,    95,    96,    97,    98,
    1480       99,   100,   101,   102,    -1,    -1,    -1,    -1,    -1,    -1,
    1481       -1,    -1,   111,    -1,   113,   114,   115,    -1,   117,    -1,
    1482       -1,    -1,   121,   122,    -1,    -1,     8,    -1,    -1,    -1,
    1483      129,    13,    14,    15,    16,   134,    -1,   136,    20,    -1,
    1484       -1,    -1,    -1,    -1,    -1,    -1,   145,   146,    -1,   148,
    1485       -1,    91,    92,    93,    94,    95,    96,    97,    98,    99,
    1486      100,   101,   102,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    1487       -1,   111,    -1,   113,   114,   115,    -1,   117,    -1,    -1,
    1488       -1,   121,   122,    -1,    -1,     8,    -1,    -1,    -1,   129,
    1489       13,    14,    15,    16,   134,    -1,   136,    20,    -1,    -1,
    1490       -1,    -1,    -1,    -1,    -1,   145,    -1,    -1,   148,    91,
    1491       92,    93,    94,    95,    96,    97,    98,    99,   100,   101,
    1492      102,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   111,
    1493       -1,   113,   114,   115,    -1,   117,    -1,    -1,    -1,   121,
    1494      122,    -1,    -1,     8,    -1,    -1,    -1,   129,    13,    14,
    1495       15,    16,   134,    -1,   136,    20,    -1,    -1,    -1,    -1,
    1496       -1,    -1,    -1,   145,    -1,    -1,   148,    -1,    91,    92,
     1504     113,   114,   115,    -1,   117,   118,    -1,    -1,    -1,   122,
     1505     123,    -1,    -1,    -1,    -1,    -1,    -1,   130,    -1,    -1,
     1506       8,    -1,   135,    -1,   137,    13,    14,    15,    16,    -1,
     1507      -1,    -1,    20,   146,    -1,    -1,   149,    -1,    91,    92,
    14971508      93,    94,    95,    96,    97,    98,    99,   100,   101,   102,
    14981509      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   111,    -1,
    1499      113,   114,   115,    -1,   117,    -1,    -1,    -1,   121,   122,
    1500       -1,    -1,     8,    -1,    -1,    -1,   129,    13,    14,    15,
    1501       16,   134,    -1,   136,    20,    -1,    -1,    -1,    -1,    -1,
    1502       -1,    -1,   145,    -1,    -1,   148,    91,    92,    93,    94,
    1503       95,    96,    97,    98,    99,   100,   101,   102,    -1,    -1,
    1504       -1,    -1,    -1,    -1,    -1,    -1,   111,    -1,   113,   114,
    1505      115,    -1,   117,    -1,    -1,    -1,   121,   122,    -1,    -1,
    1506        8,    -1,    -1,    -1,   129,    13,    14,    15,    16,   134,
    1507       -1,   136,    20,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    1508      145,    -1,    -1,   148,    -1,    91,    92,    93,    94,    95,
    1509       96,    97,    98,    99,   100,   101,   102,    -1,    -1,    -1,
    1510       -1,    -1,    -1,    -1,    -1,   111,    -1,   113,   114,   115,
    1511       -1,   117,    -1,    -1,    -1,   121,   122,    -1,    -1,     8,
    1512       -1,    -1,    -1,   129,    13,    14,    15,    16,   134,    -1,
    1513      136,    20,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   145,
    1514       -1,    -1,   148,    91,    92,    93,    94,    95,    96,    97,
     1510     113,   114,   115,    -1,   117,   118,    -1,    -1,    -1,   122,
     1511     123,    -1,    -1,    -1,    -1,    -1,    -1,   130,    -1,    -1,
     1512       8,    -1,   135,    -1,   137,    13,    14,    15,    16,    -1,
     1513      -1,    -1,    20,   146,    -1,    -1,   149,    -1,    -1,    -1,
     1514      -1,    -1,    -1,    91,    92,    93,    94,    95,    96,    97,
    15151515      98,    99,   100,   101,   102,    -1,    -1,    -1,    -1,    -1,
    15161516      -1,    -1,    -1,   111,    -1,   113,   114,   115,    -1,   117,
    1517       -1,    -1,    -1,   121,   122,    -1,    -1,     8,    -1,    -1,
    1518       -1,   129,    13,    14,    15,    16,   134,    -1,   136,    20,
    1519       -1,    -1,    -1,    -1,    -1,    -1,    -1,   145,    -1,    -1,
    1520      148,    -1,    91,    92,    93,    94,    95,    96,    97,    98,
    1521       99,   100,   101,   102,    -1,    -1,    -1,    -1,    -1,    -1,
    1522       -1,    -1,   111,    -1,   113,   114,   115,    -1,   117,    -1,
    1523       -1,    -1,   121,   122,    -1,    -1,     8,    -1,    -1,    -1,
    1524      129,    13,    14,    15,    16,   134,    -1,   136,    20,    -1,
    1525       -1,    -1,    -1,    -1,    -1,    -1,   145,    -1,    -1,   148,
    1526       91,    92,    93,    94,    95,    96,    97,    98,    99,   100,
    1527      101,   102,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    1528      111,    -1,   113,   114,   115,    -1,   117,    -1,    -1,    -1,
    1529      121,   122,    -1,    -1,     8,    -1,    -1,    -1,   129,    13,
    1530       14,    15,    16,   134,    -1,   136,    20,    -1,    -1,    -1,
    1531       -1,    -1,    -1,    -1,   145,    -1,    -1,   148,    -1,    91,
    1532       92,    93,    94,    95,    96,    97,    98,    99,   100,   101,
    1533      102,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   111,
    1534       -1,   113,   114,   115,    -1,   117,    -1,    -1,    -1,   121,
    1535      122,    -1,    -1,    -1,    -1,    -1,    -1,   129,    -1,    -1,
    1536       -1,    -1,   134,    -1,   136,    -1,    -1,    -1,    -1,    -1,
    1537       -1,    -1,    -1,   145,    -1,    -1,   148,    91,    92,    93,
    1538       94,    95,    96,    97,    98,    99,   100,   101,   102,    -1,
    1539       -1,    -1,    -1,    -1,    -1,    -1,    -1,   111,    -1,   113,
    1540      114,   115,    -1,   117,    -1,    -1,    -1,   121,   122,    -1,
    1541       -1,    -1,    -1,    -1,    -1,   129,    -1,    -1,    -1,    -1,
    1542      134,    -1,   136,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    1543       -1,   145,    -1,    -1,   148
     1517     118,    -1,    -1,    -1,   122,   123,    -1,    -1,    -1,    -1,
     1518      -1,    -1,   130,    -1,    -1,     8,    -1,   135,    -1,   137,
     1519      13,    14,    15,    16,    -1,    -1,    -1,    20,   146,    -1,
     1520      -1,   149,    -1,    91,    92,    93,    94,    95,    96,    97,
     1521      98,    99,   100,   101,   102,    -1,    -1,    -1,    -1,    -1,
     1522      -1,    -1,    -1,   111,    -1,   113,   114,   115,    -1,   117,
     1523     118,    -1,    -1,    -1,   122,   123,    -1,    -1,    -1,    -1,
     1524      -1,    -1,   130,    -1,    -1,     8,    -1,   135,    -1,   137,
     1525      13,    14,    15,    16,    -1,    -1,    -1,    20,   146,    -1,
     1526      -1,   149,    -1,    -1,    -1,    -1,    -1,    -1,    91,    92,
     1527      93,    94,    95,    96,    97,    98,    99,   100,   101,   102,
     1528      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   111,    -1,
     1529     113,   114,   115,    -1,   117,   118,    -1,    -1,    -1,   122,
     1530     123,    -1,    -1,    -1,    -1,    -1,    -1,   130,    -1,    -1,
     1531       8,    -1,   135,    -1,   137,    13,    14,    15,    16,    -1,
     1532      -1,    -1,    20,   146,    -1,    -1,   149,    -1,    91,    92,
     1533      93,    94,    95,    96,    97,    98,    99,   100,   101,   102,
     1534      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   111,    -1,
     1535     113,   114,   115,    -1,   117,   118,    -1,    -1,    -1,   122,
     1536     123,    -1,    -1,    -1,    -1,    -1,    -1,   130,    -1,    -1,
     1537       8,    -1,   135,    -1,   137,    13,    14,    15,    16,    -1,
     1538      -1,    -1,    20,   146,    -1,    -1,   149,    -1,    -1,    -1,
     1539      -1,    -1,    -1,    91,    92,    93,    94,    95,    96,    97,
     1540      98,    99,   100,   101,   102,    -1,    -1,    -1,    -1,    -1,
     1541      -1,    -1,    -1,   111,    -1,   113,   114,   115,    -1,   117,
     1542     118,    -1,    -1,    -1,   122,   123,    -1,    -1,    -1,    -1,
     1543      -1,    -1,   130,    -1,    -1,     8,    -1,   135,    -1,   137,
     1544      13,    14,    15,    16,    -1,    -1,    -1,    20,   146,    -1,
     1545      -1,   149,    -1,    91,    92,    93,    94,    95,    96,    97,
     1546      98,    99,   100,   101,   102,    -1,    -1,    -1,    -1,    -1,
     1547      -1,    -1,    -1,   111,    -1,   113,   114,   115,    -1,   117,
     1548     118,    -1,    -1,    -1,   122,   123,    -1,    -1,    -1,    -1,
     1549      -1,    -1,   130,    -1,    -1,     8,    -1,   135,    -1,   137,
     1550      13,    14,    15,    16,    -1,    -1,    -1,    20,   146,    -1,
     1551      -1,   149,    -1,    -1,    -1,    -1,    -1,    -1,    91,    92,
     1552      93,    94,    95,    96,    97,    98,    99,   100,   101,   102,
     1553      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   111,    -1,
     1554     113,   114,   115,    -1,   117,   118,    -1,    -1,    -1,   122,
     1555     123,    -1,    -1,    -1,    -1,    -1,    -1,   130,    -1,    -1,
     1556      -1,    -1,   135,    -1,   137,    -1,    -1,    -1,    -1,    -1,
     1557      -1,    -1,    -1,   146,    -1,    -1,   149,    -1,    91,    92,
     1558      93,    94,    95,    96,    97,    98,    99,   100,   101,   102,
     1559      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   111,    -1,
     1560     113,   114,   115,    -1,   117,   118,    -1,    -1,    -1,   122,
     1561     123,    -1,    -1,    -1,    -1,    -1,    -1,   130,    -1,    -1,
     1562      -1,    -1,   135,    -1,   137,    -1,    -1,    -1,    -1,    -1,
     1563      -1,    -1,    -1,   146,    -1,    -1,   149
    15441564};
    15451565
     
    15481568static const yytype_uint8 yystos[] =
    15491569{
    1550        0,   150,     0,     1,     8,    13,    14,    15,    16,    20,
     1570       0,   151,     0,     1,     8,    13,    14,    15,    16,    20,
    15511571      40,    91,    92,    93,    94,    95,    96,    97,    98,    99,
    15521572     100,   101,   102,   103,   104,   105,   106,   108,   109,   110,
    15531573     111,   113,   114,   115,   116,   117,   118,   119,   120,   121,
    1554      122,   123,   124,   125,   126,   127,   128,   129,   131,   134,
    1555      136,   140,   145,   148,   151,   152,   153,   154,   155,   156,
    1556      157,   158,   160,   162,   163,   164,   165,   166,   173,   174,
    1557      176,   177,   178,   179,   180,   181,   182,   183,   184,   185,
    1558      186,   187,   188,   189,   190,   191,   192,   140,    15,    16,
    1559       99,   100,   101,   102,   129,   158,   173,   145,   156,   158,
    1560      164,   145,   145,   145,   145,   145,   145,   145,   145,   145,
    1561      145,   156,   145,   156,   145,   156,   145,   156,   111,   112,
    1562      157,   111,   140,   156,   145,   158,   111,   145,   112,   145,
    1563      145,   111,   145,   111,   145,    15,   158,   165,   166,   166,
    1564      158,   157,   157,   158,   140,    11,   145,   130,   139,     3,
    1565        4,     7,     9,    10,   131,   133,   134,   135,   136,   138,
    1566      141,   142,   147,   158,   157,   130,   139,   140,   172,   145,
    1567      156,   139,   156,   158,   145,   145,   145,   145,   145,   145,
    1568      158,   112,   145,   158,   167,   158,   158,   158,   158,   158,
    1569      158,   158,   146,   157,   158,   146,   157,   158,   146,   157,
    1570      140,   140,    15,    16,    99,   100,   101,   102,   146,   156,
    1571      173,   111,   112,   158,   159,   111,   158,   112,   146,   157,
    1572      175,   137,   146,   148,   156,   146,   157,   158,   158,   158,
    1573      158,   158,   158,   158,   158,   158,   158,   158,   158,   156,
    1574      130,   146,   161,   156,   158,   136,   156,   172,   158,   158,
    1575      157,   158,   157,   158,   146,   158,   146,   139,   146,   139,
    1576      139,   139,   146,   139,   146,   139,   139,   146,   146,   146,
    1577      146,   146,   146,   146,   146,   146,   146,   146,   146,   139,
    1578      146,   146,   112,   139,   158,   111,   146,   146,   140,   146,
    1579      137,   139,   158,   139,   146,   158,   158,   167,   146,   146,
    1580      139,   167,   158,   158,   158,   158,   158,   158,    15,    16,
    1581       99,   100,   101,   102,   173,    91,    94,    95,    97,    98,
    1582      158,   146,   112,   112,   118,   158,   161,   158,   137,   139,
    1583      157,   139,   146,   139,   146,   139,   139,   146,   139,   146,
    1584      146,   146,   146,   146,   146,   146,   146,   146,   146,   146,
    1585      146,   146,   146,   137,   139,   136,   167,   146,   114,   145,
    1586      168,   169,   171,   158,   158,   158,   158,   158,   158,   139,
    1587      169,   170,   145,   146,   146,   146,   146,   146,   146,   137,
    1588      171,   139,   146,   157,   170,   146
     1574     122,   123,   124,   125,   126,   127,   128,   129,   130,   132,
     1575     135,   137,   141,   146,   149,   152,   153,   154,   155,   156,
     1576     157,   158,   159,   161,   162,   164,   165,   166,   167,   168,
     1577     175,   176,   178,   179,   180,   181,   182,   183,   184,   185,
     1578     186,   187,   188,   189,   190,   191,   192,   193,   194,   141,
     1579      15,    16,    99,   100,   101,   102,   130,   159,   175,   146,
     1580     157,   159,   166,   146,   146,   146,   146,   146,   146,   146,
     1581     146,   146,   146,   157,   146,   157,   146,   157,   146,   157,
     1582     111,   112,   158,   111,   141,   157,   146,   159,   111,   146,
     1583     146,   112,   146,   146,   111,   146,   111,   146,    15,   159,
     1584     167,   168,   168,   159,   158,   158,   159,   141,    11,   146,
     1585     131,   140,     3,     4,     7,     9,    10,   132,   134,   135,
     1586     136,   137,   139,   142,   143,   148,   159,   159,   158,   131,
     1587     140,   141,   174,   146,   157,   140,   157,   159,   146,   146,
     1588     146,   146,   146,   146,   159,   112,   146,   159,   169,   159,
     1589     159,   159,   159,   159,   159,   159,   147,   158,   159,   147,
     1590     158,   159,   147,   158,   141,   141,    15,    16,    99,   100,
     1591     101,   102,   147,   157,   175,   111,   112,   159,   160,   111,
     1592     159,   112,   147,   158,   177,   138,   147,   149,   157,   147,
     1593     158,   159,   159,   159,   159,   159,   159,   159,   159,   159,
     1594     159,   159,   159,   157,   131,   147,   163,   140,   157,   159,
     1595     137,   157,   174,   159,   159,   158,   159,   158,   159,   147,
     1596     159,   147,   140,   147,   140,   140,   140,   147,   140,   147,
     1597     140,   140,   147,   147,   147,   147,   147,   147,   147,   147,
     1598     147,   147,   147,   147,   140,   147,   147,   112,   140,   159,
     1599     111,   147,   147,   141,   147,   138,   140,   159,   159,   140,
     1600     147,   159,   159,   169,   147,   147,   140,   169,   159,   159,
     1601     159,   159,   159,   159,    15,    16,    99,   100,   101,   102,
     1602     175,    91,    94,    95,    97,    98,   159,   147,   112,   112,
     1603     119,   159,   163,   163,   159,   138,   140,   158,   140,   147,
     1604     140,   147,   140,   140,   147,   140,   147,   147,   147,   147,
     1605     147,   147,   147,   147,   147,   147,   147,   147,   147,   147,
     1606     138,   140,   137,   169,   147,   114,   146,   170,   171,   173,
     1607     159,   159,   159,   159,   159,   159,   140,   171,   172,   146,
     1608     147,   147,   147,   147,   147,   147,   138,   173,   140,   147,
     1609     158,   172,   147
    15891610};
    15901611
     
    24102431
    24112432/* Line 1464 of yacc.c  */
    2412 #line 373 "grammar.y"
     2433#line 370 "grammar.y"
    24132434    {
    24142435            if (timerv)
     
    24462467
    24472468/* Line 1464 of yacc.c  */
    2448 #line 408 "grammar.y"
     2469#line 405 "grammar.y"
    24492470    {currentVoice->ifsw=0;;}
    24502471    break;
     
    24532474
    24542475/* Line 1464 of yacc.c  */
    2455 #line 410 "grammar.y"
     2476#line 407 "grammar.y"
    24562477    { (yyvsp[(1) - (2)].lv).CleanUp(); currentVoice->ifsw=0;;}
    24572478    break;
     
    24602481
    24612482/* Line 1464 of yacc.c  */
    2462 #line 412 "grammar.y"
     2483#line 409 "grammar.y"
    24632484    {
    24642485            YYACCEPT;
     
    24692490
    24702491/* Line 1464 of yacc.c  */
    2471 #line 416 "grammar.y"
     2492#line 413 "grammar.y"
    24722493    {
    24732494            currentVoice->ifsw=0;
     
    24792500
    24802501/* Line 1464 of yacc.c  */
    2481 #line 421 "grammar.y"
     2502#line 418 "grammar.y"
    24822503    {currentVoice->ifsw=0;;}
    24832504    break;
     
    24862507
    24872508/* Line 1464 of yacc.c  */
    2488 #line 423 "grammar.y"
     2509#line 420 "grammar.y"
    24892510    {
    24902511            #ifdef SIQ
     
    25402561
    25412562/* Line 1464 of yacc.c  */
     2563#line 478 "grammar.y"
     2564    {if (currentVoice!=NULL) currentVoice->ifsw=0;;}
     2565    break;
     2566
     2567  case 19:
     2568
     2569/* Line 1464 of yacc.c  */
    25422570#line 481 "grammar.y"
    2543     {if (currentVoice!=NULL) currentVoice->ifsw=0;;}
    2544     break;
    2545 
    2546   case 19:
    2547 
    2548 /* Line 1464 of yacc.c  */
    2549 #line 484 "grammar.y"
    25502571    { omFree((ADDRESS)(yyvsp[(2) - (2)].name)); ;}
    25512572    break;
     
    25542575
    25552576/* Line 1464 of yacc.c  */
    2556 #line 499 "grammar.y"
     2577#line 496 "grammar.y"
    25572578    {
    25582579            if(iiAssign(&(yyvsp[(1) - (2)].lv),&(yyvsp[(2) - (2)].lv))) YYERROR;
     
    25632584
    25642585/* Line 1464 of yacc.c  */
    2565 #line 506 "grammar.y"
     2586#line 503 "grammar.y"
    25662587    {
    25672588            if (currRing==NULL) MYYERROR("no ring active");
     
    25732594
    25742595/* Line 1464 of yacc.c  */
    2575 #line 511 "grammar.y"
     2596#line 508 "grammar.y"
    25762597    {
    25772598            syMake(&(yyval.lv),(yyvsp[(1) - (1)].name));
     
    25822603
    25832604/* Line 1464 of yacc.c  */
    2584 #line 515 "grammar.y"
     2605#line 512 "grammar.y"
    25852606    {
    25862607            if(iiExprArith2(&(yyval.lv), &(yyvsp[(1) - (3)].lv), COLONCOLON, &(yyvsp[(3) - (3)].lv))) YYERROR;
     
    25912612
    25922613/* Line 1464 of yacc.c  */
    2593 #line 519 "grammar.y"
     2614#line 516 "grammar.y"
    25942615    {
    25952616            if(iiExprArith2(&(yyval.lv), &(yyvsp[(1) - (3)].lv), '.', &(yyvsp[(3) - (3)].lv))) YYERROR;
     
    26002621
    26012622/* Line 1464 of yacc.c  */
    2602 #line 523 "grammar.y"
     2623#line 520 "grammar.y"
    26032624    {
    26042625            if(iiExprArith1(&(yyval.lv),&(yyvsp[(1) - (3)].lv),'(')) YYERROR;
     
    26092630
    26102631/* Line 1464 of yacc.c  */
    2611 #line 527 "grammar.y"
     2632#line 524 "grammar.y"
    26122633    {
    26132634            if ((yyvsp[(1) - (4)].lv).rtyp==UNKNOWN)
     
    26272648
    26282649/* Line 1464 of yacc.c  */
    2629 #line 540 "grammar.y"
     2650#line 537 "grammar.y"
    26302651    {
    26312652            if (currRingHdl==NULL) MYYERROR("no ring active");
     
    26602681
    26612682/* Line 1464 of yacc.c  */
    2662 #line 568 "grammar.y"
     2683#line 565 "grammar.y"
    26632684    {
    26642685            memset(&(yyval.lv),0,sizeof((yyval.lv)));
     
    26892710
    26902711/* Line 1464 of yacc.c  */
    2691 #line 592 "grammar.y"
     2712#line 589 "grammar.y"
    26922713    {
    26932714            memset(&(yyval.lv),0,sizeof((yyval.lv)));
     
    27002721
    27012722/* Line 1464 of yacc.c  */
    2702 #line 598 "grammar.y"
     2723#line 595 "grammar.y"
    27032724    {
    27042725            memset(&(yyval.lv),0,sizeof((yyval.lv)));
     
    27112732
    27122733/* Line 1464 of yacc.c  */
    2713 #line 604 "grammar.y"
     2734#line 601 "grammar.y"
    27142735    {
    27152736            if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
     
    27202741
    27212742/* Line 1464 of yacc.c  */
    2722 #line 608 "grammar.y"
     2743#line 605 "grammar.y"
    27232744    {
    27242745            if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
     
    27292750
    27302751/* Line 1464 of yacc.c  */
    2731 #line 612 "grammar.y"
     2752#line 609 "grammar.y"
    27322753    {
    27332754            if(iiExprArithM(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
     
    27382759
    27392760/* Line 1464 of yacc.c  */
    2740 #line 616 "grammar.y"
     2761#line 613 "grammar.y"
    27412762    {
    27422763            if(iiExprArithM(&(yyval.lv),NULL,(yyvsp[(1) - (3)].i))) YYERROR;
     
    27472768
    27482769/* Line 1464 of yacc.c  */
    2749 #line 620 "grammar.y"
     2770#line 617 "grammar.y"
    27502771    {
    27512772            if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
     
    27562777
    27572778/* Line 1464 of yacc.c  */
    2758 #line 624 "grammar.y"
     2779#line 621 "grammar.y"
    27592780    {
    27602781            if(iiExprArithM(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
     
    27652786
    27662787/* Line 1464 of yacc.c  */
    2767 #line 628 "grammar.y"
     2788#line 625 "grammar.y"
    27682789    {
    27692790            if(iiExprArithM(&(yyval.lv),NULL,(yyvsp[(1) - (3)].i))) YYERROR;
     
    27742795
    27752796/* Line 1464 of yacc.c  */
    2776 #line 632 "grammar.y"
     2797#line 629 "grammar.y"
    27772798    {
    27782799            if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
     
    27832804
    27842805/* Line 1464 of yacc.c  */
    2785 #line 636 "grammar.y"
     2806#line 633 "grammar.y"
    27862807    {
    27872808            if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
     
    27922813
    27932814/* Line 1464 of yacc.c  */
    2794 #line 640 "grammar.y"
     2815#line 637 "grammar.y"
    27952816    {
    27962817            if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
     
    28012822
    28022823/* Line 1464 of yacc.c  */
    2803 #line 644 "grammar.y"
     2824#line 641 "grammar.y"
    28042825    {
    28052826            if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
     
    28102831
    28112832/* Line 1464 of yacc.c  */
    2812 #line 648 "grammar.y"
     2833#line 645 "grammar.y"
    28132834    {
    28142835            if(iiExprArith2(&(yyval.lv),&(yyvsp[(3) - (6)].lv),(yyvsp[(1) - (6)].i),&(yyvsp[(5) - (6)].lv),TRUE)) YYERROR;
     
    28192840
    28202841/* Line 1464 of yacc.c  */
    2821 #line 652 "grammar.y"
     2842#line 649 "grammar.y"
    28222843    {
    28232844            if(iiExprArith2(&(yyval.lv),&(yyvsp[(3) - (6)].lv),(yyvsp[(1) - (6)].i),&(yyvsp[(5) - (6)].lv),TRUE)) YYERROR;
     
    28282849
    28292850/* Line 1464 of yacc.c  */
    2830 #line 656 "grammar.y"
     2851#line 653 "grammar.y"
    28312852    {
    28322853            if(iiExprArith2(&(yyval.lv),&(yyvsp[(3) - (6)].lv),(yyvsp[(1) - (6)].i),&(yyvsp[(5) - (6)].lv),TRUE)) YYERROR;
     
    28372858
    28382859/* Line 1464 of yacc.c  */
    2839 #line 660 "grammar.y"
     2860#line 657 "grammar.y"
    28402861    {
    28412862            if(iiExprArith2(&(yyval.lv),&(yyvsp[(3) - (6)].lv),(yyvsp[(1) - (6)].i),&(yyvsp[(5) - (6)].lv),TRUE)) YYERROR;
     
    28462867
    28472868/* Line 1464 of yacc.c  */
    2848 #line 664 "grammar.y"
     2869#line 661 "grammar.y"
    28492870    {
    28502871            if(iiExprArith3(&(yyval.lv),(yyvsp[(1) - (8)].i),&(yyvsp[(3) - (8)].lv),&(yyvsp[(5) - (8)].lv),&(yyvsp[(7) - (8)].lv))) YYERROR;
     
    28552876
    28562877/* Line 1464 of yacc.c  */
    2857 #line 668 "grammar.y"
     2878#line 665 "grammar.y"
    28582879    {
    28592880            if(iiExprArith3(&(yyval.lv),(yyvsp[(1) - (8)].i),&(yyvsp[(3) - (8)].lv),&(yyvsp[(5) - (8)].lv),&(yyvsp[(7) - (8)].lv))) YYERROR;
     
    28642885
    28652886/* Line 1464 of yacc.c  */
    2866 #line 672 "grammar.y"
     2887#line 669 "grammar.y"
    28672888    {
    28682889            if(iiExprArith3(&(yyval.lv),(yyvsp[(1) - (8)].i),&(yyvsp[(3) - (8)].lv),&(yyvsp[(5) - (8)].lv),&(yyvsp[(7) - (8)].lv))) YYERROR;
     
    28732894
    28742895/* Line 1464 of yacc.c  */
    2875 #line 676 "grammar.y"
     2896#line 673 "grammar.y"
    28762897    {
    28772898            if(iiExprArith3(&(yyval.lv),(yyvsp[(1) - (8)].i),&(yyvsp[(3) - (8)].lv),&(yyvsp[(5) - (8)].lv),&(yyvsp[(7) - (8)].lv))) YYERROR;
     
    28822903
    28832904/* Line 1464 of yacc.c  */
    2884 #line 680 "grammar.y"
     2905#line 677 "grammar.y"
    28852906    {
    28862907            if(iiExprArithM(&(yyval.lv),NULL,(yyvsp[(1) - (3)].i))) YYERROR;
     
    28912912
    28922913/* Line 1464 of yacc.c  */
    2893 #line 684 "grammar.y"
     2914#line 681 "grammar.y"
    28942915    {
    28952916            if(iiExprArithM(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
     
    29002921
    29012922/* Line 1464 of yacc.c  */
    2902 #line 688 "grammar.y"
     2923#line 685 "grammar.y"
    29032924    {
    29042925            if(iiExprArith3(&(yyval.lv),(yyvsp[(1) - (8)].i),&(yyvsp[(3) - (8)].lv),&(yyvsp[(5) - (8)].lv),&(yyvsp[(7) - (8)].lv))) YYERROR;
     
    29092930
    29102931/* Line 1464 of yacc.c  */
    2911 #line 692 "grammar.y"
     2932#line 689 "grammar.y"
    29122933    {
    29132934            if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
     
    29182939
    29192940/* Line 1464 of yacc.c  */
    2920 #line 696 "grammar.y"
     2941#line 693 "grammar.y"
    29212942    {
    29222943            if(iiExprArith3(&(yyval.lv),RING_CMD,&(yyvsp[(3) - (8)].lv),&(yyvsp[(5) - (8)].lv),&(yyvsp[(7) - (8)].lv))) YYERROR;
     
    29272948
    29282949/* Line 1464 of yacc.c  */
    2929 #line 700 "grammar.y"
     2950#line 697 "grammar.y"
    29302951    {
    29312952            if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),RING_CMD)) YYERROR;
     
    29362957
    29372958/* Line 1464 of yacc.c  */
    2938 #line 707 "grammar.y"
     2959#line 704 "grammar.y"
    29392960    {
    29402961            leftv v = &(yyvsp[(1) - (3)].lv);
     
    29522973
    29532974/* Line 1464 of yacc.c  */
    2954 #line 718 "grammar.y"
     2975#line 715 "grammar.y"
    29552976    {
    29562977            (yyval.lv) = (yyvsp[(1) - (1)].lv);
     
    29612982
    29622983/* Line 1464 of yacc.c  */
    2963 #line 724 "grammar.y"
     2984#line 721 "grammar.y"
    29642985    {
    29652986            /*if ($1.typ == eunknown) YYERROR;*/
     
    29712992
    29722993/* Line 1464 of yacc.c  */
     2994#line 725 "grammar.y"
     2995    { (yyval.lv) = (yyvsp[(1) - (1)].lv); ;}
     2996    break;
     2997
     2998  case 69:
     2999
     3000/* Line 1464 of yacc.c  */
     3001#line 726 "grammar.y"
     3002    { (yyval.lv) = (yyvsp[(2) - (3)].lv); ;}
     3003    break;
     3004
     3005  case 70:
     3006
     3007/* Line 1464 of yacc.c  */
    29733008#line 728 "grammar.y"
    2974     { (yyval.lv) = (yyvsp[(1) - (1)].lv); ;}
    2975     break;
    2976 
    2977   case 69:
    2978 
    2979 /* Line 1464 of yacc.c  */
    2980 #line 729 "grammar.y"
    2981     { (yyval.lv) = (yyvsp[(2) - (3)].lv); ;}
    2982     break;
    2983 
    2984   case 70:
    2985 
    2986 /* Line 1464 of yacc.c  */
    2987 #line 731 "grammar.y"
    29883009    {
    29893010            if(iiExprArith3(&(yyval.lv),'[',&(yyvsp[(1) - (6)].lv),&(yyvsp[(3) - (6)].lv),&(yyvsp[(5) - (6)].lv))) YYERROR;
     
    29943015
    29953016/* Line 1464 of yacc.c  */
    2996 #line 735 "grammar.y"
     3017#line 732 "grammar.y"
    29973018    {
    29983019            if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (4)].lv),'[',&(yyvsp[(3) - (4)].lv))) YYERROR;
     
    30033024
    30043025/* Line 1464 of yacc.c  */
    3005 #line 739 "grammar.y"
     3026#line 736 "grammar.y"
    30063027    {
    30073028            if (iiApply(&(yyval.lv), &(yyvsp[(3) - (6)].lv), (yyvsp[(5) - (6)].i), NULL)) YYERROR;
     
    30123033
    30133034/* Line 1464 of yacc.c  */
    3014 #line 743 "grammar.y"
     3035#line 740 "grammar.y"
    30153036    {
    30163037            if (iiApply(&(yyval.lv), &(yyvsp[(3) - (6)].lv), (yyvsp[(5) - (6)].i), NULL)) YYERROR;
     
    30213042
    30223043/* Line 1464 of yacc.c  */
    3023 #line 747 "grammar.y"
     3044#line 744 "grammar.y"
    30243045    {
    30253046            if (iiApply(&(yyval.lv), &(yyvsp[(3) - (6)].lv), (yyvsp[(5) - (6)].i), NULL)) YYERROR;
     
    30303051
    30313052/* Line 1464 of yacc.c  */
    3032 #line 751 "grammar.y"
     3053#line 748 "grammar.y"
    30333054    {
    30343055            if (iiApply(&(yyval.lv), &(yyvsp[(3) - (6)].lv), (yyvsp[(5) - (6)].i), NULL)) YYERROR;
     
    30393060
    30403061/* Line 1464 of yacc.c  */
    3041 #line 755 "grammar.y"
     3062#line 752 "grammar.y"
    30423063    {
    30433064            if (iiApply(&(yyval.lv), &(yyvsp[(3) - (6)].lv), (yyvsp[(5) - (6)].i), NULL)) YYERROR;
     
    30483069
    30493070/* Line 1464 of yacc.c  */
    3050 #line 759 "grammar.y"
     3071#line 756 "grammar.y"
    30513072    {
    30523073            if (iiApply(&(yyval.lv), &(yyvsp[(3) - (6)].lv), 0, &(yyvsp[(5) - (6)].lv))) YYERROR;
     
    30573078
    30583079/* Line 1464 of yacc.c  */
    3059 #line 763 "grammar.y"
     3080#line 760 "grammar.y"
    30603081    {
    30613082            (yyval.lv)=(yyvsp[(2) - (3)].lv);
     
    30663087
    30673088/* Line 1464 of yacc.c  */
    3068 #line 767 "grammar.y"
     3089#line 764 "grammar.y"
    30693090    {
    30703091            #ifdef SIQ
     
    30883109
    30893110/* Line 1464 of yacc.c  */
    3090 #line 784 "grammar.y"
     3111#line 781 "grammar.y"
     3112    {
     3113            iiTestAssume(&(yyvsp[(2) - (5)].lv),&(yyvsp[(4) - (5)].lv));
     3114            memset(&(yyval.lv),0,sizeof((yyval.lv)));
     3115            (yyval.lv).rtyp=NONE;
     3116          ;}
     3117    break;
     3118
     3119  case 81:
     3120
     3121/* Line 1464 of yacc.c  */
     3122#line 787 "grammar.y"
    30913123    {
    30923124            #ifdef SIQ
     
    30963128    break;
    30973129
    3098   case 81:
    3099 
    3100 /* Line 1464 of yacc.c  */
    3101 #line 790 "grammar.y"
     3130  case 82:
     3131
     3132/* Line 1464 of yacc.c  */
     3133#line 793 "grammar.y"
    31023134    {
    31033135            #ifdef SIQ
     
    31113143    break;
    31123144
    3113   case 82:
    3114 
    3115 /* Line 1464 of yacc.c  */
    3116 #line 802 "grammar.y"
     3145  case 83:
     3146
     3147/* Line 1464 of yacc.c  */
     3148#line 805 "grammar.y"
    31173149    {
    31183150            #ifdef SIQ
     
    31223154    break;
    31233155
    3124   case 83:
    3125 
    3126 /* Line 1464 of yacc.c  */
    3127 #line 810 "grammar.y"
     3156  case 84:
     3157
     3158/* Line 1464 of yacc.c  */
     3159#line 813 "grammar.y"
     3160    {
     3161            #ifdef SIQ
     3162            siq++;
     3163            #endif
     3164          ;}
     3165    break;
     3166
     3167  case 85:
     3168
     3169/* Line 1464 of yacc.c  */
     3170#line 821 "grammar.y"
    31283171    {
    31293172            #ifdef SIQ
     
    31333176    break;
    31343177
    3135   case 84:
    3136 
    3137 /* Line 1464 of yacc.c  */
    3138 #line 819 "grammar.y"
     3178  case 86:
     3179
     3180/* Line 1464 of yacc.c  */
     3181#line 830 "grammar.y"
    31393182    {
    31403183            if(iiExprArith1(&(yyval.lv),&(yyvsp[(1) - (2)].lv),PLUSPLUS)) YYERROR;
     
    31423185    break;
    31433186
    3144   case 85:
    3145 
    3146 /* Line 1464 of yacc.c  */
    3147 #line 823 "grammar.y"
     3187  case 87:
     3188
     3189/* Line 1464 of yacc.c  */
     3190#line 834 "grammar.y"
    31483191    {
    31493192            if(iiExprArith1(&(yyval.lv),&(yyvsp[(1) - (2)].lv),MINUSMINUS)) YYERROR;
     
    31513194    break;
    31523195
    3153   case 86:
    3154 
    3155 /* Line 1464 of yacc.c  */
    3156 #line 827 "grammar.y"
     3196  case 88:
     3197
     3198/* Line 1464 of yacc.c  */
     3199#line 838 "grammar.y"
    31573200    {
    31583201            if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),'+',&(yyvsp[(3) - (3)].lv))) YYERROR;
     
    31603203    break;
    31613204
    3162   case 87:
    3163 
    3164 /* Line 1464 of yacc.c  */
    3165 #line 831 "grammar.y"
     3205  case 89:
     3206
     3207/* Line 1464 of yacc.c  */
     3208#line 842 "grammar.y"
    31663209    {
    31673210            if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),'-',&(yyvsp[(3) - (3)].lv))) YYERROR;
     
    31693212    break;
    31703213
    3171   case 88:
    3172 
    3173 /* Line 1464 of yacc.c  */
    3174 #line 835 "grammar.y"
     3214  case 90:
     3215
     3216/* Line 1464 of yacc.c  */
     3217#line 846 "grammar.y"
    31753218    {
    31763219            if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),(yyvsp[(2) - (3)].i),&(yyvsp[(3) - (3)].lv))) YYERROR;
     
    31783221    break;
    31793222
    3180   case 89:
    3181 
    3182 /* Line 1464 of yacc.c  */
    3183 #line 839 "grammar.y"
     3223  case 91:
     3224
     3225/* Line 1464 of yacc.c  */
     3226#line 850 "grammar.y"
    31843227    {
    31853228            if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),'^',&(yyvsp[(3) - (3)].lv))) YYERROR;
     
    31873230    break;
    31883231
    3189   case 90:
    3190 
    3191 /* Line 1464 of yacc.c  */
    3192 #line 843 "grammar.y"
     3232  case 92:
     3233
     3234/* Line 1464 of yacc.c  */
     3235#line 854 "grammar.y"
    31933236    {
    31943237            if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),(yyvsp[(2) - (3)].i),&(yyvsp[(3) - (3)].lv))) YYERROR;
     
    31963239    break;
    31973240
    3198   case 91:
    3199 
    3200 /* Line 1464 of yacc.c  */
    3201 #line 847 "grammar.y"
     3241  case 93:
     3242
     3243/* Line 1464 of yacc.c  */
     3244#line 858 "grammar.y"
    32023245    {
    32033246            if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),(yyvsp[(2) - (3)].i),&(yyvsp[(3) - (3)].lv))) YYERROR;
     
    32053248    break;
    32063249
    3207   case 92:
    3208 
    3209 /* Line 1464 of yacc.c  */
    3210 #line 851 "grammar.y"
     3250  case 94:
     3251
     3252/* Line 1464 of yacc.c  */
     3253#line 862 "grammar.y"
    32113254    {
    32123255            if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),NOTEQUAL,&(yyvsp[(3) - (3)].lv))) YYERROR;
     
    32143257    break;
    32153258
    3216   case 93:
    3217 
    3218 /* Line 1464 of yacc.c  */
    3219 #line 855 "grammar.y"
     3259  case 95:
     3260
     3261/* Line 1464 of yacc.c  */
     3262#line 866 "grammar.y"
    32203263    {
    32213264            if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),EQUAL_EQUAL,&(yyvsp[(3) - (3)].lv))) YYERROR;
     
    32233266    break;
    32243267
    3225   case 94:
    3226 
    3227 /* Line 1464 of yacc.c  */
    3228 #line 859 "grammar.y"
     3268  case 96:
     3269
     3270/* Line 1464 of yacc.c  */
     3271#line 870 "grammar.y"
    32293272    {
    32303273            if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),DOTDOT,&(yyvsp[(3) - (3)].lv))) YYERROR;
     
    32323275    break;
    32333276
    3234   case 95:
    3235 
    3236 /* Line 1464 of yacc.c  */
    3237 #line 863 "grammar.y"
     3277  case 97:
     3278
     3279/* Line 1464 of yacc.c  */
     3280#line 874 "grammar.y"
    32383281    {
    32393282            if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),':',&(yyvsp[(3) - (3)].lv))) YYERROR;
     
    32413284    break;
    32423285
    3243   case 96:
    3244 
    3245 /* Line 1464 of yacc.c  */
    3246 #line 867 "grammar.y"
     3286  case 98:
     3287
     3288/* Line 1464 of yacc.c  */
     3289#line 878 "grammar.y"
    32473290    {
    32483291            memset(&(yyval.lv),0,sizeof((yyval.lv)));
     
    32533296    break;
    32543297
    3255   case 97:
    3256 
    3257 /* Line 1464 of yacc.c  */
    3258 #line 874 "grammar.y"
     3298  case 99:
     3299
     3300/* Line 1464 of yacc.c  */
     3301#line 885 "grammar.y"
    32593302    {
    32603303            if(iiExprArith1(&(yyval.lv),&(yyvsp[(2) - (2)].lv),'-')) YYERROR;
     
    32623305    break;
    32633306
    3264   case 98:
    3265 
    3266 /* Line 1464 of yacc.c  */
    3267 #line 880 "grammar.y"
     3307  case 100:
     3308
     3309/* Line 1464 of yacc.c  */
     3310#line 891 "grammar.y"
    32683311    { (yyval.lv) = (yyvsp[(1) - (2)].lv); ;}
    32693312    break;
    32703313
    3271   case 99:
    3272 
    3273 /* Line 1464 of yacc.c  */
    3274 #line 882 "grammar.y"
     3314  case 101:
     3315
     3316/* Line 1464 of yacc.c  */
     3317#line 893 "grammar.y"
    32753318    {
    32763319            if ((yyvsp[(1) - (2)].lv).rtyp==0)
     
    32893332    break;
    32903333
    3291   case 101:
    3292 
    3293 /* Line 1464 of yacc.c  */
    3294 #line 902 "grammar.y"
     3334  case 103:
     3335
     3336/* Line 1464 of yacc.c  */
     3337#line 913 "grammar.y"
    32953338    {
    32963339            if ((yyvsp[(2) - (3)].lv).Typ()!=STRING_CMD)
     
    33033346    break;
    33043347
    3305   case 102:
    3306 
    3307 /* Line 1464 of yacc.c  */
    3308 #line 914 "grammar.y"
     3348  case 104:
     3349
     3350/* Line 1464 of yacc.c  */
     3351#line 925 "grammar.y"
    33093352    {
    33103353            if (iiDeclCommand(&(yyval.lv),&(yyvsp[(2) - (2)].lv),myynest,(yyvsp[(1) - (2)].i),&((yyvsp[(2) - (2)].lv).req_packhdl->idroot)))
     
    33133356    break;
    33143357
    3315   case 103:
    3316 
    3317 /* Line 1464 of yacc.c  */
    3318 #line 919 "grammar.y"
     3358  case 105:
     3359
     3360/* Line 1464 of yacc.c  */
     3361#line 930 "grammar.y"
    33193362    {
    33203363            if (iiDeclCommand(&(yyval.lv),&(yyvsp[(2) - (2)].lv),myynest,(yyvsp[(1) - (2)].i),&((yyvsp[(2) - (2)].lv).req_packhdl->idroot)))
     
    33233366    break;
    33243367
    3325   case 104:
    3326 
    3327 /* Line 1464 of yacc.c  */
    3328 #line 924 "grammar.y"
     3368  case 106:
     3369
     3370/* Line 1464 of yacc.c  */
     3371#line 935 "grammar.y"
    33293372    {
    33303373            if (iiDeclCommand(&(yyval.lv),&(yyvsp[(2) - (2)].lv),myynest,(yyvsp[(1) - (2)].i),&(currRing->idroot), TRUE)) YYERROR;
     
    33323375    break;
    33333376
    3334   case 105:
    3335 
    3336 /* Line 1464 of yacc.c  */
    3337 #line 928 "grammar.y"
     3377  case 107:
     3378
     3379/* Line 1464 of yacc.c  */
     3380#line 939 "grammar.y"
    33383381    {
    33393382            if (iiDeclCommand(&(yyval.lv),&(yyvsp[(2) - (2)].lv),myynest,(yyvsp[(1) - (2)].i),&(currRing->idroot), TRUE)) YYERROR;
     
    33413384    break;
    33423385
    3343   case 106:
    3344 
    3345 /* Line 1464 of yacc.c  */
    3346 #line 932 "grammar.y"
     3386  case 108:
     3387
     3388/* Line 1464 of yacc.c  */
     3389#line 943 "grammar.y"
    33473390    {
    33483391            int r; TESTSETINT((yyvsp[(4) - (8)].lv),r);
     
    33863429    break;
    33873430
    3388   case 107:
    3389 
    3390 /* Line 1464 of yacc.c  */
    3391 #line 972 "grammar.y"
     3431  case 109:
     3432
     3433/* Line 1464 of yacc.c  */
     3434#line 983 "grammar.y"
    33923435    {
    33933436            if ((yyvsp[(1) - (2)].i) == MATRIX_CMD)
     
    34173460    break;
    34183461
    3419   case 108:
    3420 
    3421 /* Line 1464 of yacc.c  */
    3422 #line 998 "grammar.y"
     3462  case 110:
     3463
     3464/* Line 1464 of yacc.c  */
     3465#line 1009 "grammar.y"
    34233466    {
    34243467            int t=(yyvsp[(1) - (3)].lv).Typ();
     
    34433486    break;
    34443487
    3445   case 109:
    3446 
    3447 /* Line 1464 of yacc.c  */
    3448 #line 1019 "grammar.y"
     3488  case 111:
     3489
     3490/* Line 1464 of yacc.c  */
     3491#line 1030 "grammar.y"
    34493492    {
    34503493            if (iiDeclCommand(&(yyval.lv),&(yyvsp[(2) - (2)].lv),myynest,(yyvsp[(1) - (2)].i),&((yyvsp[(2) - (2)].lv).req_packhdl->idroot)))
     
    34533496    break;
    34543497
    3455   case 112:
    3456 
    3457 /* Line 1464 of yacc.c  */
    3458 #line 1032 "grammar.y"
     3498  case 114:
     3499
     3500/* Line 1464 of yacc.c  */
     3501#line 1043 "grammar.y"
    34593502    {
    34603503            leftv v = &(yyvsp[(2) - (5)].lv);
     
    34693512    break;
    34703513
    3471   case 113:
    3472 
    3473 /* Line 1464 of yacc.c  */
    3474 #line 1046 "grammar.y"
     3514  case 115:
     3515
     3516/* Line 1464 of yacc.c  */
     3517#line 1057 "grammar.y"
    34753518    {
    34763519          // let rInit take care of any errors
     
    34793522    break;
    34803523
    3481   case 114:
    3482 
    3483 /* Line 1464 of yacc.c  */
    3484 #line 1054 "grammar.y"
     3524  case 116:
     3525
     3526/* Line 1464 of yacc.c  */
     3527#line 1065 "grammar.y"
    34853528    {
    34863529            memset(&(yyval.lv),0,sizeof((yyval.lv)));
     
    34933536    break;
    34943537
    3495   case 115:
    3496 
    3497 /* Line 1464 of yacc.c  */
    3498 #line 1063 "grammar.y"
     3538  case 117:
     3539
     3540/* Line 1464 of yacc.c  */
     3541#line 1074 "grammar.y"
    34993542    {
    35003543            memset(&(yyval.lv),0,sizeof((yyval.lv)));
     
    35403583    break;
    35413584
    3542   case 117:
    3543 
    3544 /* Line 1464 of yacc.c  */
    3545 #line 1109 "grammar.y"
     3585  case 119:
     3586
     3587/* Line 1464 of yacc.c  */
     3588#line 1120 "grammar.y"
    35463589    {
    35473590            (yyval.lv) = (yyvsp[(1) - (3)].lv);
     
    35513594    break;
    35523595
    3553   case 119:
    3554 
    3555 /* Line 1464 of yacc.c  */
    3556 #line 1119 "grammar.y"
     3596  case 121:
     3597
     3598/* Line 1464 of yacc.c  */
     3599#line 1130 "grammar.y"
    35573600    {
    35583601            (yyval.lv) = (yyvsp[(2) - (3)].lv);
     
    35603603    break;
    35613604
    3562   case 120:
    3563 
    3564 /* Line 1464 of yacc.c  */
    3565 #line 1125 "grammar.y"
     3605  case 122:
     3606
     3607/* Line 1464 of yacc.c  */
     3608#line 1136 "grammar.y"
    35663609    {
    35673610            expected_parms = TRUE;
     
    35693612    break;
    35703613
    3571   case 121:
    3572 
    3573 /* Line 1464 of yacc.c  */
    3574 #line 1132 "grammar.y"
     3614  case 123:
     3615
     3616/* Line 1464 of yacc.c  */
     3617#line 1143 "grammar.y"
    35753618    { (yyval.i) = (yyvsp[(1) - (1)].i); ;}
    35763619    break;
    35773620
    3578   case 122:
    3579 
    3580 /* Line 1464 of yacc.c  */
    3581 #line 1134 "grammar.y"
     3621  case 124:
     3622
     3623/* Line 1464 of yacc.c  */
     3624#line 1145 "grammar.y"
    35823625    { (yyval.i) = (yyvsp[(1) - (1)].i); ;}
    35833626    break;
    35843627
    3585   case 123:
    3586 
    3587 /* Line 1464 of yacc.c  */
    3588 #line 1136 "grammar.y"
     3628  case 125:
     3629
     3630/* Line 1464 of yacc.c  */
     3631#line 1147 "grammar.y"
    35893632    { (yyval.i) = (yyvsp[(1) - (1)].i); ;}
    35903633    break;
    35913634
    3592   case 124:
    3593 
    3594 /* Line 1464 of yacc.c  */
    3595 #line 1145 "grammar.y"
     3635  case 126:
     3636
     3637/* Line 1464 of yacc.c  */
     3638#line 1156 "grammar.y"
    35963639    { if ((yyvsp[(1) - (2)].i) != '<') YYERROR;
    35973640            if((feFilePending=feFopen((yyvsp[(2) - (2)].name),"r",NULL,TRUE))==NULL) YYERROR; ;}
    35983641    break;
    35993642
    3600   case 125:
    3601 
    3602 /* Line 1464 of yacc.c  */
    3603 #line 1148 "grammar.y"
     3643  case 127:
     3644
     3645/* Line 1464 of yacc.c  */
     3646#line 1159 "grammar.y"
    36043647    { newFile((yyvsp[(2) - (4)].name),feFilePending); ;}
    36053648    break;
    36063649
    3607   case 126:
    3608 
    3609 /* Line 1464 of yacc.c  */
    3610 #line 1153 "grammar.y"
     3650  case 128:
     3651
     3652/* Line 1464 of yacc.c  */
     3653#line 1164 "grammar.y"
    36113654    {
    36123655            feHelp((yyvsp[(2) - (3)].name));
     
    36153658    break;
    36163659
    3617   case 127:
    3618 
    3619 /* Line 1464 of yacc.c  */
    3620 #line 1158 "grammar.y"
     3660  case 129:
     3661
     3662/* Line 1464 of yacc.c  */
     3663#line 1169 "grammar.y"
    36213664    {
    36223665            feHelp(NULL);
     
    36243667    break;
    36253668
    3626   case 128:
    3627 
    3628 /* Line 1464 of yacc.c  */
    3629 #line 1165 "grammar.y"
     3669  case 130:
     3670
     3671/* Line 1464 of yacc.c  */
     3672#line 1176 "grammar.y"
    36303673    {
    36313674            singular_example((yyvsp[(2) - (3)].name));
     
    36343677    break;
    36353678
    3636   case 129:
    3637 
    3638 /* Line 1464 of yacc.c  */
    3639 #line 1173 "grammar.y"
     3679  case 131:
     3680
     3681/* Line 1464 of yacc.c  */
     3682#line 1184 "grammar.y"
    36403683    {
    36413684          if (basePack!=(yyvsp[(2) - (2)].lv).req_packhdl)
     
    36483691    break;
    36493692
    3650   case 130:
    3651 
    3652 /* Line 1464 of yacc.c  */
    3653 #line 1185 "grammar.y"
     3693  case 132:
     3694
     3695/* Line 1464 of yacc.c  */
     3696#line 1196 "grammar.y"
    36543697    {
    36553698          leftv v=&(yyvsp[(2) - (2)].lv);
     
    36693712    break;
    36703713
    3671   case 131:
    3672 
    3673 /* Line 1464 of yacc.c  */
    3674 #line 1201 "grammar.y"
     3714  case 133:
     3715
     3716/* Line 1464 of yacc.c  */
     3717#line 1212 "grammar.y"
    36753718    {
    36763719          leftv v=&(yyvsp[(3) - (3)].lv);
     
    36903733    break;
    36913734
    3692   case 132:
    3693 
    3694 /* Line 1464 of yacc.c  */
    3695 #line 1220 "grammar.y"
     3735  case 134:
     3736
     3737/* Line 1464 of yacc.c  */
     3738#line 1231 "grammar.y"
    36963739    {
    36973740            list_cmd((yyvsp[(3) - (4)].i),NULL,"// ",TRUE);
     
    36993742    break;
    37003743
    3701   case 133:
    3702 
    3703 /* Line 1464 of yacc.c  */
    3704 #line 1224 "grammar.y"
     3744  case 135:
     3745
     3746/* Line 1464 of yacc.c  */
     3747#line 1235 "grammar.y"
    37053748    {
    37063749            list_cmd((yyvsp[(3) - (4)].i),NULL,"// ",TRUE);
     
    37083751    break;
    37093752
    3710   case 134:
    3711 
    3712 /* Line 1464 of yacc.c  */
    3713 #line 1228 "grammar.y"
     3753  case 136:
     3754
     3755/* Line 1464 of yacc.c  */
     3756#line 1239 "grammar.y"
    37143757    {
    37153758            if ((yyvsp[(3) - (4)].i)==QRING_CMD) (yyvsp[(3) - (4)].i)=RING_CMD;
     
    37183761    break;
    37193762
    3720   case 135:
    3721 
    3722 /* Line 1464 of yacc.c  */
    3723 #line 1233 "grammar.y"
     3763  case 137:
     3764
     3765/* Line 1464 of yacc.c  */
     3766#line 1244 "grammar.y"
    37243767    {
    37253768            list_cmd((yyvsp[(3) - (4)].i),NULL,"// ",TRUE);
     
    37273770    break;
    37283771
    3729   case 136:
    3730 
    3731 /* Line 1464 of yacc.c  */
    3732 #line 1237 "grammar.y"
     3772  case 138:
     3773
     3774/* Line 1464 of yacc.c  */
     3775#line 1248 "grammar.y"
    37333776    {
    37343777            list_cmd(RING_CMD,NULL,"// ",TRUE);
     
    37363779    break;
    37373780
    3738   case 137:
    3739 
    3740 /* Line 1464 of yacc.c  */
    3741 #line 1241 "grammar.y"
     3781  case 139:
     3782
     3783/* Line 1464 of yacc.c  */
     3784#line 1252 "grammar.y"
    37423785    {
    37433786            list_cmd((yyvsp[(3) - (4)].i),NULL,"// ",TRUE);
     
    37453788    break;
    37463789
    3747   case 138:
    3748 
    3749 /* Line 1464 of yacc.c  */
    3750 #line 1245 "grammar.y"
     3790  case 140:
     3791
     3792/* Line 1464 of yacc.c  */
     3793#line 1256 "grammar.y"
    37513794    {
    37523795            list_cmd(PROC_CMD,NULL,"// ",TRUE);
     
    37543797    break;
    37553798
    3756   case 139:
    3757 
    3758 /* Line 1464 of yacc.c  */
    3759 #line 1249 "grammar.y"
     3799  case 141:
     3800
     3801/* Line 1464 of yacc.c  */
     3802#line 1260 "grammar.y"
    37603803    {
    37613804            list_cmd(0,(yyvsp[(3) - (4)].lv).Fullname(),"// ",TRUE);
     
    37643807    break;
    37653808
    3766   case 140:
    3767 
    3768 /* Line 1464 of yacc.c  */
    3769 #line 1254 "grammar.y"
     3809  case 142:
     3810
     3811/* Line 1464 of yacc.c  */
     3812#line 1265 "grammar.y"
    37703813    {
    37713814            if((yyvsp[(3) - (6)].lv).Typ() == PACKAGE_CMD)
     
    37753818    break;
    37763819
    3777   case 141:
    3778 
    3779 /* Line 1464 of yacc.c  */
    3780 #line 1260 "grammar.y"
     3820  case 143:
     3821
     3822/* Line 1464 of yacc.c  */
     3823#line 1271 "grammar.y"
    37813824    {
    37823825            if((yyvsp[(3) - (6)].lv).Typ() == PACKAGE_CMD)
     
    37863829    break;
    37873830
    3788   case 142:
    3789 
    3790 /* Line 1464 of yacc.c  */
    3791 #line 1266 "grammar.y"
     3831  case 144:
     3832
     3833/* Line 1464 of yacc.c  */
     3834#line 1277 "grammar.y"
    37923835    {
    37933836            if((yyvsp[(3) - (6)].lv).Typ() == PACKAGE_CMD)
     
    37973840    break;
    37983841
    3799   case 143:
    3800 
    3801 /* Line 1464 of yacc.c  */
    3802 #line 1272 "grammar.y"
     3842  case 145:
     3843
     3844/* Line 1464 of yacc.c  */
     3845#line 1283 "grammar.y"
    38033846    {
    38043847            if((yyvsp[(3) - (6)].lv).Typ() == PACKAGE_CMD)
     
    38083851    break;
    38093852
    3810   case 144:
    3811 
    3812 /* Line 1464 of yacc.c  */
    3813 #line 1278 "grammar.y"
     3853  case 146:
     3854
     3855/* Line 1464 of yacc.c  */
     3856#line 1289 "grammar.y"
    38143857    {
    38153858            if((yyvsp[(3) - (6)].lv).Typ() == PACKAGE_CMD)
     
    38193862    break;
    38203863
    3821   case 145:
    3822 
    3823 /* Line 1464 of yacc.c  */
    3824 #line 1284 "grammar.y"
     3864  case 147:
     3865
     3866/* Line 1464 of yacc.c  */
     3867#line 1295 "grammar.y"
    38253868    {
    38263869            if((yyvsp[(3) - (6)].lv).Typ() == PACKAGE_CMD)
     
    38303873    break;
    38313874
    3832   case 146:
    3833 
    3834 /* Line 1464 of yacc.c  */
    3835 #line 1290 "grammar.y"
     3875  case 148:
     3876
     3877/* Line 1464 of yacc.c  */
     3878#line 1301 "grammar.y"
    38363879    {
    38373880            if((yyvsp[(3) - (6)].lv).Typ() == PACKAGE_CMD)
     
    38413884    break;
    38423885
    3843   case 147:
    3844 
    3845 /* Line 1464 of yacc.c  */
    3846 #line 1302 "grammar.y"
     3886  case 149:
     3887
     3888/* Line 1464 of yacc.c  */
     3889#line 1313 "grammar.y"
    38473890    {
    38483891            list_cmd(-1,NULL,"// ",TRUE);
     
    38503893    break;
    38513894
    3852   case 148:
    3853 
    3854 /* Line 1464 of yacc.c  */
    3855 #line 1308 "grammar.y"
     3895  case 150:
     3896
     3897/* Line 1464 of yacc.c  */
     3898#line 1319 "grammar.y"
    38563899    { yyInRingConstruction = TRUE; ;}
    38573900    break;
    38583901
    3859   case 149:
    3860 
    3861 /* Line 1464 of yacc.c  */
    3862 #line 1317 "grammar.y"
     3902  case 151:
     3903
     3904/* Line 1464 of yacc.c  */
     3905#line 1328 "grammar.y"
    38633906    {
    38643907            const char *ring_name = (yyvsp[(2) - (8)].lv).name;
     
    38953938    break;
    38963939
    3897   case 150:
    3898 
    3899 /* Line 1464 of yacc.c  */
    3900 #line 1350 "grammar.y"
     3940  case 152:
     3941
     3942/* Line 1464 of yacc.c  */
     3943#line 1361 "grammar.y"
    39013944    {
    39023945            const char *ring_name = (yyvsp[(2) - (2)].lv).name;
     
    39073950    break;
    39083951
    3909   case 151:
    3910 
    3911 /* Line 1464 of yacc.c  */
    3912 #line 1360 "grammar.y"
     3952  case 153:
     3953
     3954/* Line 1464 of yacc.c  */
     3955#line 1371 "grammar.y"
    39133956    {
    39143957            if (((yyvsp[(1) - (2)].i)!=LIB_CMD)||(jjLOAD((yyvsp[(2) - (2)].name),TRUE))) YYERROR;
     
    39163959    break;
    39173960
    3918   case 154:
    3919 
    3920 /* Line 1464 of yacc.c  */
    3921 #line 1369 "grammar.y"
     3961  case 156:
     3962
     3963/* Line 1464 of yacc.c  */
     3964#line 1380 "grammar.y"
    39223965    {
    39233966            if (((yyvsp[(1) - (2)].i)==KEEPRING_CMD) && (myynest==0))
     
    39904033    break;
    39914034
    3992   case 155:
    3993 
    3994 /* Line 1464 of yacc.c  */
    3995 #line 1441 "grammar.y"
     4035  case 157:
     4036
     4037/* Line 1464 of yacc.c  */
     4038#line 1452 "grammar.y"
    39964039    {
    39974040            type_cmd(&((yyvsp[(2) - (2)].lv)));
     
    39994042    break;
    40004043
    4001   case 156:
    4002 
    4003 /* Line 1464 of yacc.c  */
    4004 #line 1445 "grammar.y"
     4044  case 158:
     4045
     4046/* Line 1464 of yacc.c  */
     4047#line 1456 "grammar.y"
    40054048    {
    40064049            //Print("typ is %d, rtyp:%d\n",$1.Typ(),$1.rtyp);
     
    40274070    break;
    40284071
    4029   case 157:
    4030 
    4031 /* Line 1464 of yacc.c  */
    4032 #line 1474 "grammar.y"
     4072  case 159:
     4073
     4074/* Line 1464 of yacc.c  */
     4075#line 1485 "grammar.y"
    40334076    {
    40344077            int i; TESTSETINT((yyvsp[(3) - (5)].lv),i);
     
    40454088    break;
    40464089
    4047   case 158:
    4048 
    4049 /* Line 1464 of yacc.c  */
    4050 #line 1487 "grammar.y"
     4090  case 160:
     4091
     4092/* Line 1464 of yacc.c  */
     4093#line 1498 "grammar.y"
    40514094    {
    40524095            if (currentVoice->ifsw==1)
     
    40674110    break;
    40684111
    4069   case 159:
    4070 
    4071 /* Line 1464 of yacc.c  */
    4072 #line 1504 "grammar.y"
     4112  case 161:
     4113
     4114/* Line 1464 of yacc.c  */
     4115#line 1515 "grammar.y"
    40734116    {
    40744117            int i; TESTSETINT((yyvsp[(3) - (5)].lv),i);
     
    40814124    break;
    40824125
    4083   case 160:
    4084 
    4085 /* Line 1464 of yacc.c  */
    4086 #line 1513 "grammar.y"
     4126  case 162:
     4127
     4128/* Line 1464 of yacc.c  */
     4129#line 1524 "grammar.y"
    40874130    {
    40884131            if (exitBuffer(BT_break)) YYERROR;
     
    40914134    break;
    40924135
    4093   case 161:
    4094 
    4095 /* Line 1464 of yacc.c  */
    4096 #line 1518 "grammar.y"
     4136  case 163:
     4137
     4138/* Line 1464 of yacc.c  */
     4139#line 1529 "grammar.y"
    40974140    {
    40984141            if (contBuffer(BT_break)) YYERROR;
     
    41014144    break;
    41024145
    4103   case 162:
    4104 
    4105 /* Line 1464 of yacc.c  */
    4106 #line 1526 "grammar.y"
     4146  case 164:
     4147
     4148/* Line 1464 of yacc.c  */
     4149#line 1537 "grammar.y"
    41074150    {
    41084151            /* -> if(!$2) break; $3; continue;*/
     
    41154158    break;
    41164159
    4117   case 163:
    4118 
    4119 /* Line 1464 of yacc.c  */
    4120 #line 1538 "grammar.y"
     4160  case 165:
     4161
     4162/* Line 1464 of yacc.c  */
     4163#line 1549 "grammar.y"
    41214164    {
    41224165            /* $2 */
     
    41364179    break;
    41374180
    4138   case 164:
    4139 
    4140 /* Line 1464 of yacc.c  */
    4141 #line 1557 "grammar.y"
     4181  case 166:
     4182
     4183/* Line 1464 of yacc.c  */
     4184#line 1568 "grammar.y"
    41424185    {
    41434186            idhdl h = enterid((yyvsp[(2) - (3)].name),myynest,PROC_CMD,&IDROOT,TRUE);
     
    41514194    break;
    41524195
    4153   case 165:
    4154 
    4155 /* Line 1464 of yacc.c  */
    4156 #line 1567 "grammar.y"
     4196  case 167:
     4197
     4198/* Line 1464 of yacc.c  */
     4199#line 1578 "grammar.y"
    41574200    {
    41584201            idhdl h = enterid((yyvsp[(1) - (3)].name),myynest,PROC_CMD,&IDROOT,TRUE);
     
    41754218    break;
    41764219
    4177   case 166:
    4178 
    4179 /* Line 1464 of yacc.c  */
    4180 #line 1586 "grammar.y"
     4220  case 168:
     4221
     4222/* Line 1464 of yacc.c  */
     4223#line 1597 "grammar.y"
    41814224    {
    41824225            omFree((ADDRESS)(yyvsp[(3) - (4)].name));
     
    42004243    break;
    42014244
    4202   case 167:
    4203 
    4204 /* Line 1464 of yacc.c  */
    4205 #line 1609 "grammar.y"
     4245  case 169:
     4246
     4247/* Line 1464 of yacc.c  */
     4248#line 1620 "grammar.y"
    42064249    {
    42074250            // decl. of type proc p(int i)
     
    42114254    break;
    42124255
    4213   case 168:
    4214 
    4215 /* Line 1464 of yacc.c  */
    4216 #line 1615 "grammar.y"
     4256  case 170:
     4257
     4258/* Line 1464 of yacc.c  */
     4259#line 1626 "grammar.y"
    42174260    {
    42184261            // decl. of type proc p(i)
     
    42254268    break;
    42264269
    4227   case 169:
    4228 
    4229 /* Line 1464 of yacc.c  */
    4230 #line 1627 "grammar.y"
     4270  case 171:
     4271
     4272/* Line 1464 of yacc.c  */
     4273#line 1638 "grammar.y"
    42314274    {
    42324275            iiRETURNEXPR.Copy(&(yyvsp[(3) - (4)].lv));
     
    42364279    break;
    42374280
    4238   case 170:
    4239 
    4240 /* Line 1464 of yacc.c  */
    4241 #line 1633 "grammar.y"
     4281  case 172:
     4282
     4283/* Line 1464 of yacc.c  */
     4284#line 1644 "grammar.y"
    42424285    {
    42434286            if ((yyvsp[(1) - (3)].i)==RETURN)
     
    42534296
    42544297/* Line 1464 of yacc.c  */
    4255 #line 4258 "grammar.cc"
     4298#line 4297 "grammar.cc"
    42564299      default: break;
    42574300    }
  • Singular/grammar.h

    r4c1341 rce70e6  
    154154     PROC_DEF = 371,
    155155     APPLY = 372,
    156      BREAK_CMD = 373,
    157      CONTINUE_CMD = 374,
    158      ELSE_CMD = 375,
    159      EVAL = 376,
    160      QUOTE = 377,
    161      FOR_CMD = 378,
    162      IF_CMD = 379,
    163      SYS_BREAK = 380,
    164      WHILE_CMD = 381,
    165      RETURN = 382,
    166      PARAMETER = 383,
    167      SYSVAR = 384,
    168      UMINUS = 385
     156     ASSUME_CMD = 373,
     157     BREAK_CMD = 374,
     158     CONTINUE_CMD = 375,
     159     ELSE_CMD = 376,
     160     EVAL = 377,
     161     QUOTE = 378,
     162     FOR_CMD = 379,
     163     IF_CMD = 380,
     164     SYS_BREAK = 381,
     165     WHILE_CMD = 382,
     166     RETURN = 383,
     167     PARAMETER = 384,
     168     SYSVAR = 385,
     169     UMINUS = 386
    169170   };
    170171#endif
  • Singular/grammar.y

    r4c1341 rce70e6  
    315315/* control */
    316316%token <i> APPLY
     317%token <i> ASSUME_CMD
    317318%token <i> BREAK_CMD
    318319%token <i> CONTINUE_CMD
     
    777778            #endif
    778779          }
     780        | assume_start expr ',' expr quote_end
     781          {
     782            iiTestAssume(&$2,&$4);
     783            memset(&$$,0,sizeof($$));
     784            $$.rtyp=NONE;
     785          }
    779786        | EVAL  '('
    780787          {
     
    796803
    797804quote_start:    QUOTE  '('
     805          {
     806            #ifdef SIQ
     807            siq++;
     808            #endif
     809          }
     810          ;
     811
     812assume_start:    ASSUME_CMD '('
    798813          {
    799814            #ifdef SIQ
  • Singular/ipid.cc

    r4c1341 rce70e6  
    433433  else if ((IDTYP(h)==RING_CMD)||(IDTYP(h)==QRING_CMD))
    434434    rKill(h);
    435   else
     435  else if (IDDATA(h)!=NULL)
    436436    s_internalDelete(IDTYP(h),IDDATA(h),r);
    437437  //  general  -------------------------------------------------------------
  • Singular/iplib.cc

    r4c1341 rce70e6  
    298298  return NULL;
    299299}
    300 #ifndef LIBSINGULAR
     300
    301301// see below:
    302302struct soptionStruct
     
    308308extern struct soptionStruct optionStruct[];
    309309extern struct soptionStruct verboseStruct[];
    310 #endif
     310
    311311
    312312BOOLEAN iiAllStart(procinfov pi, char *p,feBufferTypes t, int l)
    313313{
     314  // see below:
     315  BITSET save1=si_opt_1;
     316  BITSET save2=si_opt_2;
    314317  newBuffer( omStrDup(p /*pi->data.s.body*/), t /*BT_proc*/,
    315318               pi, l );
    316   #ifndef LIBSINGULAR
    317   // see below:
    318   BITSET save1=(test & ~TEST_RINGDEP_OPTS);
    319   BITSET save2=verbose;
    320   #endif
    321319  BOOLEAN err=yyparse();
    322320  if (sLastPrinted.rtyp!=0)
     
    324322    sLastPrinted.CleanUp();
    325323  }
    326   #ifndef LIBSINGULAR
    327324  // the access to optionStruct and verboseStruct do not work
    328325  // on x86_64-Linux for pic-code
    329   BITSET save11= ( test & ~TEST_RINGDEP_OPTS);
    330326  if ((TEST_V_ALLWARN) &&
    331327  (t==BT_proc) &&
    332   ((save1!=save11)||(save2!=verbose)) &&
     328  ((save1!=si_opt_1)||(save2!=si_opt_2)) &&
    333329  (pi->libname!=NULL) && (pi->libname[0]!='\0'))
    334330  {
     
    340336    for (i=0; optionStruct[i].setval!=0; i++)
    341337    {
    342       if ((optionStruct[i].setval & save11)
     338      if ((optionStruct[i].setval & si_opt_1)
    343339      && (!(optionStruct[i].setval & save1)))
    344340      {
    345341          Print(" +%s",optionStruct[i].name);
    346342      }
    347       if (!(optionStruct[i].setval & save11)
     343      if (!(optionStruct[i].setval & si_opt_1)
    348344      && ((optionStruct[i].setval & save1)))
    349345      {
     
    353349    for (i=0; verboseStruct[i].setval!=0; i++)
    354350    {
    355       if ((verboseStruct[i].setval & verbose)
     351      if ((verboseStruct[i].setval & si_opt_2)
    356352      && (!(verboseStruct[i].setval & save2)))
    357353      {
    358354          Print(" +%s",verboseStruct[i].name);
    359355      }
    360       if (!(verboseStruct[i].setval & verbose)
     356      if (!(verboseStruct[i].setval & si_opt_2)
    361357      && ((verboseStruct[i].setval & save2)))
    362358      {
     
    366362    PrintLn();
    367363  }
    368   #endif
    369364  return err;
    370365}
  • Singular/ipshell.cc

    r4c1341 rce70e6  
    51965196        if (mpz_cmp_ui(modBase,0)==0)
    51975197        {
    5198           WerrorS("modulus must not be 0");
     5198          WerrorS("modulus must not be 0 or parameter not allowed");
    51995199          goto rInitError;
    52005200        }
     
    52115211      if (mpz_cmp_ui(modBase,0)==0)
    52125212      {
    5213         WerrorS("modulus must not be 0");
     5213        WerrorS("modulus must not be 0 or parameter not allowed");
    52145214        goto rInitError;
    52155215      }
     
    58135813  return TRUE;
    58145814}
     5815
     5816BOOLEAN iiTestAssume(leftv a, leftv b)
     5817{
     5818  // assume a: level
     5819  if ((a->Typ()==INT_CMD)&&((long)a->Data()>=0))
     5820  {
     5821    int lev=(long)a->Data();
     5822    int startlev=0;
     5823    idhdl h=ggetid("assumeLevel");
     5824    if ((h!=NULL)&&(IDTYP(h)==INT_CMD)) startlev=(long)IDINT(h);
     5825    if(lev <=startlev)
     5826    {
     5827      BOOLEAN bo=b->Eval();
     5828      if (bo) { WerrorS("syntax error in ASSUME");return TRUE;}
     5829      if (b->Typ()!=INT_CMD) { WerrorS("ASUMME(<level>,<int expr>)");return TRUE; }
     5830      if (b->Data()==NULL) { WerrorS("ASSUME failed");return TRUE;}
     5831    }
     5832  }
     5833  else
     5834     b->CleanUp();
     5835  a->CleanUp();
     5836  return FALSE;
     5837}
  • Singular/ipshell.h

    r4c1341 rce70e6  
    247247
    248248
    249 #endif
    250 
     249BOOLEAN iiTestAssume(leftv a, leftv b);
     250#endif
     251
  • Singular/singular-libs

    r4c1341 rce70e6  
    2323        paraplanecurves.lib phindex.lib \
    2424        pointid.lib poly.lib \
    25         oldpolymake.lib presolve.lib primdec.lib primdecint.lib \
     25        presolve.lib primdec.lib primdecint.lib \
    2626        primitiv.lib qhmoduli.lib random.lib realclassify.lib \
    2727        realrad.lib reesclos.lib resbinomial.lib \
     
    3232        surf.lib surfacesignature.lib surfex.lib \
    3333        teachstd.lib toric.lib triang.lib \
    34         tropical.lib weierstr.lib zeroset.lib
     34        weierstr.lib zeroset.lib
    3535
    3636# libs in beta testing:
     
    4141# for new libs
    4242
    43 SLIB1 = classifyci.lib classify_aeq.lib ffsolve.lib decomp.lib template.lib\
     43SLIB1 = classifyci.lib classify_aeq.lib \
     44        divisors.lib \
     45        ffsolve.lib decomp.lib template.lib \
    4446        findifs.lib finitediff.lib \
     47        gitfan.lib \
    4548        locnormal.lib modnormal.lib \
    46         JMBTest.lib JMSConst.lib multigrading.lib parallel.lib realizationMatroids.lib ringgb.lib \
     49        JMBTest.lib JMSConst.lib multigrading.lib\
     50        orbitparam.lib parallel.lib polymake.lib\
     51        realizationMatroids.lib resources.lib ringgb.lib \
    4752        schreyer.lib symodstd.lib derham.lib polybori.lib ellipticcovers.lib \
    48         schubert.lib
     53        schubert.lib tasks.lib tropical.lib
    4954
    5055PLIBS = bfun.lib central.lib dmod.lib dmodapp.lib dmodvar.lib fpadim.lib \
     
    5257        ncfactor.lib nctools.lib perron.lib qmatrix.lib \
    5358        ncall.lib
    54        
    5559
     60
  • Singular/subexpr.cc

    r4c1341 rce70e6  
    455455void s_internalDelete(const int t,  void *d, const ring r)
    456456{
     457  assume(d!=NULL);
    457458  switch (t)
    458459  {
     
    15851586        {
    15861587        // WARNING: do not use ring variable names in procedures
    1587           Warn("use of variable >>%s<< in a procedure in line %s",id);
     1588          Warn("use of variable >>%s<< in a procedure in line %s",id,my_yylinebuf);
    15881589        }
    15891590        return;
  • Singular/table.h

    r4c1341 rce70e6  
    798798{  // name-string alias tokval          toktype
    799799  { "$INVALID$",   0, -1,                 0},
     800  { "ASSUME",      0, ASSUME_CMD,         ASSUME_CMD},
    800801  { "LIB",         0, LIB_CMD ,           SYSVAR},
    801802  { "alias",       0, ALIAS_CMD ,         PARAMETER},
  • Singular/tesths.cc

    r4c1341 rce70e6  
    4949#include <time.h>
    5050#include <errno.h>
    51 #ifdef HAVE_SIMPLEIPC
    52 #include <Singular/links/simpleipc.h>
    53 #endif
    54 
    55 
    56 
    5751
    5852
    5953extern int siInit(char *);
    60 
    61 #if ! defined(LIBSINGULAR)
    6254
    6355int initializeGMP(){ return 1; }
     
    127119    if (optc == 'h') exit(0);
    128120  }
    129 
    130 // semaphore0: CPUs --------------------------------------------------
    131 #ifdef HAVE_SIMPLEIPC
    132   feOptIndex cpu_opt = feGetOptIndex("cpus");
    133   int cpus = (int)(long)feOptValue(FE_OPT_CPUS);
    134   sipc_semaphore_init(0, cpus-1);
    135 #endif
    136121
    137122  /* say hello */
     
    249234  return 0;
    250235}
    251 #endif // not LIBSINGULAR
    252 
     236
Note: See TracChangeset for help on using the changeset viewer.