Wild Life: lib.c File Reference

Wild Life 2.30

- Main Page
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Macros
Functions | Variables
lib.c File Reference

lib for calling wild_life from C More...

Go to the source code of this file.

## Functions
char ** | group_features (char **f, ptr_node n)
| group_features More...
void | exit_if_true (long exitflag)
| exit_if_true More...
void | init_io ()
| void init_io More...
void | init_system ()
| init_system More...
void | WFInit (long argc, char *argv[])
| WFInit. More...
int | WFInput (char *query)
| WFInput. More...
PsiTerm | WFGetVar (char *name)
| WFGetVar. More...
int | WFfeature_count_loop (ptr_node n)
| WFfeature_count_loop. More...
int | WFFeatureCount (ptr_psi_term psi)
| WFFeatureCount. More...
char * | WFType (ptr_psi_term psi)
| WFType. More...
char ** | WFFeatures (ptr_psi_term psi)
| WFFeatures. More...
double | WFGetDouble (ptr_psi_term psi, int *ok)
| WFGetDouble. More...
char * | WFGetString (ptr_psi_term psi, int *ok)
| WFGetString. More...
PsiTerm | WFGetFeature (ptr_psi_term psi, char *feature)
| WFGetFeature. More...

## Variables
long | noisy =TRUE
long | file_date =3
long | types_done =FALSE
float | garbage_time =0

## Detailed Description

lib for calling wild_life from C

VERSION of Wild-LIFE for calling from C

Definition in file lib.c.

## Function Documentation

void exit_if_true | ( | long | exitflag | ) |

exit_if_true

Parameters

  exitflag | - long exitflag

Definition at line 55 of file lib.c.

56 {
57 if (exitflag) {
58 printf("\n\n*** Execution is not allowed to continue.\n");
59 /*exit_life(TRUE);*/
60 exit(EXIT_FAILURE);
61 }
62 }

char** group_features | ( | char ** | f,
|  | ptr_node | n
| ) |  |

group_features

Parameters

  f | - char **f
  n | - ptr_node n

Definition at line 34 of file lib.c.

References wl_node::key, wl_node::left, NULL, and wl_node::right.

35 {
36 *f=NULL;
37 if(n) {
38 if(n->left)
39 f=group_features(f,n->left);
40 *f=n->key;
41 f++;
42 if(n->right)
43 f=group_features(f,n->right);
44 }
45
46 return f;
47 }
NULL
#define NULL
Definition: def_const.h:533
wl_node::left
ptr_node left
Definition: def_struct.h:199
wl_node::key
char * key
Definition: def_struct.h:198
group_features
char ** group_features(char **f, ptr_node n)
group_features
Definition: lib.c:34
wl_node::right
ptr_node right
Definition: def_struct.h:200

void init_io | ( |  | ) |

void init_io

I/O initialization

Definition at line 69 of file lib.c.

References input_state, NULL, output_stream, stdin_state, stdin_terminal, and TRUE.

70 {
71 stdin_terminal=TRUE ;
72 input_state=NULL;
73 stdin_state=NULL;
74 output_stream=stdout;
75 }
stdin_state
ptr_psi_term stdin_state
Definition: def_glob.h:857
NULL
#define NULL
Definition: def_const.h:533
input_state
ptr_psi_term input_state
Definition: def_glob.h:856
TRUE
#define TRUE
Standard boolean.
Definition: def_const.h:268
stdin_terminal
long stdin_terminal
set in init_io in lib.c to true - never changed - used in token.c
Definition: def_glob.h:832
output_stream
FILE * output_stream
Definition: def_glob.h:1017

void init_system | ( |  | ) |

init_system

Initial state of system to begin a query

Definition at line 83 of file lib.c.

References choice_stack, current_module, exit_if_true(), FALSE, goal_stack, init_global_vars(), mem_base, memory_check(), wl_module::module_name, NULL, PROMPT, prompt, PROMPT_BUFFER, prompt_buffer, resid_aim, stack_nil(), stack_pointer, undo_stack, user_module, var_tree, x_window_creation, and xevent_list.

