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
 
static snumber2 iiNumber2Data [4]
 
static int iiCmatrix_index =0
 

Function Documentation

§ assumeStdFlag()

BOOLEAN assumeStdFlag ( leftv  h)

Definition at line 1458 of file subexpr.cc.

1459 {
1460  if (h->e!=NULL)
1461  {
1462  leftv hh=h->LData();
1463  if (h!=hh) return assumeStdFlag(h->LData());
1464  }
1465  if (!hasFlag(h,FLAG_STD))
1466  {
1467  if (!TEST_VERB_NSB)
1468  {
1469  if (TEST_V_ALLWARN)
1470  Warn("%s is no standard basis in >>%s<<",h->Name(),my_yylinebuf);
1471  else
1472  Warn("%s is no standard basis",h->Name());
1473  }
1474  return FALSE;
1475  }
1476  return TRUE;
1477 }
#define TEST_VERB_NSB
Definition: options.h:129
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Subexpr e
Definition: subexpr.h:107
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
const char * Name()
Definition: subexpr.h:122
char my_yylinebuf[80]
Definition: febase.cc:48
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1458
#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:1390
#define TEST_V_ALLWARN
Definition: options.h:135
#define Warn
Definition: emacs.cc:80

§ iiSleftv2name()

const char* iiSleftv2name ( leftv  v)

Definition at line 1936 of file subexpr.cc.

1937 {
1938  return(v->name);
1939 }
const char * name
Definition: subexpr.h:89

§ s_internalCopy()

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

Definition at line 403 of file subexpr.cc.

404 {
405  switch (t)
406  {
407 #ifdef SINGULAR_4_1
408  case CRING_CMD:
409  {
410  coeffs cf=(coeffs)d;
411  cf->ref++;
412  return (void*)d;
413  }
414  case CNUMBER_CMD:
415  return (void*)n2Copy((number2)d);
416  case CMATRIX_CMD: // like BIGINTMAT
417 #endif
418  case BIGINTMAT_CMD:
419  return (void*)bimCopy((bigintmat *)d);
420  case INTVEC_CMD:
421  case INTMAT_CMD:
422  return (void *)ivCopy((intvec *)d);
423  case MATRIX_CMD:
424  return (void *)mp_Copy((matrix)d, currRing);
425  case IDEAL_CMD:
426  case MODUL_CMD:
427  return (void *)idCopy((ideal)d);
428  case STRING_CMD:
429  return (void *)omStrDup((char *)d);
430  case PACKAGE_CMD:
431  return (void *)paCopy((package) d);
432  case PROC_CMD:
433  return (void *)piCopy((procinfov) d);
434  case POLY_CMD:
435  case VECTOR_CMD:
436  return (void *)pCopy((poly)d);
437  case INT_CMD:
438  return d;
439  case NUMBER_CMD:
440  return (void *)nCopy((number)d);
441  case BIGINT_CMD:
442  return (void *)n_Copy((number)d, coeffs_BIGINT);
443  case MAP_CMD:
444  return (void *)maCopy((map)d, currRing);
445  case LIST_CMD:
446  return (void *)lCopy((lists)d);
447  case LINK_CMD:
448  return (void *)slCopy((si_link) d);
449  case RING_CMD:
450  {
451  ring r=(ring)d;
452  if (r!=NULL)
453  {
454  r->ref++;
455  //Print("s_internalCopy:+ ring %d, ref %d\n",r,r->ref);
456  }
457  return d;
458  }
459  case RESOLUTION_CMD:
460  return (void*)syCopy((syStrategy)d);
461  case DEF_CMD:
462  case NONE:
463  case 0: /* type in error case */
464  break; /* error recovery: do nothing */
465  //case COMMAND:
466  default:
467  {
468  if (t>MAX_TOK)
469  {
470  blackbox *b=getBlackboxStuff(t);
471  if (b!=NULL) return b->blackbox_Copy(b,d);
472  return NULL;
473  }
474  else
475  Warn("s_internalCopy: cannot copy type %s(%d)",
476  Tok2Cmdname(t),t);
477  }
478  }
479  return NULL;
480 }
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:94
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:150
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:55
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:57
The main handler for Singular numbers which are suitable for Singular polynomials.
package paCopy(package pack)
Definition: ipid.h:45
Definition: tok.h:99
lists lCopy(lists L)
Definition: lists.cc:32
ideal idCopy(ideal A)
Definition: ideals.h:62
number2 n2Copy(const number2 d)
Definition: number2.cc:270
CanonicalForm cf
Definition: cfModGcd.cc:4024
Definition: tok.h:115
#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:1895
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:128
#define nCopy(n)
Definition: numbers.h:15
Definition: tok.h:116
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:75
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 482 of file subexpr.cc.

