Functions | Variables
subexpr.cc File Reference
#include <kernel/mod2.h>
#include <omalloc/omalloc.h>
#include <misc/intvec.h>
#include <misc/options.h>
#include <coeffs/numbers.h>
#include <coeffs/bigintmat.h>
#include <coeffs/ffields.h>
#include <polys/monomials/maps.h>
#include <polys/matpol.h>
#include <polys/monomials/ring.h>
#include <kernel/polys.h>
#include <kernel/ideals.h>
#include <kernel/GBEngine/kstd1.h>
#include <kernel/GBEngine/syz.h>
#include <kernel/oswrapper/timer.h>
#include <Singular/tok.h>
#include <Singular/ipid.h>
#include <Singular/ipshell.h>
#include <Singular/lists.h>
#include <Singular/attrib.h>
#include <Singular/links/silink.h>
#include <Singular/subexpr.h>
#include <Singular/blackbox.h>
#include <Singular/number2.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>

Go to the source code of this file.

Functions

static void * s_internalCopy (const int t, void *d)
 
void s_internalDelete (const int t, void *d, const ring r)
 
void * slInternalCopy (leftv source, const int t, void *d, Subexpr e)
 
BOOLEAN assumeStdFlag (leftv h)
 
void syMake (leftv v, const char *id, package pa)
 
const char * iiSleftv2name (leftv v)
 

Variables

omBin sSubexpr_bin = omGetSpecBin(sizeof(_ssubexpr))
 
omBin sleftv_bin = omGetSpecBin(sizeof(sleftv))
 
omBin procinfo_bin = omGetSpecBin(sizeof(procinfo))
 
omBin libstack_bin = omGetSpecBin(sizeof(libstack))
 
static omBin size_two_bin = omGetSpecBin(2)
 
sleftv sLastPrinted
 
const char sNoName [] ="_"
 
BOOLEAN siq =FALSE
 

Function Documentation

§ assumeStdFlag()

BOOLEAN assumeStdFlag ( leftv  h)

Definition at line 1475 of file subexpr.cc.

1476 {
1477  if (h->e!=NULL)
1478  {
1479  leftv hh=h->LData();
1480  if (h!=hh) return assumeStdFlag(h->LData());
1481  }
1482  if (!hasFlag(h,FLAG_STD))
1483  {
1484  if (!TEST_VERB_NSB)
1485  {
1486  if (TEST_V_ALLWARN)
1487  Warn("%s is no standard basis in >>%s<<",h->Name(),my_yylinebuf);
1488  else
1489  Warn("%s is no standard basis",h->Name());
1490  }
1491  return FALSE;
1492  }
1493  return TRUE;
1494 }
#define TEST_VERB_NSB
Definition: options.h:129
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Subexpr e
Definition: subexpr.h:106
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
const char * Name()
Definition: subexpr.h:121
char my_yylinebuf[80]
Definition: febase.cc:48
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1475
#define FLAG_STD
Definition: ipid.h:106
#define NULL
Definition: omList.c:10
#define hasFlag(A, F)
Definition: ipid.h:109
leftv LData()
Definition: subexpr.cc:1407
#define TEST_V_ALLWARN
Definition: options.h:135
#define Warn
Definition: emacs.cc:80

§ iiSleftv2name()

const char* iiSleftv2name ( leftv  v)

Definition at line 1953 of file subexpr.cc.

1954 {
1955  return(v->name);
1956 }
const char * name
Definition: subexpr.h:88

§ s_internalCopy()

static void* s_internalCopy ( const int  t,
void *  d 
)
inlinestatic

Definition at line 415 of file subexpr.cc.

