source: git/Singular/ipshell.h @ 121d2ae

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