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/ipprint.h"
#include "Singular/subexpr.h"
#include "Singular/blackbox.h"
#include "Singular/number2.h"
#include <ctype.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)
 

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
 
BOOLEAN siq =FALSE
 

Function Documentation

◆ assumeStdFlag()

BOOLEAN assumeStdFlag ( leftv  h)

Definition at line 1552 of file subexpr.cc.

1553 {
1554  if (h->e!=NULL)
1555  {
1556  leftv hh=h->LData();
1557  if (h!=hh) return assumeStdFlag(h->LData());
1558  }
1559  if (!hasFlag(h,FLAG_STD))
1560  {
1561  if (!TEST_VERB_NSB)
1562  {
1563  if (TEST_V_ALLWARN)
1564  Warn("%s is no standard basis in >>%s<<",h->Name(),my_yylinebuf);
1565  else
1566  Warn("%s is no standard basis",h->Name());
1567  }
1568  return FALSE;
1569  }
1570  return TRUE;
1571 }
#define TEST_VERB_NSB
Definition: options.h:134
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
Subexpr e
Definition: subexpr.h:105
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
const char * Name()
Definition: subexpr.h:120
char my_yylinebuf[80]
Definition: febase.cc:43
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1552
#define FLAG_STD
Definition: ipid.h:104
#define NULL
Definition: omList.c:12
#define hasFlag(A, F)
Definition: ipid.h:107
leftv LData()
Definition: subexpr.cc:1484
#define TEST_V_ALLWARN
Definition: options.h:140
#define Warn
Definition: emacs.cc:77

◆ s_internalCopy()

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

Definition at line 430 of file subexpr.cc.

431 {
432  switch (t)
433  {
434  case CRING_CMD:
435  {
436  coeffs cf=(coeffs)d;
437  cf->ref++;
438  return (void*)d;
439  }
440 #ifdef SINGULAR_4_2
441  case CNUMBER_CMD:
442  return (void*)n2Copy((number2)d);
443  case CPOLY_CMD:
444  return (void*)p2Copy((poly2)d);
445  case CMATRIX_CMD: // like BIGINTMAT
446 #endif
447  case BIGINTMAT_CMD:
448  return (void*)bimCopy((bigintmat *)d);
449  case BUCKET_CMD:
450  return (void*)sBucketCopy((sBucket_pt)d);
451  case INTVEC_CMD:
452  case INTMAT_CMD:
453  return (void *)ivCopy((intvec *)d);
454  case MATRIX_CMD:
455  return (void *)mp_Copy((matrix)d, currRing);
456  case SMATRIX_CMD:
457  case IDEAL_CMD:
458  case MODUL_CMD:
459  return (void *)idCopy((ideal)d);
460  case STRING_CMD:
461  return (void *)omStrDup((char *)d);
462  case PACKAGE_CMD:
463  return (void *)paCopy((package) d);
464  case PROC_CMD:
465  return (void *)piCopy((procinfov) d);
466  case POLY_CMD:
467  case VECTOR_CMD:
468  return (void *)pCopy((poly)d);
469  case INT_CMD:
470  return d;
471  case NUMBER_CMD:
472  return (void *)nCopy((number)d);
473  case BIGINT_CMD:
474  return (void *)n_Copy((number)d, coeffs_BIGINT);
475  case MAP_CMD:
476  return (void *)maCopy((map)d, currRing);
477  case LIST_CMD:
478  return (void *)lCopy((lists)d);
479  case LINK_CMD:
480  return (void *)slCopy((si_link) d);
481  case RING_CMD:
482  {
483  ring r=(ring)d;
484  if (r!=NULL)
485  {
486  r->ref++;
487  //Print("s_internalCopy:+ ring %d, ref %d\n",r,r->ref);
488  }
489  return d;
490  }
491  case RESOLUTION_CMD:
492  return (void*)syCopy((syStrategy)d);
493  case DEF_CMD:
494  case NONE:
495  case 0: /* type in error case */
496  break; /* error recovery: do nothing */
497  //case COMMAND:
498  default:
499  {
500  if (t>MAX_TOK)
501  {
502  blackbox *b=getBlackboxStuff(t);
503  if (b!=NULL) return b->blackbox_Copy(b,d);
504  return NULL;
505  }
506  else
507  Warn("s_internalCopy: cannot copy type %s(%d)",
508  Tok2Cmdname(t),t);
509  }
510  }
511  return NULL;
512 }
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:48
Definition: tok.h:48
Definition: tok.h:96
Definition: lists.h:23
Definition: tok.h:38
Matrices of numbers.
Definition: bigintmat.h:50
Definition: tok.h:216
intvec * ivCopy(const intvec *o)
Definition: intvec.h:135
procinfov piCopy(procinfov pi)
Definition: subexpr.h:148
coeffs coeffs_BIGINT
Definition: ipid.cc:50
CanonicalForm b
Definition: cfModGcd.cc:4044
Definition: tok.h:56
Definition: intvec.h:19
bigintmat * bimCopy(const bigintmat *b)
same as copy constructor - apart from it being able to accept NULL as input
Definition: bigintmat.cc:405
Definition: tok.h:58
The main handler for Singular numbers which are suitable for Singular polynomials.
package paCopy(package pack)
Definition: ipid.h:43
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:117
#define NULL
Definition: omList.c:12
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:451
syStrategy syCopy(syStrategy syzstr)
Definition: syz1.cc:1884
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:140
#define nCopy(n)
Definition: numbers.h:15
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: tok.h:118
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:64
map maCopy(map theMap, const ring r)
Definition: maps.cc:32
#define NONE
Definition: tok.h:219
#define pCopy(p)
return a copy of the poly
Definition: polys.h:180
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition: blackbox.cc:16
#define Warn
Definition: emacs.cc:77
sBucket_pt sBucketCopy(const sBucket_pt bucket)
Copy sBucket non-intrusive!!!
Definition: sbuckets.cc:70
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ s_internalDelete()

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