416 {
417  switch (t)
418  {
419  case CRING_CMD:
420  {
421  coeffs cf=(coeffs)d;
422  cf->ref++;
423  return (void*)d;
424  }
425 #ifdef SINGULAR_4_2
426  case CNUMBER_CMD:
427  return (void*)n2Copy((number2)d);
428  case CPOLY_CMD:
429  return (void*)p2Copy((poly2)d);
430  case CMATRIX_CMD: // like BIGINTMAT
431 #endif
432  case BIGINTMAT_CMD:
433  return (void*)bimCopy((bigintmat *)d);
434  case INTVEC_CMD:
435  case INTMAT_CMD:
436  return (void *)ivCopy((intvec *)d);
437  case MATRIX_CMD:
438  return (void *)mp_Copy((matrix)d, currRing);
439  case IDEAL_CMD:
440  case MODUL_CMD:
441  return (void *)idCopy((ideal)d);
442  case STRING_CMD:
443  return (void *)omStrDup((char *)d);
444  case PACKAGE_CMD:
445  return (void *)paCopy((package) d);
446  case PROC_CMD:
447  return (void *)piCopy((procinfov) d);
448  case POLY_CMD:
449  case VECTOR_CMD:
450  return (void *)pCopy((poly)d);
451  case INT_CMD:
452  return d;
453  case NUMBER_CMD:
454  return (void *)nCopy((number)d);
455  case BIGINT_CMD:
456  return (void *)n_Copy((number)d, coeffs_BIGINT);
457  case MAP_CMD:
458  return (void *)maCopy((map)d, currRing);
459  case LIST_CMD:
460  return (void *)lCopy((lists)d);
461  case LINK_CMD:
462  return (void *)slCopy((si_link) d);
463  case RING_CMD:
464  {
465  ring r=(ring)d;
466  if (r!=NULL)
467  {
468  r->ref++;
469  //Print("s_internalCopy:+ ring %d, ref %d\n",r,r->ref);
470  }
471  return d;
472  }
473  case RESOLUTION_CMD:
474  return (void*)syCopy((syStrategy)d);
475  case DEF_CMD:
476  case NONE:
477  case 0: /* type in error case */
478  break; /* error recovery: do nothing */
479  //case COMMAND:
480  default:
481  {
482  if (t>MAX_TOK)
483  {
484  blackbox *b=getBlackboxStuff(t);
485  if (b!=NULL) return b->blackbox_Copy(b,d);
486  return NULL;
487  }
488  else
489  Warn("s_internalCopy: cannot copy type %s(%d)",
490  Tok2Cmdname(t),t);
491  }
492  }
493  return NULL;
494 }
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
Definition: cf_map_ext.cc:400
ip_package * package
Definition: structs.h:46
Definition: tok.h:48
Definition: tok.h:95
Definition: lists.h:22
Definition: tok.h:38
Matrices of numbers.
Definition: bigintmat.h:51
Definition: tok.h:213
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
procinfov piCopy(procinfov pi)
Definition: subexpr.h:149
coeffs coeffs_BIGINT
Definition: ipid.cc:54
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: tok.h:56
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
bigintmat * bimCopy(const bigintmat *b)
same as copy constructor - apart from it being able to accept NULL as input
Definition: bigintmat.cc:408
Definition: tok.h:58
The main handler for Singular numbers which are suitable for Singular polynomials.
package paCopy(package pack)
Definition: ipid.h:45
lists lCopy(lists L)
Definition: lists.cc:32
ideal idCopy(ideal A)
Definition: ideals.h:60
CanonicalForm cf
Definition: cfModGcd.cc:4024
Definition: tok.h:116
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:455
syStrategy syCopy(syStrategy syzstr)
Definition: syz1.cc:1892
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:132
#define nCopy(n)
Definition: numbers.h:15
Definition: tok.h:117
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:74
map maCopy(map theMap, const ring r)
Definition: maps.cc:38
polyrec * poly
Definition: hilb.h:10
const poly b
Definition: syzextra.cc:213
#define NONE
Definition: tok.h:216
#define pCopy(p)
return a copy of the poly
Definition: polys.h:168
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition: blackbox.cc:16
#define Warn
Definition: emacs.cc:80
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ s_internalDelete()

void s_internalDelete ( const int  t,
void *  d,
const ring  r 
)

Definition at line 496 of file subexpr.cc.

