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 | |
---|
14 | struct _ssubexpr; |
---|
15 | typedef struct _ssubexpr *Subexpr; |
---|
16 | |
---|
17 | BOOLEAN spectrumProc ( leftv,leftv ); |
---|
18 | BOOLEAN spectrumfProc( leftv,leftv ); |
---|
19 | BOOLEAN spaddProc ( leftv,leftv,leftv ); |
---|
20 | BOOLEAN spmulProc ( leftv,leftv,leftv ); |
---|
21 | BOOLEAN semicProc ( leftv,leftv,leftv ); |
---|
22 | BOOLEAN semicProc3 ( leftv,leftv,leftv,leftv ); |
---|
23 | |
---|
24 | extern leftv iiCurrArgs; |
---|
25 | extern idhdl iiCurrProc; |
---|
26 | extern int iiOp; /* the current operation*/ |
---|
27 | extern const char * currid; |
---|
28 | extern int iiRETURNEXPR_len; |
---|
29 | extern sleftv iiRETURNEXPR; |
---|
30 | #ifdef USE_IILOCALRING |
---|
31 | extern ring *iiLocalRing; |
---|
32 | #endif |
---|
33 | //extern cmdnames cmds[]; |
---|
34 | extern const char *lastreserved; |
---|
35 | extern const char *singular_date; /* tesths.cc, set by final compile */ |
---|
36 | |
---|
37 | extern BOOLEAN yyInRingConstruction; /* 1: during ring construction */ |
---|
38 | |
---|
39 | int IsCmd(const char *n, int & tok); |
---|
40 | |
---|
41 | BOOLEAN iiPStart(idhdl pn, sleftv * sl); |
---|
42 | BOOLEAN iiEStart(char* example, procinfo *pi); |
---|
43 | BOOLEAN iiAllStart(procinfov pi, char *p,feBufferTypes t, int l); |
---|
44 | void type_cmd(leftv v); |
---|
45 | void test_cmd(int i); |
---|
46 | void list_cmd(int typ, const char* what, const char * prefix, |
---|
47 | BOOLEAN iterate, BOOLEAN fullname=FALSE); |
---|
48 | //char * iiStringMatrix(matrix im, int dim, char ch=','); |
---|
49 | void killlocals(int v); |
---|
50 | int exprlist_length(leftv v); |
---|
51 | const char * Tok2Cmdname(int i); |
---|
52 | const char * iiTwoOps(int t); |
---|
53 | int iiOpsTwoChar(const char *s); |
---|
54 | |
---|
55 | int IsPrime(int i); |
---|
56 | |
---|
57 | BOOLEAN iiWRITE(leftv res,leftv exprlist); |
---|
58 | BOOLEAN iiExport(leftv v, int toLev); |
---|
59 | BOOLEAN iiExport(leftv v, int toLev, idhdl roothdl); |
---|
60 | BOOLEAN iiInternalExport (leftv v, int toLev, idhdl roothdl); |
---|
61 | char * iiGetLibName(procinfov v); |
---|
62 | char * iiGetLibProcBuffer( procinfov pi, int part=1 ); |
---|
63 | char * iiProcName(char *buf, char & ct, char* &e); |
---|
64 | char * iiProcArgs(char *e,BOOLEAN withParenth); |
---|
65 | BOOLEAN iiLibCmd( char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force ); |
---|
66 | /* sees wheter library lib has already been loaded |
---|
67 | if yes, writes filename of lib into where and returns TRUE, |
---|
68 | if no, returns FALSE |
---|
69 | */ |
---|
70 | /// load lib/module given in v |
---|
71 | BOOLEAN jjLOAD(char *s, BOOLEAN autoexport = FALSE); |
---|
72 | BOOLEAN iiLocateLib(const char* lib, char* where); |
---|
73 | leftv iiMap(map theMap, const char * what); |
---|
74 | void iiMakeResolv(resolvente r, int length, int rlen, char * name, int typ0, |
---|
75 | intvec ** weights=NULL); |
---|
76 | BOOLEAN jjMINRES(leftv res, leftv v); |
---|
77 | BOOLEAN jjBETTI(leftv res, leftv v); |
---|
78 | BOOLEAN jjBETTI2(leftv res, leftv u, leftv v); |
---|
79 | BOOLEAN jjBETTI2_ID(leftv res, leftv u, leftv v); |
---|
80 | BOOLEAN jjIMPORTFROM(leftv res, leftv u, leftv v); |
---|
81 | BOOLEAN jjLIST_PL(leftv res, leftv v); |
---|
82 | |
---|
83 | BOOLEAN jjVARIABLES_P(leftv res, leftv u); |
---|
84 | BOOLEAN jjVARIABLES_ID(leftv res, leftv u); |
---|
85 | |
---|
86 | int iiRegularity(lists L); |
---|
87 | leftv singular_system(sleftv h); |
---|
88 | BOOLEAN jjSYSTEM(leftv res, leftv v); |
---|
89 | void iiDebug(); |
---|
90 | BOOLEAN iiCheckRing(int i); |
---|
91 | poly iiHighCorner(ideal i, int ak); |
---|
92 | char * iiConvName(const char *libname); |
---|
93 | BOOLEAN iiLoadLIB(FILE *fp, const char *libnamebuf, char *newlib, |
---|
94 | idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror); |
---|
95 | |
---|
96 | // converts a resolution into a list of modules |
---|
97 | lists syConvRes(syStrategy syzstr,BOOLEAN toDel=FALSE,int add_row_shift=0); |
---|
98 | // converts a list of modules into a minimal resolution |
---|
99 | syStrategy syForceMin(lists li); |
---|
100 | // converts a list of modules into a resolution |
---|
101 | syStrategy syConvList(lists li,BOOLEAN toDel); |
---|
102 | |
---|
103 | BOOLEAN syBetti1(leftv res, leftv u); |
---|
104 | BOOLEAN syBetti2(leftv res, leftv u, leftv w); |
---|
105 | |
---|
106 | /* ================================================================== */ |
---|
107 | /* Expressions : */ |
---|
108 | BOOLEAN iiExprArith1(leftv res, sleftv* a, int op); |
---|
109 | BOOLEAN iiExprArith2(leftv res, sleftv* a, int op, sleftv* b, |
---|
110 | BOOLEAN proccall=FALSE); |
---|
111 | BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c); |
---|
112 | BOOLEAN iiExprArithM(leftv res, sleftv* a, int op); |
---|
113 | BOOLEAN iiApply(leftv res,leftv a, int op, leftv proc); |
---|
114 | |
---|
115 | typedef BOOLEAN (*proc1)(leftv,leftv); |
---|
116 | |
---|
117 | #ifdef __GNUC__ |
---|
118 | #if (__GNUC__ < 3) |
---|
119 | #define INIT_BUG 1 |
---|
120 | void jjInitTab1(); |
---|
121 | #endif |
---|
122 | #endif |
---|
123 | |
---|
124 | #ifdef GENTABLE |
---|
125 | typedef char * (*Proc1)(char *); |
---|
126 | struct sValCmd1 |
---|
127 | { |
---|
128 | proc1 p; |
---|
129 | short cmd; |
---|
130 | short res; |
---|
131 | short arg; |
---|
132 | short valid_for; |
---|
133 | }; |
---|
134 | |
---|
135 | typedef BOOLEAN (*proc2)(leftv,leftv,leftv); |
---|
136 | struct sValCmd2 |
---|
137 | { |
---|
138 | proc2 p; |
---|
139 | short cmd; |
---|
140 | short res; |
---|
141 | short arg1; |
---|
142 | short arg2; |
---|
143 | short valid_for; |
---|
144 | }; |
---|
145 | |
---|
146 | typedef BOOLEAN (*proc3)(leftv,leftv,leftv,leftv); |
---|
147 | struct sValCmd3 |
---|
148 | { |
---|
149 | proc3 p; |
---|
150 | short cmd; |
---|
151 | short res; |
---|
152 | short arg1; |
---|
153 | short arg2; |
---|
154 | short arg3; |
---|
155 | short valid_for; |
---|
156 | }; |
---|
157 | struct sValCmdM |
---|
158 | { |
---|
159 | proc1 p; |
---|
160 | short cmd; |
---|
161 | short res; |
---|
162 | short number_of_args; /* -1: any, -2: any >0, .. */ |
---|
163 | short valid_for; |
---|
164 | }; |
---|
165 | extern struct sValCmd2 dArith2[]; |
---|
166 | extern struct sValCmd1 dArith1[]; |
---|
167 | extern struct sValCmd3 dArith3[]; |
---|
168 | extern struct sValCmdM dArithM[]; |
---|
169 | #endif |
---|
170 | |
---|
171 | /* ================================================================== */ |
---|
172 | /* Assigments : */ |
---|
173 | BOOLEAN iiAssign(leftv left, leftv right); |
---|
174 | |
---|
175 | typedef BOOLEAN (*proci)(leftv,leftv,Subexpr); |
---|
176 | struct sValAssign_sys |
---|
177 | { |
---|
178 | proc1 p; |
---|
179 | short res; |
---|
180 | short arg; |
---|
181 | }; |
---|
182 | |
---|
183 | struct sValAssign |
---|
184 | { |
---|
185 | proci p; |
---|
186 | short res; |
---|
187 | short arg; |
---|
188 | }; |
---|
189 | |
---|
190 | BOOLEAN iiParameter(leftv p); |
---|
191 | BOOLEAN iiAlias(leftv p); |
---|
192 | |
---|
193 | int iiTokType(int op); |
---|
194 | /* ================================================================== */ |
---|
195 | int iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl* root, |
---|
196 | BOOLEAN isring = FALSE, BOOLEAN init_b=TRUE); |
---|
197 | BOOLEAN iiMake_proc(idhdl pn, package pack, sleftv* sl); |
---|
198 | // from misc.cc: |
---|
199 | char * showOption(); |
---|
200 | BOOLEAN setOption(leftv res, leftv v); |
---|
201 | /* ================================================================== */ |
---|
202 | char * versionString(); |
---|
203 | /* ================================================================== */ |
---|
204 | void singular_example(char *str); |
---|
205 | |
---|
206 | BOOLEAN iiTryLoadLib(leftv v, const char *id); |
---|
207 | |
---|
208 | int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic, |
---|
209 | BOOLEAN(*func)(leftv res, leftv v)); |
---|
210 | |
---|
211 | void iiCheckPack(package &p); |
---|
212 | #ifndef NDEBUG |
---|
213 | void checkall(); |
---|
214 | #endif |
---|
215 | |
---|
216 | void rSetHdl(idhdl h); |
---|
217 | ring rInit(sleftv* pn, sleftv* rv, sleftv* ord); |
---|
218 | idhdl rDefault(const char *s); |
---|
219 | |
---|
220 | idhdl rSimpleFindHdl(ring r, idhdl root, idhdl n=NULL); |
---|
221 | idhdl rFindHdl(ring r, idhdl n, idhdl w); |
---|
222 | void rKill(idhdl h); |
---|
223 | void rKill(ring r); |
---|
224 | lists scIndIndset(ideal S, BOOLEAN all, ideal Q); |
---|
225 | BOOLEAN mpKoszul(leftv res,leftv c/*ip*/, leftv b/*in*/, leftv id); |
---|
226 | BOOLEAN mpJacobi(leftv res,leftv a); |
---|
227 | BOOLEAN jjRESULTANT(leftv res, leftv u, leftv v, leftv w); |
---|
228 | BOOLEAN kQHWeight(leftv res,leftv v); |
---|
229 | BOOLEAN kWeight(leftv res,leftv id); |
---|
230 | BOOLEAN loSimplex( leftv res, leftv args ); |
---|
231 | BOOLEAN loNewtonP( leftv res, leftv arg1 ); |
---|
232 | BOOLEAN nuMPResMat( leftv res, leftv arg1, leftv arg2 ); |
---|
233 | BOOLEAN nuLagSolve( leftv res, leftv arg1, leftv arg2, leftv arg3 ); |
---|
234 | BOOLEAN nuVanderSys( leftv res, leftv arg1, leftv arg2, leftv arg3); |
---|
235 | BOOLEAN nuUResSolve( leftv res, leftv args ); |
---|
236 | |
---|
237 | BOOLEAN jjCHARSERIES(leftv res, leftv u); |
---|
238 | /* |
---|
239 | BOOLEAN jjRESULTANT(leftv res, leftv u, leftv v, leftv w); |
---|
240 | #if 0 |
---|
241 | BOOLEAN jjIS_SQR_FREE(leftv res, leftv u); |
---|
242 | #endif |
---|
243 | */ |
---|
244 | /* ================================================================== */ |
---|
245 | void paPrint(const char *n,package p); |
---|
246 | /* ================================================================== */ |
---|
247 | |
---|
248 | |
---|
249 | #endif |
---|
250 | |
---|