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 1483 of file subexpr.cc.

1484 {
1485  if (h->e!=NULL)
1486  {
1487  leftv hh=h->LData();
1488  if (h!=hh) return assumeStdFlag(h->LData());
1489  }
1490  if (!hasFlag(h,FLAG_STD))
1491  {
1492  if (!TEST_VERB_NSB)
1493  {
1494  if (TEST_V_ALLWARN)
1495  Warn("%s is no standard basis in >>%s<<",h->Name(),my_yylinebuf);
1496  else
1497  Warn("%s is no standard basis",h->Name());
1498  }
1499  return FALSE;
1500  }
1501  return TRUE;
1502 }
#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:95
#define TRUE
Definition: auxiliary.h:99
const char * Name()
Definition: subexpr.h:121
char my_yylinebuf[80]
Definition: febase.cc:48
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1483
#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:1415
#define TEST_V_ALLWARN
Definition: options.h:135
#define Warn
Definition: emacs.cc:80

§ iiSleftv2name()

const char* iiSleftv2name ( leftv  v)

Definition at line 1961 of file subexpr.cc.

1962 {
1963  return(v->name);
1964 }
const char * name
Definition: subexpr.h:88

§ s_internalCopy()

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

Definition at line 417 of file subexpr.cc.

418 {
419  switch (t)
420  {
421 #ifdef SINGULAR_4_1
422  case CRING_CMD:
423  {
424  coeffs cf=(coeffs)d;
425  cf->ref++;
426  return (void*)d;
427  }
428 #endif
429 #ifdef SINGULAR_4_2
430  case CNUMBER_CMD:
431  return (void*)n2Copy((number2)d);
432  case CPOLY_CMD:
433  return (void*)p2Copy((poly2)d);
434  case CMATRIX_CMD: // like BIGINTMAT
435 #endif
436  case BIGINTMAT_CMD:
437  return (void*)bimCopy((bigintmat *)d);
438  case INTVEC_CMD:
439  case INTMAT_CMD:
440  return (void *)ivCopy((intvec *)d);
441  case MATRIX_CMD:
442  return (void *)mp_Copy((matrix)d, currRing);
443  case IDEAL_CMD:
444  case MODUL_CMD:
445  return (void *)idCopy((ideal)d);
446  case STRING_CMD:
447  return (void *)omStrDup((char *)d);
448  case PACKAGE_CMD:
449  return (void *)paCopy((package) d);
450  case PROC_CMD:
451  return (void *)piCopy((procinfov) d);
452  case POLY_CMD:
453  case VECTOR_CMD:
454  return (void *)pCopy((poly)d);
455  case INT_CMD:
456  return d;
457  case NUMBER_CMD:
458  return (void *)nCopy((number)d);
459  case BIGINT_CMD:
460  return (void *)n_Copy((number)d, coeffs_BIGINT);
461  case MAP_CMD:
462  return (void *)maCopy((map)d, currRing);
463  case LIST_CMD:
464  return (void *)lCopy((lists)d);
465  case LINK_CMD:
466  return (void *)slCopy((si_link) d);
467  case RING_CMD:
468  {
469  ring r=(ring)d;
470  if (r!=NULL)
471  {
472  r->ref++;
473  //Print("s_internalCopy:+ ring %d, ref %d\n",r,r->ref);
474  }
475  return d;
476  }
477  case RESOLUTION_CMD:
478  return (void*)syCopy((syStrategy)d);
479  case DEF_CMD:
480  case NONE:
481  case 0: /* type in error case */
482  break; /* error recovery: do nothing */
483  //case COMMAND:
484  default:
485  {
486  if (t>MAX_TOK)
487  {
488  blackbox *b=getBlackboxStuff(t);
489  if (b!=NULL) return b->blackbox_Copy(b,d);
490  return NULL;
491  }
492  else
493  Warn("s_internalCopy: cannot copy type %s(%d)",
494  Tok2Cmdname(t),t);
495  }
496  }
497  return NULL;
498 }
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:215
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:1886
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:130
#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:218
#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 500 of file subexpr.cc.

