My Project
Loading...
Searching...
No Matches
Data Structures | Typedefs | Enumerations | Functions | Variables
subexpr.h File Reference
#include <string.h>
#include "polys/monomials/ring.h"
#include "kernel/mod2.h"
#include "Singular/grammar.h"
#include "Singular/tok.h"
#include "Singular/attrib.h"
#include "Singular/fevoices.h"

Go to the source code of this file.

Data Structures

class  proc_singular
 
struct  proc_object
 
union  procinfodata
 
class  procinfo
 
struct  Subexpr
 
class  sleftv
 Class used for (list of) interpreter objects. More...
 
class  libstack
 

Typedefs

typedef procinfoprocinfov
 
typedef sleftvleftv
 
typedef libstacklibstackv
 

Enumerations

enum  language_defs {
  LANG_NONE , LANG_TOP , LANG_SINGULAR , LANG_C ,
  LANG_MIX , LANG_MAX
}
 

Functions

BOOLEAN RingDependend (int t)
 
void syMake (leftv v, const char *name, package pa=NULL)
 
void syMakeMonom (leftv v, const char *name)
 
BOOLEAN assumeStdFlag (leftv h)
 
procinfov piCopy (procinfov pi)
 
BOOLEAN piKill (procinfov l)
 
const char * piProcinfo (procinfov pi, const char *request)
 
void piShowProcinfo (procinfov pi, char *txt)
 
void s_internalDelete (const int t, void *d, const ring r)
 

Variables

EXTERN_VAR BOOLEAN siq
 
EXTERN_INST_VAR sleftv sLastPrinted
 
EXTERN_VAR omBin sSubexpr_bin
 
EXTERN_VAR omBin procinfo_bin
 
EXTERN_VAR omBin libstack_bin
 

Data Structure Documentation

◆ proc_singular

class proc_singular

Definition at line 23 of file subexpr.h.

Data Fields
char * body
long body_end
int body_lineno
long body_start
long def_end
int example_lineno
long example_start
long help_chksum
long help_end
long help_start
long proc_end
long proc_start

◆ uprocinfodata

union uprocinfodata

Definition at line 45 of file subexpr.h.

Data Fields
struct proc_object o
proc_singular s

◆ procinfo

class procinfo

Definition at line 53 of file subexpr.h.

Data Fields
procinfodata data
char is_static
language_defs language
char * libname
package pack
char * procname
short ref
char trace_flag

◆ _ssubexpr

struct _ssubexpr

Definition at line 68 of file subexpr.h.

Data Fields
struct _ssubexpr * next
int start

Typedef Documentation

◆ leftv

typedef sleftv* leftv

Definition at line 79 of file subexpr.h.

◆ libstackv

typedef libstack* libstackv

Definition at line 159 of file subexpr.h.

◆ procinfov

typedef procinfo* procinfov

Definition at line 66 of file subexpr.h.

Enumeration Type Documentation

◆ language_defs

Enumerator
LANG_NONE 
LANG_TOP 
LANG_SINGULAR 
LANG_C 
LANG_MIX 
LANG_MAX 

Definition at line 22 of file subexpr.h.

language_defs
Definition: subexpr.h:22
@ LANG_MAX
Definition: subexpr.h:22
@ LANG_SINGULAR
Definition: subexpr.h:22
@ LANG_NONE
Definition: subexpr.h:22
@ LANG_MIX
Definition: subexpr.h:22
@ LANG_C
Definition: subexpr.h:22
@ LANG_TOP
Definition: subexpr.h:22

Function Documentation

◆ assumeStdFlag()

BOOLEAN assumeStdFlag ( leftv  h)

Definition at line 1544 of file subexpr.cc.

1545{
1546 if (h->e!=NULL)
1547 {
1548 leftv hh=h->LData();
1549 if (h!=hh) return assumeStdFlag(h->LData());
1550 }
1551 if (!hasFlag(h,FLAG_STD))
1552 {
1553 if (!TEST_VERB_NSB)
1554 {
1555 if (TEST_V_ALLWARN)
1556 Warn("%s is no standard basis in >>%s<<",h->Name(),my_yylinebuf);
1557 else
1558 Warn("%s is no standard basis",h->Name());
1559 }
1560 return FALSE;
1561 }
1562 return TRUE;
1563}
#define TRUE
Definition: auxiliary.h:100
#define FALSE
Definition: auxiliary.h:96
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define Warn
Definition: emacs.cc:77
VAR char my_yylinebuf[80]
Definition: febase.cc:44
#define hasFlag(A, F)
Definition: ipid.h:112
#define FLAG_STD
Definition: ipid.h:106
STATIC_VAR Poly * h
Definition: janet.cc:971
#define NULL
Definition: omList.c:12
#define TEST_V_ALLWARN
Definition: options.h:144
#define TEST_VERB_NSB
Definition: options.h:138
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1544