84 {
85 #ifdef X11
86 x_window_creation=FALSE;
87 #endif
88 stack_pointer=mem_base;
89 goal_stack=NULL;
90 choice_stack=NULL;
91 undo_stack=NULL; /* 7.8 */
92 var_tree=NULL;
93
94 /* RM: Oct 13 1993 */
95 if(current_module==user_module)
96 prompt=PROMPT;
97 else {
98 prompt=prompt_buffer;
99 (void)snprintf(prompt_buffer,PROMPT_BUFFER,"%s%s",current_module->module_name,PROMPT);
100 }
101
102 resid_aim=NULL;
103 exit_if_true(!memory_check());
104
105 #ifdef X11
106 /* RM: Dec 15 1992 */
107 xevent_list=stack_nil();
108 #endif
109
110 init_global_vars(); /* RM: Feb 15 1993 */
111 }
stack_pointer
GENERIC stack_pointer
used to allocate from stack - size allocated added - adj for alignment
Definition: def_glob.h:69
user_module
ptr_module user_module
Default module for user input.
Definition: def_glob.h:694
goal_stack
ptr_goal goal_stack
Definition: def_glob.h:1025
prompt_buffer
char prompt_buffer[PROMPT_BUFFER]
Definition: def_glob.h:878
xevent_list
ptr_psi_term xevent_list
Definition: def_glob.h:1037
current_module
ptr_module current_module
The current module for the tokenizer.
Definition: def_glob.h:729
NULL
#define NULL
Definition: def_const.h:533
var_tree
ptr_node var_tree
Definition: def_glob.h:1005
PROMPT
#define PROMPT
Head of prompt.
Definition: def_const.h:218
resid_aim
ptr_goal resid_aim
Definition: def_glob.h:865
x_window_creation
long x_window_creation
Definition: def_glob.h:1046
undo_stack
ptr_stack undo_stack
Definition: def_glob.h:1027
exit_if_true
void exit_if_true(long exitflag)
exit_if_true
Definition: lib.c:55
init_global_vars
void init_global_vars()
init_global_vars
Definition: lefun.c:1484
FALSE
#define FALSE
Standard boolean.
Definition: def_const.h:275
stack_nil
ptr_psi_term stack_nil()
stack_nil
Definition: built_ins.c:26
wl_module::module_name
char * module_name
Definition: def_struct.h:106
PROMPT_BUFFER
#define PROMPT_BUFFER
Size of prompt buffer.
Definition: def_const.h:225
prompt
char * prompt
Definition: def_glob.h:1018
mem_base
GENERIC mem_base
mem_size memory allocated in init_memory by malloc
Definition: def_glob.h:48
memory_check
long memory_check()
memory_check
Definition: memory.c:1723
choice_stack
ptr_choice_point choice_stack
Definition: def_glob.h:1026

int WFfeature_count_loop | ( | ptr_node | n | ) |

WFfeature_count_loop.

Parameters

  n | - ptr_node n

Definition at line 325 of file lib.c.

References wl_node::left, and wl_node::right.

326 {
327 int result=0;
328
329 if(n) {
330 if(n->left)
331 result+=WFfeature_count_loop(n->left);
332 result++;
333 if(n->right)
334 result+=WFfeature_count_loop(n->right);
335 }
336
337 return result;
338 }
wl_node::left
ptr_node left
Definition: def_struct.h:199
WFfeature_count_loop
int WFfeature_count_loop(ptr_node n)
WFfeature_count_loop.
Definition: lib.c:325
wl_node::right
ptr_node right
Definition: def_struct.h:200

int WFFeatureCount | ( | ptr_psi_term | psi | ) |

WFFeatureCount.

Parameters

  psi | - ptr_psi_term psi

Definition at line 346 of file lib.c.

References wl_psi_term::attr_list, deref_ptr, and WFfeature_count_loop().

347 {
348 int result=0;
349
350 if(psi) {
351 deref_ptr(psi);
352 result=WFfeature_count_loop(psi->attr_list);
353 }
354
355 return result;
356 }
deref_ptr
#define deref_ptr(P)
Definition: def_macro.h:100
WFfeature_count_loop
int WFfeature_count_loop(ptr_node n)
WFfeature_count_loop.
Definition: lib.c:325
wl_psi_term::attr_list
ptr_node attr_list
Definition: def_struct.h:187

