source: git/Singular/ipshell.h @ d35711

fieker-DuValspielwiese
Last change on this file since d35711 was d35711, checked in by Hans Schoenemann <hannes@…>, 8 years ago
simplified rInit, avoid changing input parameters
  • Property mode set to 100644
File size: 9.7 KB
RevLine 
[0e1846]1#ifndef IPSHELL_H
2#define IPSHELL_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/*
7* ABSTRACT
8*/
9#include <stdio.h>
[f5a3a23]10//#include <kernel/structs.h>
[599326]11#include <kernel/ideals.h>
[f5a3a23]12#include <Singular/lists.h>
[cf19a8]13#include <Singular/fevoices.h>
[508937]14
[0e051f]15struct _ssubexpr;
16typedef struct _ssubexpr *Subexpr;
17
[47a4c2]18BOOLEAN    spectrumProc ( leftv,leftv );
19BOOLEAN    spectrumfProc( leftv,leftv );
20BOOLEAN    spaddProc    ( leftv,leftv,leftv );
21BOOLEAN    spmulProc    ( leftv,leftv,leftv );
22BOOLEAN    semicProc   ( leftv,leftv,leftv );
23BOOLEAN    semicProc3   ( leftv,leftv,leftv,leftv );
[0e1846]24
[33d610]25BOOLEAN iiAssignCR(leftv, leftv);
26
[6be074]27BOOLEAN iiARROW (leftv, char*,char *);
28
[0e1846]29extern leftv iiCurrArgs;
[f71681]30extern idhdl iiCurrProc;
[0e1846]31extern int iiOp; /* the current operation*/
[85e68dd]32extern const char *  currid;
[0e1846]33extern int     iiRETURNEXPR_len;
[f92a39]34extern sleftv  iiRETURNEXPR;
[0a3ddd]35#ifdef USE_IILOCALRING
[0e1846]36extern ring   *iiLocalRing;
[77ff8e]37#endif
[2617dd5]38//extern cmdnames cmds[];
[85e68dd]39extern const char *lastreserved;
[995a6a]40extern const char *singular_date; /* tesths.cc, set by final compile */
[72a01e]41extern int myynest;
42extern int printlevel;
43extern int si_echo;
44
[923c27]45
[34fbd93]46extern BOOLEAN yyInRingConstruction; /* 1: during ring construction */
[0e1846]47
[2c52262]48int     IsCmd(const char *n, int & tok);
[6bc5bb]49
[057e93c]50BOOLEAN iiPStart(idhdl pn, sleftv * sl);
51BOOLEAN iiEStart(char* example, procinfo *pi);
[ba73e9]52BOOLEAN iiAllStart(procinfov pi, char *p,feBufferTypes t, int l);
[103560]53void    type_cmd(leftv v);
[0e1846]54void    test_cmd(int i);
[7da3cd]55void    list_cmd(int typ, const char* what, const char * prefix,
56                 BOOLEAN iterate, BOOLEAN fullname=FALSE);
[8dde75]57//char *  iiStringMatrix(matrix im, int dim, char ch=',');
[0e1846]58void    killlocals(int v);
59int     exprlist_length(leftv v);
[85e68dd]60const char *  Tok2Cmdname(int i);
61const char *  iiTwoOps(int t);
[06c0b3]62int           iiOpsTwoChar(const char *s);
63
[0e1846]64BOOLEAN iiWRITE(leftv res,leftv exprlist);
65BOOLEAN iiExport(leftv v, int toLev);
[9d864a]66BOOLEAN iiExport(leftv v, int toLev, package pack);
67BOOLEAN iiInternalExport (leftv v, int toLev, package pack);
[2ba9a6]68char *  iiGetLibName(procinfov v);
69char *  iiGetLibProcBuffer( procinfov pi, int part=1 );
[0e1846]70char *  iiProcName(char *buf, char & ct, char* &e);
71char *  iiProcArgs(char *e,BOOLEAN withParenth);
[22ed4c]72BOOLEAN iiLibCmd( char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force );
[698457]73/* sees wheter library lib has already been loaded
74   if yes, writes filename of lib into where and returns TRUE,
75   if  no, returns FALSE
76*/
[6babcbc]77/// load lib/module given in v
[e2202ee]78BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport = FALSE);
[ea63bfc]79BOOLEAN jjLOAD_TRY(const char *s);
[698457]80BOOLEAN iiLocateLib(const char* lib, char* where);
[85e68dd]81leftv   iiMap(map theMap, const char * what);
[0e1846]82void    iiMakeResolv(resolvente r, int length, int rlen, char * name, int typ0,
83           intvec ** weights=NULL);
84BOOLEAN jjMINRES(leftv res, leftv v);
85BOOLEAN jjBETTI(leftv res, leftv v);
[7f14f2]86BOOLEAN jjBETTI2(leftv res, leftv u, leftv v);
[709ab0]87BOOLEAN jjBETTI2_ID(leftv res, leftv u, leftv v);
[762bfd]88BOOLEAN jjIMPORTFROM(leftv res, leftv u, leftv v);
[146d90]89BOOLEAN jjLIST_PL(leftv res, leftv v);
[7f14f2]90
[f46646]91BOOLEAN jjVARIABLES_P(leftv res, leftv u);
92BOOLEAN jjVARIABLES_ID(leftv res, leftv u);
93
[0e1846]94int     iiRegularity(lists L);
95leftv   singular_system(sleftv h);
96BOOLEAN jjSYSTEM(leftv res, leftv v);
97void    iiDebug();
98BOOLEAN iiCheckRing(int i);
[f99917f]99poly    iiHighCorner(ideal i, int ak);
[f43a74]100char *  iiConvName(const char *libname);
[e2202ee]101BOOLEAN iiLoadLIB(FILE *fp, const char *libnamebuf, const char *newlib,
[bf4ff72]102                         idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror);
103
[8fa9ea]104// converts a resolution into a list of modules
105lists syConvRes(syStrategy syzstr,BOOLEAN toDel=FALSE,int add_row_shift=0);
106// converts a list of modules into a minimal resolution
107syStrategy syForceMin(lists li);
108// converts a list of modules into a resolution
109syStrategy syConvList(lists li,BOOLEAN toDel);
110
[ae3ad6]111BOOLEAN syBetti1(leftv res, leftv u);
112BOOLEAN syBetti2(leftv res, leftv u, leftv w);
113
[0e1846]114/* ================================================================== */
115/* Expressions : */
116BOOLEAN iiExprArith1(leftv res, sleftv* a, int op);
117BOOLEAN iiExprArith2(leftv res, sleftv* a, int op, sleftv* b,
118                     BOOLEAN proccall=FALSE);
119BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c);
120BOOLEAN iiExprArithM(leftv res, sleftv* a, int op);
[78c0dbe]121BOOLEAN iiApply(leftv res,leftv a, int op, leftv proc);
[0e1846]122
123typedef BOOLEAN (*proc1)(leftv,leftv);
124
125#ifdef GENTABLE
126typedef char * (*Proc1)(char *);
127struct sValCmd1
128{
129  proc1 p;
130  short cmd;
131  short res;
132  short arg;
[ee9485]133  short valid_for;
[0e1846]134};
135
136typedef BOOLEAN (*proc2)(leftv,leftv,leftv);
137struct sValCmd2
138{
139  proc2 p;
140  short cmd;
141  short res;
142  short arg1;
143  short arg2;
[ee9485]144  short valid_for;
[0e1846]145};
146
147typedef BOOLEAN (*proc3)(leftv,leftv,leftv,leftv);
148struct sValCmd3
149{
150  proc3 p;
151  short cmd;
152  short res;
153  short arg1;
154  short arg2;
155  short arg3;
[ee9485]156  short valid_for;
[0e1846]157};
158struct sValCmdM
159{
160  proc1 p;
161  short cmd;
162  short res;
163  short number_of_args; /* -1: any, -2: any >0, .. */
[ee9485]164  short valid_for;
[0e1846]165};
166extern struct sValCmd2 dArith2[];
167extern struct sValCmd1 dArith1[];
168extern struct sValCmd3 dArith3[];
169extern struct sValCmdM dArithM[];
170#endif
171
172/* ================================================================== */
173/* Assigments : */
[4a74cc]174BOOLEAN iiAssign(leftv left, leftv right, BOOLEAN toplevel=TRUE);
[0e1846]175
176typedef BOOLEAN (*proci)(leftv,leftv,Subexpr);
177struct sValAssign_sys
178{
179  proc1 p;
180  short res;
181  short arg;
182};
183
184struct sValAssign
185{
186  proci p;
187  short res;
188  short arg;
189};
190
191BOOLEAN iiParameter(leftv p);
[ea947e]192BOOLEAN iiAlias(leftv p);
[91ef34]193
194int iiTokType(int op);
[0e1846]195/* ================================================================== */
196int     iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl* root,
[0a3ddd]197  BOOLEAN isring = FALSE, BOOLEAN init_b=TRUE);
[5edb77]198BOOLEAN iiMake_proc(idhdl pn, package pack, sleftv* sl);
[0e1846]199// from misc.cc:
[979a09f]200char *  showOption();
[0e1846]201BOOLEAN setOption(leftv res, leftv v);
202/* ================================================================== */
[9ea9c6]203char * versionString();
[706c95]204/* ================================================================== */
205void  singular_example(char *str);
[a3bc95e]206
[85e68dd]207BOOLEAN iiTryLoadLib(leftv v, const char *id);
[5c5638]208
[ce0ca7]209int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic,
[b90cc8]210               BOOLEAN(*func)(leftv res, leftv v));
211
[d66a7d]212void iiCheckPack(package &p);
[7fe9e13]213#ifndef SING_NDEBUG
[5c5638]214void checkall();
215#endif
[2b7f4e]216
[88ece17]217void rSetHdl(idhdl h);
[d35711]218ring rInit(leftv pn, leftv rv, leftv ord);
[2b7f4e]219idhdl  rDefault(const char *s);
220
[6cc7f5]221idhdl rSimpleFindHdl(ring r, idhdl root, idhdl n=NULL);
[cbe2a4c]222idhdl rFindHdl(ring r, idhdl n);
[1085d4]223void   rKill(idhdl h);
224void   rKill(ring r);
[bf38a4]225lists scIndIndset(ideal S, BOOLEAN all, ideal Q);
226BOOLEAN mpKoszul(leftv res,leftv c/*ip*/, leftv b/*in*/, leftv id);
[15ff9a]227BOOLEAN mpJacobi(leftv res,leftv a);
228BOOLEAN jjRESULTANT(leftv res, leftv u, leftv v, leftv w);
229BOOLEAN kQHWeight(leftv res,leftv v);
230BOOLEAN kWeight(leftv res,leftv id);
231BOOLEAN loSimplex( leftv res, leftv args );
232BOOLEAN loNewtonP( leftv res, leftv arg1 );
[c10515]233BOOLEAN nuMPResMat( leftv res, leftv arg1, leftv arg2 );
234BOOLEAN nuLagSolve( leftv res, leftv arg1, leftv arg2, leftv arg3 );
235BOOLEAN nuVanderSys( leftv res, leftv arg1, leftv arg2, leftv arg3);
236BOOLEAN nuUResSolve( leftv res, leftv args );
[15ff9a]237
[f0168a5]238BOOLEAN jjCHARSERIES(leftv res, leftv u);
239/*
240BOOLEAN jjRESULTANT(leftv res, leftv u, leftv v, leftv w);
241#if 0
242BOOLEAN jjIS_SQR_FREE(leftv res, leftv u);
243#endif
244*/
[95197e]245/* ================================================================== */
246void paPrint(const char *n,package p);
247/* ================================================================== */
[f0168a5]248
[88ece17]249
[6b5a71]250BOOLEAN iiTestAssume(leftv a, leftv b);
[e25346]251
252/* table inteface for iiAddCproc */
[1438fbb]253/// apply an operation 'op' to an argument a
254/// return TRUE on failure
255BOOLEAN iiExprArith1Tab(leftv res,///< [out] pre-allocated result
256                        leftv a,  ///< [in]  argument
257                        int op,   ///< [in]  operation
258                        struct sValCmd1* dA1, ///< [in] table of possible proc
259                                                  ///< assumes dArith1[0].cmd==op
260                        int at,   ///< [in] a->Typ()
261                        struct sConvertTypes *dConvertTypes ///< [in] table of type conversions
262                        );
263/// apply an operation 'op' to arguments a and a->next
264/// return TRUE on failure
265BOOLEAN iiExprArith2Tab(leftv res,///< [out] pre-allocated result
266                        leftv a,  ///< [in]  2 arguments
267                        int op,   ///< [in]  operation
268                        struct sValCmd2* dA2,///< [in] table of possible proc
269                                   ///< assumes dA2[0].cmd==op
270                        int at,    ///< [in] a->Typ()
271                        struct sConvertTypes *dConvertTypes ///< [in] table of type conversions
272                        );
273/// apply an operation 'op' to arguments a, a->next and a->next->next
274/// return TRUE on failure
275BOOLEAN iiExprArith3Tab(leftv res, ///< [out] pre-allocated result
276                        leftv a,   ///< [in]  3 arguments
277                        int op,    ///< [in]  operation
278                        struct sValCmd3* dA3,///< [in] table of possible proc
279                                   ///< assumes dA3[0].cmd==op
280                        int at,    ///< [in] a->Typ()
281                        struct sConvertTypes *dConvertTypes ///< [in] table of type conversions
282                        );
283
284/// check a list of arguemys against a given field of types
285/// return TRUE if the types match
286/// return FALSE (and, if report) report an error via Werror otherwise
287BOOLEAN iiCheckTypes(leftv args,/// < [in] argument list (may be NULL)
288                      const short *type_list,///< [in] field of types
289                                             ///< len, t1,t2,...
290                      int report=0  /// ;in] report error?
291                      );
[f0e7c4]292
293BOOLEAN iiBranchTo(leftv r, leftv args);
294
[afbc156]295#ifdef SINGULAR_4_1
296BOOLEAN rDecompose_CF(leftv res,const coeffs C);
297#endif
[a3bc95e]298#endif
[0e1846]299
Note: See TracBrowser for help on using the repository browser.