source: git/Singular/ipshell.h @ 5abb79f

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