char** WFFeatures | ( | ptr_psi_term | psi | ) |

WFFeatures.

Parameters

  psi | - ptr_psi_term psi

Definition at line 380 of file lib.c.

References wl_psi_term::attr_list, deref_ptr, group_features(), NULL, and WFfeature_count_loop().

381 {
382 char **features_loc=NULL;
383 int n;
384
385 if(psi) {
386 deref_ptr(psi);
387
388 n=WFfeature_count_loop(psi->attr_list);
389 if(n) {
390 features_loc=(char **)malloc((n+1)*sizeof(char *));
391 (void)group_features(features_loc,psi->attr_list);
392 }
393 }
394
395 return features_loc;
396 }
NULL
#define NULL
Definition: def_const.h:533
deref_ptr
#define deref_ptr(P)
Definition: def_macro.h:100
group_features
char ** group_features(char **f, ptr_node n)
group_features
Definition: lib.c:34
WFfeature_count_loop
int WFfeature_count_loop(ptr_node n)
WFfeature_count_loop.
Definition: lib.c:325
wl_psi_term::attr_list
ptr_node attr_list
Definition: def_struct.h:187

double WFGetDouble | ( | ptr_psi_term | psi,
|  | int * | ok
| ) |  |

WFGetDouble.

Parameters

  psi | - ptr_psi_term psi
  ok | - int *ok

Definition at line 405 of file lib.c.

References deref_ptr, FALSE, real, sub_type(), TRUE, wl_psi_term::type, and wl_psi_term::value_3.

406 {
407 double value=0.0;
408
409 if(ok)
410 *ok=FALSE;
411
412 if(psi) {
413 deref_ptr(psi);
414
415 if(sub_type(psi->type,real) && psi->value_3) {
416 value= *((double *)psi->value_3);
417 if(ok)
418 *ok=TRUE;
419 }
420 }
421 return value;
422 }
sub_type
long sub_type(ptr_definition t1, ptr_definition t2)
sub_type
Definition: types.c:1642
real
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
deref_ptr
#define deref_ptr(P)
Definition: def_macro.h:100
TRUE
#define TRUE
Standard boolean.
Definition: def_const.h:268
FALSE
#define FALSE
Standard boolean.
Definition: def_const.h:275
wl_psi_term::value_3
GENERIC value_3
Definition: def_struct.h:186
wl_psi_term::type
ptr_definition type
Definition: def_struct.h:181

PsiTerm WFGetFeature | ( | ptr_psi_term | psi,
|  | char * | feature
| ) |  |

WFGetFeature.

Parameters

  psi | - ptr_psi_term psi
  feature | - char *feature

Definition at line 457 of file lib.c.

References wl_psi_term::attr_list, wl_node::data, deref_ptr, FEATCMP, find(), and NULL.

458 {
459 ptr_psi_term result=NULL;
460 ptr_node n;
461
462 if(psi && feature) {
463 deref_ptr(psi);
464 n=find(FEATCMP,feature,psi->attr_list);
465 if(n)
466 result=(PsiTerm)n->data;
467 }
468
469 return result;
470 }
FEATCMP
#define FEATCMP
indicates to use featcmp for comparison (in trees.c)
Definition: def_const.h:979
wl_psi_term
Definition: def_struct.h:177
wl_node::data
GENERIC data
Definition: def_struct.h:201
NULL
#define NULL
Definition: def_const.h:533
PsiTerm
void * PsiTerm
Type for psi-terms, hidden from users.
Definition: def_struct.h:21
deref_ptr
#define deref_ptr(P)
Definition: def_macro.h:100
find
ptr_node find(long comp, char *keystr, ptr_node tree)
find
Definition: trees.c:394
wl_node
Definition: def_struct.h:197
wl_psi_term::attr_list
ptr_node attr_list
Definition: def_struct.h:187

char* WFGetString | ( | ptr_psi_term | psi,
|  | int * | ok
| ) |  |

WFGetString.

Parameters

  psi | - ptr_psi_term psi
  ok | - int *ok

Definition at line 431 of file lib.c.

References deref_ptr, FALSE, NULL, quoted_string, sub_type(), TRUE, wl_psi_term::type, and wl_psi_term::value_3.

