-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathalma_backsearch.h
41 lines (31 loc) · 1.05 KB
/
alma_backsearch.h
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
#ifndef alma_backsearch_h
#define alma_backsearch_h
#include "tommy.h"
#include "alma_formula.h"
#include "alma_clause.h"
#include "alma_kb.h"
// Used to keep track of binding lists for given clause of backsearch
typedef struct binding_mapping {
long key;
binding_list *bindings;
tommy_node node;
} binding_mapping;
typedef struct backsearch_task {
clause *target;
// Model empty binding list to be copied for others
binding_list *target_vars;
int clause_count;
tommy_array clauses;
tommy_hashlin clause_bindings;
tommy_array new_clauses;
tommy_array new_clause_bindings;
tommy_array to_resolve;
tommy_node node;
} backsearch_task;
void backsearch_from_clause(tommy_list *backsearch_tasks, clause *c);
void generate_backsearch_tasks(kb *collection, long time, backsearch_task *bt);
void process_backsearch_tasks(kb *collection, long time, tommy_list *backsearch_tasks, kb_logger *logger);
void backsearch_halt(backsearch_task *t);
int idling_backsearch(tommy_list *backsearch_tasks);
int bm_compare(const void *arg, const void *obj);
#endif