497 {
498  assume(d!=NULL);
499  switch (t)
500  {
501  case CRING_CMD:
502  {
503  coeffs cf=(coeffs)d;
504  if ((cf->ref<=1)&&
505  ((cf->type <=n_long_R)
506  ||((cf->type >=n_long_C)&&(cf->type <=n_CF))))
507  {
508  Werror("cannot kill %s",nCoeffName(cf));
509  }
510  else
511  nKillChar((coeffs)d);
512  break;
513  }
514 #ifdef SINGULAR_4_2
515  case CNUMBER_CMD:
516  {
517  number2 n=(number2)d;
518  n2Delete(n);
519  break;
520  }
521  case CPOLY_CMD:
522  {
523  poly2 n=(poly2)d;
524  p2Delete(n);
525  break;
526  }
527  case CMATRIX_CMD: //like BIGINTMAT
528 #endif
529  case BIGINTMAT_CMD:
530  {
531  bigintmat *v=(bigintmat*)d;
532  delete v;
533  break;
534  }
535  case INTVEC_CMD:
536  case INTMAT_CMD:
537  {
538  intvec *v=(intvec*)d;
539  delete v;
540  break;
541  }
542  case MAP_CMD:
543  {
544  map m=(map)d;
545  omFreeBinAddr((ADDRESS)m->preimage);
546  m->preimage=NULL;
547  /* no break: continue as IDEAL*/
548  }
549  case MATRIX_CMD:
550  case IDEAL_CMD:
551  case MODUL_CMD:
552  {
553  ideal i=(ideal)d;
554  id_Delete(&i,r);
555  break;
556  }
557  case STRING_CMD:
558  omFree(d);
559  break;
560  //case PACKAGE_CMD:
561  // return (void *)paCopy((package) d);
562  case PROC_CMD:
563  piKill((procinfo*)d);
564  break;
565  case POLY_CMD:
566  case VECTOR_CMD:
567  {
568  poly p=(poly)d;
569  p_Delete(&p,r);
570  break;
571  }
572  case NUMBER_CMD:
573  {
574  number n=(number)d;
575  n_Delete(&n,r->cf);
576  break;
577  }
578  case BIGINT_CMD:
579  {
580  number n=(number)d;
582  break;
583  }
584  case LIST_CMD:
585  {
586  lists l=(lists)d;
587  l->Clean(r);
588  break;
589  }
590  case LINK_CMD:
591  {
592  si_link l=(si_link)d;
593  slKill(l);
594  break;
595  }
596  case RING_CMD:
597  {
598  ring R=(ring)d;
599  if ((R!=currRing)||(R->ref>=0))
600  rKill(R);
601  #ifdef TEST
602  else
603  Print("currRing? ref=%d\n",R->ref);
604  #endif
605  break;
606  }
607  case RESOLUTION_CMD:
608  {
610  if (s!=NULL) syKillComputation(s,r);
611  break;
612  }
613  case COMMAND:
614  {
615  command cmd=(command)d;
616  if (cmd->arg1.rtyp!=0) cmd->arg1.CleanUp(r);
617  if (cmd->arg2.rtyp!=0) cmd->arg2.CleanUp(r);
618  if (cmd->arg3.rtyp!=0) cmd->arg3.CleanUp(r);
620  break;
621  }
622  case INT_CMD:
623  case DEF_CMD:
624  case ALIAS_CMD:
625  case PACKAGE_CMD:
626  case IDHDL:
627  case NONE:
628  case ANY_TYPE:
629  case VECHO:
630  case VPRINTLEVEL:
631  case VCOLMAX:
632  case VTIMER:
633  case VRTIMER:
634  case VOICE:
635  case VMAXDEG:
636  case VMAXMULT:
637  case TRACE:
638  case VSHORTOUT:
639  case VNOETHER:
640  case VMINPOLY:
641  case 0: /* type in error case */
642  break; /* error recovery: do nothing */
643  //case COMMAND:
644  //case COMMAND:
645  default:
646  {
647  if (t>MAX_TOK)
648  {
649  blackbox *b=getBlackboxStuff(t);
650  if (b!=NULL) b->blackbox_destroy(b,d);
651  break;
652  }
653  else
654  Warn("s_internalDelete: cannot delete type %s(%d)",
655  Tok2Cmdname(t),t);
656  }
657  }
658 }
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
Definition: cf_map_ext.cc:400
Definition: tok.h:207
const CanonicalForm int s
Definition: facAbsFact.cc:55
Definition: tok.h:203
ip_command * command
Definition: ipid.h:24
Definition: tok.h:48
#define ANY_TYPE
Definition: tok.h:30
#define Print
Definition: emacs.cc:83
Definition: tok.h:95
Definition: tok.h:204
?
Definition: coeffs.h:47
Definition: lists.h:22
Definition: tok.h:38
return P p
Definition: myNF.cc:203
Matrices of numbers.
Definition: bigintmat.h:51
Definition: tok.h:213
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
void * ADDRESS
Definition: auxiliary.h:115
coeffs coeffs_BIGINT
Definition: ipid.cc:54
BOOLEAN piKill(procinfov pi)
Definition: ipid.cc:653
#define IDHDL
Definition: tok.h:31
real floating point (GMP) numbers
Definition: coeffs.h:34
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: tok.h:208
Definition: tok.h:56
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
void rKill(ring r)
Definition: ipshell.cc:6026
Definition: tok.h:58
#define omFreeBinAddr(addr)
Definition: omAllocDecl.h:258
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:394
The main handler for Singular numbers which are suitable for Singular polynomials.
const ring R
Definition: DebugPrint.cc:36
complex floating point (GMP) numbers
Definition: coeffs.h:42
static FORCE_INLINE char * nCoeffName(const coeffs cf)
Definition: coeffs.h:980
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
Definition: tok.h:206
Definition: tok.h:34
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
Definition: tok.h:209
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
CanonicalForm cf
Definition: cfModGcd.cc:4024
Definition: tok.h:116
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
omBin sip_command_bin
Definition: ipid.cc:49
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:132
void Clean(ring r=currRing)
Definition: lists.h:25
Definition: tok.h:117
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
polyrec * poly
Definition: hilb.h:10
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
Definition: tok.h:205
const poly b
Definition: syzextra.cc:213
#define NONE
Definition: tok.h:216
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:496
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void syKillComputation(syStrategy syzstr, ring r=currRing)
Definition: syz1.cc:1503
int l
Definition: cfEzgcd.cc:94
#define COMMAND
Definition: tok.h:29
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition: blackbox.cc:16
ssyStrategy * syStrategy
Definition: syz.h:35
#define Warn
Definition: emacs.cc:80