432 {
433 char *value=NULL;
434
435 if(ok)
436 *ok=FALSE;
437
438 if(psi) {
439 deref_ptr(psi);
440
441 if(sub_type(psi->type,quoted_string) && psi->value_3) {
442 value=(char *)psi->value_3;
443 if(ok)
444 *ok=TRUE;
445 }
446 }
447 return value;
448 }
NULL
#define NULL
Definition: def_const.h:533
sub_type
long sub_type(ptr_definition t1, ptr_definition t2)
sub_type
Definition: types.c:1642
deref_ptr
#define deref_ptr(P)
Definition: def_macro.h:100
TRUE
#define TRUE
Standard boolean.
Definition: def_const.h:268
FALSE
#define FALSE
Standard boolean.
Definition: def_const.h:275
wl_psi_term::value_3
GENERIC value_3
Definition: def_struct.h:186
wl_psi_term::type
ptr_definition type
Definition: def_struct.h:181
quoted_string
ptr_definition quoted_string
symbol in bi module
Definition: def_glob.h:368

PsiTerm WFGetVar | ( | char * | name | ) |

WFGetVar.

Parameters

  name | - char *name

Definition at line 304 of file lib.c.

References wl_node::data, deref_ptr, find(), NULL, STRCMP, and var_tree.

305 {
306 ptr_psi_term result=NULL;
307 ptr_node n;
308
309 n=find(STRCMP,name,var_tree);
310 if(n) {
311 result=(ptr_psi_term)n->data;
312 if(result)
313 deref_ptr(result);
314 }
315
316 return result;
317 }
wl_psi_term
Definition: def_struct.h:177
ptr_psi_term
struct wl_psi_term * ptr_psi_term
quotedStackCopy
Definition: def_struct.h:62
wl_node::data
GENERIC data
Definition: def_struct.h:201
NULL
#define NULL
Definition: def_const.h:533
var_tree
ptr_node var_tree
Definition: def_glob.h:1005
deref_ptr
#define deref_ptr(P)
Definition: def_macro.h:100
name
char * name
Definition: def_glob.h:966
STRCMP
#define STRCMP
indicates to use strcmp for comparison (c function)
Definition: def_const.h:963
find
ptr_node find(long comp, char *keystr, ptr_node tree)
find
Definition: trees.c:394
wl_node
Definition: def_struct.h:197

void WFInit | ( | long | argc,
|  | char * | argv[]
| ) |  |

WFInit.

Parameters

  argc | - long argc
  argv | - char *argv[]

WFINIT(argc,argv) This routine contains the Read-Solve-Print loop.

Definition at line 122 of file lib.c.

References arg_c, arg_v, assert, begin_terminal_io(), c_query_level, env, Errorline(), exit_if_true(), FALSE, file_date, heap_copy_string(), init_built_in_types(), init_copy(), init_interrupt(), init_io(), init_memory(), init_modules(), init_print(), init_system(), init_trace(), input_state, life_start, load, main_prove(), mem_base, noisy, open_input_file(), other_base, push_goal(), quietflag, rand_array, set_current_module(), stack_pointer, stdin_cleareof(), title(), TRUE, undo_stack, user_module, var_occurred, and x_setup_builtins().

