source: git/Singular/ipshell.h @ daf33c

spielwiese
Last change on this file since daf33c was daf33c, checked in by Hans Schoenemann <hannes@…>, 10 years ago
simplify interpreter tables (removed XS(..), INIT_BUG,PROC_BUG)
  • Property mode set to 100644
File size: 7.3 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
25extern leftv iiCurrArgs;
26extern idhdl iiCurrProc;
27extern int iiOp; /* the current operation*/
28extern const char *  currid;
29extern int     iiRETURNEXPR_len;
30extern sleftv  iiRETURNEXPR;
31#ifdef USE_IILOCALRING
32extern ring   *iiLocalRing;
33#endif
34//extern cmdnames cmds[];
35extern const char *lastreserved;
36extern const char *singular_date; /* tesths.cc, set by final compile */
37extern int myynest;
38extern int printlevel;
39extern int si_echo;
40
41
42extern BOOLEAN yyInRingConstruction; /* 1: during ring construction */
43
44int     IsCmd(const char *n, int & tok);
45
46BOOLEAN iiPStart(idhdl pn, sleftv * sl);
47BOOLEAN iiEStart(char* example, procinfo *pi);
48BOOLEAN iiAllStart(procinfov pi, char *p,feBufferTypes t, int l);
49void    type_cmd(leftv v);
50void    test_cmd(int i);
51void    list_cmd(int typ, const char* what, const char * prefix,
52                 BOOLEAN iterate, BOOLEAN fullname=FALSE);
53//char *  iiStringMatrix(matrix im, int dim, char ch=',');
54void    killlocals(int v);
55int     exprlist_length(leftv v);
56const char *  Tok2Cmdname(int i);
57const char *  iiTwoOps(int t);
58int           iiOpsTwoChar(const char *s);
59
60int     IsPrime(int i);
61
62BOOLEAN iiWRITE(leftv res,leftv exprlist);
63BOOLEAN iiExport(leftv v, int toLev);
64BOOLEAN iiExport(leftv v, int toLev, package pack);
65BOOLEAN iiInternalExport (leftv v, int toLev, package pack);
66char *  iiGetLibName(procinfov v);
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 iiLocateLib(const char* lib, char* where);
78leftv   iiMap(map theMap, const char * what);
79void    iiMakeResolv(resolvente r, int length, int rlen, char * name, int typ0,
80           intvec ** weights=NULL);
81BOOLEAN jjMINRES(leftv res, leftv v);
82BOOLEAN jjBETTI(leftv res, leftv v);
83BOOLEAN jjBETTI2(leftv res, leftv u, leftv v);
84BOOLEAN jjBETTI2_ID(leftv res, leftv u, leftv v);
85BOOLEAN jjIMPORTFROM(leftv res, leftv u, leftv v);
86BOOLEAN jjLIST_PL(leftv res, leftv v);
87
88BOOLEAN jjVARIABLES_P(leftv res, leftv u);
89BOOLEAN jjVARIABLES_ID(leftv res, leftv u);
90
91int     iiRegularity(lists L);
92leftv   singular_system(sleftv h);
93BOOLEAN jjSYSTEM(leftv res, leftv v);
94void    iiDebug();
95BOOLEAN iiCheckRing(int i);
96poly    iiHighCorner(ideal i, int ak);
97char *  iiConvName(const char *libname);
98BOOLEAN iiLoadLIB(FILE *fp, const char *libnamebuf, const char *newlib,
99                         idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror);
100
101// converts a resolution into a list of modules
102lists syConvRes(syStrategy syzstr,BOOLEAN toDel=FALSE,int add_row_shift=0);
103// converts a list of modules into a minimal resolution
104syStrategy syForceMin(lists li);
105// converts a list of modules into a resolution
106syStrategy syConvList(lists li,BOOLEAN toDel);
107
108BOOLEAN syBetti1(leftv res, leftv u);
109BOOLEAN syBetti2(leftv res, leftv u, leftv w);
110
111/* ================================================================== */
112/* Expressions : */
113BOOLEAN iiExprArith1(leftv res, sleftv* a, int op);
114BOOLEAN iiExprArith2(leftv res, sleftv* a, int op, sleftv* b,
115                     BOOLEAN proccall=FALSE);
116BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c);
117BOOLEAN iiExprArithM(leftv res, sleftv* a, int op);
118BOOLEAN iiApply(leftv res,leftv a, int op, leftv proc);
119
120typedef BOOLEAN (*proc1)(leftv,leftv);
121
122#ifdef GENTABLE
123typedef char * (*Proc1)(char *);
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 struct sValCmd2 dArith2[];
164extern struct sValCmd1 dArith1[];
165extern struct sValCmd3 dArith3[];
166extern struct sValCmdM dArithM[];
167#endif
168
169/* ================================================================== */
170/* Assigments : */
171BOOLEAN iiAssign(leftv left, leftv right);
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, sleftv* sl);
196// from misc.cc:
197char *  showOption();
198BOOLEAN setOption(leftv res, leftv v);
199/* ================================================================== */
200char * versionString();
201/* ================================================================== */
202void  singular_example(char *str);
203
204BOOLEAN iiTryLoadLib(leftv v, const char *id);
205
206int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic,
207               BOOLEAN(*func)(leftv res, leftv v));
208
209void iiCheckPack(package &p);
210#ifndef SING_NDEBUG
211void checkall();
212#endif
213
214void rSetHdl(idhdl h);
215ring rInit(sleftv* pn, sleftv* rv, sleftv* ord);
216idhdl  rDefault(const char *s);
217
218idhdl rSimpleFindHdl(ring r, idhdl root, idhdl n=NULL);
219idhdl rFindHdl(ring r, idhdl n);
220void   rKill(idhdl h);
221void   rKill(ring r);
222lists scIndIndset(ideal S, BOOLEAN all, ideal Q);
223BOOLEAN mpKoszul(leftv res,leftv c/*ip*/, leftv b/*in*/, leftv id);
224BOOLEAN mpJacobi(leftv res,leftv a);
225BOOLEAN jjRESULTANT(leftv res, leftv u, leftv v, leftv w);
226BOOLEAN kQHWeight(leftv res,leftv v);
227BOOLEAN kWeight(leftv res,leftv id);
228BOOLEAN loSimplex( leftv res, leftv args );
229BOOLEAN loNewtonP( leftv res, leftv arg1 );
230BOOLEAN nuMPResMat( leftv res, leftv arg1, leftv arg2 );
231BOOLEAN nuLagSolve( leftv res, leftv arg1, leftv arg2, leftv arg3 );
232BOOLEAN nuVanderSys( leftv res, leftv arg1, leftv arg2, leftv arg3);
233BOOLEAN nuUResSolve( leftv res, leftv args );
234
235BOOLEAN jjCHARSERIES(leftv res, leftv u);
236/*
237BOOLEAN jjRESULTANT(leftv res, leftv u, leftv v, leftv w);
238#if 0
239BOOLEAN jjIS_SQR_FREE(leftv res, leftv u);
240#endif
241*/
242/* ================================================================== */
243void paPrint(const char *n,package p);
244/* ================================================================== */
245
246
247BOOLEAN iiTestAssume(leftv a, leftv b);
248#endif
249
Note: See TracBrowser for help on using the repository browser.