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