123 {
124 ptr_stack save_undo_stack;
125
126 int i;
127 #ifdef SOLARIS
128 for(i=0;i<256;i++)
129 rand_array[i]=rand_r(&libseed);
130 #else
131 for(i=0;i<256;i++)
132 rand_array[i]=random();
133 #endif
134
135 if (argc < 10)
136 {
137 arg_c=argc;
138 for (i = 0; i < argc; i++) {
139 arg_v[i]=argv[i];
140 }
141 }
142 else
143 {
144 Errorline("Too many command line arguments\n");
145 }
146
147 quietflag = TRUE; /* RM: Mar 31 1993 */
148
149 init_io();
150 init_memory();
151 exit_if_true(!mem_base || !other_base);
152 assert(stack_pointer==mem_base); /* 8.10 */
153 init_copy();
154 assert(stack_pointer==mem_base); /* 8.10 */
155 init_print();
156 assert(stack_pointer==mem_base); /* 8.10 */
157
158 /* Timekeeping initialization */
159 tzset();
160 (void)times(&life_start);
161 assert(stack_pointer==mem_base); /* 8.10 */
162
163 init_modules(); /* RM: Jan 8 1993 */
164
165 init_built_in_types();
166 assert(stack_pointer==mem_base); /* 8.10 */
167 #ifdef X11
168 x_setup_builtins();
169 assert(stack_pointer==mem_base); /* 8.10 */
170 #endif
171 init_interrupt();
172 assert(stack_pointer==mem_base); /* 8.10 */
173 title();
174 assert(stack_pointer==mem_base); /* 8.10 */
175 init_trace();
176 noisy=FALSE;
177
178 assert(stack_pointer==mem_base); /* 8.10 */
179
180
181 (void)set_current_module(user_module); /* RM: Jan 27 1993 */
182
183 /* Read in the .set_up file */
184 init_system();
185
186 #ifdef ARITY /* RM: Mar 29 1993 */
187 arity_init();
188 #endif
189
190
191 (void)open_input_file("+SETUP+");
192 push_goal(load,input_state,(ptr_psi_term)file_date,(GENERIC)heap_copy_string("+SETUP+"));
193 file_date+=2;
194 main_prove();
195
196
197 (void)setjmp(env);
198 /* printf("%ld\n",(long)(stack_pointer-mem_base)); */ /* 8.10 */
199 init_system();
200 init_trace();
201 begin_terminal_io();
202 var_occurred=FALSE;
203 save_undo_stack=undo_stack;
204 stdin_cleareof();
205
206 c_query_level=0;
207 }
stack_pointer
GENERIC stack_pointer
used to allocate from stack - size allocated added - adj for alignment
Definition: def_glob.h:69
init_trace
void init_trace()
init_trace
Definition: error.c:651
user_module
ptr_module user_module
Default module for user input.
Definition: def_glob.h:694
push_goal
void push_goal(goals t, ptr_psi_term a, ptr_psi_term b, GENERIC c)
push_goal
Definition: login.c:600
init_system
void init_system()
init_system
Definition: lib.c:83
init_io
void init_io()
void init_io
Definition: lib.c:69
wl_psi_term
Definition: def_struct.h:177
wl_stack
Definition: def_struct.h:230
quietflag
long quietflag
Definition: def_glob.h:912
input_state
ptr_psi_term input_state
Definition: def_glob.h:856
life_start
struct tms life_start
time life started - seconds
Definition: def_glob.h:83
undo_stack
ptr_stack undo_stack
Definition: def_glob.h:1027
Errorline
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
GENERIC
unsigned long * GENERIC
unsigned long *GENERIC
Definition: def_struct.h:35
heap_copy_string
char * heap_copy_string(char *s)
heap_copy_string
Definition: trees.c:172
begin_terminal_io
void begin_terminal_io()
begin_terminal_io
Definition: token.c:493
arg_c
int arg_c
set from argc in either life.c or lib.c
Definition: def_glob.h:20
TRUE
#define TRUE
Standard boolean.
Definition: def_const.h:268
other_base
GENERIC other_base
mem_size memory allocated in init_memory by malloc
Definition: def_glob.h:98
exit_if_true
void exit_if_true(long exitflag)
exit_if_true
Definition: lib.c:55
FALSE
#define FALSE
Standard boolean.
Definition: def_const.h:275
init_print
void init_print()
init_print
Definition: print.c:52
init_memory
void init_memory()
init_memory ()
Definition: memory.c:1671
file_date
long file_date
Definition: lib.c:22
arg_v
char * arg_v[ARGNN]
set from argv in either life.c or lib.c
Definition: def_glob.h:27
load
#define load
was enum (goal) – but must be long for error.c - now typedef
Definition: def_const.h:1156
rand_array
long rand_array[256]
Definition: def_glob.h:920
env
jmp_buf env
Definition: def_glob.h:877
main_prove
void main_prove()
main_prove
Definition: login.c:2333
x_setup_builtins
void x_setup_builtins()
x_setup_builtins
Definition: xpred.c:3374
init_built_in_types
void init_built_in_types()
init_built_in_types
Definition: built_ins.c:6155
c_query_level
long c_query_level
Definition: def_glob.h:930
mem_base
GENERIC mem_base
mem_size memory allocated in init_memory by malloc
Definition: def_glob.h:48
noisy
long noisy
Definition: lib.c:21
init_modules
void init_modules()
init_modules
Definition: modules.c:34
stdin_cleareof
void stdin_cleareof()
stdin_cleareof
Definition: token.c:51
title
void title()
TITLE.
Definition: info.c:39
init_copy
void init_copy()
init_copy
Definition: copy.c:32
var_occurred
long var_occurred
???
Definition: def_glob.h:839
open_input_file
long open_input_file(char *file)
open_input_file
Definition: token.c:594
set_current_module
ptr_module set_current_module(ptr_module module)
set_current_module
Definition: modules.c:100
init_interrupt
void init_interrupt()
INIT_INTERRUPT.
Definition: interrupt.c:36
assert
#define assert(N)
Definition: memory.c:114