501 {
502  assume(d!=NULL);
503  switch (t)
504  {
505 #ifdef SINGULAR_4_1
506  case CRING_CMD:
507  {
508  coeffs cf=(coeffs)d;
509  if ((cf->ref<=1)&&
510  ((cf->type <=n_long_R)
511  ||((cf->type >=n_long_C)&&(cf->type <=n_CF))))
512  {
513  Werror("cannot kill %s",nCoeffName(cf));
514  }
515  else
516  nKillChar((coeffs)d);
517  break;
518  }
519 #endif
520 #ifdef SINGULAR_4_2
521  case CNUMBER_CMD:
522  {
523  number2 n=(number2)d;
524  n2Delete(n);
525  break;
526  }
527  case CPOLY_CMD:
528  {
529  poly2 n=(poly2)d;
530  p2Delete(n);
531  break;
532  }
533  case CMATRIX_CMD: //like BIGINTMAT
534 #endif
535  case BIGINTMAT_CMD:
536  {
537  bigintmat *v=(bigintmat*)d;
538  delete v;
539  break;
540  }
541  case INTVEC_CMD:
542  case INTMAT_CMD:
543  {
544  intvec *v=(intvec*)d;
545  delete v;
546  break;
547  }
548  case MAP_CMD:
549  {
550  map m=(map)d;
551  omFreeBinAddr((ADDRESS)m->preimage);
552  m->preimage=NULL;
553  /* no break: continue as IDEAL*/
554  }
555  case MATRIX_CMD:
556  case IDEAL_CMD:
557  case MODUL_CMD:
558  {
559  ideal i=(ideal)d;
560  id_Delete(&i,r);
561  break;
562  }
563  case STRING_CMD:
564  omFree(d);
565  break;
566  //case PACKAGE_CMD:
567  // return (void *)paCopy((package) d);
568  case PROC_CMD:
569  piKill((procinfo*)d);
570  break;
571  case POLY_CMD:
572  case VECTOR_CMD:
573  {
574  poly p=(poly)d;
575  p_Delete(&p,r);
576  break;
577  }
578  case NUMBER_CMD:
579  {
580  number n=(number)d;
581  n_Delete(&n,r->cf);
582  break;
583  }
584  case BIGINT_CMD:
585  {
586  number n=(number)d;
588  break;
589  }
590  case LIST_CMD:
591  {
592  lists l=(lists)d;
593  l->Clean(r);
594  break;
595  }
596  case LINK_CMD:
597  {
598  si_link l=(si_link)d;
599  slKill(l);
600  break;
601  }
602  case RING_CMD:
603  {
604  ring R=(ring)d;
605  if ((R!=currRing)||(R->ref>=0))
606  rKill(R);
607  #ifdef TEST
608  else
609  Print("currRing? ref=%d\n",R->ref);
610  #endif
611  break;
612  }
613  case RESOLUTION_CMD:
614  {
616  if (s!=NULL) syKillComputation(s,r);
617  break;
618  }
619  case COMMAND:
620  {
621  command cmd=(command)d;
622  if (cmd->arg1.rtyp!=0) cmd->arg1.CleanUp(r);
623  if (cmd->arg2.rtyp!=0) cmd->arg2.CleanUp(r);
624  if (cmd->arg3.rtyp!=0) cmd->arg3.CleanUp(r);
626  break;
627  }
628  case INT_CMD:
629  case DEF_CMD:
630  case ALIAS_CMD:
631  case PACKAGE_CMD:
632  case IDHDL:
633  case NONE:
634  case ANY_TYPE:
635  case VECHO:
636  case VPRINTLEVEL:
637  case VCOLMAX:
638  case VTIMER:
639  case VRTIMER:
640  case VOICE:
641  case VMAXDEG:
642  case VMAXMULT:
643  case TRACE:
644  case VSHORTOUT:
645  case VNOETHER:
646  case VMINPOLY:
647  case 0: /* type in error case */
648  break; /* error recovery: do nothing */
649  //case COMMAND:
650  //case COMMAND:
651  default:
652  {
653  if (t>MAX_TOK)
654  {
655  blackbox *b=getBlackboxStuff(t);
656  if (b!=NULL) b->blackbox_destroy(b,d);
657  break;
658  }
659  else
660  Warn("s_internalDelete: cannot delete type %s(%d)",
661  Tok2Cmdname(t),t);
662  }
663  }
664 }
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:209
const CanonicalForm int s
Definition: facAbsFact.cc:55
Definition: tok.h:205
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:206
?
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:215
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
void * ADDRESS
Definition: auxiliary.h:116
coeffs coeffs_BIGINT
Definition: ipid.cc:54
BOOLEAN piKill(procinfov pi)
Definition: ipid.cc:655
#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:210
Definition: tok.h:56
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
void rKill(ring r)
Definition: ipshell.cc:6048
Definition: tok.h:58
#define omFreeBinAddr(addr)
Definition: omAllocDecl.h:258
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:403
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:977
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
Definition: tok.h:208
Definition: tok.h:34
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
Definition: tok.h:211
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:130
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:207
const poly b
Definition: syzextra.cc:213
#define NONE
Definition: tok.h:218
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:1497
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 666 of file subexpr.cc.

