Soar Kernel  9.3.2 08-06-12
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
chunk.h
Go to the documentation of this file.
1 /*************************************************************************
2  * PLEASE SEE THE FILE "license.txt" (INCLUDED WITH THIS SOFTWARE PACKAGE)
3  * FOR LICENSE AND COPYRIGHT INFORMATION.
4  *************************************************************************/
5 
6 /* =======================================================================
7  chunk.h
8 ======================================================================= */
9 
10 #ifndef CHUNK_H
11 #define CHUNK_H
12 
13 #ifdef __cplusplus
14 //extern "C"
15 //{
16 #endif
17 
18 typedef char Bool;
19 typedef struct condition_struct condition;
21 typedef union symbol_union Symbol;
22 struct not_struct;
23 
24 /* RBD Need more comments here */
25 #define CHUNK_COND_HASH_TABLE_SIZE 1024
26 #define LOG_2_CHUNK_COND_HASH_TABLE_SIZE 10
27 
28 typedef struct chunk_cond_struct {
29  condition *cond; /* points to the original condition */
30 
31  condition *instantiated_cond; /* points to cond in chunk instantiation */
32  condition *variablized_cond; /* points to cond in the actual chunk */
34 
35  /* dll of all cond's in a set (i.e., a chunk_cond_set, or the grounds) */
37 
38  /* dll of cond's in this particular hash bucket for this set */
40 
41  uint32_t hash_value; /* equals hash_condition(cond) */
42  uint32_t compressed_hash_value; /* above, compressed to a few bits */
43 } chunk_cond;
44 
45 
46 typedef struct chunk_cond_set_struct {
47  chunk_cond *all; /* header for dll of all chunk_cond's in the set */
48  chunk_cond *table[CHUNK_COND_HASH_TABLE_SIZE]; /* hash table buckets */
50 
51 typedef struct agent_struct agent;
52 
53 extern void init_chunker (agent* thisAgent);
54 extern void chunk_instantiation (agent* thisAgent,
55  instantiation *inst,
56  bool variablize,
57  instantiation **custom_inst_list);
58 extern chunk_cond *make_chunk_cond_for_condition (agent* thisAgent, condition *cond);
59 extern Bool add_to_chunk_cond_set (agent* thisAgent, chunk_cond_set *set, chunk_cond *new_cc);
60 
61 extern void add_results_for_id (agent* thisAgent, Symbol *id);
62 
63 extern void variablize_symbol (agent* thisAgent, Symbol **sym);
64 extern void variablize_nots_and_insert_into_conditions (agent* thisAgent, not_struct *nots, condition *conds);
65 extern void variablize_condition_list (agent* thisAgent, condition *cond);
66 
67 #ifdef __cplusplus
68 //}
69 #endif
70 
71 #endif
72 
73