◆ piCopy()

procinfov piCopy ( procinfov  pi)
inline

Definition at line 149 of file subexpr.h.

150{
151 pi->ref++;
152 return pi;
153}
#define pi
Definition: libparse.cc:1145

◆ piKill()

BOOLEAN piKill ( procinfov  l)

Definition at line 747 of file ipid.cc.

748{
749 (pi->ref)--;
750 if (pi->ref == 0)
751 {
752 if (pi->language==LANG_SINGULAR)
753 {
755 while (p!=NULL)
756 {
757 if (p->pi==pi && pi->ref <= 1)
758 {
759 Warn("`%s` in use, can not be killed",pi->procname);
760 return TRUE;
761 }
762 p=p->next;
763 }
764 }
765 if (pi->libname != NULL) // OB: ????
766 omFreeBinAddr((ADDRESS)pi->libname);
767 if (pi->procname != NULL) // OB: ????
768 omFreeBinAddr((ADDRESS)pi->procname);
769
770 if( pi->language == LANG_SINGULAR)
771 {
772 if (pi->data.s.body != NULL) // OB: ????
773 omFree((ADDRESS)pi->data.s.body);
774 }
775 if( pi->language == LANG_C)
776 {
777 }
778 memset((void *) pi, 0, sizeof(procinfo));
779 //pi->language=LANG_NONE;
781 }
782 return FALSE;
783}
void * ADDRESS
Definition: auxiliary.h:119
int p
Definition: cfModGcd.cc:4078
Definition: fevoices.h:59
VAR Voice * currentVoice
Definition: fevoices.cc:49
#define omFree(addr)
Definition: omAllocDecl.h:261
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
#define omFreeBinAddr(addr)
Definition: omAllocDecl.h:258
VAR omBin procinfo_bin
Definition: subexpr.cc:42

◆ piProcinfo()

const char * piProcinfo ( procinfov  pi,
const char *  request 
)

Definition at line 723 of file ipid.cc.

724{
725 if((pi == NULL)||(pi->language==LANG_NONE)) return "empty proc";
726 else if (strcmp(request, "libname") == 0) return pi->libname;
727 else if (strcmp(request, "procname") == 0) return pi->procname;
728 else if (strcmp(request, "type") == 0)
729 {
730 switch (pi->language)
731 {
732 case LANG_SINGULAR: return "singular"; break;
733 case LANG_C: return "object"; break;
734 case LANG_NONE: return "none"; break;
735 default: return "unknown language";
736 }
737 }
738 else if (strcmp(request, "ref") == 0)
739 {
740 char p[8];
741 sprintf(p, "%d", pi->ref);
742 return omStrDup(p); // MEMORY-LEAK
743 }
744 return "??";
745}
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ piShowProcinfo()

void piShowProcinfo ( procinfov  pi,
char *  txt 
)

◆ RingDependend()

BOOLEAN RingDependend ( int  t)
inline

Definition at line 142 of file subexpr.h.

142{ return (BEGIN_RING<t)&&(t<END_RING); }
@ END_RING
Definition: grammar.cc:310
@ BEGIN_RING
Definition: grammar.cc:282

