source: git/Singular/ipshell.h @ 8fa9ea

spielwiese
Last change on this file since 8fa9ea was 8fa9ea, checked in by Burcin Erocal <burcin@…>, 12 years ago
Fix Singular/subexpr.cc.
  • Property mode set to 100644
File size: 5.5 KB
Line 
1#ifndef IPSHELL_H
2#define IPSHELL_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id$ */
7/*
8* ABSTRACT
9*/
10#include <stdio.h>
11//#include <kernel/structs.h>
12#include <kernel/ideals.h>
13#include <Singular/lists.h>
14
15struct _ssubexpr;
16typedef struct _ssubexpr *Subexpr;
17
18
19extern leftv iiCurrArgs;
20extern idhdl iiCurrProc;
21extern int iiOp; /* the current operation*/
22extern const char *  currid;
23extern int     iiRETURNEXPR_len;
24extern sleftv *iiRETURNEXPR;
25#ifdef USE_IILOCALRING
26extern ring   *iiLocalRing;
27#endif
28//extern cmdnames cmds[];
29extern const char *lastreserved;
30extern const char *singular_date; /* tesths.cc, set by final compile */
31
32extern BOOLEAN yyInRingConstruction; /* 1: during ring construction */
33
34int     IsCmd(const char *n, int & tok);
35
36BOOLEAN iiPStart(idhdl pn, sleftv * sl);
37BOOLEAN iiEStart(char* example, procinfo *pi);
38BOOLEAN iiAllStart(procinfov pi, char *p,feBufferTypes t, int l);
39void    type_cmd(leftv v);
40void    test_cmd(int i);
41void    list_cmd(int typ, const char* what, const char * prefix,
42                 BOOLEAN iterate, BOOLEAN fullname=FALSE);
43//char *  iiStringMatrix(matrix im, int dim, char ch=',');
44void    killlocals(int v);
45int     exprlist_length(leftv v);
46const char *  Tok2Cmdname(int i);
47const char *  iiTwoOps(int t);
48int     IsPrime(int i);
49
50BOOLEAN iiWRITE(leftv res,leftv exprlist);
51BOOLEAN iiExport(leftv v, int toLev);
52BOOLEAN iiExport(leftv v, int toLev, idhdl roothdl);
53BOOLEAN iiInternalExport (leftv v, int toLev, idhdl roothdl);
54char *  iiGetLibName(procinfov v);
55char *  iiGetLibProcBuffer( procinfov pi, int part=1 );
56char *  iiProcName(char *buf, char & ct, char* &e);
57char *  iiProcArgs(char *e,BOOLEAN withParenth);
58BOOLEAN iiLibCmd( char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force );
59/* sees wheter library lib has already been loaded
60   if yes, writes filename of lib into where and returns TRUE,
61   if  no, returns FALSE
62*/
63BOOLEAN iiLocateLib(const char* lib, char* where);
64leftv   iiMap(map theMap, const char * what);
65void    iiMakeResolv(resolvente r, int length, int rlen, char * name, int typ0,
66           intvec ** weights=NULL);
67BOOLEAN jjMINRES(leftv res, leftv v);
68BOOLEAN jjBETTI(leftv res, leftv v);
69BOOLEAN jjBETTI2(leftv res, leftv u, leftv v);
70BOOLEAN jjBETTI2_ID(leftv res, leftv u, leftv v);
71BOOLEAN jjIMPORTFROM(leftv res, leftv u, leftv v);
72BOOLEAN jjLIST_PL(leftv res, leftv v);
73
74BOOLEAN jjVARIABLES_P(leftv res, leftv u);
75BOOLEAN jjVARIABLES_ID(leftv res, leftv u);
76
77int     iiRegularity(lists L);
78leftv   singular_system(sleftv h);
79BOOLEAN jjSYSTEM(leftv res, leftv v);
80void    iiDebug();
81BOOLEAN iiCheckRing(int i);
82poly    iiHighCorner(ideal i, int ak);
83char *  iiConvName(const char *libname);
84BOOLEAN iiLoadLIB(FILE *fp, char *libnamebuf, char *newlib,
85                         idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror);
86
87// converts a resolution into a list of modules
88lists syConvRes(syStrategy syzstr,BOOLEAN toDel=FALSE,int add_row_shift=0);
89// converts a list of modules into a minimal resolution
90syStrategy syForceMin(lists li);
91// converts a list of modules into a resolution
92syStrategy syConvList(lists li,BOOLEAN toDel);
93
94
95
96/* ================================================================== */
97/* Expressions : */
98BOOLEAN iiExprArith1(leftv res, sleftv* a, int op);
99BOOLEAN iiExprArith2(leftv res, sleftv* a, int op, sleftv* b,
100                     BOOLEAN proccall=FALSE);
101BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c);
102BOOLEAN iiExprArithM(leftv res, sleftv* a, int op);
103
104typedef BOOLEAN (*proc1)(leftv,leftv);
105
106#ifdef __GNUC__
107#if (__GNUC__ < 3)
108#define INIT_BUG 1
109void    jjInitTab1();
110#endif
111#endif
112
113#ifdef GENTABLE
114typedef char * (*Proc1)(char *);
115struct sValCmd1
116{
117  proc1 p;
118  short cmd;
119  short res;
120  short arg;
121  short valid_for;
122};
123
124typedef BOOLEAN (*proc2)(leftv,leftv,leftv);
125struct sValCmd2
126{
127  proc2 p;
128  short cmd;
129  short res;
130  short arg1;
131  short arg2;
132  short valid_for;
133};
134
135typedef BOOLEAN (*proc3)(leftv,leftv,leftv,leftv);
136struct sValCmd3
137{
138  proc3 p;
139  short cmd;
140  short res;
141  short arg1;
142  short arg2;
143  short arg3;
144  short valid_for;
145};
146struct sValCmdM
147{
148  proc1 p;
149  short cmd;
150  short res;
151  short number_of_args; /* -1: any, -2: any >0, .. */
152  short valid_for;
153};
154extern struct sValCmd2 dArith2[];
155extern struct sValCmd1 dArith1[];
156extern struct sValCmd3 dArith3[];
157extern struct sValCmdM dArithM[];
158#endif
159
160/* ================================================================== */
161/* Assigments : */
162BOOLEAN iiAssign(leftv left, leftv right);
163
164typedef BOOLEAN (*proci)(leftv,leftv,Subexpr);
165struct sValAssign_sys
166{
167  proc1 p;
168  short res;
169  short arg;
170};
171
172struct sValAssign
173{
174  proci p;
175  short res;
176  short arg;
177};
178
179BOOLEAN iiParameter(leftv p);
180BOOLEAN iiAlias(leftv p);
181/* ================================================================== */
182int     iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl* root,
183  BOOLEAN isring = FALSE, BOOLEAN init_b=TRUE);
184sleftv * iiMake_proc(idhdl pn, package pack, sleftv* sl);
185// from misc.cc:
186char *  showOption();
187BOOLEAN setOption(leftv res, leftv v);
188/* ================================================================== */
189char * versionString();
190/* ================================================================== */
191void  singular_example(char *str);
192
193BOOLEAN iiTryLoadLib(leftv v, const char *id);
194
195int iiAddCproc(char *libname, char *procname, BOOLEAN pstatic,
196               BOOLEAN(*func)(leftv res, leftv v));
197
198void iiCheckPack(package &p);
199#ifndef NDEBUG
200void checkall();
201#endif
202#endif
203
Note: See TracBrowser for help on using the repository browser.