int WFInput | ( | char * | query | ) |

WFInput.

Parameters

  query | - char *query

Definition at line 215 of file lib.c.

References wl_goal::aaaa_1, assert_clause(), assert_first, assert_ok, c_query_level, c_what_next, choice_stack, DEFRULES, encode_types(), FACT, fail, FALSE, goal_count, goal_stack, ignore_eff, init_parse_state(), main_prove(), wl_goal::next, NULL, parse(), prove, push_choice_point(), push_goal(), QUERY, reset_stacks(), save_parse_state(), stack_copy_psi_term(), start_chrono(), stringinput, stringparse, TRUE, wl_goal::type, undo(), undo_stack, var_occurred, WFmore, WFno, and WFyes.

216 {
217 ptr_psi_term t;
218 long sort;
219 parse_block pb;
220 int result=WFno;
221 ptr_stack save_undo_stack;
222 ptr_choice_point old_choice;
223
224
225 save_undo_stack=undo_stack;
226 old_choice=choice_stack;
227
228
229 if(!strcmp(query,".")) {
230 reset_stacks();
231 result=WFyes;
232 c_query_level=0;
233 }
234 else {
235 if(!strcmp(query,";")) {
236 sort=QUERY;
237 push_goal(fail,NULL,NULL,NULL);
238 }
239 else {
240 /* Parse the string in its own state */
241 save_parse_state(&pb);
242 init_parse_state();
243 stringparse=TRUE;
244 stringinput=query;
245
246 /* old_var_occurred=var_occurred; */
247 var_occurred=FALSE;
248 t=stack_copy_psi_term(parse(&sort));
249
250 /* Main loop of interpreter */
251 if(sort==QUERY) {
252 ignore_eff=TRUE;
253 goal_count=0;
254
255 push_choice_point(c_what_next,(ptr_psi_term)c_query_level,NULL,NULL);
256 c_query_level++;
257 push_goal(c_what_next,(ptr_psi_term)c_query_level,(ptr_psi_term)var_occurred,NULL);
258 push_goal(prove,t,(ptr_psi_term)DEFRULES,NULL);
259 /* reset_step(); */
260 }
261 else if (sort==FACT) {
262 assert_first=FALSE;
263 assert_clause(t);
264 if(assert_ok)
265 result=WFyes;
266 undo(save_undo_stack);
267 var_occurred=FALSE;
268 encode_types();
269 }
270 }
271
272 if(sort==QUERY) {
273 start_chrono();
274 main_prove();
275
276 if(goal_stack && goal_stack->type==c_what_next) {
277
278 if((long)(goal_stack->aaaa_1)==c_query_level)
279 if(choice_stack==old_choice) {
280 result=WFyes;
281 c_query_level--;
282 }
283 else
284 result=WFmore;
285 else {
286 result=WFno;
287 c_query_level--;
288 }
289
290 goal_stack=goal_stack->next;
291 }
292 }
293 }
294
295 return result;
296 }
prove
#define prove
was enum (goal) – but must be long for error.c - now typedef
Definition: def_const.h:1051
wl_goal::aaaa_1
ptr_psi_term aaaa_1
Definition: def_struct.h:239
undo
void undo(ptr_stack limit)
undo
Definition: login.c:691
assert_first
long assert_first
Definition: def_glob.h:1032
wl_choice_point
Definition: def_struct.h:246
goal_stack
ptr_goal goal_stack
Definition: def_glob.h:1025
push_choice_point
void push_choice_point(goals t, ptr_psi_term a, ptr_psi_term b, GENERIC c)
push_choice_point
Definition: login.c:638
push_goal
void push_goal(goals t, ptr_psi_term a, ptr_psi_term b, GENERIC c)
push_goal
Definition: login.c:600
parse
psi_term parse(long *q)
parse
Definition: parser.c:907
save_parse_state
void save_parse_state(ptr_parse_block pb)
save_parse_state
Definition: token.c:425
wl_psi_term
Definition: def_struct.h:177
wl_stack
Definition: def_struct.h:230
DEFRULES
#define DEFRULES
Must be different from NULL, a built-in index, and a pointer Used to indicate that the rules of the d...
Definition: def_const.h:302
WFmore
#define WFmore
Input succeeded with possibly more answers.
Definition: def_const.h:47
FACT
#define FACT
Fact Kind of user input.
Definition: def_const.h:338
NULL
#define NULL
Definition: def_const.h:533
WFno
#define WFno
Input failed.
Definition: def_const.h:34
ignore_eff
long ignore_eff
Definition: def_glob.h:677
QUERY
#define QUERY
Query Kind of user input.
Definition: def_const.h:345
WFyes
#define WFyes
Input succeeded.
Definition: def_const.h:41
c_what_next
#define c_what_next
was enum (goal) – but must be long for error.c - now typedef
Definition: def_const.h:1163
assert_ok
long assert_ok
Definition: def_glob.h:1033
undo_stack
ptr_stack undo_stack
Definition: def_glob.h:1027
goal_count
long goal_count
Definition: def_glob.h:678
wl_goal::type
goals type
Definition: def_struct.h:238
wl_parse_block
Definition: def_struct.h:371
TRUE
#define TRUE
Standard boolean.
Definition: def_const.h:268
start_chrono
void start_chrono()
start_chrono
Definition: login.c:349
FALSE
#define FALSE
Standard boolean.
Definition: def_const.h:275
fail
#define fail
was enum (goal) – but must be long for error.c - now typedef
Definition: def_const.h:1044
init_parse_state
void init_parse_state()
init_parse_state
Definition: token.c:464
reset_stacks
void reset_stacks()
reset_stacks
Definition: login.c:2047
stack_copy_psi_term
ptr_psi_term stack_copy_psi_term(psi_term t)
stack_copy_psi_term
Definition: parser.c:205
encode_types
void encode_types()
encode_types
Definition: types.c:1091
main_prove
void main_prove()
main_prove
Definition: login.c:2333
c_query_level
long c_query_level
Definition: def_glob.h:930
stringparse
long stringparse
Definition: def_glob.h:859
stringinput
char * stringinput
Definition: def_glob.h:860
var_occurred
long var_occurred
???
Definition: def_glob.h:839
assert_clause
void assert_clause(ptr_psi_term t)
assert_clause
Definition: login.c:287
choice_stack
ptr_choice_point choice_stack
Definition: def_glob.h:1026
wl_goal::next
ptr_goal next
Definition: def_struct.h:242

char* WFType | ( | ptr_psi_term | psi | ) |

WFType.

Parameters

  psi | - ptr_psi_term psi

Definition at line 364 of file lib.c.

References wl_keyword::combined_name, deref_ptr, wl_definition::keyword, NULL, and wl_psi_term::type.

365 {
366 char *result=NULL;
367 if(psi) {
368 deref_ptr(psi);
369 result=psi->type->keyword->combined_name;
370 }
371 return result;
372 }
wl_keyword::combined_name
char * combined_name
Definition: def_struct.h:119
wl_definition::keyword
ptr_keyword keyword
Definition: def_struct.h:147
NULL
#define NULL
Definition: def_const.h:533
deref_ptr
#define deref_ptr(P)
Definition: def_macro.h:100
wl_psi_term::type
ptr_definition type
Definition: def_struct.h:181

## Variable Documentation

long file_date =3

Definition at line 22 of file lib.c.

float garbage_time =0

Definition at line 25 of file lib.c.

long noisy =TRUE

Definition at line 21 of file lib.c.

long types_done =FALSE

Definition at line 23 of file lib.c.