My Project  debian-1:4.1.1-p2+ds-4
ipid.cc
Go to the documentation of this file.
1 /****************************************
2 * Computer Algebra System SINGULAR *
3 ****************************************/
4 
5 /*
6 * ABSTRACT: identfier handling
7 */
8 
9 
10 
11 
12 
13 #include "kernel/mod2.h"
14 
15 #include "omalloc/omalloc.h"
16 
17 #include "misc/options.h"
18 #include "misc/intvec.h"
19 
20 #include "coeffs/numbers.h"
21 #include "coeffs/bigintmat.h"
22 
23 #include "polys/matpol.h"
24 #include "polys/monomials/ring.h"
25 
26 #include "kernel/polys.h"
27 #include "kernel/ideals.h"
28 #include "kernel/GBEngine/syz.h"
29 
30 #include "Singular/tok.h"
31 #include "Singular/ipshell.h"
32 #include "Singular/fevoices.h"
33 #include "Singular/lists.h"
34 #include "Singular/attrib.h"
35 #include "Singular/links/silink.h"
36 #include "Singular/ipid.h"
37 #include "Singular/blackbox.h"
38 #include "Singular/number2.h"
39 
40 #ifdef SINGULAR_4_2
41 #include "Singular/number2.h"
42 #endif
43 #ifdef HAVE_DYNAMIC_LOADING
44 #include "polys/mod_raw.h"
45 #endif /* HAVE_DYNAMIC_LOADING */
46 
49 //omBin ip_package_bin = omGetSpecBin(sizeof(ip_package));
51 
53 
55 //idhdl idroot = NULL;
56 
59 package currPack = NULL;
60 package basePack = NULL;
62 
63 void paCleanUp(package pack);
64 
65 /*0 implementation*/
66 
67 int iiS2I(const char *s)
68 {
69  int i;
70  i=s[0];
71  if (s[1]!='\0')
72  {
73  i=(i<<8)+s[1];
74  if (s[2]!='\0')
75  {
76  i=(i<<8)+s[2];
77  if (s[3]!='\0')
78  {
79  i=(i<<8)+s[3];
80  }
81  }
82  }
83  return i;
84 }
85 
86 idhdl idrec::get(const char * s, int level)
87 {
88  assume(s!=NULL);
89  assume((level>=0) && (level<=1000)); //not really, but if it isnt in that bounds..
90  idhdl h = this;
92  int l;
93  const char *id_;
94  int i=iiS2I(s);
95  int less4=(i < (1<<24));
96  while (h!=NULL)
97  {
99  l=IDLEV(h);
100  if ((l==0)||(l==level))
101  {
102  if (i==h->id_i)
103  {
104  id_=IDID(h);
105  if (less4 || (0 == strcmp(s+4,id_+4)))
106  {
107  if (l==level) return h;
108  found=h;
109  }
110  }
111  }
112  h = IDNEXT(h);
113  }
114  return found;
115 }
116 
117 //idrec::~idrec()
118 //{
119 // if (id!=NULL)
120 // {
121 // omFree((ADDRESS)id);
122 // id=NULL;
123 // }
124 // /* much more !! */
125 //}
126 
127 void *idrecDataInit(int t)
128 {
129  switch (t)
130  {
131  //the type with init routines:
132 #ifdef SINGULAR_4_2
133  case CNUMBER_CMD:
134  return (void*)n2Init(0,NULL);
135  case CPOLY_CMD:
136  return (void*)p2Init(0,NULL);
137  case CMATRIX_CMD:
138 #endif
139  case BIGINTMAT_CMD:
140  return (void *)new bigintmat();
141  case INTVEC_CMD:
142  case INTMAT_CMD:
143  return (void *)new intvec();
144  case NUMBER_CMD:
145  {
146  if (currRing!=NULL) return (void *) nInit(0);
147  else return NULL;
148  }
149  case BIGINT_CMD:
150  return (void *) n_Init(0, coeffs_BIGINT);
151  case IDEAL_CMD:
152  case MODUL_CMD:
153  case MATRIX_CMD:
154  return (void*) idInit(1,1);
155  case MAP_CMD:
156  {
157  map m = (map)idInit(1,1);
158  m->preimage = omStrDup(IDID(currRingHdl));
159  return (void *)m;
160  }
161  case STRING_CMD:
162  return (void *)omAlloc0(1);
163  case LIST_CMD:
164  {
166  l->Init();
167  return (void*)l;
168  }
169  //the types with the standard init: set the struct to zero
170  case LINK_CMD:
171  return (void*) omAlloc0Bin(sip_link_bin);
172  case RING_CMD:
173  return NULL;
174  case PACKAGE_CMD:
175  {
176  package pa=(package)omAlloc0Bin(sip_package_bin);
177  pa->language=LANG_NONE;
178  pa->loaded = FALSE;
179  return (void*)pa;
180  }
181  case PROC_CMD:
182  {
184  pi->ref=1;
185  pi->language=LANG_NONE;
186  return (void*)pi;
187  }
188  case RESOLUTION_CMD:
189  return (void *)omAlloc0(sizeof(ssyStrategy));
190  //other types: without init (int,script,poly,def,package)
191  case CRING_CMD:
192  case INT_CMD:
193  case DEF_CMD:
194  case POLY_CMD:
195  case VECTOR_CMD:
196  case QRING_CMD:
197  return (void*)0L;
198  default:
199  {
200  if (t>MAX_TOK)
201  {
202 #ifdef BLACKBOX_DEVEL
203  Print("bb-type %d\n",t);
204 #endif
205  blackbox *bb=getBlackboxStuff(t);
206  if (bb!=NULL)
207  return (void *)bb->blackbox_Init(bb);
208  }
209  else
210  Werror("unknown type in idrecDataInit:%d",t);
211  break;
212  }
213  }
214  return (void *)0L;
215 }
216 idhdl idrec::set(const char * s, int level, int t, BOOLEAN init)
217 {
218  //printf("define %s, %x, level: %d, typ: %d\n", s,s,level,t);
220  IDID(h) = s;
221  IDTYP(h) = t;
222  IDLEV(h) = level;
223  IDNEXT(h) = this;
224  BOOLEAN at_start=(this==IDROOT);
225  h->id_i=iiS2I(s);
226  if (init)
227  {
228  if ((t==IDEAL_CMD)||(t==MODUL_CMD))
229  IDFLAG(h) = Sy_bit(FLAG_STD);
230  IDSTRING(h)=(char *)idrecDataInit(t);
231  // additional settings:--------------------------------------
232 #if 0
233  // this leads to a memory leak
234  if (t == QRING_CMD)
235  {
236  // IDRING(h)=rCopy(currRing);
237  /* QRING_CMD is ring dep => currRing !=NULL */
238  }
239 #endif
240  }
241  // --------------------------------------------------------
242  if (at_start)
243  IDNEXT(h) = IDROOT;
244  return h;
245 }
246 
247 char * idrec::String(BOOLEAN typed)
248 {
249  sleftv tmp;
250  memset(&tmp,0,sizeof(sleftv));
251  tmp.rtyp=IDTYP(this);
252  tmp.data=IDDATA(this);
253  tmp.name=IDID(this);
254  return tmp.String(NULL, typed);
255 }
256 
257 idhdl enterid(const char * s, int lev, int t, idhdl* root, BOOLEAN init, BOOLEAN search)
258 {
259  if (s==NULL) return NULL;
260  if (root==NULL) return NULL;
261  idhdl h;
262  s=omStrDup(s);
263  // idhdl *save_root=root;
264  if (t==PACKAGE_CMD)
265  {
266  if (root!=&(basePack->idroot))
267  {
268  root=&(basePack->idroot);
269  }
270  }
271  // is it already defined in root ?
272  if ((h=(*root)->get(s,lev))!=NULL)
273  {
274  if (IDLEV(h)==lev)
275  {
276  if ((IDTYP(h) == t)||(t==DEF_CMD))
277  {
278  if (IDTYP(h)==PACKAGE_CMD)
279  {
280  if (strcmp(s,"Top")==0)
281  {
282  goto errlabel;
283  }
284  else return h;
285  }
286  else
287  {
288  if (BVERBOSE(V_REDEFINE))
289  Warn("redefining %s (%s)",s,my_yylinebuf);
290  if (s==IDID(h)) IDID(h)=NULL;
291  killhdl2(h,root,currRing);
292  }
293  }
294  else
295  goto errlabel;
296  }
297  }
298  // is it already defined in currRing->idroot ?
299  else if (search && (currRing!=NULL)&&((*root) != currRing->idroot))
300  {
301  if ((h=currRing->idroot->get(s,lev))!=NULL)
302  {
303  if (IDLEV(h)==lev)
304  {
305  if ((IDTYP(h) == t)||(t==DEF_CMD))
306  {
307  if (BVERBOSE(V_REDEFINE))
308  Warn("redefining %s (%s)",s,my_yylinebuf);
309  if (s==IDID(h)) IDID(h)=NULL;
310  killhdl2(h,&currRing->idroot,currRing);
311  }
312  else
313  goto errlabel;
314  }
315  }
316  }
317  // is it already defined in idroot ?
318  else if (search && (*root != IDROOT))
319  {
320  if ((h=IDROOT->get(s,lev))!=NULL)
321  {
322  if (IDLEV(h)==lev)
323  {
324  if ((IDTYP(h) == t)||(t==DEF_CMD))
325  {
326  if (BVERBOSE(V_REDEFINE))
327  Warn("redefining %s (%s)",s,my_yylinebuf);
328  if (s==IDID(h)) IDID(h)=NULL;
329  killhdl2(h,&IDROOT,NULL);
330  }
331  else
332  goto errlabel;
333  }
334  }
335  }
336  *root = (*root)->set(s, lev, t, init);
337 #ifndef SING_NDEBUG
338  checkall();
339 #endif
340  return *root;
341 
342  errlabel:
343  //Werror("identifier `%s` in use(lev h=%d,typ=%d,t=%d, curr=%d)",s,IDLEV(h),IDTYP(h),t,lev);
344  Werror("identifier `%s` in use",s);
345  //listall();
346  omFree((ADDRESS)s);
347  return NULL;
348 }
349 void killid(const char * id, idhdl * ih)
350 {
351  if (id!=NULL)
352  {
353  idhdl h = (*ih)->get(id,myynest);
354 
355  // id not found in global list, is it defined in current ring ?
356  if (h==NULL)
357  {
358  if ((currRing!=NULL) && (*ih != (currRing->idroot)))
359  {
360  h = currRing->idroot->get(id,myynest);
361  if (h!=NULL)
362  {
363  killhdl2(h,&(currRing->idroot),currRing);
364  return;
365  }
366  }
367  Werror("`%s` is not defined",id);
368  return;
369  }
370  killhdl2(h,ih,currRing);
371  }
372  else
373  WerrorS("kill what ?");
374 }
375 
376 void killhdl(idhdl h, package proot)
377 {
378  int t=IDTYP(h);
379  if (((BEGIN_RING<t) && (t<END_RING))
380  || ((t==LIST_CMD) && (lRingDependend((lists)IDDATA(h)))))
381  killhdl2(h,&currRing->idroot,currRing);
382  else
383  {
384  if(t==PACKAGE_CMD)
385  {
386  killhdl2(h,&(basePack->idroot),NULL);
387  }
388  else
389  {
390  idhdl s=proot->idroot;
391  while ((s!=h) && (s!=NULL)) s=s->next;
392  if (s!=NULL)
393  killhdl2(h,&(proot->idroot),NULL);
394  else if (basePack!=proot)
395  {
396  idhdl s=basePack->idroot;
397  while ((s!=h) && (s!=NULL)) s=s->next;
398  if (s!=NULL)
399  killhdl2(h,&(basePack->idroot),currRing);
400  else
401  killhdl2(h,&(currRing->idroot),currRing);
402  }
403  }
404  }
405 }
406 
407 void killhdl2(idhdl h, idhdl * ih, ring r)
408 {
409  //printf("kill %s, id %x, typ %d lev: %d\n",IDID(h),(int)IDID(h),IDTYP(h),IDLEV(h));
410  idhdl hh;
411 
412  if (TEST_V_ALLWARN
413  && (IDLEV(h)!=myynest)
414  &&(IDLEV(h)==0))
415  {
416  if (((*ih)==basePack->idroot)
417  || ((currRing!=NULL)&&((*ih)==currRing->idroot)))
418  Warn("kill global `%s` at line >>%s<<\n",IDID(h),my_yylinebuf);
419  }
420  if (h->attribute!=NULL)
421  {
422  if ((IDTYP(h)==RING_CMD)&&(IDRING(h)!=r))
423  h->attribute->killAll(IDRING(h));
424  else
425  h->attribute->killAll(r);
426  h->attribute=NULL;
427  }
428  if (IDTYP(h) == PACKAGE_CMD)
429  {
430  if (((IDPACKAGE(h)->language==LANG_C)&&(IDPACKAGE(h)->idroot!=NULL))
431  || (strcmp(IDID(h),"Top")==0))
432  {
433  Warn("cannot kill `%s`",IDID(h));
434  return;
435  }
436  // any objects defined for this package ?
437  if ((IDPACKAGE(h)->ref<=0) && (IDPACKAGE(h)->idroot!=NULL))
438  {
439  if (currPack==IDPACKAGE(h))
440  {
443  }
444  idhdl * hd = &IDRING(h)->idroot;
445  idhdl hdh = IDNEXT(*hd);
446  idhdl temp;
447  while (hdh!=NULL)
448  {
449  temp = IDNEXT(hdh);
450  killhdl2(hdh,&(IDPACKAGE(h)->idroot),NULL);
451  hdh = temp;
452  }
453  killhdl2(*hd,hd,NULL);
454  if (IDPACKAGE(h)->libname!=NULL) omFree((ADDRESS)(IDPACKAGE(h)->libname));
455  }
456  paKill(IDPACKAGE(h));
459  }
460  else if (IDTYP(h)==RING_CMD)
461  rKill(h);
462  else if (IDDATA(h)!=NULL)
464  // general -------------------------------------------------------------
465  // now dechain it and delete idrec
466  if (IDID(h)!=NULL) // OB: ?????
467  omFree((ADDRESS)IDID(h));
468  IDID(h)=NULL;
469  IDDATA(h)=NULL;
470  if (h == (*ih))
471  {
472  // h is at the beginning of the list
473  *ih = IDNEXT(h) /* ==*ih */;
474  }
475  else if (ih!=NULL)
476  {
477  // h is somethere in the list:
478  hh = *ih;
479  loop
480  {
481  if (hh==NULL)
482  {
483  PrintS(">>?<< not found for kill\n");
484  return;
485  }
486  idhdl hhh = IDNEXT(hh);
487  if (hhh == h)
488  {
489  IDNEXT(hh) = IDNEXT(hhh);
490  break;
491  }
492  hh = hhh;
493  }
494  }
496 }
497 
498 #if 0
499 idhdl ggetid(const char *n, BOOLEAN /*local*/, idhdl *packhdl)
500 {
501  idhdl h = IDROOT->get(n,myynest);
502  idhdl h2=NULL;
503  *packhdl = NULL;
504  if ((currRing!=NULL) && ((h==NULL)||(IDLEV(h)!=myynest)))
505  {
506  h2 = currRing->idroot->get(n,myynest);
507  }
508  if (h2==NULL) return h;
509  return h2;
510 }
511 #endif
512 
513 idhdl ggetid(const char *n)
514 {
515  idhdl h = IDROOT->get(n,myynest);
516  if ((h!=NULL)&&(IDLEV(h)==myynest)) return h;
517  if (currRing!=NULL)
518  {
519  idhdl h2 = currRing->idroot->get(n,myynest);
520  if (h2!=NULL) return h2;
521  }
522  if (h!=NULL) return h;
523  if (basePack!=currPack)
524  return basePack->idroot->get(n,myynest);
525  return NULL;
526 }
527 
528 void ipListFlag(idhdl h)
529 {
530  if (hasFlag(h,FLAG_STD)) PrintS(" (SB)");
531 #ifdef HAVE_PLURAL
532  if (hasFlag(h,FLAG_TWOSTD)) PrintS(" (2SB)");
533 #endif
534 }
535 
536 lists ipNameList(idhdl root)
537 {
538  idhdl h=root;
539  /* compute the length */
540  int l=0;
541  while (h!=NULL) { l++; h=IDNEXT(h); }
542  /* allocate list */
544  L->Init(l);
545  /* copy names */
546  h=root;
547  l=0;
548  while (h!=NULL)
549  {
550  /* list is initialized with 0 => no need to clear anything */
551  L->m[l].rtyp=STRING_CMD;
552  L->m[l].data=omStrDup(IDID(h));
553  l++;
554  h=IDNEXT(h);
555  }
556  return L;
557 }
558 
559 lists ipNameListLev(idhdl root, int lev)
560 {
561  idhdl h=root;
562  /* compute the length */
563  int l=0;
564  while (h!=NULL) { if (IDLEV(h)==lev) l++; h=IDNEXT(h); }
565  /* allocate list */
567  L->Init(l);
568  /* copy names */
569  h=root;
570  l=0;
571  while (h!=NULL)
572  {
573  if (IDLEV(h)==lev)
574  {
575  /* list is initialized with 0 => no need to clear anything */
576  L->m[l].rtyp=STRING_CMD;
577  L->m[l].data=omStrDup(IDID(h));
578  l++;
579  }
580  h=IDNEXT(h);
581  }
582  return L;
583 }
584 
585 /*
586 * move 'tomove' from root1 list to root2 list
587 */
588 static int ipSwapId(idhdl tomove, idhdl &root1, idhdl &root2)
589 {
590  idhdl h;
591  /* search 'tomove' in root2 : if found -> do nothing */
592  h=root2;
593  while ((h!=NULL) && (h!=tomove)) h=IDNEXT(h);
594  if (h!=NULL) return FALSE; /*okay */
595  /* search predecessor of h in root1, remove 'tomove' */
596  h=root1;
597  if (tomove==h)
598  {
599  root1=IDNEXT(h);
600  }
601  else
602  {
603  while ((h!=NULL) && (IDNEXT(h)!=tomove)) h=IDNEXT(h);
604  if (h==NULL) return TRUE; /* not in the list root1 -> do nothing */
605  IDNEXT(h)=IDNEXT(tomove);
606  }
607  /* add to root2 list */
608  IDNEXT(tomove)=root2;
609  root2=tomove;
610  return FALSE;
611 }
612 
613 void ipMoveId(idhdl tomove)
614 {
615  if ((currRing!=NULL)&&(tomove!=NULL))
616  {
617  if (RingDependend(IDTYP(tomove))
618  || ((IDTYP(tomove)==LIST_CMD) && (lRingDependend(IDLIST(tomove)))))
619  {
620  /*move 'tomove' to ring id's*/
621  if (ipSwapId(tomove,IDROOT,currRing->idroot))
622  ipSwapId(tomove,basePack->idroot,currRing->idroot);
623  }
624  else
625  {
626  /*move 'tomove' to global id's*/
627  ipSwapId(tomove,currRing->idroot,IDROOT);
628  }
629  }
630 }
631 
632 const char * piProcinfo(procinfov pi, const char *request)
633 {
634  if((pi == NULL)||(pi->language==LANG_NONE)) return "empty proc";
635  else if (strcmp(request, "libname") == 0) return pi->libname;
636  else if (strcmp(request, "procname") == 0) return pi->procname;
637  else if (strcmp(request, "type") == 0)
638  {
639  switch (pi->language)
640  {
641  case LANG_SINGULAR: return "singular"; break;
642  case LANG_C: return "object"; break;
643  case LANG_NONE: return "none"; break;
644  default: return "unknown language";
645  }
646  }
647  else if (strcmp(request, "ref") == 0)
648  {
649  char p[8];
650  sprintf(p, "%d", pi->ref);
651  return omStrDup(p); // MEMORY-LEAK
652  }
653  return "??";
654 }
655 
657 {
658  (pi->ref)--;
659  if (pi->ref == 0)
660  {
661  if (pi->language==LANG_SINGULAR)
662  {
664  while (p!=NULL)
665  {
666  if (p->pi==pi && pi->ref <= 1)
667  {
668  Warn("`%s` in use, can not be killed",pi->procname);
669  return TRUE;
670  }
671  p=p->next;
672  }
673  }
674  if (pi->libname != NULL) // OB: ????
675  omFree((ADDRESS)pi->libname);
676  if (pi->procname != NULL) // OB: ????
677  omFree((ADDRESS)pi->procname);
678 
679  if( pi->language == LANG_SINGULAR)
680  {
681  if (pi->data.s.body != NULL) // OB: ????
682  omFree((ADDRESS)pi->data.s.body);
683  }
684  if( pi->language == LANG_C)
685  {
686  }
687  memset((void *) pi, 0, sizeof(procinfo));
688  //pi->language=LANG_NONE;
690  }
691  return FALSE;
692 }
693 
694 void paCleanUp(package pack)
695 {
696  (pack->ref)--;
697  if (pack->ref < 0)
698  {
699 #ifndef HAVE_STATIC
700  if( pack->language == LANG_C)
701  {
702  Print("//dlclose(%s)\n",pack->libname);
703 #ifdef HAVE_DYNAMIC_LOADING
704  dynl_close (pack->handle);
705 #endif /* HAVE_DYNAMIC_LOADING */
706  }
707 #endif /* HAVE_STATIC */
708  omFree((ADDRESS)pack->libname);
709  memset((void *) pack, 0, sizeof(sip_package));
710  pack->language=LANG_NONE;
711  }
712 }
713 
714 void proclevel::push(char *n)
715 {
716  //Print("push %s\n",n);
717  proclevel *p=(proclevel*)omAlloc0(sizeof(proclevel));
718  p->name=n;
719  p->cPackHdl=currPackHdl;
720  p->cPack=currPack;
721  p->next=this;
722  procstack=p;
723 }
724 void proclevel::pop()
725 {
726  //Print("pop %s\n",name);
727  //if (currRing!=::currRing) PrintS("currRing wrong\n");;
728  //::currRing=this->currRing;
729  //if (r==NULL) Print("set ring to NULL at lev %d(%s)\n",myynest,name);
730  //::currRingHdl=this->currRingHdl;
731  //if((::currRingHdl==NULL)||(IDRING(::currRingHdl)!=(::currRing)))
732  // ::currRingHdl=rFindHdl(::currRing,NULL,NULL);
733  //Print("restore pack=%s,1.obj=%s\n",IDID(currPackHdl),IDID(currPack->idroot));
734  currPackHdl=this->cPackHdl;
735  currPack=this->cPack;
737  proclevel *p=this;
738  procstack=next;
739  omFreeSize(p,sizeof(proclevel));
740 }
741 
743 {
744  idhdl h=basePack->idroot;
745  while (h!=NULL)
746  {
747  if ((IDTYP(h)==PACKAGE_CMD)
748  && (IDPACKAGE(h)==r))
749  return h;
750  h=IDNEXT(h);
751  }
752  return NULL;
753 }
754 
756 {
757  if (iiCurrArgs==NULL)
758  {
759  Werror("not enough arguments for proc %s",VoiceName());
760  p->CleanUp();
761  return TRUE;
762  }
764  iiCurrArgs=h->next;
765  h->next=NULL;
766  if (h->rtyp!=IDHDL)
767  {
769  h->CleanUp();
771  return res;
772  }
773  if ((h->Typ()!=p->Typ()) &&(p->Typ()!=DEF_CMD))
774  {
775  WerrorS("type mismatch");
776  return TRUE;
777  }
778  idhdl pp=(idhdl)p->data;
779  switch(pp->typ)
780  {
781  case CRING_CMD:
782  nKillChar((coeffs)pp);
783  break;
784  case DEF_CMD:
785  case INT_CMD:
786  break;
787  case INTVEC_CMD:
788  case INTMAT_CMD:
789  delete IDINTVEC(pp);
790  break;
791  case NUMBER_CMD:
792  nDelete(&IDNUMBER(pp));
793  break;
794  case BIGINT_CMD:
796  break;
797  case MAP_CMD:
798  {
799  map im = IDMAP(pp);
800  omFree((ADDRESS)im->preimage);
801  }
802  // continue as ideal:
803  case IDEAL_CMD:
804  case MODUL_CMD:
805  case MATRIX_CMD:
806  idDelete(&IDIDEAL(pp));
807  break;
808  case PROC_CMD:
809  case RESOLUTION_CMD:
810  case STRING_CMD:
812  break;
813  case LIST_CMD:
814  IDLIST(pp)->Clean();
815  break;
816  case LINK_CMD:
818  break;
819  // case ring: cannot happen
820  default:
821  Werror("unknown type %d",p->Typ());
822  return TRUE;
823  }
824  pp->typ=ALIAS_CMD;
825  IDDATA(pp)=(char*)h->data;
826  int eff_typ=h->Typ();
827  if ((RingDependend(eff_typ))
828  || ((eff_typ==LIST_CMD) && (lRingDependend((lists)h->Data()))))
829  {
830  ipSwapId(pp,IDROOT,currRing->idroot);
831  }
832  h->CleanUp();
834  return FALSE;
835 }
836 
dynl_close
int dynl_close(void *handle)
Definition: mod_raw.cc:176
FALSE
#define FALSE
Definition: auxiliary.h:94
mod_raw.h
omalloc.h
IDMAP
#define IDMAP(a)
Definition: ipid.h:129
iiCheckPack
void iiCheckPack(package &p)
Definition: ipshell.cc:1535
ipListFlag
void ipListFlag(idhdl h)
Definition: ipid.cc:527
FLAG_TWOSTD
#define FLAG_TWOSTD
Definition: ipid.h:104
omFree
#define omFree(addr)
Definition: omAllocDecl.h:259
idDelete
#define idDelete(H)
delete an ideal
Definition: ideals.h:28
CRING_CMD
Definition: tok.h:55
idrecDataInit
void * idrecDataInit(int t)
Definition: ipid.cc:126
NUMBER_CMD
Definition: grammar.cc:287
procinfov
procinfo * procinfov
Definition: structs.h:62
bigintmat
Definition: bigintmat.h:50
omGetSpecBin
#define omGetSpecBin(size)
Definition: omBin.h:10
LANG_SINGULAR
Definition: subexpr.h:22
BIGINT_CMD
Definition: tok.h:37
LIST_CMD
Definition: tok.h:117
lists.h
attrib.h
ADDRESS
void * ADDRESS
Definition: auxiliary.h:133
proclevel::push
void push(char *)
Definition: ipid.cc:713
enterid
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition: ipid.cc:256
MODUL_CMD
Definition: grammar.cc:286
STRING_CMD
Definition: tok.h:182
CNUMBER_CMD
Definition: tok.h:46
number2.h
map
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
search
int search(const CFArray &A, const CanonicalForm &F, int i, int j)
search for F in A between index i and j
Definition: facSparseHensel.h:566
killid
void killid(const char *id, idhdl *ih)
Definition: ipid.cc:348
MAX_TOK
Definition: tok.h:214
polys.h
IDDATA
#define IDDATA(a)
Definition: ipid.h:120
rKill
void rKill(ring r)
Definition: ipshell.cc:6075
idrec::get
idhdl get(const char *s, int lev)
Definition: ipid.cc:85
procinfo
Definition: subexpr.h:52
omStrDup
#define omStrDup(s)
Definition: omAllocDecl.h:261
basePackHdl
idhdl basePackHdl
Definition: ipid.cc:57
ipNameListLev
lists ipNameListLev(idhdl root, int lev)
Definition: ipid.cc:558
level
int level(const CanonicalForm &f)
Definition: canonicalform.h:324
n_Delete
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
DEF_CMD
Definition: tok.h:57
omAllocBin
#define omAllocBin(bin)
Definition: omAllocDecl.h:203
options.h
BIGINTMAT_CMD
Definition: grammar.cc:278
omAlloc0Bin
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:204
currPack
package currPack
Definition: ipid.cc:58
iiAlias
BOOLEAN iiAlias(leftv p)
Definition: ipid.cc:754
idrec_bin
omBin idrec_bin
Definition: ipid.cc:49
loop
#define loop
Definition: structs.h:77
sleftv
Class used for (list of) interpreter objects.
Definition: subexpr.h:81
idhdl
idrec * idhdl
Definition: ring.h:20
idrec::String
char * String(BOOLEAN typed=FALSE)
Definition: ipid.cc:246
sip_command_bin
omBin sip_command_bin
Definition: ipid.cc:46
RING_CMD
Definition: grammar.cc:281
procstack
proclevel * procstack
Definition: ipid.cc:53
bigintmat.h
currRingHdl
idhdl currRingHdl
Definition: ipid.cc:60
slists_bin
omBin slists_bin
Definition: lists.cc:22
proclevel::pop
void pop()
Definition: ipid.cc:723
RingDependend
int RingDependend(int t)
Definition: gentable.cc:28
MATRIX_CMD
Definition: grammar.cc:285
IDLIST
#define IDLIST(a)
Definition: ipid.h:131
found
bool found
Definition: facFactorize.cc:56
IDLEV
#define IDLEV(a)
Definition: ipid.h:115
IDLINK
#define IDLINK(a)
Definition: ipid.h:132
next
ListNode * next
Definition: janet.h:31
pi
#define pi
Definition: libparse.cc:1142
packFindHdl
idhdl packFindHdl(package r)
Definition: ipid.cc:741
currRing
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
BEGIN_RING
Definition: grammar.cc:282
sleftv::name
const char * name
Definition: subexpr.h:86
IDINTVEC
#define IDINTVEC(a)
Definition: ipid.h:122
TRUE
#define TRUE
Definition: auxiliary.h:98
i
int i
Definition: cfEzgcd.cc:125
hasFlag
#define hasFlag(A, F)
Definition: ipid.h:106
res
CanonicalForm res
Definition: facAbsFact.cc:64
INT_CMD
Definition: tok.h:95
matpol.h
paCleanUp
void paCleanUp(package pack)
Definition: ipid.cc:693
piProcinfo
const char * piProcinfo(procinfov pi, const char *request)
Definition: ipid.cc:631
Sy_bit
#define Sy_bit(x)
Definition: options.h:31
IDFLAG
#define IDFLAG(a)
Definition: ipid.h:114
CPOLY_CMD
Definition: tok.h:47
PrintS
void PrintS(const char *s)
Definition: reporter.cc:283
omFreeSize
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:258
BOOLEAN
int BOOLEAN
Definition: auxiliary.h:85
proclevel
Definition: ipid.h:53
killhdl2
void killhdl2(idhdl h, idhdl *ih, ring r)
Definition: ipid.cc:406
PROC_CMD
Definition: grammar.cc:280
procinfo_bin
omBin procinfo_bin
Definition: subexpr.cc:46
currentVoice
Voice * currentVoice
Definition: fevoices.cc:46
IDROOT
#define IDROOT
Definition: ipid.h:17
IDEAL_CMD
Definition: grammar.cc:283
h
static Poly * h
Definition: janet.cc:972
lRingDependend
BOOLEAN lRingDependend(lists L)
Definition: lists.cc:198
mod2.h
ipNameList
lists ipNameList(idhdl root)
Definition: ipid.cc:535
coeffs
piKill
BOOLEAN piKill(procinfov pi)
Definition: ipid.cc:655
paKill
void paKill(package pack)
Definition: ipid.h:48
intvec
Definition: intvec.h:16
blackbox.h
sleftv::data
void * data
Definition: subexpr.h:87
sip_package_bin
omBin sip_package_bin
Definition: ipid.cc:47
LANG_C
Definition: subexpr.h:22
n_Init
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:538
fevoices.h
killhdl
void killhdl(idhdl h, package proot)
Definition: ipid.cc:375
ipMoveId
void ipMoveId(idhdl tomove)
Definition: ipid.cc:612
END_RING
Definition: grammar.cc:308
VECTOR_CMD
Definition: grammar.cc:290
myynest
int myynest
Definition: febase.cc:40
pp
CanonicalForm pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition: cf_gcd.cc:253
IDTYP
#define IDTYP(a)
Definition: ipid.h:113
ipSwapId
static int ipSwapId(idhdl tomove, idhdl &root1, idhdl &root2)
Definition: ipid.cc:587
slists::m
sleftv * m
Definition: lists.h:44
intvec.h
my_yylinebuf
char my_yylinebuf[80]
Definition: febase.cc:42
LANG_NONE
Definition: subexpr.h:22
sip_command
Definition: ipid.h:23
sip_package
Definition: ipid.h:32
IDRING
#define IDRING(a)
Definition: ipid.h:121
slists
Definition: lists.h:21
INTVEC_CMD
Definition: tok.h:100
INTMAT_CMD
Definition: grammar.cc:279
coeffs_BIGINT
coeffs coeffs_BIGINT
Definition: ipid.cc:51
ring.h
idrec
Definition: idrec.h:33
omBin
omBin_t * omBin
Definition: omStructs.h:11
ALIAS_CMD
Definition: tok.h:33
sleftv::String
char * String(void *d=NULL, BOOLEAN typed=FALSE, int dim=1)
Called for conversion to string (used by string(..), write(..),..)
Definition: subexpr.cc:746
IDPACKAGE
#define IDPACKAGE(a)
Definition: ipid.h:133
BVERBOSE
#define BVERBOSE(a)
Definition: options.h:34
Print
#define Print
Definition: emacs.cc:79
QRING_CMD
Definition: tok.h:157
VoiceName
const char * VoiceName()
Definition: fevoices.cc:55
Werror
void Werror(const char *fmt,...)
Definition: reporter.cc:188
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:36
PACKAGE_CMD
Definition: tok.h:148
tok.h
IDHDL
#define IDHDL
Definition: tok.h:30
WerrorS
void WerrorS(const char *s)
Definition: feFopen.cc:24
Voice
Definition: fevoices.h:57
m
int m
Definition: cfEzgcd.cc:121
sleftv::rtyp
int rtyp
Definition: subexpr.h:90
syz.h
basePack
package basePack
Definition: ipid.cc:59
assume
#define assume(x)
Definition: mod2.h:384
NULL
#define NULL
Definition: omList.c:9
MAP_CMD
Definition: grammar.cc:284
lists
slists * lists
Definition: mpr_numeric.h:145
ideals.h
currPackHdl
idhdl currPackHdl
Definition: ipid.cc:56
l
int l
Definition: cfEzgcd.cc:93
IDSTRING
#define IDSTRING(a)
Definition: ipid.h:130
nDelete
#define nDelete(n)
Definition: numbers.h:16
IDNEXT
#define IDNEXT(a)
Definition: ipid.h:112
IDNUMBER
#define IDNUMBER(a)
Definition: ipid.h:126
iiS2I
int iiS2I(const char *s)
Definition: ipid.cc:66
s_internalDelete
void s_internalDelete(const int t, void *d, const ring r)
Definition: subexpr.cc:490
Warn
#define Warn
Definition: emacs.cc:76
sleftv_bin
omBin sleftv_bin
Definition: subexpr.cc:45
omCheckAddr
#define omCheckAddr(addr)
Definition: omAllocDecl.h:326
slists::Init
INLINE_THIS void Init(int l=0)
p
int p
Definition: cfModGcd.cc:4019
iiCurrArgs
leftv iiCurrArgs
Definition: ipshell.cc:77
ggetid
idhdl ggetid(const char *n)
Definition: ipid.cc:512
s
const CanonicalForm int s
Definition: facAbsFact.cc:55
RESOLUTION_CMD
Definition: grammar.cc:289
nInit
#define nInit(i)
Definition: numbers.h:24
POLY_CMD
Definition: grammar.cc:288
IDID
#define IDID(a)
Definition: ipid.h:116
ipshell.h
FLAG_STD
#define FLAG_STD
Definition: ipid.h:103
V_REDEFINE
#define V_REDEFINE
Definition: options.h:44
idrec::set
idhdl set(const char *s, int lev, int t, BOOLEAN init=TRUE)
Definition: ipid.cc:215
omFreeBin
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:257
TEST_V_ALLWARN
#define TEST_V_ALLWARN
Definition: options.h:139
getBlackboxStuff
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition: blackbox.cc:16
iiAssign
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)
Definition: ipassign.cc:1791
LINK_CMD
Definition: tok.h:116
numbers.h
CMATRIX_CMD
Definition: tok.h:45
ipid.h
omAlloc0
#define omAlloc0(size)
Definition: omAllocDecl.h:209
package
ip_package * package
Definition: structs.h:45
IDIDEAL
#define IDIDEAL(a)
Definition: ipid.h:127
nKillChar
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:510
ssyStrategy
Definition: syz.h:36