667 {
668  if (t==STRING_CMD)
669  {
670  if ((e==NULL)
671  || (source->rtyp==LIST_CMD)
672  || ((source->rtyp==IDHDL)
673  &&((IDTYP((idhdl)source->data)==LIST_CMD)
674  || (IDTYP((idhdl)source->data)>MAX_TOK)))
675  || (source->rtyp>MAX_TOK))
676  return (void *)omStrDup((char *)d);
677  else if (e->next==NULL)
678  {
679  char *s=(char*)omAllocBin(size_two_bin);
680  s[0]=*(char *)d;
681  s[1]='\0';
682  return s;
683  }
684  #ifdef TEST
685  else
686  {
687  Werror("not impl. string-op in `%s`",my_yylinebuf);
688  return NULL;
689  }
690  #endif
691  }
692  return s_internalCopy(t,d);
693 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
const CanonicalForm int s
Definition: facAbsFact.cc:55
Definition: tok.h:215
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:417
#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 1509 of file subexpr.cc.

1510 {
1511  /* resolv an identifier: (to DEF_CMD, if siq>0)
1512  * 1) reserved id: done by scanner
1513  * 2) `basering` / 'Current`
1514  * 3) existing identifier, local
1515  * 4) ringvar, ringpar, local ring
1516  * 5) existing identifier, global
1517  * 6) monom (resp. number), local ring: consisting of:
1518  * 6') ringvar, ringpar,global ring
1519  * 6'') monom (resp. number), local ring
1520  * 7) monom (resp. number), non-local ring
1521  * 8) basering
1522  * 9) `_`
1523  * 10) everything else is of type 0
1524  */
1525 #ifdef TEST
1526  if ((*id<' ')||(*id>(char)126))
1527  {
1528  Print("wrong id :%s:\n",id);
1529  }
1530 #endif
1531  idhdl save_ring=currRingHdl;
1532  v->Init();
1533  if(pa != NULL)
1534  {
1535  v->req_packhdl = pa;
1536  }
1537  else v->req_packhdl = currPack;
1538 // if (v->req_packhdl!=basePack)
1539 // Print("search %s in %s\n",id,v->req_packhdl->libname);
1540  idhdl h=NULL;
1541 #ifdef SIQ
1542  if (siq<=0)
1543 #endif
1544  {
1545  if (!isdigit(id[0]))
1546  {
1547  if (strcmp(id,"basering")==0)
1548  {
1549  if (currRingHdl!=NULL)
1550  {
1551  if (id!=IDID(currRingHdl)) omFreeBinAddr((ADDRESS)id);
1552  h=currRingHdl;
1553  goto id_found;
1554  }
1555  else
1556  {
1557  v->name = id;
1558  return; /* undefined */
1559  }
1560  }
1561  else if (strcmp(id,"Current")==0)
1562  {
1563  if (currPackHdl!=NULL)
1564  {
1565  omFreeBinAddr((ADDRESS)id);
1566  h=currPackHdl;
1567  goto id_found;
1568  }
1569  else
1570  {
1571  v->name = id;
1572  return; /* undefined */
1573  }
1574  }
1575  if(v->req_packhdl!=currPack)
1576  {
1577  h=v->req_packhdl->idroot->get(id,myynest);
1578  }
1579  else
1580  h=ggetid(id);
1581  /* 3) existing identifier, local */
1582  if ((h!=NULL) && (IDLEV(h)==myynest))
1583  {
1584  if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1585  goto id_found;
1586  }
1587  }
1589  {
1590  currRingHdl=NULL;
1591  }
1592  /* 4. local ring: ringvar */
1593  if ((currRingHdl!=NULL) && (IDLEV(currRingHdl)==myynest)
1594  /*&& (!yyInRingConstruction)*/)
1595  {
1596  int vnr;
1597  if ((vnr=r_IsRingVar(id, currRing->names,currRing->N))>=0)
1598  {
1599  poly p=pOne();
1600  pSetExp(p,vnr+1,1);
1601  pSetm(p);
1602  v->data = (void *)p;
1603  v->name = id;
1604  v->rtyp = POLY_CMD;
1605  return;
1606  }
1607  if((n_NumberOfParameters(currRing->cf)>0)
1608  &&((vnr=r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
1609  n_NumberOfParameters(currRing->cf))>=0)))
1610  {
1611  BOOLEAN ok=FALSE;
1612  poly p = pmInit(id,ok);
1613  if (ok && (p!=NULL))
1614  {
1615  v->data = pGetCoeff(p);
1616  pGetCoeff(p)=NULL;
1617  pLmFree(p);
1618  v->rtyp = NUMBER_CMD;
1619  v->name = id;
1620  return;
1621  }
1622  }
1623  }
1624  /* 5. existing identifier, global */
1625  if (h!=NULL)
1626  {
1627  if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1628  goto id_found;
1629  }
1630  /* 6. local ring: number/poly */
1631  if ((currRingHdl!=NULL) && (IDLEV(currRingHdl)==myynest))
1632  {
1633  BOOLEAN ok=FALSE;
1634  /*poly p = (!yyInRingConstruction) ? pmInit(id,ok) : (poly)NULL;*/
1635  poly p = pmInit(id,ok);
1636  if (ok)
1637  {
1638  if (p==NULL)
1639  {
1640  v->data = (void *)nInit(0);
1641  v->rtyp = NUMBER_CMD;
1642  #ifdef HAVE_PLURAL
1643  // in this case we may have monomials equal to 0 in p_Read
1644  v->name = id;
1645  #else
1646  omFreeBinAddr((ADDRESS)id);
1647  #endif
1648  }
1649  else if (pIsConstant(p))
1650  {
1651  v->data = pGetCoeff(p);
1652  pGetCoeff(p)=NULL;
1653  pLmFree(p);
1654  v->rtyp = NUMBER_CMD;
1655  v->name = id;
1656  }
1657  else
1658  {
1659  v->data = p;
1660  v->rtyp = POLY_CMD;
1661  v->name = id;
1662  }
1663  return;
1664  }
1665  }
1666  /* 7. non-local ring: number/poly */
1667  {
1668  BOOLEAN ok=FALSE;
1669  poly p = ((currRing!=NULL) /* ring required */
1670  && (currRingHdl!=NULL)
1671  /*&& (!yyInRingConstruction) - not in decl */
1672  && (IDLEV(currRingHdl)!=myynest)) /* already in case 4/6 */
1673  ? pmInit(id,ok) : (poly)NULL;
1674  if (ok)
1675  {
1676  if (p==NULL)
1677  {
1678  v->data = (void *)nInit(0);
1679  v->rtyp = NUMBER_CMD;
1680  #ifdef HAVE_PLURAL
1681  // in this case we may have monomials equal to 0 in p_Read
1682  v->name = id;
1683  #else
1684  omFreeBinAddr((ADDRESS)id);
1685  #endif
1686  }
1687  else
1688  if (pIsConstant(p))
1689  {
1690  v->data = pGetCoeff(p);
1691  pGetCoeff(p)=NULL;
1692  pLmFree(p);
1693  v->rtyp = NUMBER_CMD;
1694  v->name = id;
1695  }
1696  else
1697  {
1698  v->data = p;
1699  v->rtyp = POLY_CMD;
1700  v->name = id;
1701  }
1702  //if (TEST_V_ALLWARN /*&& (myynest>0)*/
1703  //&& ((r_IsRingVar(id, currRing->names,currRing->N)>=0)
1704  // || ((n_NumberOfParameters(currRing->cf)>0)
1705  // &&(r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
1706  // n_NumberOfParameters(currRing->cf))>=0))))
1707  //{
1708  //// WARNING: do not use ring variable names in procedures
1709  // Warn("use of variable >>%s<< in a procedure in line %s",id,my_yylinebuf);
1710  //}
1711  return;
1712  }
1713  }
1714  /* 8. basering ? */
1715  if ((myynest>1)&&(currRingHdl!=NULL))
1716  {
1717  if (strcmp(id,IDID(currRingHdl))==0)
1718  {
1719  if (IDID(currRingHdl)!=id) omFreeBinAddr((ADDRESS)id); /*assume strlen (id) <1000 */
1720  h=currRingHdl;
1721  goto id_found;
1722  }
1723  }
1724  if((v->req_packhdl!=basePack) && (v->req_packhdl==currPack))
1725  {
1726  h=basePack->idroot->get(id,myynest);
1727  if (h!=NULL)
1728  {
1729  if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1730  v->req_packhdl=basePack;
1731  goto id_found;
1732  }
1733  }
1734  }
1735 #ifdef SIQ
1736  else
1737  v->rtyp=DEF_CMD;
1738 #endif
1739  /* 9: _ */
1740  if (strcmp(id,"_")==0)
1741  {
1742  omFreeBinAddr((ADDRESS)id);
1743  v->Copy(&sLastPrinted);
1744  }
1745  else
1746  {
1747  /* 10: everything else */
1748  /* v->rtyp = UNKNOWN;*/
1749  v->name = id;
1750  }
1751  currRingHdl=save_ring;
1752  return;
1753 id_found: // we have an id (in h) found, to set the data in from h
1754  if (IDTYP(h)!=ALIAS_CMD)
1755  {
1756  v->rtyp = IDHDL;
1757  v->flag = IDFLAG(h);
1758  v->attribute=IDATTR(h);
1759  }
1760  else
1761  {
1762  v->rtyp = ALIAS_CMD;
1763  }
1764  v->name = IDID(h);
1765  v->data = (char *)h;
1766  currRingHdl=save_ring;
1767 }
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:95
return P p
Definition: myNF.cc:203
BOOLEAN siq
Definition: subexpr.cc:58
void Init()
Definition: subexpr.h:108
void * ADDRESS
Definition: auxiliary.h:116
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:695
#define pIsConstant(p)
like above, except that Comp might be != 0
Definition: polys.h:221
#define pOne()
Definition: polys.h:298
#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:272
#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:86
idhdl ggetid(const char *n, BOOLEAN, idhdl *packhdl)
Definition: ipid.cc:498

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.