483 {
484  assume(d!=NULL);
485  switch (t)
486  {
487 #ifdef SINGULAR_4_1
488  case CRING_CMD:
489  nKillChar((coeffs)d);
490  break;
491  case CNUMBER_CMD:
492  {
493  number2 n=(number2)d;
494  n2Delete(n);
495  break;
496  }
497  case CMATRIX_CMD: //like BIGINTMAT
498 #endif
499  case BIGINTMAT_CMD:
500  {
501  bigintmat *v=(bigintmat*)d;
502  delete v;
503  break;
504  }
505  case INTVEC_CMD:
506  case INTMAT_CMD:
507  {
508  intvec *v=(intvec*)d;
509  delete v;
510  break;
511  }
512  case MAP_CMD:
513  {
514  map m=(map)d;
515  omFreeBinAddr((ADDRESS)m->preimage);
516  m->preimage=NULL;
517  /* no break: continue as IDEAL*/
518  }
519  case MATRIX_CMD:
520  case IDEAL_CMD:
521  case MODUL_CMD:
522  {
523  ideal i=(ideal)d;
524  id_Delete(&i,r);
525  break;
526  }
527  case STRING_CMD:
528  omFree(d);
529  break;
530  //case PACKAGE_CMD:
531  // return (void *)paCopy((package) d);
532  case PROC_CMD:
533  piKill((procinfo*)d);
534  break;
535  case POLY_CMD:
536  case VECTOR_CMD:
537  {
538  poly p=(poly)d;
539  p_Delete(&p,r);
540  break;
541  }
542  case NUMBER_CMD:
543  {
544  number n=(number)d;
545  n_Delete(&n,r);
546  break;
547  }
548  case BIGINT_CMD:
549  {
550  number n=(number)d;
552  break;
553  }
554  case LIST_CMD:
555  {
556  lists l=(lists)d;
557  l->Clean(r);
558  break;
559  }
560  case LINK_CMD:
561  {
562  si_link l=(si_link)d;
563  slKill(l);
564  break;
565  }
566  case RING_CMD:
567  {
568  ring R=(ring)d;
569  if ((R!=currRing)||(R->ref>=0))
570  rKill(R);
571  #ifdef TEST
572  else
573  Print("currRing? ref=%d\n",R->ref);
574  #endif
575  break;
576  }
577  case RESOLUTION_CMD:
578  {
580  if (s!=NULL) syKillComputation(s,r);
581  break;
582  }
583  case COMMAND:
584  {
585  command cmd=(command)d;
586  if (cmd->arg1.rtyp!=0) cmd->arg1.CleanUp(r);
587  if (cmd->arg2.rtyp!=0) cmd->arg2.CleanUp(r);
588  if (cmd->arg3.rtyp!=0) cmd->arg3.CleanUp(r);
590  break;
591  }
592  case INT_CMD:
593  case DEF_CMD:
594  case ALIAS_CMD:
595  case PACKAGE_CMD:
596  case IDHDL:
597  case NONE:
598  case ANY_TYPE:
599  case VECHO:
600  case VPRINTLEVEL:
601  case VCOLMAX:
602  case VTIMER:
603  case VRTIMER:
604  case VOICE:
605  case VMAXDEG:
606  case VMAXMULT:
607  case TRACE:
608  case VSHORTOUT:
609  case VNOETHER:
610  case VMINPOLY:
611  case LIB_CMD:
612  case 0: /* type in error case */
613  break; /* error recovery: do nothing */
614  //case COMMAND:
615  //case COMMAND:
616  default:
617  {
618  if (t>MAX_TOK)
619  {
620  blackbox *b=getBlackboxStuff(t);
621  if (b!=NULL) b->blackbox_destroy(b,d);
622  break;
623  }
624  else
625  Warn("s_internalDelete: cannot delete type %s(%d)",
626  Tok2Cmdname(t),t);
627  }
628  }
629 }
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
#define ANY_TYPE
Definition: tok.h:30
#define Print
Definition: emacs.cc:83
Definition: tok.h:94
Definition: tok.h:204
Definition: lists.h:22
Definition: tok.h:38
return P p
Definition: myNF.cc:203
Matrices of numbers.
Definition: bigintmat.h:51
void n2Delete(number2 &d)
Definition: number2.cc:285
Definition: tok.h:213
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
void * ADDRESS
Definition: auxiliary.h:118
coeffs coeffs_BIGINT
Definition: ipid.cc:54
BOOLEAN piKill(procinfov pi)
Definition: ipid.cc:647
#define IDHDL
Definition: tok.h:31
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:55
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
void rKill(ring r)
Definition: ipshell.cc:6044
Definition: tok.h:57
#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
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
Definition: tok.h:206
Definition: tok.h:99
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
Definition: tok.h:115
#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:128
void Clean(ring r=currRing)
Definition: lists.h:25
Definition: tok.h:116
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:490
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 631 of file subexpr.cc.

632 {
633  if (t==STRING_CMD)
634  {
635  if ((e==NULL)
636  || (source->rtyp==LIST_CMD)
637  || ((source->rtyp==IDHDL)
638  &&((IDTYP((idhdl)source->data)==LIST_CMD)
639  || (IDTYP((idhdl)source->data)>MAX_TOK)))
640  || (source->rtyp>MAX_TOK))
641  return (void *)omStrDup((char *)d);
642  else if (e->next==NULL)
643  {
644  char *s=(char*)omAllocBin(size_two_bin);
645  s[0]=*(char *)d;
646  s[1]='\0';
647  return s;
648  }
649  #ifdef TEST
650  else
651  {
652  Werror("not impl. string-op in `%s`",my_yylinebuf);
653  return NULL;
654  }
655  #endif
656  }
657  return s_internalCopy(t,d);
658 }
#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:90
#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:403
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
Definition: tok.h:116
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 1484 of file subexpr.cc.

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

Variable Documentation

§ iiCmatrix_index

int iiCmatrix_index =0
static

Definition at line 1119 of file subexpr.cc.

§ iiNumber2Data

snumber2 iiNumber2Data[4]
static

Definition at line 1118 of file subexpr.cc.

§ 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.