Definition at line 514 of file subexpr.cc.

515 {
516  assume(d!=NULL);
517  switch (t)
518  {
519  case CRING_CMD:
520  {
521  coeffs cf=(coeffs)d;
522  if ((cf->ref<1)&&
523  ((cf->type <=n_GF)
524  ||((cf->type >=n_long_C)&&(cf->type <=n_CF))))
525  {
526  Warn("cannot kill `%s`",nCoeffName(cf));
527  }
528  else // allow nKillChar for n_long_R, extensions, and user defined:
529  nKillChar((coeffs)d);
530  break;
531  }
532 #ifdef SINGULAR_4_2
533  case CNUMBER_CMD:
534  {
535  number2 n=(number2)d;
536  n2Delete(n);
537  break;
538  }
539  case CPOLY_CMD:
540  {
541  poly2 n=(poly2)d;
542  p2Delete(n);
543  break;
544  }
545  case CMATRIX_CMD: //like BIGINTMAT
546 #endif
547  case BIGINTMAT_CMD:
548  {
549  bigintmat *v=(bigintmat*)d;
550  delete v;
551  break;
552  }
553  case BUCKET_CMD:
554  {
557  break;
558  }
559  case INTVEC_CMD:
560  case INTMAT_CMD:
561  {
562  intvec *v=(intvec*)d;
563  delete v;
564  break;
565  }
566  case MAP_CMD:
567  {
568  map m=(map)d;
569  omFreeBinAddr((ADDRESS)m->preimage);
570  m->preimage=NULL;
571  /* no break: continue as IDEAL*/
572  }
573  case SMATRIX_CMD:
574  case MATRIX_CMD:
575  case IDEAL_CMD:
576  case MODUL_CMD:
577  {
578  ideal i=(ideal)d;
579  id_Delete(&i,r);
580  break;
581  }
582  case STRING_CMD:
583  omFree(d);
584  break;
585  //case PACKAGE_CMD:
586  // return (void *)paCopy((package) d);
587  case PROC_CMD:
588  piKill((procinfo*)d);
589  break;
590  case POLY_CMD:
591  case VECTOR_CMD:
592  {
593  poly p=(poly)d;
594  p_Delete(&p,r);
595  break;
596  }
597  case NUMBER_CMD:
598  {
599  number n=(number)d;
600  n_Delete(&n,r->cf);
601  break;
602  }
603  case BIGINT_CMD:
604  {
605  number n=(number)d;
607  break;
608  }
609  case LIST_CMD:
610  {
611  lists l=(lists)d;
612  l->Clean(r);
613  break;
614  }
615  case LINK_CMD:
616  {
617  si_link l=(si_link)d;
618  slKill(l);
619  break;
620  }
621  case RING_CMD:
622  {
623  ring R=(ring)d;
624  if ((R!=currRing)||(R->ref>=0))
625  rKill(R);
626  #ifdef TEST
627  else
628  Print("currRing? ref=%d\n",R->ref);
629  #endif
630  break;
631  }
632  case RESOLUTION_CMD:
633  {
635  if (s!=NULL) syKillComputation(s,r);
636  break;
637  }
638  case COMMAND:
639  {
640  command cmd=(command)d;
641  if (cmd->arg1.rtyp!=0) cmd->arg1.CleanUp(r);
642  if (cmd->arg2.rtyp!=0) cmd->arg2.CleanUp(r);
643  if (cmd->arg3.rtyp!=0) cmd->arg3.CleanUp(r);
645  break;
646  }
647  case INT_CMD:
648  case DEF_CMD:
649  case ALIAS_CMD:
650  case PACKAGE_CMD:
651  case IDHDL:
652  case NONE:
653  case ANY_TYPE:
654  case VECHO:
655  case VPRINTLEVEL:
656  case VCOLMAX:
657  case VTIMER:
658  case VRTIMER:
659  case VOICE:
660  case VMAXDEG:
661  case VMAXMULT:
662  case TRACE:
663  case VSHORTOUT:
664  case VNOETHER:
665  case VMINPOLY:
666  case 0: /* type in error case */
667  break; /* error recovery: do nothing */
668  //case COMMAND:
669  //case COMMAND:
670  default:
671  {
672  if (t>MAX_TOK)
673  {
674  blackbox *b=getBlackboxStuff(t);
675  if (b!=NULL) b->blackbox_destroy(b,d);
676  break;
677  }
678  else
679  Warn("s_internalDelete: cannot delete type %s(%d)",
680  Tok2Cmdname(t),t);
681  }
682  }
683 }
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:210
const CanonicalForm int s
Definition: facAbsFact.cc:55
Definition: tok.h:206
ip_command * command
Definition: ipid.h:22
Definition: tok.h:48
#define ANY_TYPE
Definition: tok.h:30
#define Print
Definition: emacs.cc:80
Definition: tok.h:96
Definition: tok.h:207
?
Definition: coeffs.h:48
Definition: lists.h:23
Definition: tok.h:38
Matrices of numbers.
Definition: bigintmat.h:50
Definition: tok.h:216
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
void * ADDRESS
Definition: auxiliary.h:133
coeffs coeffs_BIGINT
Definition: ipid.cc:50
BOOLEAN piKill(procinfov pi)
Definition: ipid.cc:664
#define IDHDL
Definition: tok.h:31
Definition: tok.h:211
CanonicalForm b
Definition: cfModGcd.cc:4044
Definition: tok.h:56
Definition: intvec.h:19
void rKill(ring r)
Definition: ipshell.cc:6124
Definition: tok.h:58
#define omFreeBinAddr(addr)
Definition: omAllocDecl.h:258
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:390
The main handler for Singular numbers which are suitable for Singular polynomials.
sBucket * sBucket_pt
Definition: sbuckets.h:16
complex floating point (GMP) numbers
Definition: coeffs.h:42
static FORCE_INLINE char * nCoeffName(const coeffs cf)
Definition: coeffs.h:985
int m
Definition: cfEzgcd.cc:121
int i
Definition: cfEzgcd.cc:125
Definition: tok.h:209
Definition: tok.h:34
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:856
Definition: tok.h:212
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
CanonicalForm cf
Definition: cfModGcd.cc:4024
Definition: tok.h:117
#define NULL
Definition: omList.c:12
slists * lists
Definition: mpr_numeric.h:146
{p^n < 2^16}
Definition: coeffs.h:33
omBin sip_command_bin
Definition: ipid.cc:45
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:140
#define R
Definition: sirandom.c:26
void sBucketDeleteAndDestroy(sBucket_pt *bucket_pt)
Definition: sbuckets.cc:110
void Clean(ring r=currRing)
Definition: lists.h:26
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: tok.h:118
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:455
int p
Definition: cfModGcd.cc:4019
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
Definition: tok.h:208
#define NONE
Definition: tok.h:219
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:510
void syKillComputation(syStrategy syzstr, ring r=currRing)
Definition: syz1.cc:1495
int l
Definition: cfEzgcd.cc:93
#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:77