◆ 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}
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition: blackbox.cc:17
int l
Definition: cfEzgcd.cc:100
int m
Definition: cfEzgcd.cc:128
int i
Definition: cfEzgcd.cc:132
CanonicalForm cf
Definition: cfModGcd.cc:4083
CanonicalForm b
Definition: cfModGcd.cc:4103
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:504
Matrices of numbers.
Definition: bigintmat.h:51
Definition: intvec.h:23
Definition: lists.h:24
@ n_GF
\GF{p^n < 2^16}
Definition: coeffs.h:32
@ n_CF
?
Definition: coeffs.h:48
@ n_long_C
complex floating point (GMP) numbers
Definition: coeffs.h:41
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:452
static FORCE_INLINE char * nCoeffName(const coeffs cf)
Definition: coeffs.h:960
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:568
#define Print
Definition: emacs.cc:80
const CanonicalForm int s
Definition: facAbsFact.cc:51
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:39
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:140
@ IDEAL_CMD
Definition: grammar.cc:284
@ MATRIX_CMD
Definition: grammar.cc:286
@ BUCKET_CMD
Definition: grammar.cc:283
@ BIGINTMAT_CMD
Definition: grammar.cc:278
@ MAP_CMD
Definition: grammar.cc:285
@ PROC_CMD
Definition: grammar.cc:280
@ INTMAT_CMD
Definition: grammar.cc:279
@ VMAXMULT
Definition: grammar.cc:307
@ MODUL_CMD
Definition: grammar.cc:287
@ VMAXDEG
Definition: grammar.cc:306
@ SMATRIX_CMD
Definition: grammar.cc:291
@ VECTOR_CMD
Definition: grammar.cc:292
@ RESOLUTION_CMD
Definition: grammar.cc:290
@ NUMBER_CMD
Definition: grammar.cc:288
@ POLY_CMD
Definition: grammar.cc:289
@ VMINPOLY
Definition: grammar.cc:309
@ RING_CMD
Definition: grammar.cc:281
@ VNOETHER
Definition: grammar.cc:308
VAR omBin sip_command_bin
Definition: ipid.cc:45
BOOLEAN piKill(procinfov pi)
Definition: ipid.cc:747
VAR coeffs coeffs_BIGINT
Definition: ipid.cc:50
ip_command * command
Definition: ipid.h:23
void rKill(ring r)
Definition: ipshell.cc:6180
#define assume(x)
Definition: mod2.h:389
slists * lists
Definition: mpr_numeric.h:146
The main handler for Singular numbers which are suitable for Singular polynomials.
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:899
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
void sBucketDeleteAndDestroy(sBucket_pt *bucket_pt)
Definition: sbuckets.cc:110
sBucket * sBucket_pt
Definition: sbuckets.h:16
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define R
Definition: sirandom.c:27
void syKillComputation(syStrategy syzstr, ring r=currRing)
Definition: syz1.cc:1495
ssyStrategy * syStrategy
Definition: syz.h:36
#define IDHDL
Definition: tok.h:31
@ VCOLMAX
Definition: tok.h:209
@ ALIAS_CMD
Definition: tok.h:34
@ BIGINT_CMD
Definition: tok.h:38
@ CRING_CMD
Definition: tok.h:56
@ LIST_CMD
Definition: tok.h:118
@ VSHORTOUT
Definition: tok.h:214
@ VPRINTLEVEL
Definition: tok.h:215
@ INTVEC_CMD
Definition: tok.h:101
@ PACKAGE_CMD
Definition: tok.h:149
@ CMATRIX_CMD
Definition: tok.h:46
@ DEF_CMD
Definition: tok.h:58
@ VECHO
Definition: tok.h:208
@ CNUMBER_CMD
Definition: tok.h:47
@ LINK_CMD
Definition: tok.h:117
@ TRACE
Definition: tok.h:212
@ STRING_CMD
Definition: tok.h:185
@ VTIMER
Definition: tok.h:210
@ VRTIMER
Definition: tok.h:211
@ VOICE
Definition: tok.h:213
@ CPOLY_CMD
Definition: tok.h:48
@ INT_CMD
Definition: tok.h:96
@ MAX_TOK
Definition: tok.h:218
#define NONE
Definition: tok.h:221
#define COMMAND
Definition: tok.h:29
#define ANY_TYPE
Definition: tok.h:30

◆ syMake()

void syMake ( leftv  v,
const char *  name,
package  pa = NULL 
)

Definition at line 1570 of file subexpr.cc.

