-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse_util.c
More file actions
63 lines (53 loc) · 1.9 KB
/
parse_util.c
File metadata and controls
63 lines (53 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include "num2sat.h"
#include "output.h"
#include "memory.h"
void print_tables (char* filename){
FILE* OUT = NULL;
int i, j;
if ( (OUT = fopen(filename, "w")) == NULL ) {
printf("\ncan't open file %s!\n\n",filename);
exit( 1 );
}
if (gcmd_line.display_info == 103 ) {
fprintf(OUT, "constants %d", gnum_constants);
for ( i = 0; i < gnum_constants; i++ ) {
fprintf(OUT, "\n%d %s", i, gconstants[i]);
}
fprintf(OUT, "\n\ntypes %d", gnum_types);
for ( i = 0; i < gnum_types; i++ ) {
fprintf(OUT, "\n%d %s ", i, gtype_names[i]);
for ( j = 0; j < gtype_size[i]; j++ ) {
fprintf(OUT, "%d ", gtype_consts[i][j]);
}
}
fprintf(OUT, "\n\npredicates %d", gnum_predicates);
for ( i = 0; i < gnum_predicates; i++ ) {
fprintf(OUT, "\n%3d %s ", i, gpredicates[i]);
for ( j = 0; j < garity[i]; j++ ) {
fprintf(OUT, "%d ", gpredicates_args_type[i][j]);
}
}
/*
fprintf(OUT, "\n\nfunctions %d", gnum_functions);
for ( i = 0; i < gnum_functions; i++ ) {
fprintf(OUT, "\n%3d %s: ", i, gfunctions[i]);
for ( j = 0; j < gf_arity[i]; j++ ) {
fprintf(OUT, "%d ", gfunctions_args_type[i][j]);
}
}*/
fprintf(OUT, "\n\nfacts %d", gnum_relevant_facts);
for ( i = 0; i < gnum_relevant_facts; i++ ) {
fprintf(OUT, "\n%d ", i);
print_Fact_file(OUT, &(grelevant_facts[i]));
}
/*
printf("\n\nfluents %d", gnum_relevant_fluents);
for ( i = 0; i < gnum_relevant_fluents; i++ ) {
printf("\n%d: ", i);
print_Fluent( &(grelevant_fluents[i]) );
}
*/
fprintf(OUT, "\n\n");
}
fclose(OUT);
}