◆ slInternalCopy()

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

Definition at line 685 of file subexpr.cc.

686 {
687  if (t==STRING_CMD)
688  {
689  if ((e==NULL)
690  || (source->rtyp==LIST_CMD)
691  || ((source->rtyp==IDHDL)
692  &&((IDTYP((idhdl)source->data)==LIST_CMD)
693  || (IDTYP((idhdl)source->data)>MAX_TOK)))
694  || (source->rtyp>MAX_TOK))
695  return (void *)omStrDup((char *)d);
696  else if (e->next==NULL)
697  {
698  char *s=(char*)omAllocBin(size_two_bin);
699  s[0]=*(char *)d;
700  s[1]='\0';
701  return s;
702  }
703  #ifdef TEST
704  else
705  {
706  Werror("not impl. string-op in `%s`",my_yylinebuf);
707  return NULL;
708  }
709  #endif
710  }
711  return s_internalCopy(t,d);
712 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
const CanonicalForm int s
Definition: facAbsFact.cc:55
Definition: tok.h:216
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
#define IDTYP(a)
Definition: ipid.h:114
char my_yylinebuf[80]
Definition: febase.cc:43
static void * s_internalCopy(const int t, void *d)
Definition: subexpr.cc:430
#define NULL
Definition: omList.c:12
int rtyp
Definition: subexpr.h:91
Definition: tok.h:118
void Werror(const char *fmt,...)
Definition: reporter.cc:189
static omBin size_two_bin
Definition: subexpr.cc:44
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ syMake()

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

Definition at line 1578 of file subexpr.cc.

1579 {
1580  /* resolv an identifier: (to DEF_CMD, if siq>0)
1581  * 1) reserved id: done by scanner
1582  * 2) `basering` / 'Current`
1583  * 3) existing identifier, local
1584  * 4) ringvar, ringpar, local ring
1585  * 5) existing identifier, global
1586  * 6) monom (resp. number), local ring: consisting of:
1587  * 6') ringvar, ringpar,global ring
1588  * 6'') monom (resp. number), local ring
1589  * 7) monom (resp. number), non-local ring
1590  * 8) basering
1591  * 9) `_`
1592  * 10) everything else is of type 0
1593  */
1594 #ifdef TEST
1595  if ((*id<' ')||(*id>(char)126))
1596  {
1597  Print("wrong id :%s:\n",id);
1598  }
1599 #endif
1600  idhdl save_ring=currRingHdl;
1601  v->Init();
1602  if(pa != NULL)
1603  {
1604  v->req_packhdl = pa;
1605  }
1606  else v->req_packhdl = currPack;
1607 // if (v->req_packhdl!=basePack)
1608 // Print("search %s in %s\n",id,v->req_packhdl->libname);
1609  idhdl h=NULL;
1610 #ifdef SIQ
1611  if (siq<=0)
1612 #endif
1613  {
1614  if (!isdigit(id[0]))
1615  {
1616  if (strcmp(id,"basering")==0)
1617  {
1618  if (currRingHdl!=NULL)
1619  {
1620  if (id!=IDID(currRingHdl)) omFreeBinAddr((ADDRESS)id);
1621  h=currRingHdl;
1622  goto id_found;
1623  }
1624  else
1625  {
1626  v->name = id;
1627  return; /* undefined */
1628  }
1629  }
1630  else if (strcmp(id,"Current")==0)
1631  {
1632  if (currPackHdl!=NULL)
1633  {
1634  omFreeBinAddr((ADDRESS)id);
1635  h=currPackHdl;
1636  goto id_found;
1637  }
1638  else
1639  {
1640  v->name = id;
1641  return; /* undefined */
1642  }
1643  }
1644  if(v->req_packhdl!=currPack)
1645  {
1646  h=v->req_packhdl->idroot->get(id,myynest);
1647  }
1648  else
1649  h=ggetid(id);
1650  /* 3) existing identifier, local */
1651  if ((h!=NULL) && (IDLEV(h)==myynest))
1652  {
1653  if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1654  goto id_found;
1655  }
1656  }
1658  {
1659  currRingHdl=NULL;
1660  }
1661  /* 4. local ring: ringvar */
1662  if ((currRingHdl!=NULL) && (IDLEV(currRingHdl)==myynest)
1663  /*&& (!yyInRingConstruction)*/)
1664  {
1665  int vnr;
1666  if ((vnr=r_IsRingVar(id, currRing->names,currRing->N))>=0)
1667  {
1668  poly p=pOne();
1669  pSetExp(p,vnr+1,1);
1670  pSetm(p);
1671  v->data = (void *)p;
1672  v->name = id;
1673  v->rtyp = POLY_CMD;
1674  return;
1675  }
1676  if((n_NumberOfParameters(currRing->cf)>0)
1677  &&((vnr=r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
1678  n_NumberOfParameters(currRing->cf))>=0)))
1679  {
1680  BOOLEAN ok=FALSE;
1681  poly p = pmInit(id,ok);
1682  if (ok && (p!=NULL))
1683  {
1684  v->data = pGetCoeff(p);
1685  pGetCoeff(p)=NULL;
1686  pLmFree(p);
1687  v->rtyp = NUMBER_CMD;
1688  v->name = id;
1689  return;
1690  }
1691  }
1692  }
1693  /* 5. existing identifier, global */
1694  if (h!=NULL)
1695  {
1696  if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1697  goto id_found;
1698  }
1699  /* 6. local ring: number/poly */
1700  if ((currRingHdl!=NULL) && (IDLEV(currRingHdl)==myynest)
1701  #ifdef HAVE_SHIFTBBA
1702  && (currRing->isLPring==0)
1703  #endif
1704  )
1705  {
1706  BOOLEAN ok=FALSE;
1707  /*poly p = (!yyInRingConstruction) ? pmInit(id,ok) : (poly)NULL;*/
1708  poly p = pmInit(id,ok);
1709  if (ok)
1710  {
1711  if (p==NULL)
1712  {
1713  v->data = (void *)nInit(0);
1714  v->rtyp = NUMBER_CMD;
1715  #ifdef HAVE_PLURAL
1716  // in this case we may have monomials equal to 0 in p_Read
1717  v->name = id;
1718  #else
1719  omFreeBinAddr((ADDRESS)id);
1720  #endif
1721  }
1722  else if (pIsConstant(p))
1723  {
1724  v->data = pGetCoeff(p);
1725  pGetCoeff(p)=NULL;
1726  pLmFree(p);
1727  v->rtyp = NUMBER_CMD;
1728  v->name = id;
1729  }
1730  else
1731  {
1732  v->data = p;
1733  v->rtyp = POLY_CMD;
1734  v->name = id;
1735  }
1736  return;
1737  }
1738  }
1739  /* 7. non-local ring: number/poly */
1740  {
1741  BOOLEAN ok=FALSE;
1742  poly p = ((currRing!=NULL) /* ring required */
1743  && (currRingHdl!=NULL)
1744  /*&& (!yyInRingConstruction) - not in decl */
1745  && (IDLEV(currRingHdl)!=myynest)) /* already in case 4/6 */
1746  ? pmInit(id,ok) : (poly)NULL;
1747  if (ok)
1748  {
1749  if (p==NULL)
1750  {
1751  v->data = (void *)nInit(0);
1752  v->rtyp = NUMBER_CMD;
1753  omFreeBinAddr((ADDRESS)id);
1754  }
1755  else
1756  if (pIsConstant(p))
1757  {
1758  v->data = pGetCoeff(p);
1759  pGetCoeff(p)=NULL;
1760  pLmFree(p);
1761  v->rtyp = NUMBER_CMD;
1762  v->name = id;
1763  }
1764  else
1765  {
1766  v->data = p;
1767  v->rtyp = POLY_CMD;
1768  v->name = id;
1769  }
1770  //if (TEST_V_ALLWARN /*&& (myynest>0)*/
1771  //&& ((r_IsRingVar(id, currRing->names,currRing->N)>=0)
1772  // || ((n_NumberOfParameters(currRing->cf)>0)
1773  // &&(r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
1774  // n_NumberOfParameters(currRing->cf))>=0))))
1775  //{
1776  //// WARNING: do not use ring variable names in procedures
1777  // Warn("use of variable >>%s<< in a procedure in line %s",id,my_yylinebuf);
1778  //}
1779  return;
1780  }
1781  }
1782  /* 8. basering ? */
1783  if ((myynest>1)&&(currRingHdl!=NULL))
1784  {
1785  if (strcmp(id,IDID(currRingHdl))==0)
1786  {
1787  if (IDID(currRingHdl)!=id) omFreeBinAddr((ADDRESS)id); /*assume strlen (id) <1000 */
1788  h=currRingHdl;
1789  goto id_found;
1790  }
1791  }
1792  if((v->req_packhdl!=basePack) && (v->req_packhdl==currPack))
1793  {
1794  h=basePack->idroot->get(id,myynest);
1795  if (h!=NULL)
1796  {
1797  if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1798  v->req_packhdl=basePack;
1799  goto id_found;
1800  }
1801  }
1802  }
1803 #ifdef SIQ
1804  else
1805  v->rtyp=DEF_CMD;
1806 #endif
1807  /* 9: _ */
1808  if (strcmp(id,"_")==0)
1809  {
1810  omFreeBinAddr((ADDRESS)id);
1811  v->Copy(&sLastPrinted);
1812  }
1813  else
1814  {
1815  /* 10: everything else */
1816  /* v->rtyp = UNKNOWN;*/
1817  v->name = id;
1818  }
1819  currRingHdl=save_ring;
1820  return;
1821 id_found: // we have an id (in h) found, to set the data in from h
1822  if (IDTYP(h)!=ALIAS_CMD)
1823  {
1824  v->rtyp = IDHDL;
1825  v->flag = IDFLAG(h);
1826  v->attribute=IDATTR(h);
1827  }
1828  else
1829  {
1830  v->rtyp = ALIAS_CMD;
1831  }
1832  v->name = IDID(h);
1833  v->data = (char *)h;
1834  currRingHdl=save_ring;
1835 }
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:800
idhdl ggetid(const char *n)
Definition: ipid.cc:521
#define pSetm(p)
Definition: polys.h:266
#define Print
Definition: emacs.cc:80
idhdl currPackHdl
Definition: ipid.cc:55
BITSET flag
Definition: subexpr.h:90
#define IDID(a)
Definition: ipid.h:117
#define pSetExp(p, i, v)
Definition: polys.h:42
#define FALSE
Definition: auxiliary.h:94
BOOLEAN siq
Definition: subexpr.cc:48
void Init()
Definition: subexpr.h:107
void * ADDRESS
Definition: auxiliary.h:133
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:44
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:796
void * data
Definition: subexpr.h:88
int myynest
Definition: febase.cc:41
#define IDTYP(a)
Definition: ipid.h:114
int r_IsRingVar(const char *n, char **names, int N)
Definition: ring.cc:212
Definition: tok.h:58
const char * name
Definition: subexpr.h:87
#define omFreeBinAddr(addr)
Definition: omAllocDecl.h:258
idhdl currRingHdl
Definition: ipid.cc:59
void Copy(leftv e)
Definition: subexpr.cc:714
#define pIsConstant(p)
like above, except that Comp must be 0
Definition: polys.h:233
#define pOne()
Definition: polys.h:310
#define IDLEV(a)
Definition: ipid.h:116
Definition: tok.h:34
#define NULL
Definition: omList.c:12
package req_packhdl
Definition: subexpr.h:106
package basePack
Definition: ipid.cc:58
package currPack
Definition: ipid.cc:57
int rtyp
Definition: subexpr.h:91
sleftv sLastPrinted
Definition: subexpr.cc:46
#define IDFLAG(a)
Definition: ipid.h:115
#define pmInit(a, b)
Definition: polys.h:284
#define IDATTR(a)
Definition: ipid.h:118
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
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:89
BOOLEAN pa(leftv res, leftv args)
Definition: cohomo.cc:4346
int p
Definition: cfModGcd.cc:4019
#define nInit(i)
Definition: numbers.h:24
static Poly * h
Definition: janet.cc:971
int BOOLEAN
Definition: auxiliary.h:85

Variable Documentation

◆ libstack_bin

omBin libstack_bin = omGetSpecBin(sizeof(libstack))

Definition at line 43 of file subexpr.cc.

◆ procinfo_bin

omBin procinfo_bin = omGetSpecBin(sizeof(procinfo))

Definition at line 42 of file subexpr.cc.

◆ siq

BOOLEAN siq =FALSE

Definition at line 48 of file subexpr.cc.

◆ size_two_bin

omBin size_two_bin = omGetSpecBin(2)
static

Definition at line 44 of file subexpr.cc.

◆ sLastPrinted

sleftv sLastPrinted

Definition at line 46 of file subexpr.cc.

◆ sleftv_bin

omBin sleftv_bin = omGetSpecBin(sizeof(sleftv))

Definition at line 41 of file subexpr.cc.

◆ sSubexpr_bin

omBin sSubexpr_bin = omGetSpecBin(sizeof(_ssubexpr))

Definition at line 40 of file subexpr.cc.