Wild Life  2.29
 All Data Structures Files Functions Variables Typedefs Macros
def_const.h
Go to the documentation of this file.
1 // To use my revised gamma_table logic - Works better without (FALSE)
2 #define NEW_GAMMA FALSE
3 
4 // from built_ins.h
5 
6 #define least_sel 0
7 #define greatest_sel 1
8 #define op_sel 2
9 
10 // from c_life.h
11 
12 /* Input failed */
13 #define WFno 0
14 
15 /* Input succeeded */
16 #define WFyes 1
17 
18 /* Input succeeded with possibly more answers */
19 #define WFmore 2
20 
21 // from externs.h
22 
23 #define DJD_PORT 1
24 // added next djd
25 #define WORDALIGN 1
26 /* Memory Alignment and size */
27 #define WORD sizeof(long)
28 
29 
30 #ifdef WORDALIGN
31 #define ALIGN WORD
32 #else
33 #define ALIGN 8
34 #endif
35 
36 /* Time stamp technique */
37 #define TS 1
38 
39 #ifdef CLIFE
40 #include "blockdef.h"
41 #endif /* CLIFE */
42 
43 
44 /*************************** CONSTANTS **************************/
45 
46 /* Enable looking first for local set_up file */
47 /* In the final release, LOCALSETUP should be undefined. */
48 #define LOCALSETUP
49 #define LOCALSETUPFILE "./.set_up"
50 
51 
52 /* RM: Mar 1 1994: replaced macros with variables. */
53 
54 /* Memory is determined in words by the variable "alloc_words", this may be
55  specified on the command line and defaults to the macro "ALLOC_WORDS". mem_size
56  is in bytes and is the product of alloc_words by the size of a machine word.
57  This system is thus consistent between 32 and 64-bit architectures: the same
58  number of psi-terms can be allocated in either.
59  */
60 
61 
62 // from extern.h
63 
64 /* Garbage collection threshold (1/8 of MEM_SIZE is reasonable). */
65 #define GC_THRESHOLD (alloc_words>>3) /* number of words */
66 
67 /* Copy threshold (1/8 of GC_THRESHOLD is reasonable) */
68 #define COPY_THRESHOLD (GC_THRESHOLD>>3)
69 
70 
71 /* Which C type to use to represent reals and integers in Wild_Life. */
72 #define REAL double
73 
74 /* Maximum exactly representable integer (2^53-1 for double IEEE format) */
75 /* May be incorrect for Alpha - haven't checked. RM: Mar 1 1994 */
76 #define WL_MAXINT 9007199254740991.0
77 
78 /* Maximum number of syntactic tokens in a pretty-printed output term. */
79 #define PRETTY_SIZE 20000L
80 
81 /* Maximum number of built_ins */
82 #define MAX_BUILT_INS 300L
83 
84 /* Maximum size of file names and input tokens (which includes input strings) */
85 /* (Note: calculated tokens can be arbitrarily large) */
86 #define STRLEN 10000L
87 
88 /* Initial page width for printing */
89 #define PAGE_WIDTH 80L
90 
91 /* Initial depth limit for printing */
92 #define PRINT_DEPTH 1000000000L
93 
94 /* Power of ten to split printing (REALs are often more precise than ints) */
95 #define PRINT_SPLIT 1000000000L
96 #define PRINT_POWER 9L
97 
98 /* Maximum depth of the parser stack */
99 /* = maximum depth of embedded brackets etc... */
100 #define PARSER_STACK_SIZE 10000L
101 
102 /* Maximum operator precedence */
103 #define MAX_PRECEDENCE 1200L
104 
105 /* Size of prlong buffer */
106 #define PRINT_BUFFER 100000L
107 
108 /* Head of prompt */
109 #define PROMPT "> "
110 
111 /* Size of prompt buffer */
112 #define PROMPT_BUFFER 200L
113 #define MAX_LEVEL ((PROMPT_BUFFER-4-strlen(PROMPT))/2)
114 
115 /* Maximum number of goals executed between event polling */
116 /* Ideally, this should be a function of machine speed. */
117 #define XEVENTDELAY 1000L
118 
119 /* Maximum goal indentation during tracing */
120 #define MAX_TRACE_INDENT 40L
121 
122 /* True flags for the flags field of psi-terms */
123 #define QUOTED_TRUE 1L
124 #define UNFOLDED_TRUE 2L
125 
126 /* Standard booleans */
127 #define TRUE 1L
128 #define FALSE 0L
129 #define TRUEMASK 1L
130 
131 /* For LIFE boolean calculation built-ins */
132 #define UNDEF 2L
133 
134 #define NOT_CODED 0L
135 
136 /* Must be different from NULL, a built-in index, and a pointer */
137 /* Used to indicate that the rules of the definition are needed. */
138 #define DEFRULES -1L
139 
140 #define EOLN 10L
141 
142 /* How many types can be encoded on one integer */
143 /* in the transitive closure encoding. */
144 #define INT_SIZE 8*sizeof(unsigned long)
145 
146 /* Flags to indicate heap or stack allocation */
147 #define HEAP TRUE
148 #define STACK FALSE
149 
150 /* Kinds of user inputs */
151 #define FACT 100L
152 #define QUERY 200L
153 #define ERROR 999L
154 
155 /* Bit masks for status field of psi-terms: RMASK is used as a flag to */
156 /* avoid infinite loops when tracing psi-terms, SMASK masks off the */
157 /* status bits. These are used in the 'mark' routines (copy.c) and in */
158 /* check_out. */
159 #define RMASK 256L
160 #define SMASK 255L
161 
162 /* Initial value of time stamp (for variable binding) */
163 #ifdef TS
164 #define INIT_TIME_STAMP 1L
165 #endif
166 
167 /* Used to identify the object on the undo_stack */
168 /* Use define instead of enums because quick masking is important */
169 typedef long type_ptr;
170 #define psi_term_ptr 0
171 #define resid_ptr 1
172 #define int_ptr 2
173 #define def_ptr 3
174 #define code_ptr 4
175 #define goal_ptr 5
176 #define cut_ptr 6 /* 22.9 */
177 
178 #ifdef CLIFE
179 #define block_ptr 12
180 #define value_ptr 13
181 #endif /* CLIFE */
182 
183 #define destroy_window 7+32 /* To backtrack on window creation */
184 #define show_window 8+32 /* To backtrack on show window */
185 #define hide_window 9+32 /* To backtrack on hide window */
186 #define show_subwindow 10+32 /* To backtrack on show sub windows RM 8/12/92 */
187 #define hide_subwindow 11+32 /* To backtrack on hide sub windows RM 8/12/92 */
188 #define undo_action 32 /* Fast checking for an undo action */
189 
190 // from lefun.h
191 
192 /* Set constants for deref_args */
193 #define set_empty 0
194 #define set_1 1
195 #define set_2 2
196 #define set_1_2 3
197 #define set_1_2_3 7
198 #define set_1_2_3_4 15
199 
200 // from list.h
201 
202 #ifndef NULL
203 #define NULL 0
204 #endif
205 #ifndef TRUE
206 #define TRUE 1
207 #endif
208 #ifndef FALSE
209 #define FALSE 0
210 #endif
211 
212 // from sys.h
213 
214 #define OPTIONAL 0
215 #define REQUIRED 1
216 #define UNEVALED (1<<1)
217 #define JUSTFAIL (1<<2)
218 #define POLYTYPE (1<<3)
219 #define MANDATORY (1<<4)
220 #define NOVALUE (1<<5)
221 
222 // from token.h
223 
224 /* Names of the features */
225 #define STREAM "stream"
226 #define INPUT_FILE_NAME "input_file_name"
227 #define LINE_COUNT "line_count"
228 #define START_OF_LINE "start_of_line"
229 #define SAVED_CHAR "saved_char"
230 #define OLD_SAVED_CHAR "old_saved_char"
231 #define SAVED_PSI_TERM "saved_psi_term"
232 #define OLD_SAVED_PSI_TERM "old_saved_psi_term"
233 #define EOF_FLAG "eof_flag"
234 #define CURRENT_MODULE "current_module"
235 
236 // from xdisplaylist.h
237 
238 
239 #define xDefaultFont -1
240 #define xDefaultLineWidth -1
241 
242 // from error.h
243 
244 // from templates.h
245 
246 /* constants */
247 
248 #define MAXNBARGS 20
249 
250 // from error.h
251 
252 // #define Warningline if (warningflag) warningline // this would not work!
253 // #define Warningline warningline
254 
255 #define STRCMP 1L
256 #define INTCMP 2L
257 #define FEATCMP 3L
258 
259 // were enum but va_arg could not handle
260 #define nop 0
261 #define xf 1
262 #define fx 2
263 #define yf 3
264 #define fy 4
265 #define xfx 5
266 /* yfy, */
267 #define xfy 6
268 #define yfx 7
269 
270 
271 // cannot be enum -- must be long for error.c
272 #define fail 0L
273 #define prove 1L
274 #define unify 2L
275 #define unify_noeval 3L
276 #define disj 4L
277 #define what_next 5L
278 #define eval 6L
279 #define eval_cut 7L
280 #define freeze_cut 8L
281 #define implies_cut 9L
282 #define general_cut 10L
283 #define match 11L
284 #define type_disj 12L
285 #define clause 13L
286 #define del_clause 14L
287 #define retract 15L
288 #define load 16L
289 #define c_what_next 17L
290 /* RM: Mar 31 1993 */
291 
292 // from bi_math.c
293 #define SINFLAG 1
294 #define COSFLAG 2
295 #define TANFLAG 3
296 
297 // from bi_type.c
298 
299 #define isa_le_sel 0
300 #define isa_lt_sel 1
301 #define isa_ge_sel 2
302 #define isa_gt_sel 3
303 #define isa_eq_sel 4
304 #define isa_nle_sel 5
305 #define isa_nlt_sel 6
306 #define isa_nge_sel 7
307 #define isa_ngt_sel 8
308 #define isa_neq_sel 9
309 #define isa_cmp_sel 10
310 #define isa_ncmp_sel 11
311 
312 // from copy.c
313 /* Size of hash table; must be a power of 2 */
314 /* A big hash table means it is sparse and therefore fast */
315 #define HASHSIZE 2048L
316 
317 /* Total number of buckets in initial hash table; */
318 /* this is dynamically increased if necessary. */
319 #define NUMBUCKETS 1024L
320 
321 /* Tail of hash bucket */
322 #define HASHEND (-1)
323 
324 
325 #define EXACT_FLAG 0
326 #define QUOTE_FLAG 1
327 #define EVAL_FLAG 2
328 /* See mark_quote_c: */ /* 15.9 */
329 #define QUOTE_STUB 3
330 
331 // from parser.c
332 #define NOP 2000
333 
334 // from print.c
335 #define DOTDOT ": " /* RM: Dec 14 1992, should be " : " */
336 
337 #define NOTOP 0
338 #define INFIX 1
339 #define PREFIX 2
340 #define POSTFIX 3
341 
342 #ifndef NORAW
343 #define stdin_fileno fileno (stdin)
344 #endif
345 
346 // from sys.h
347 #define ARGNN 10
348 
349 // from types.h
350 #define MAX_GAMMA 1000
351 
352 
353 // from xdisplaylist.h
354 #ifdef X11
355 #define xDefaultFont -1
356 #define xDefaultLineWidth -1
357 #endif
358 
359 // was enum def_type now there is typedef ptr_definition
360 #define undef 1
361 #define predicate 2
362 #define function_it 3
363 #define type_it 4
364 #define global 5
365  /* RM: Feb 8 1993 */
366 #ifdef CLIFE
367 #define block 6
368  /* AA: Mar 8 1993 */
369 #endif /* CLIFE */
370 
371 #ifdef X11
372 
373 // was enum
374 #define DRAW_LINE 1
375 #define DRAW_RECTANGLE 2
376 #define DRAW_ARC 3
377 #define DRAW_POLYGON 4
378 #define FILL_RECTANGLE 5
379 #define FILL_ARC 6
380 #define FILL_POLYGON 7
381 #define DRAW_STRING 8
382 #define DRAW_IMAGE_STRING 9
383 
384 
385 #endif
long type_ptr
Definition: def_const.h:169