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