§ slInternalCopy()

void* slInternalCopy ( leftv  source,
const int  t,
void *  d,
Subexpr  e 
)

Definition at line 660 of file subexpr.cc.

661 {
662  if (t==STRING_CMD)
663  {
664  if ((e==NULL)
665  || (source->rtyp==LIST_CMD)
666  || ((source->rtyp==IDHDL)
667  &&((IDTYP((idhdl)source->data)==LIST_CMD)
668  || (IDTYP((idhdl)source->data)>MAX_TOK)))
669  || (source->rtyp>MAX_TOK))
670  return (void *)omStrDup((char *)d);
671  else if (e->next==NULL)
672  {
673  char *s=(char*)omAllocBin(size_two_bin);
674  s[0]=*(char *)d;
675  s[1]='\0';
676  return s;
677  }
678  #ifdef TEST
679  else
680  {
681  Werror("not impl. string-op in `%s`",my_yylinebuf);
682  return NULL;
683  }
684  #endif
685  }
686  return s_internalCopy(t,d);
687 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
const CanonicalForm int s
Definition: facAbsFact.cc:55
Definition: tok.h:213
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:89
#define IDTYP(a)
Definition: ipid.h:116
char my_yylinebuf[80]
Definition: febase.cc:48
static void * s_internalCopy(const int t, void *d)
Definition: subexpr.cc:415
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
Definition: tok.h:117
void Werror(const char *fmt,...)
Definition: reporter.cc:189
static omBin size_two_bin
Definition: subexpr.cc:53
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ syMake()

void syMake ( leftv  v,
const char *  id,
package  pa 
)

Definition at line 1501 of file subexpr.cc.

1502 {
1503  /* resolv an identifier: (to DEF_CMD, if siq>0)
1504  * 1) reserved id: done by scanner
1505  * 2) `basering` / 'Current`
1506  * 3) existing identifier, local
1507  * 4) ringvar, ringpar, local ring
1508  * 5) existing identifier, global
1509  * 6) monom (resp. number), local ring: consisting of:
1510  * 6') ringvar, ringpar,global ring
1511  * 6'') monom (resp. number), local ring
1512  * 7) monom (resp. number), non-local ring
1513  * 8) basering
1514  * 9) `_`
1515  * 10) everything else is of type 0
1516  */
1517 #ifdef TEST
1518  if ((*id<' ')||(*id>(char)126))
1519  {
1520  Print("wrong id :%s:\n",id);
1521  }
1522 #endif
1523  idhdl save_ring=currRingHdl;
1524  v->Init();
1525  if(pa != NULL)
1526  {
1527  v->req_packhdl = pa;
1528  }
1529  else v->req_packhdl = currPack;
1530 // if (v->req_packhdl!=basePack)
1531 // Print("search %s in %s\n",id,v->req_packhdl->libname);
1532  idhdl h=NULL;
1533 #ifdef SIQ
1534  if (siq<=0)
1535 #endif
1536  {
1537  if (!isdigit(id[0]))
1538  {
1539  if (strcmp(id,"basering")==0)
1540  {
1541  if (currRingHdl!=NULL)
1542  {
1543  if (id!=IDID(currRingHdl)) omFreeBinAddr((ADDRESS)id);
1544  h=currRingHdl;
1545  goto id_found;
1546  }
1547  else
1548  {
1549  v->name = id;
1550  return; /* undefined */
1551  }
1552  }
1553  else if (strcmp(id,"Current")==0)
1554  {
1555  if (currPackHdl!=NULL)
1556  {
1557  omFreeBinAddr((ADDRESS)id);
1558  h=currPackHdl;
1559  goto id_found;
1560  }
1561  else
1562  {
1563  v->name = id;
1564  return; /* undefined */
1565  }
1566  }
1567  if(v->req_packhdl!=currPack)
1568  {
1569  h=v->req_packhdl->idroot->get(id,myynest);
1570  }
1571  else
1572  h=ggetid(id);
1573  /* 3) existing identifier, local */
1574  if ((h!=NULL) && (IDLEV(h)==myynest))
1575  {
1576  if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1577  goto id_found;
1578  }
1579  }
1581  {
1582  currRingHdl=NULL;
1583  }
1584  /* 4. local ring: ringvar */
1585  if ((currRingHdl!=NULL) && (IDLEV(currRingHdl)==myynest)
1586  /*&& (!yyInRingConstruction)*/)
1587  {
1588  int vnr;
1589  if ((vnr=r_IsRingVar(id, currRing->names,currRing->N))>=0)
1590  {
1591  poly p=pOne();
1592  pSetExp(p,vnr+1,1);
1593  pSetm(p);
1594  v->data = (void *)p;
1595  v->name = id;
1596  v->rtyp = POLY_CMD;
1597  return;
1598  }
1599  if((n_NumberOfParameters(currRing->cf)>0)
1600  &&((vnr=r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
1601  n_NumberOfParameters(currRing->cf))>=0)))
1602  {
1603  BOOLEAN ok=FALSE;
1604  poly p = pmInit(id,ok);
1605  if (ok && (p!=NULL))
1606  {
1607  v->data = pGetCoeff(p);
1608  pGetCoeff(p)=NULL;
1609  pLmFree(p);
1610  v->rtyp = NUMBER_CMD;
1611  v->name = id;
1612  return;
1613  }
1614  }
1615  }
1616  /* 5. existing identifier, global */
1617  if (h!=NULL)
1618  {
1619  if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1620  goto id_found;
1621  }
1622  /* 6. local ring: number/poly */
1623  if ((currRingHdl!=NULL) && (IDLEV(currRingHdl)==myynest))
1624  {
1625  BOOLEAN ok=FALSE;
1626  /*poly p = (!yyInRingConstruction) ? pmInit(id,ok) : (poly)NULL;*/
1627  poly p = pmInit(id,ok);
1628  if (ok)
1629  {
1630  if (p==NULL)
1631  {
1632  v->data = (void *)nInit(0);
1633  v->rtyp = NUMBER_CMD;
1634  #ifdef HAVE_PLURAL
1635  // in this case we may have monomials equal to 0 in p_Read
1636  v->name = id;
1637  #else
1638  omFreeBinAddr((ADDRESS)id);
1639  #endif
1640  }
1641  else if (pIsConstant(p))
1642  {
1643  v->data = pGetCoeff(p);
1644  pGetCoeff(p)=NULL;
1645  pLmFree(p);
1646  v->rtyp = NUMBER_CMD;
1647  v->name = id;
1648  }
1649  else
1650  {
1651  v->data = p;
1652  v->rtyp = POLY_CMD;
1653  v->name = id;
1654  }
1655  return;
1656  }
1657  }
1658  /* 7. non-local ring: number/poly */
1659  {
1660  BOOLEAN ok=FALSE;
1661  poly p = ((currRing!=NULL) /* ring required */
1662  && (currRingHdl!=NULL)
1663  /*&& (!yyInRingConstruction) - not in decl */
1664  && (IDLEV(currRingHdl)!=myynest)) /* already in case 4/6 */
1665  ? pmInit(id,ok) : (poly)NULL;
1666  if (ok)
1667  {
1668  if (p==NULL)
1669  {
1670  v->data = (void *)nInit(0);
1671  v->rtyp = NUMBER_CMD;
1672  #ifdef HAVE_PLURAL
1673  // in this case we may have monomials equal to 0 in p_Read
1674  v->name = id;
1675  #else
1676  omFreeBinAddr((ADDRESS)id);
1677  #endif
1678  }
1679  else
1680  if (pIsConstant(p))
1681  {
1682  v->data = pGetCoeff(p);
1683  pGetCoeff(p)=NULL;
1684  pLmFree(p);
1685  v->rtyp = NUMBER_CMD;
1686  v->name = id;
1687  }
1688  else
1689  {
1690  v->data = p;
1691  v->rtyp = POLY_CMD;
1692  v->name = id;
1693  }
1694  //if (TEST_V_ALLWARN /*&& (myynest>0)*/
1695  //&& ((r_IsRingVar(id, currRing->names,currRing->N)>=0)
1696  // || ((n_NumberOfParameters(currRing->cf)>0)
1697  // &&(r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
1698  // n_NumberOfParameters(currRing->cf))>=0))))
1699  //{
1700  //// WARNING: do not use ring variable names in procedures
1701  // Warn("use of variable >>%s<< in a procedure in line %s",id,my_yylinebuf);
1702  //}
1703  return;
1704  }
1705  }
1706  /* 8. basering ? */
1707  if ((myynest>1)&&(currRingHdl!=NULL))
1708  {
1709  if (strcmp(id,IDID(currRingHdl))==0)
1710  {
1711  if (IDID(currRingHdl)!=id) omFreeBinAddr((ADDRESS)id); /*assume strlen (id) <1000 */
1712  h=currRingHdl;
1713  goto id_found;
1714  }
1715  }
1716  if((v->req_packhdl!=basePack) && (v->req_packhdl==currPack))
1717  {
1718  h=basePack->idroot->get(id,myynest);
1719  if (h!=NULL)
1720  {
1721  if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1722  v->req_packhdl=basePack;
1723  goto id_found;
1724  }
1725  }
1726  }
1727 #ifdef SIQ
1728  else
1729  v->rtyp=DEF_CMD;
1730 #endif
1731  /* 9: _ */
1732  if (strcmp(id,"_")==0)
1733  {
1734  omFreeBinAddr((ADDRESS)id);
1735  v->Copy(&sLastPrinted);
1736  }
1737  else
1738  {
1739  /* 10: everything else */
1740  /* v->rtyp = UNKNOWN;*/
1741  v->name = id;
1742  }
1743  currRingHdl=save_ring;
1744  return;
1745 id_found: // we have an id (in h) found, to set the data in from h
1746  if (IDTYP(h)!=ALIAS_CMD)
1747  {
1748  v->rtyp = IDHDL;
1749  v->flag = IDFLAG(h);
1750  v->attribute=IDATTR(h);
1751  }
1752  else
1753  {
1754  v->rtyp = ALIAS_CMD;
1755  }
1756  v->name = IDID(h);
1757  v->data = (char *)h;
1758  currRingHdl=save_ring;
1759 }
BOOLEAN yyInRingConstruction
Definition: grammar.cc:172
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
Definition: coeffs.h:812
#define pSetm(p)
Definition: polys.h:253
#define Print
Definition: emacs.cc:83
idhdl currPackHdl
Definition: ipid.cc:61
BITSET flag
Definition: subexpr.h:91
#define IDID(a)
Definition: ipid.h:119
#define pSetExp(p, i, v)
Definition: polys.h:42
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
BOOLEAN siq
Definition: subexpr.cc:58
void Init()
Definition: subexpr.h:108
void * ADDRESS
Definition: auxiliary.h:115
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
Definition: coeffs.h:808
void * data
Definition: subexpr.h:89
int myynest
Definition: febase.cc:46
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define IDTYP(a)
Definition: ipid.h:116
int r_IsRingVar(const char *n, char **names, int N)
Definition: ring.cc:222
Definition: tok.h:58
const char * name
Definition: subexpr.h:88
#define omFreeBinAddr(addr)
Definition: omAllocDecl.h:258
idhdl currRingHdl
Definition: ipid.cc:65
void Copy(leftv e)
Definition: subexpr.cc:689
#define pIsConstant(p)
like above, except that Comp might be != 0
Definition: polys.h:221
#define pOne()
Definition: polys.h:297
#define IDLEV(a)
Definition: ipid.h:118
Definition: tok.h:34
#define NULL
Definition: omList.c:10
package req_packhdl
Definition: subexpr.h:107
package basePack
Definition: ipid.cc:64
package currPack
Definition: ipid.cc:63
int rtyp
Definition: subexpr.h:92
sleftv sLastPrinted
Definition: subexpr.cc:55
#define IDFLAG(a)
Definition: ipid.h:117
#define pmInit(a, b)
Definition: polys.h:271
#define IDATTR(a)
Definition: ipid.h:120
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced ...
Definition: polys.h:70
attr attribute
Definition: subexpr.h:90
polyrec * poly
Definition: hilb.h:10
#define nInit(i)
Definition: numbers.h:24
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:85
idhdl ggetid(const char *n, BOOLEAN, idhdl *packhdl)
Definition: ipid.cc:496

Variable Documentation

§ libstack_bin

omBin libstack_bin = omGetSpecBin(sizeof(libstack))

Definition at line 52 of file subexpr.cc.

§ procinfo_bin

omBin procinfo_bin = omGetSpecBin(sizeof(procinfo))

Definition at line 51 of file subexpr.cc.

§ siq

BOOLEAN siq =FALSE

Definition at line 58 of file subexpr.cc.

§ size_two_bin

omBin size_two_bin = omGetSpecBin(2)
static

Definition at line 53 of file subexpr.cc.

§ sLastPrinted

sleftv sLastPrinted

Definition at line 55 of file subexpr.cc.

§ sleftv_bin

omBin sleftv_bin = omGetSpecBin(sizeof(sleftv))

Definition at line 50 of file subexpr.cc.

§ sNoName

const char sNoName[] ="_"

Definition at line 56 of file subexpr.cc.

§ sSubexpr_bin

omBin sSubexpr_bin = omGetSpecBin(sizeof(_ssubexpr))

Definition at line 49 of file subexpr.cc.