1571{
1572 /* resolv an identifier: (to DEF_CMD, if siq>0)
1573 * 1) reserved id: done by scanner
1574 * 2) `basering` / 'Current`
1575 * 3) existing identifier, local
1576 * 4) ringvar, ringpar, local ring
1577 * 5) existing identifier, global
1578 * 6a) int/bigint
1579 * 6b) monom (resp. number), local ring: consisting of:
1580 * 6') ringvar, ringpar,global ring
1581 * 6'') monom (resp. number), local ring
1582 * 7) monom (resp. number), non-local ring
1583 * 8) basering
1584 * 9) `_`
1585 * 10) everything else is of type 0
1586 */
1587#ifdef TEST
1588 if ((*id<' ')||(*id>(char)126))
1589 {
1590 Print("wrong id :%s:\n",id);
1591 }
1592#endif
1593 idhdl save_ring=currRingHdl;
1594 v->Init();
1595 if(pa != NULL)
1596 {
1597 v->req_packhdl = pa;
1598 }
1599 else v->req_packhdl = currPack;
1600// if (v->req_packhdl!=basePack)
1601// Print("search %s in %s\n",id,v->req_packhdl->libname);
1602 idhdl h=NULL;
1603#ifdef SIQ
1604 if (siq<=0)
1605#endif
1606 {
1607 if (strcmp(id,"basering")==0)
1608 {
1609 if (currRingHdl!=NULL)
1610 {
1611 if (id!=IDID(currRingHdl)) omFreeBinAddr((ADDRESS)id);
1612 h=currRingHdl;
1613 goto id_found;
1614 }
1615 else
1616 {
1617 v->name = id;
1618 return; /* undefined */
1619 }
1620 }
1621 else if (strcmp(id,"Current")==0)
1622 {
1623 if (currPackHdl!=NULL)
1624 {
1626 h=currPackHdl;
1627 goto id_found;
1628 }
1629 else
1630 {
1631 v->name = id;
1632 return; /* undefined */
1633 }
1634 }
1635 if(v->req_packhdl!=currPack)
1636 {
1637 h=v->req_packhdl->idroot->get(id,myynest);
1638 }
1639 else
1640 {
1641 h=ggetid(id);
1642 }
1643 /* 3) existing identifier, local */
1644 if ((h!=NULL) && (IDLEV(h)==myynest))
1645 {
1646 if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1647 goto id_found;
1648 }
1650 {
1652 }
1653 /* 4. local ring: ringvar */
1655 /*&& (!yyInRingConstruction)*/)
1656 {
1657 int vnr;
1658 if ((vnr=r_IsRingVar(id, currRing->names,currRing->N))>=0)
1659 {
1660 poly p=pOne();
1661 pSetExp(p,vnr+1,1);
1662 pSetm(p);
1663 v->data = (void *)p;
1664 v->name = id;
1665 v->rtyp = POLY_CMD;
1666 return;
1667 }
1668 if((n_NumberOfParameters(currRing->cf)>0)
1669 &&((vnr=r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
1670 n_NumberOfParameters(currRing->cf))>=0)))
1671 {
1672 BOOLEAN ok=FALSE;
1673 poly p = pmInit(id,ok);
1674 if (ok && (p!=NULL))
1675 {
1676 v->data = pGetCoeff(p);
1677 pGetCoeff(p)=NULL;
1678 pLmFree(p);
1679 v->rtyp = NUMBER_CMD;
1680 v->name = id;
1681 return;
1682 }
1683 }
1684 }
1685 /* 5. existing identifier, global */
1686 if (h!=NULL)
1687 {
1688 if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1689 goto id_found;
1690 }
1691 /* 6a: int/bigint */
1692 if (strlen(id)<=MAX_INT_LEN)
1693 {
1694 int i;
1695 i=0;
1696 if (id[0]=='-') { i=1; }
1697 while(isdigit(id[i])) i++;
1698 if (id[i]=='\0')
1699 {
1700 int j=atoi(id);
1701 char tmp[MAX_INT_LEN+5];
1702 sprintf(tmp,"%d",j);
1703 if ((j>MAX_INT_LEN) || (strcmp(tmp,id)!=0))
1704 {
1705 number n;
1706 n_Read(id,&n,coeffs_BIGINT);
1707 v->rtyp=BIGINT_CMD;
1708 v->data = n;
1709 }
1710 else
1711 {
1712 v->data=(void*)(long)j;
1713 v->rtyp=INT_CMD;
1714 }
1716 return;
1717 }
1718 }
1719 /* 6b local ring: number/poly */
1721 {
1722 BOOLEAN ok=FALSE;
1723 /*poly p = (!yyInRingConstruction) ? pmInit(id,ok) : (poly)NULL;*/
1724 poly p = pmInit(id,ok);
1725 if (ok)
1726 {
1727 if (p==NULL)
1728 {
1729 v->data = (void *)nInit(0);
1730 v->rtyp = NUMBER_CMD;
1731 #ifdef HAVE_PLURAL
1732 // in this case we may have monomials equal to 0 in p_Read
1733 v->name = id;
1734 #else
1736 #endif
1737 }
1738 else if (pIsConstant(p))
1739 {
1740 v->data = pGetCoeff(p);
1741 pGetCoeff(p)=NULL;
1742 pLmFree(p);
1743 v->rtyp = NUMBER_CMD;
1744 v->name = id;
1745 }
1746 else
1747 {
1748 v->name = id;
1749 #ifdef HAVE_SHIFTBBA
1750 if ((currRing->isLPring!=0)
1751 && (p_Totaldegree(p,currRing)>1))
1752 {
1754 /* v->rtyp = UNKNOWN; - already set */
1755 return; /* error, report "unknown id" */
1756 }
1757 #endif
1758 v->data = p;
1759 v->rtyp = POLY_CMD;
1760 }
1761 return;
1762 }
1763 }
1764 /* 7. non-local ring: number/poly */
1765 {
1766 BOOLEAN ok=FALSE;
1767 poly p = ((currRing!=NULL) /* ring required */
1768 && (currRingHdl!=NULL)
1769 /*&& (!yyInRingConstruction) - not in decl */
1770 && (IDLEV(currRingHdl)!=myynest)) /* already in case 4/6 */
1771 ? pmInit(id,ok) : (poly)NULL;
1772 if (ok)
1773 {
1774 if (p==NULL)
1775 {
1776 v->data = (void *)nInit(0);
1777 v->rtyp = NUMBER_CMD;
1779 }
1780 else
1781 if (pIsConstant(p))
1782 {
1783 v->data = pGetCoeff(p);
1784 pGetCoeff(p)=NULL;
1785 pLmFree(p);
1786 v->rtyp = NUMBER_CMD;
1787 v->name = id;
1788 }
1789 else
1790 {
1791 v->data = p;
1792 v->rtyp = POLY_CMD;
1793 v->name = id;
1794 }
1795 //if (TEST_V_ALLWARN /*&& (myynest>0)*/
1796 //&& ((r_IsRingVar(id, currRing->names,currRing->N)>=0)
1797 // || ((n_NumberOfParameters(currRing->cf)>0)
1798 // &&(r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
1799 // n_NumberOfParameters(currRing->cf))>=0))))
1800 //{
1801 //// WARNING: do not use ring variable names in procedures
1802 // Warn("use of variable >>%s<< in a procedure in line %s",id,my_yylinebuf);
1803 //}
1804 return;
1805 }
1806 }
1807 /* 8. basering ? */
1808 if ((myynest>1)&&(currRingHdl!=NULL))
1809 {
1810 if (strcmp(id,IDID(currRingHdl))==0)
1811 {
1812 if (IDID(currRingHdl)!=id) omFreeBinAddr((ADDRESS)id); /*assume strlen (id) <1000 */
1813 h=currRingHdl;
1814 goto id_found;
1815 }
1816 }
1817 if((v->req_packhdl!=basePack) && (v->req_packhdl==currPack))
1818 {
1819 h=basePack->idroot->get(id,myynest);
1820 if (h!=NULL)
1821 {
1822 if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1823 v->req_packhdl=basePack;
1824 goto id_found;
1825 }
1826 }
1827 }
1828#ifdef SIQ
1829 else
1830 v->rtyp=DEF_CMD;
1831#endif
1832 /* 9: _ */
1833 if (strcmp(id,"_")==0)
1834 {
1836 v->Copy(&sLastPrinted);
1837 }
1838 else
1839 {
1840 /* 10: everything else */
1841 /* v->rtyp = UNKNOWN;*/
1842 v->name = id;
1843 }
1844 currRingHdl=save_ring;
1845 return;
1846id_found: // we have an id (in h) found, to set the data in from h
1847 if (IDTYP(h)!=ALIAS_CMD)
1848 {
1849 v->rtyp = IDHDL;
1850 v->flag = IDFLAG(h);
1851 v->attribute=IDATTR(h);
1852 }
1853 else
1854 {
1855 v->rtyp = ALIAS_CMD;
1856 }
1857 v->name = IDID(h);
1858 v->data = (char *)h;
1859 currRingHdl=save_ring;
1860}
int BOOLEAN
Definition: auxiliary.h:87
char name() const
Definition: variable.cc:122
Definition: idrec.h:35
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
Definition: coeffs.h:775
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
Definition: coeffs.h:771
static FORCE_INLINE const char * n_Read(const char *s, number *a, const coeffs r)
!!! Recommendation: This method is too cryptic to be part of the user- !!! interface....
Definition: coeffs.h:595
static BOOLEAN pa(leftv res, leftv args)
Definition: cohomo.cc:3723
int j
Definition: facHensel.cc:110
VAR int myynest
Definition: febase.cc:41
VAR BOOLEAN yyInRingConstruction
Definition: grammar.cc:172
idhdl ggetid(const char *n)
Definition: ipid.cc:581
VAR package basePack
Definition: ipid.cc:58
VAR idhdl currRingHdl
Definition: ipid.cc:59
VAR package currPack
Definition: ipid.cc:57
VAR idhdl currPackHdl
Definition: ipid.cc:55
#define IDFLAG(a)
Definition: ipid.h:120
#define IDID(a)
Definition: ipid.h:122
#define IDLEV(a)
Definition: ipid.h:121
#define IDTYP(a)
Definition: ipid.h:119
#define IDATTR(a)
Definition: ipid.h:123
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
const int MAX_INT_LEN
Definition: mylimits.h:13
#define nInit(i)
Definition: numbers.h:24
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:721
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1505
#define pSetm(p)
Definition: polys.h:271
#define pIsConstant(p)
like above, except that Comp must be 0
Definition: polys.h:238
#define pmInit(a, b)
Definition: polys.h:289
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
#define pSetExp(p, i, v)
Definition: polys.h:42
#define pOne()
Definition: polys.h:315
int r_IsRingVar(const char *n, char **names, int N)
Definition: ring.cc:212
INST_VAR sleftv sLastPrinted
Definition: subexpr.cc:46
VAR BOOLEAN siq
Definition: subexpr.cc:48

◆ syMakeMonom()

void syMakeMonom ( leftv  v,
const char *  name 
)

Definition at line 1862 of file subexpr.cc.

1863{
1864 if (!isdigit(id[0]))
1865 {
1866 Print("non-digit:%s\n",id);
1867 }
1868 /* resolv an identifier: (to DEF_CMD, if siq>0)
1869 * 6) monom (resp. number), local ring
1870 * 7) monom (resp. number), non-local ring
1871 * 10) everything else is of type 0
1872 */
1873#ifdef TEST
1874 if ((*id<' ')||(*id>(char)126))
1875 {
1876 Print("wrong id :%s:\n",id);
1877 }
1878#endif
1879 idhdl save_ring=currRingHdl;
1880 v->Init();
1881 v->req_packhdl = currPack;
1882#ifdef SIQ
1883 if (siq<=0)
1884#endif
1885 {
1886 /* 6. local ring: number/poly */
1887 BOOLEAN ok=FALSE;
1888 poly p = pmInit(id,ok);
1889 if (ok)
1890 {
1891 if (p==NULL)
1892 {
1893 v->data = (void *)nInit(0);
1894 v->rtyp = NUMBER_CMD;
1895 #ifdef HAVE_PLURAL
1896 // in this case we may have monomials equal to 0 in p_Read
1897 if (rIsPluralRing(currRing)) v->name = omStrDup(id);
1898 #endif
1899 }
1900 else if (pIsConstant(p))
1901 {
1902 v->data = pGetCoeff(p);
1903 pGetCoeff(p)=NULL;
1904 pLmFree(p);
1905 v->rtyp = NUMBER_CMD;
1906 }
1907 else
1908 {
1909 v->name = omStrDup(id);
1910 #ifdef HAVE_SHIFTBBA
1911 if ((currRing->isLPring!=0)
1912 && (p_Totaldegree(p,currRing)>1))
1913 {
1915 /* v->rtyp = UNKNOWN; - already set */
1916 return; /* error, report "unknown id" */
1917 }
1918 #endif
1919 v->data = p;
1920 v->rtyp = POLY_CMD;
1921 }
1922 return;
1923 }
1924 }
1925#ifdef SIQ
1926 else
1927 {
1928 v->rtyp=DEF_CMD;
1929 }
1930#endif
1931 /* 9: _ */
1932 if (strcmp(id,"_")==0)
1933 {
1934 v->Copy(&sLastPrinted);
1935 }
1936 else
1937 {
1938 /* 10: everything else */
1939 /* v->rtyp = UNKNOWN;*/
1940 v->name = omStrDup(id);
1941 }
1942 currRingHdl=save_ring;
1943}
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:400

Variable Documentation

◆ libstack_bin

EXTERN_VAR omBin libstack_bin

Definition at line 176 of file subexpr.h.

◆ procinfo_bin

EXTERN_VAR omBin procinfo_bin

Definition at line 175 of file subexpr.h.

◆ siq

Definition at line 76 of file subexpr.h.

◆ sLastPrinted

EXTERN_INST_VAR sleftv sLastPrinted

Definition at line 143 of file subexpr.h.

◆ sSubexpr_bin

EXTERN_VAR omBin sSubexpr_bin

Definition at line 174 of file subexpr.h.