Soar Kernel  9.3.2 08-06-12
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Data Structures | Macros | Typedefs | Functions
symtab.h File Reference
#include "kernel.h"

Go to the source code of this file.

Data Structures

union  symbol_common_data_struct::a_union
struct  float_constant_struct
struct  identifier_struct
struct  int_constant_struct
struct  sym_constant_struct
struct  symbol_common_data_struct
union  symbol_union
struct  variable_struct

Macros

#define common   var.common_symbol_info
#define FLOAT_CONSTANT_SYMBOL_TYPE   4
#define IDENTIFIER_SYMBOL_TYPE   1
#define INT_CONSTANT_SYMBOL_TYPE   3
#define SYM_CONSTANT_SYMBOL_TYPE   2
#define VARIABLE_SYMBOL_TYPE   0

Typedefs

typedef struct agent_struct agent
typedef char Bool
typedef unsigned char byte
typedef struct cons_struct cons
typedef struct dl_cons_struct dl_cons
typedef uint64_t epmem_hash_id
typedef int64_t epmem_node_id
typedef uint64_t epmem_time_id
typedef struct
float_constant_struct 
float_constant
typedef signed short goal_stack_level
typedef struct identifier_struct identifier
typedef struct int_constant_struct int_constant
typedef cons list
typedef uint64_t smem_hash_id
typedef uint64_t smem_lti_id
typedef struct sym_constant_struct sym_constant
typedef union symbol_union Symbol
typedef struct
symbol_common_data_struct 
symbol_common_data
typedef uint64_t tc_number
typedef struct variable_struct variable

Functions

void create_predefined_symbols (agent *thisAgent)
void deallocate_symbol (agent *thisAgent, Symbol *sym)
Symbolfind_float_constant (agent *thisAgent, double value)
Symbolfind_identifier (agent *thisAgent, char name_letter, uint64_t name_number)
Symbolfind_int_constant (agent *thisAgent, int64_t value)
Symbolfind_sym_constant (agent *thisAgent, const char *name)
Symbolfind_variable (agent *thisAgent, const char *name)
Symbolgenerate_new_sym_constant (agent *thisAgent, const char *prefix, uint64_t *counter)
void init_symbol_tables (agent *thisAgent)
Symbolmake_float_constant (agent *thisAgent, double value)
Symbolmake_int_constant (agent *thisAgent, int64_t value)
Symbolmake_new_identifier (agent *thisAgent, char name_letter, goal_stack_level level, uint64_t name_number=(0))
Symbolmake_sym_constant (agent *thisAgent, char const *name)
Symbolmake_variable (agent *thisAgent, const char *name)
void print_internal_symbols (agent *thisAgent)
void release_predefined_symbols (agent *thisAgent)
void reset_id_and_variable_tc_numbers (agent *thisAgent)
bool reset_id_counters (agent *thisAgent)
void reset_variable_gensym_numbers (agent *thisAgent)
uint64_t symbol_add_ref (Symbol *x)
uint64_t symbol_remove_ref (agent *thisAgent, Symbol *x)

Macro Definition Documentation

#define common   var.common_symbol_info
#define FLOAT_CONSTANT_SYMBOL_TYPE   4

Definition at line 142 of file symtab.h.

#define IDENTIFIER_SYMBOL_TYPE   1

Definition at line 139 of file symtab.h.

#define INT_CONSTANT_SYMBOL_TYPE   3

Definition at line 141 of file symtab.h.

#define SYM_CONSTANT_SYMBOL_TYPE   2

Definition at line 140 of file symtab.h.

#define VARIABLE_SYMBOL_TYPE   0

Definition at line 138 of file symtab.h.

Typedef Documentation

typedef struct agent_struct agent

Definition at line 149 of file symtab.h.

typedef char Bool

Definition at line 144 of file symtab.h.

typedef unsigned char byte

Definition at line 145 of file symtab.h.

typedef struct cons_struct cons

Definition at line 148 of file symtab.h.

typedef struct dl_cons_struct dl_cons

Definition at line 150 of file symtab.h.

typedef uint64_t epmem_hash_id

Definition at line 154 of file symtab.h.

typedef int64_t epmem_node_id

Definition at line 153 of file symtab.h.

typedef uint64_t epmem_time_id

Definition at line 155 of file symtab.h.

typedef signed short goal_stack_level

Definition at line 147 of file symtab.h.

typedef struct identifier_struct identifier
typedef cons list

Definition at line 151 of file symtab.h.

typedef uint64_t smem_hash_id

Definition at line 157 of file symtab.h.

typedef uint64_t smem_lti_id

Definition at line 156 of file symtab.h.

typedef union symbol_union Symbol
typedef uint64_t tc_number

Definition at line 146 of file symtab.h.

typedef struct variable_struct variable

Function Documentation

void create_predefined_symbols ( agent thisAgent)

Definition at line 660 of file symtab.cpp.

References agent_struct::attribute_symbol, agent_struct::choices_symbol, agent_struct::conflict_symbol, agent_struct::constraint_failure_symbol, agent_struct::epmem_sym, agent_struct::epmem_sym_after, agent_struct::epmem_sym_bad_cmd, agent_struct::epmem_sym_before, agent_struct::epmem_sym_cmd, agent_struct::epmem_sym_cue_size, agent_struct::epmem_sym_current, agent_struct::epmem_sym_failure, agent_struct::epmem_sym_graph_match, agent_struct::epmem_sym_graph_match_mapping, agent_struct::epmem_sym_graph_match_mapping_cue, agent_struct::epmem_sym_graph_match_mapping_node, agent_struct::epmem_sym_match_cardinality, agent_struct::epmem_sym_match_score, agent_struct::epmem_sym_memory_id, agent_struct::epmem_sym_negquery, agent_struct::epmem_sym_next, agent_struct::epmem_sym_no, agent_struct::epmem_sym_no_memory, agent_struct::epmem_sym_normalized_match_score, agent_struct::epmem_sym_present_id, agent_struct::epmem_sym_prev, agent_struct::epmem_sym_prohibit, agent_struct::epmem_sym_query, agent_struct::epmem_sym_result, agent_struct::epmem_sym_retrieve, agent_struct::epmem_sym_retrieved, agent_struct::epmem_sym_status, agent_struct::epmem_sym_success, agent_struct::epmem_sym_yes, agent_struct::goal_symbol, agent_struct::impasse_symbol, agent_struct::input_link_symbol, agent_struct::io_symbol, agent_struct::item_count_symbol, agent_struct::item_symbol, make_sym_constant(), make_variable(), agent_struct::multiple_symbol, agent_struct::name_symbol, agent_struct::nil_symbol, agent_struct::no_change_symbol, agent_struct::non_numeric_count_symbol, agent_struct::non_numeric_symbol, agent_struct::none_symbol, agent_struct::o_context_variable, agent_struct::object_symbol, agent_struct::operator_symbol, agent_struct::output_link_symbol, agent_struct::problem_space_symbol, agent_struct::quiescence_symbol, agent_struct::rl_sym_reward, agent_struct::rl_sym_reward_link, agent_struct::rl_sym_value, agent_struct::s_context_variable, agent_struct::smem_sym, agent_struct::smem_sym_bad_cmd, agent_struct::smem_sym_cmd, agent_struct::smem_sym_failure, agent_struct::smem_sym_negquery, agent_struct::smem_sym_prohibit, agent_struct::smem_sym_query, agent_struct::smem_sym_result, agent_struct::smem_sym_retrieve, agent_struct::smem_sym_retrieved, agent_struct::smem_sym_status, agent_struct::smem_sym_store, agent_struct::smem_sym_success, agent_struct::so_context_variable, agent_struct::ss_context_variable, agent_struct::sso_context_variable, agent_struct::sss_context_variable, agent_struct::state_symbol, agent_struct::superstate_symbol, agent_struct::t_symbol, agent_struct::tie_symbol, agent_struct::to_context_variable, agent_struct::ts_context_variable, agent_struct::type_symbol, and agent_struct::wait_symbol.

Referenced by init_soar_agent().

{
thisAgent->problem_space_symbol = make_sym_constant (thisAgent, "problem-space");
thisAgent->state_symbol = make_sym_constant (thisAgent, "state");
thisAgent->operator_symbol = make_sym_constant (thisAgent, "operator");
thisAgent->superstate_symbol = make_sym_constant (thisAgent, "superstate");
thisAgent->io_symbol = make_sym_constant (thisAgent, "io");
thisAgent->object_symbol = make_sym_constant (thisAgent, "object");
thisAgent->attribute_symbol = make_sym_constant (thisAgent, "attribute");
thisAgent->impasse_symbol = make_sym_constant (thisAgent, "impasse");
thisAgent->choices_symbol = make_sym_constant (thisAgent, "choices");
thisAgent->none_symbol = make_sym_constant (thisAgent, "none");
thisAgent->constraint_failure_symbol = make_sym_constant (thisAgent, "constraint-failure");
thisAgent->no_change_symbol = make_sym_constant (thisAgent, "no-change");
thisAgent->multiple_symbol = make_sym_constant (thisAgent, "multiple");
// SBW 5/07
thisAgent->item_count_symbol = make_sym_constant (thisAgent, "item-count");
// NLD 11/11
thisAgent->non_numeric_count_symbol = make_sym_constant( thisAgent, "non-numeric-count" );
thisAgent->conflict_symbol = make_sym_constant (thisAgent, "conflict");
thisAgent->tie_symbol = make_sym_constant (thisAgent, "tie");
thisAgent->item_symbol = make_sym_constant (thisAgent, "item");
thisAgent->non_numeric_symbol = make_sym_constant (thisAgent, "non-numeric");
thisAgent->quiescence_symbol = make_sym_constant (thisAgent, "quiescence");
thisAgent->t_symbol = make_sym_constant (thisAgent, "t");
thisAgent->nil_symbol = make_sym_constant (thisAgent, "nil");
thisAgent->type_symbol = make_sym_constant (thisAgent, "type");
thisAgent->goal_symbol = make_sym_constant (thisAgent, "goal");
thisAgent->name_symbol = make_sym_constant (thisAgent, "name");
thisAgent->ts_context_variable = make_variable (thisAgent, "<ts>");
thisAgent->to_context_variable = make_variable (thisAgent, "<to>");
thisAgent->sss_context_variable = make_variable (thisAgent, "<sss>");
thisAgent->sso_context_variable = make_variable (thisAgent, "<sso>");
thisAgent->ss_context_variable = make_variable (thisAgent, "<ss>");
thisAgent->so_context_variable = make_variable (thisAgent, "<so>");
thisAgent->s_context_variable = make_variable (thisAgent, "<s>");
thisAgent->o_context_variable = make_variable (thisAgent, "<o>");
/* REW: begin 10.24.97 */
thisAgent->wait_symbol = make_variable (thisAgent, "wait");
/* REW: end 10.24.97 */
/* RPM 9/06 begin */
thisAgent->input_link_symbol = make_sym_constant(thisAgent, "input-link");
thisAgent->output_link_symbol = make_sym_constant(thisAgent, "output-link");
/* RPM 9/06 end */
thisAgent->rl_sym_reward_link = make_sym_constant( thisAgent, "reward-link" );
thisAgent->rl_sym_reward = make_sym_constant( thisAgent, "reward" );
thisAgent->rl_sym_value = make_sym_constant( thisAgent, "value" );
thisAgent->epmem_sym = make_sym_constant( thisAgent, "epmem" );
thisAgent->epmem_sym_cmd = make_sym_constant( thisAgent, "command" );
thisAgent->epmem_sym_result = make_sym_constant( thisAgent, "result" );
thisAgent->epmem_sym_retrieved = make_sym_constant( thisAgent, "retrieved" );
thisAgent->epmem_sym_status = make_sym_constant( thisAgent, "status" );
thisAgent->epmem_sym_match_score = make_sym_constant( thisAgent, "match-score" );
thisAgent->epmem_sym_cue_size = make_sym_constant( thisAgent, "cue-size" );
thisAgent->epmem_sym_normalized_match_score = make_sym_constant( thisAgent, "normalized-match-score" );
thisAgent->epmem_sym_match_cardinality = make_sym_constant( thisAgent, "match-cardinality" );
thisAgent->epmem_sym_memory_id = make_sym_constant( thisAgent, "memory-id" );
thisAgent->epmem_sym_present_id = make_sym_constant( thisAgent, "present-id" );
thisAgent->epmem_sym_no_memory = make_sym_constant( thisAgent, "no-memory" );
thisAgent->epmem_sym_graph_match = make_sym_constant( thisAgent, "graph-match" );
thisAgent->epmem_sym_graph_match_mapping = make_sym_constant( thisAgent, "mapping" );
thisAgent->epmem_sym_graph_match_mapping_node = make_sym_constant( thisAgent, "node" );
thisAgent->epmem_sym_graph_match_mapping_cue = make_sym_constant( thisAgent, "cue" );
thisAgent->epmem_sym_success = make_sym_constant( thisAgent, "success" );
thisAgent->epmem_sym_failure = make_sym_constant( thisAgent, "failure" );
thisAgent->epmem_sym_bad_cmd = make_sym_constant( thisAgent, "bad-cmd" );
thisAgent->epmem_sym_retrieve = make_sym_constant( thisAgent, "retrieve" );
thisAgent->epmem_sym_next = make_sym_constant( thisAgent, "next" );
thisAgent->epmem_sym_prev = make_sym_constant( thisAgent, "previous" );
thisAgent->epmem_sym_query = make_sym_constant( thisAgent, "query" );
thisAgent->epmem_sym_negquery = make_sym_constant( thisAgent, "neg-query" );
thisAgent->epmem_sym_before = make_sym_constant( thisAgent, "before" );
thisAgent->epmem_sym_after = make_sym_constant( thisAgent, "after" );
thisAgent->epmem_sym_prohibit = make_sym_constant( thisAgent, "prohibit" );
thisAgent->epmem_sym_current = make_sym_constant( thisAgent, "current" );
thisAgent->epmem_sym_yes = make_sym_constant( thisAgent, "yes" );
thisAgent->epmem_sym_no = make_sym_constant( thisAgent, "no" );
thisAgent->smem_sym = make_sym_constant( thisAgent, "smem" );
thisAgent->smem_sym_cmd = make_sym_constant( thisAgent, "command" );
thisAgent->smem_sym_result = make_sym_constant( thisAgent, "result" );
thisAgent->smem_sym_retrieved = make_sym_constant( thisAgent, "retrieved" );
thisAgent->smem_sym_status = make_sym_constant( thisAgent, "status" );
thisAgent->smem_sym_success = make_sym_constant( thisAgent, "success" );
thisAgent->smem_sym_failure = make_sym_constant( thisAgent, "failure" );
thisAgent->smem_sym_bad_cmd = make_sym_constant( thisAgent, "bad-cmd" );
thisAgent->smem_sym_retrieve = make_sym_constant( thisAgent, "retrieve" );
thisAgent->smem_sym_query = make_sym_constant( thisAgent, "query" );
thisAgent->smem_sym_negquery = make_sym_constant( thisAgent, "neg-query" );
thisAgent->smem_sym_prohibit = make_sym_constant( thisAgent, "prohibit" );
thisAgent->smem_sym_store = make_sym_constant( thisAgent, "store" );
}
void deallocate_symbol ( agent thisAgent,
Symbol sym 
)

Definition at line 451 of file symtab.cpp.

References abort_with_fatal_error(), BUFFER_MSG_SIZE, agent_struct::float_constant_hash_table, agent_struct::float_constant_pool, FLOAT_CONSTANT_SYMBOL_TYPE, free_memory_block_for_string(), agent_struct::identifier_hash_table, agent_struct::identifier_pool, IDENTIFIER_SYMBOL_TYPE, agent_struct::int_constant_hash_table, agent_struct::int_constant_pool, INT_CONSTANT_SYMBOL_TYPE, sym_constant_struct::name, variable_struct::name, print_with_symbols(), remove_from_hash_table(), symbol_union::sc, agent_struct::sym_constant_hash_table, agent_struct::sym_constant_pool, SYM_CONSTANT_SYMBOL_TYPE, symbol_union::var, agent_struct::variable_hash_table, agent_struct::variable_pool, and VARIABLE_SYMBOL_TYPE.

Referenced by symbol_remove_ref().

{
#ifdef DEBUG_SYMBOLS
print_with_symbols (thisAgent, "\nDeallocating Symbol %y", sym);
#endif
switch (sym->common.symbol_type) {
remove_from_hash_table (thisAgent, thisAgent->variable_hash_table, sym);
free_with_pool (&thisAgent->variable_pool, sym);
break;
remove_from_hash_table (thisAgent, thisAgent->identifier_hash_table, sym);
free_with_pool (&thisAgent->identifier_pool, sym);
break;
remove_from_hash_table (thisAgent, thisAgent->sym_constant_hash_table, sym);
free_with_pool (&thisAgent->sym_constant_pool, sym);
break;
remove_from_hash_table (thisAgent, thisAgent->int_constant_hash_table, sym);
free_with_pool (&thisAgent->int_constant_pool, sym);
break;
remove_from_hash_table (thisAgent, thisAgent->float_constant_hash_table, sym);
free_with_pool (&thisAgent->float_constant_pool, sym);
break;
default:
{ char msg[BUFFER_MSG_SIZE];
strncpy (msg, "Internal error: called deallocate_symbol on non-symbol.\n", BUFFER_MSG_SIZE);
msg[BUFFER_MSG_SIZE - 1] = 0; /* ensure null termination */
abort_with_fatal_error(thisAgent, msg);
}
}
}
Symbol* find_float_constant ( agent thisAgent,
double  value 
)

Definition at line 245 of file symtab.cpp.

References hash_table_struct::buckets, symbol_union::fc, agent_struct::float_constant_hash_table, hash_float_constant_raw_info(), hash_table_struct::log2size, NIL, uint32_t(), and float_constant_struct::value.

Referenced by make_float_constant().

{
uint32_t hash_value;
Symbol *sym;
hash_value = hash_float_constant_raw_info (value,
sym = reinterpret_cast<Symbol *>(*(thisAgent->float_constant_hash_table->buckets + hash_value));
for ( ; sym!=NIL; sym = sym->common.next_in_hash_table) {
if (value==sym->fc.value) return sym;
}
return NIL;
}
Symbol* find_identifier ( agent thisAgent,
char  name_letter,
uint64_t  name_number 
)

Definition at line 205 of file symtab.cpp.

References hash_table_struct::buckets, hash_identifier_raw_info(), symbol_union::id, agent_struct::identifier_hash_table, hash_table_struct::log2size, identifier_struct::name_letter, identifier_struct::name_number, NIL, and uint32_t().

Referenced by get_io_identifier(), read_id_or_context_var_from_string(), read_identifier_or_context_variable(), smem_lti_soar_make(), and smem_parse_chunks().

{
uint32_t hash_value;
Symbol *sym;
hash_value = hash_identifier_raw_info (name_letter,name_number,
sym = reinterpret_cast<Symbol *>(*(thisAgent->identifier_hash_table->buckets + hash_value));
for ( ; sym!=NIL; sym = sym->common.next_in_hash_table) {
if ((name_letter==sym->id.name_letter) &&
(name_number==sym->id.name_number)) return sym;
}
return NIL;
}
Symbol* find_int_constant ( agent thisAgent,
int64_t  value 
)

Definition at line 232 of file symtab.cpp.

References hash_table_struct::buckets, hash_int_constant_raw_info(), symbol_union::ic, agent_struct::int_constant_hash_table, hash_table_struct::log2size, NIL, uint32_t(), and int_constant_struct::value.

Referenced by make_int_constant().

{
uint32_t hash_value;
Symbol *sym;
hash_value = hash_int_constant_raw_info (value,
sym = reinterpret_cast<Symbol *>(*(thisAgent->int_constant_hash_table->buckets + hash_value));
for ( ; sym!=NIL; sym = sym->common.next_in_hash_table) {
if (value==sym->ic.value) return sym;
}
return NIL;
}
Symbol* find_sym_constant ( agent thisAgent,
const char *  name 
)
Symbol* find_variable ( agent thisAgent,
const char *  name 
)

Definition at line 193 of file symtab.cpp.

References hash_table_struct::buckets, hash_variable_raw_info(), hash_table_struct::log2size, variable_struct::name, NIL, uint32_t(), symbol_union::var, and agent_struct::variable_hash_table.

Referenced by get_context_var_info(), and make_variable().

{
uint32_t hash_value;
Symbol *sym;
hash_value = hash_variable_raw_info (name,thisAgent->variable_hash_table->log2size);
sym = reinterpret_cast<Symbol *>(*(thisAgent->variable_hash_table->buckets + hash_value));
for ( ; sym!=NIL; sym = sym->common.next_in_hash_table) {
if (!strcmp(sym->var.name,name)) return sym;
}
return NIL;
}
Symbol* generate_new_sym_constant ( agent thisAgent,
const char *  prefix,
uint64_t *  counter 
)

Definition at line 640 of file symtab.cpp.

References find_sym_constant(), GENERATE_NEW_SYM_CONSTANT_BUFFER_SIZE, make_sym_constant(), and TRUE.

Referenced by chunk_instantiation(), generate_chunk_name_sym_constant(), and make_constant_symbol_rhs_function_code().

{
#define GENERATE_NEW_SYM_CONSTANT_BUFFER_SIZE 2000 /* that ought to be long enough! */
Symbol *New;
while (TRUE) {
SNPRINTF (name,GENERATE_NEW_SYM_CONSTANT_BUFFER_SIZE, "%s%lu", prefix, static_cast<long unsigned int>((*counter)++));
if (! find_sym_constant (thisAgent, name)) break;
}
New = make_sym_constant (thisAgent, name);
return New;
}
void init_symbol_tables ( agent thisAgent)

Definition at line 158 of file symtab.cpp.

References agent_struct::float_constant_hash_table, agent_struct::float_constant_pool, hash_float_constant(), hash_identifier(), hash_int_constant(), hash_sym_constant(), hash_variable(), agent_struct::identifier_hash_table, agent_struct::identifier_pool, init_memory_pool(), agent_struct::int_constant_hash_table, agent_struct::int_constant_pool, make_hash_table(), reset_id_counters(), agent_struct::sym_constant_hash_table, agent_struct::sym_constant_pool, agent_struct::variable_hash_table, and agent_struct::variable_pool.

Referenced by init_soar_agent().

{
thisAgent->variable_hash_table = make_hash_table (thisAgent, 0, hash_variable);
init_memory_pool (thisAgent, &thisAgent->variable_pool, sizeof(variable), "variable");
init_memory_pool (thisAgent, &thisAgent->identifier_pool, sizeof(identifier), "identifier");
init_memory_pool (thisAgent, &thisAgent->sym_constant_pool, sizeof(sym_constant), "sym constant");
init_memory_pool (thisAgent, &thisAgent->int_constant_pool, sizeof(int_constant), "int constant");
init_memory_pool (thisAgent, &thisAgent->float_constant_pool, sizeof(float_constant),
"float constant");
reset_id_counters( thisAgent );
}
Symbol* make_float_constant ( agent thisAgent,
double  value 
)

Definition at line 419 of file symtab.cpp.

References add_to_hash_table(), FALSE, symbol_union::fc, find_float_constant(), agent_struct::float_constant_hash_table, agent_struct::float_constant_pool, FLOAT_CONSTANT_SYMBOL_TYPE, get_next_symbol_hash_id(), symbol_add_ref(), symbol_to_string(), and float_constant_struct::value.

Referenced by abs_rhs_function_code(), atan2_rhs_function_code(), cos_rhs_function_code(), dice_prob_rhs_function_code(), epmem_install_memory(), epmem_process_query(), float_rhs_function_code(), fp_divide_rhs_function_code(), get_io_float_constant(), make_symbol_for_current_lexeme(), minus_rhs_function_code(), plus_rhs_function_code(), rand_float_rhs_function_code(), reteload_all_symbols(), rl_perform_update(), round_off_air_rhs_function_code(), round_off_heading_air_rhs_function_code(), sin_rhs_function_code(), smem_parse_chunk(), smem_parse_constant_attr(), smem_reverse_hash(), sqrt_rhs_function_code(), and times_rhs_function_code().

{
Symbol *sym;
sym = find_float_constant(thisAgent, value);
if (sym) {
} else {
allocate_with_pool (thisAgent, &thisAgent->float_constant_pool, &sym);
sym->common.symbol_type = FLOAT_CONSTANT_SYMBOL_TYPE;
sym->common.reference_count = 1;
sym->common.hash_id = get_next_symbol_hash_id(thisAgent);
sym->common.epmem_hash = 0;
sym->common.epmem_valid = 0;
sym->common.smem_hash = 0;
sym->common.smem_valid = 0;
sym->fc.value = value;
add_to_hash_table (thisAgent, thisAgent->float_constant_hash_table, sym);
#ifdef DEBUG_SYMBOL_REFCOUNTS
char buf[64];
OutputDebugString(symbol_to_string(thisAgent, sym, FALSE, buf, 64));
OutputDebugString(":+ \n");
#endif // DEBUG_SYMBOL_REFCOUNTS
}
return sym;
}
Symbol* make_int_constant ( agent thisAgent,
int64_t  value 
)

Definition at line 393 of file symtab.cpp.

References add_to_hash_table(), FALSE, find_int_constant(), get_next_symbol_hash_id(), symbol_union::ic, agent_struct::int_constant_hash_table, agent_struct::int_constant_pool, INT_CONSTANT_SYMBOL_TYPE, symbol_add_ref(), symbol_to_string(), and int_constant_struct::value.

Referenced by abs_rhs_function_code(), compute_heading_rhs_function_code(), compute_range_rhs_function_code(), create_new_impasse(), div_rhs_function_code(), epmem_install_memory(), epmem_new_episode(), epmem_process_query(), get_io_int_constant(), int_rhs_function_code(), make_symbol_for_current_lexeme(), minus_rhs_function_code(), mod_rhs_function_code(), plus_rhs_function_code(), rand_int_rhs_function_code(), reteload_all_symbols(), round_off_air_rhs_function_code(), round_off_heading_air_rhs_function_code(), smem_parse_chunk(), smem_parse_constant_attr(), smem_reverse_hash(), strlen_rhs_function_code(), times_rhs_function_code(), and update_impasse_items().

{
Symbol *sym;
sym = find_int_constant(thisAgent, value);
if (sym) {
} else {
allocate_with_pool (thisAgent, &thisAgent->int_constant_pool, &sym);
sym->common.symbol_type = INT_CONSTANT_SYMBOL_TYPE;
sym->common.reference_count = 1;
sym->common.hash_id = get_next_symbol_hash_id(thisAgent);
sym->common.epmem_hash = 0;
sym->common.epmem_valid = 0;
sym->common.smem_hash = 0;
sym->common.smem_valid = 0;
sym->ic.value = value;
add_to_hash_table (thisAgent, thisAgent->int_constant_hash_table, sym);
#ifdef DEBUG_SYMBOL_REFCOUNTS
char buf[64];
OutputDebugString(symbol_to_string(thisAgent, sym, FALSE, buf, 64));
OutputDebugString(":+ \n");
#endif // DEBUG_SYMBOL_REFCOUNTS
}
return sym;
}
Symbol* make_new_identifier ( agent thisAgent,
char  name_letter,
goal_stack_level  level,
uint64_t  name_number = (0) 
)

Definition at line 283 of file symtab.cpp.

References add_to_hash_table(), identifier_struct::associated_output_links, identifier_struct::could_be_a_link_from_below, identifier_struct::epmem_cmd_header, identifier_struct::epmem_header, identifier_struct::epmem_id, EPMEM_MEMID_NONE, EPMEM_NODEID_BAD, identifier_struct::epmem_result_header, identifier_struct::epmem_time_wme, identifier_struct::epmem_valid, FALSE, identifier_struct::gds, get_next_symbol_hash_id(), identifier_struct::higher_goal, symbol_union::id, agent_struct::id_counter, agent_struct::identifier_hash_table, agent_struct::identifier_pool, IDENTIFIER_SYMBOL_TYPE, identifier_struct::impasse_wmes, identifier_struct::input_wmes, identifier_struct::isa_goal, identifier_struct::isa_impasse, identifier_struct::isa_operator, identifier_struct::level, identifier_struct::link_count, identifier_struct::lower_goal, identifier_struct::ms_i_assertions, identifier_struct::ms_o_assertions, identifier_struct::ms_retractions, identifier_struct::name_letter, identifier_struct::name_number, NIL, NO_SAVED_PRODS, identifier_struct::operator_slot, identifier_struct::preferences_from_goal, identifier_struct::promotion_level, identifier_struct::reward_header, identifier_struct::rl_info, identifier_struct::saved_firing_type, identifier_struct::slots, identifier_struct::smem_cmd_header, identifier_struct::smem_header, identifier_struct::smem_lti, identifier_struct::smem_result_header, identifier_struct::smem_time_id, identifier_struct::smem_valid, symbol_to_string(), identifier_struct::tc_num, and identifier_struct::unknown_level.

Referenced by _epmem_install_id_wme(), create_new_impasse(), deep_copy_rhs_function_code(), epmem_install_memory(), epmem_process_query(), get_io_identifier(), get_new_io_identifier(), instantiate_rhs_value(), recursive_wme_copy(), and smem_lti_soar_make().

{
Symbol *sym;
if (isalpha(name_letter)) {
if (islower(name_letter)) name_letter = static_cast<char>(toupper(name_letter));
} else {
name_letter = 'I';
}
allocate_with_pool (thisAgent, &thisAgent->identifier_pool, &sym);
sym->common.symbol_type = IDENTIFIER_SYMBOL_TYPE;
sym->common.reference_count = 1;
sym->common.hash_id = get_next_symbol_hash_id(thisAgent);
sym->id.name_letter = name_letter;
// NLD: modified for long-term identifiers
if ( name_number == NIL )
{
name_number = thisAgent->id_counter[name_letter-'A']++;
}
else
{
uint64_t *current_number = &( thisAgent->id_counter[ name_letter - 'A' ] );
if ( name_number >= (*current_number) )
{
(*current_number) = ( name_number + 1 );
}
}
sym->id.name_number = name_number;
sym->id.level = level;
sym->id.promotion_level = level;
sym->id.slots = NIL;
sym->id.isa_goal = FALSE;
sym->id.isa_operator = 0;
sym->id.link_count = 0;
sym->id.higher_goal = NIL;
/* REW: begin 09.15.96 */
sym->id.gds = NIL;
/* REW: end 09.15.96 */
/* REW: begin 08.20.97 */
/* REW: end 08.20.97 */
sym->id.lower_goal = NIL;
sym->id.tc_num = 0;
sym->id.input_wmes = NIL;
sym->id.rl_info = NIL;
sym->id.epmem_valid = NIL;
sym->id.smem_header = NIL;
sym->id.smem_lti = NIL;
sym->id.smem_valid = NIL;
add_to_hash_table (thisAgent, thisAgent->identifier_hash_table, sym);
#ifdef DEBUG_SYMBOL_REFCOUNTS
char buf[64];
OutputDebugString(symbol_to_string(thisAgent, sym, FALSE, buf, 64));
OutputDebugString(":+ \n");
#endif // DEBUG_SYMBOL_REFCOUNTS
return sym;
}
Symbol* make_sym_constant ( agent thisAgent,
char const *  name 
)

Definition at line 366 of file symtab.cpp.

References add_to_hash_table(), FALSE, find_sym_constant(), get_next_symbol_hash_id(), make_memory_block_for_string(), sym_constant_struct::name, NIL, sym_constant_struct::production, symbol_union::sc, agent_struct::sym_constant_hash_table, agent_struct::sym_constant_pool, SYM_CONSTANT_SYMBOL_TYPE, symbol_add_ref(), and symbol_to_string().

Referenced by capitalize_symbol_rhs_function_code(), create_predefined_symbols(), crlf_rhs_function_code(), deep_copy_rhs_function_code(), epmem_install_memory(), generate_chunk_name_sym_constant(), generate_new_sym_constant(), get_io_sym_constant(), soar_module::sym_set_param::in_set(), init_built_in_rhs_functions(), init_built_in_rhs_math_functions(), init_soar_agent(), make_constant_symbol_rhs_function_code(), make_symbol_for_current_lexeme(), parse_attribute_path_in_brackets(), parse_production(), reteload_all_symbols(), rl_build_template_instantiation(), soar_module::sym_set_param::set_value(), smem_parse_chunk(), smem_parse_constant_attr(), smem_reverse_hash(), timestamp_rhs_function_code(), and trim_rhs_function_code().

{
Symbol *sym;
sym = find_sym_constant(thisAgent, name);
if (sym) {
} else {
allocate_with_pool (thisAgent, &thisAgent->sym_constant_pool, &sym);
sym->common.symbol_type = SYM_CONSTANT_SYMBOL_TYPE;
sym->common.reference_count = 1;
sym->common.hash_id = get_next_symbol_hash_id(thisAgent);
sym->common.epmem_hash = 0;
sym->common.epmem_valid = 0;
sym->common.smem_hash = 0;
sym->common.smem_valid = 0;
sym->sc.name = make_memory_block_for_string (thisAgent, name);
sym->sc.production = NIL;
add_to_hash_table (thisAgent, thisAgent->sym_constant_hash_table, sym);
#ifdef DEBUG_SYMBOL_REFCOUNTS
char buf[64];
OutputDebugString(symbol_to_string(thisAgent, sym, FALSE, buf, 64));
OutputDebugString(":+ \n");
#endif // DEBUG_SYMBOL_REFCOUNTS
}
return sym;
}
Symbol* make_variable ( agent thisAgent,
const char *  name 
)

Definition at line 258 of file symtab.cpp.

References add_to_hash_table(), FALSE, find_variable(), variable_struct::gensym_number, get_next_symbol_hash_id(), make_memory_block_for_string(), variable_struct::name, NIL, variable_struct::rete_binding_locations, symbol_add_ref(), symbol_to_string(), variable_struct::tc_num, symbol_union::var, agent_struct::variable_hash_table, agent_struct::variable_pool, and VARIABLE_SYMBOL_TYPE.

Referenced by create_predefined_symbols(), generate_new_variable(), make_placeholder_var(), make_symbol_for_current_lexeme(), parse_rhs_action(), and reteload_all_symbols().

{
Symbol *sym;
sym = find_variable(thisAgent, name);
if (sym) {
} else {
allocate_with_pool (thisAgent, &thisAgent->variable_pool, &sym);
sym->common.symbol_type = VARIABLE_SYMBOL_TYPE;
sym->common.reference_count = 1;
sym->common.hash_id = get_next_symbol_hash_id(thisAgent);
sym->var.name = make_memory_block_for_string (thisAgent, name);
sym->var.gensym_number = 0;
sym->var.tc_num = 0;
add_to_hash_table (thisAgent, thisAgent->variable_hash_table, sym);
#ifdef DEBUG_SYMBOL_REFCOUNTS
char buf[64];
OutputDebugString(symbol_to_string(thisAgent, sym, FALSE, buf, 64));
OutputDebugString(":+ \n");
#endif // DEBUG_SYMBOL_REFCOUNTS
}
return sym;
}
void print_internal_symbols ( agent thisAgent)

Definition at line 627 of file symtab.cpp.

References do_for_all_items_in_hash_table(), agent_struct::float_constant_hash_table, agent_struct::identifier_hash_table, agent_struct::int_constant_hash_table, print_string(), print_sym(), agent_struct::sym_constant_hash_table, and agent_struct::variable_hash_table.

{
print_string (thisAgent, "\n--- Symbolic Constants: ---\n");
print_string (thisAgent, "\n--- Integer Constants: ---\n");
print_string (thisAgent, "\n--- Floating-Point Constants: ---\n");
print_string (thisAgent, "\n--- Identifiers: ---\n");
print_string (thisAgent, "\n--- Variables: ---\n");
}
void release_predefined_symbols ( agent thisAgent)

Definition at line 770 of file symtab.cpp.

References agent_struct::attribute_symbol, agent_struct::choices_symbol, agent_struct::conflict_symbol, agent_struct::constraint_failure_symbol, agent_struct::epmem_sym, agent_struct::epmem_sym_after, agent_struct::epmem_sym_bad_cmd, agent_struct::epmem_sym_before, agent_struct::epmem_sym_cmd, agent_struct::epmem_sym_cue_size, agent_struct::epmem_sym_current, agent_struct::epmem_sym_failure, agent_struct::epmem_sym_graph_match, agent_struct::epmem_sym_graph_match_mapping, agent_struct::epmem_sym_graph_match_mapping_cue, agent_struct::epmem_sym_graph_match_mapping_node, agent_struct::epmem_sym_match_cardinality, agent_struct::epmem_sym_match_score, agent_struct::epmem_sym_memory_id, agent_struct::epmem_sym_negquery, agent_struct::epmem_sym_next, agent_struct::epmem_sym_no, agent_struct::epmem_sym_no_memory, agent_struct::epmem_sym_normalized_match_score, agent_struct::epmem_sym_present_id, agent_struct::epmem_sym_prev, agent_struct::epmem_sym_prohibit, agent_struct::epmem_sym_query, agent_struct::epmem_sym_result, agent_struct::epmem_sym_retrieve, agent_struct::epmem_sym_retrieved, agent_struct::epmem_sym_status, agent_struct::epmem_sym_success, agent_struct::epmem_sym_yes, agent_struct::goal_symbol, agent_struct::impasse_symbol, agent_struct::input_link_symbol, agent_struct::io_symbol, agent_struct::item_count_symbol, agent_struct::item_symbol, agent_struct::multiple_symbol, agent_struct::name_symbol, agent_struct::nil_symbol, agent_struct::no_change_symbol, agent_struct::non_numeric_count_symbol, agent_struct::non_numeric_symbol, agent_struct::none_symbol, agent_struct::o_context_variable, agent_struct::object_symbol, agent_struct::operator_symbol, agent_struct::output_link_symbol, agent_struct::problem_space_symbol, agent_struct::quiescence_symbol, release_helper(), agent_struct::rl_sym_reward, agent_struct::rl_sym_reward_link, agent_struct::rl_sym_value, agent_struct::s_context_variable, agent_struct::smem_sym, agent_struct::smem_sym_bad_cmd, agent_struct::smem_sym_cmd, agent_struct::smem_sym_failure, agent_struct::smem_sym_negquery, agent_struct::smem_sym_prohibit, agent_struct::smem_sym_query, agent_struct::smem_sym_result, agent_struct::smem_sym_retrieve, agent_struct::smem_sym_retrieved, agent_struct::smem_sym_status, agent_struct::smem_sym_store, agent_struct::smem_sym_success, agent_struct::so_context_variable, agent_struct::ss_context_variable, agent_struct::sso_context_variable, agent_struct::sss_context_variable, agent_struct::state_symbol, agent_struct::superstate_symbol, agent_struct::t_symbol, agent_struct::tie_symbol, agent_struct::to_context_variable, agent_struct::ts_context_variable, agent_struct::type_symbol, and agent_struct::wait_symbol.

Referenced by destroy_soar_agent().

{
release_helper(thisAgent,&(thisAgent->problem_space_symbol));
release_helper(thisAgent,&(thisAgent->state_symbol));
release_helper(thisAgent,&(thisAgent->operator_symbol));
release_helper(thisAgent,&(thisAgent->superstate_symbol));
release_helper(thisAgent,&(thisAgent->io_symbol));
release_helper(thisAgent,&(thisAgent->object_symbol));
release_helper(thisAgent,&(thisAgent->attribute_symbol));
release_helper(thisAgent,&(thisAgent->impasse_symbol));
release_helper(thisAgent,&(thisAgent->choices_symbol));
release_helper(thisAgent,&(thisAgent->none_symbol));
release_helper(thisAgent,&(thisAgent->constraint_failure_symbol));
release_helper(thisAgent,&(thisAgent->no_change_symbol));
release_helper(thisAgent,&(thisAgent->multiple_symbol));
release_helper(thisAgent,&(thisAgent->conflict_symbol));
release_helper(thisAgent,&(thisAgent->tie_symbol));
release_helper(thisAgent,&(thisAgent->item_symbol));
release_helper(thisAgent,&(thisAgent->non_numeric_symbol));
release_helper(thisAgent,&(thisAgent->quiescence_symbol));
release_helper(thisAgent,&(thisAgent->t_symbol));
release_helper(thisAgent,&(thisAgent->nil_symbol));
release_helper(thisAgent,&(thisAgent->type_symbol));
release_helper(thisAgent,&(thisAgent->goal_symbol));
release_helper(thisAgent,&(thisAgent->name_symbol));
release_helper(thisAgent,&(thisAgent->ts_context_variable));
release_helper(thisAgent,&(thisAgent->to_context_variable));
release_helper(thisAgent,&(thisAgent->sss_context_variable));
release_helper(thisAgent,&(thisAgent->sso_context_variable));
release_helper(thisAgent,&(thisAgent->ss_context_variable));
release_helper(thisAgent,&(thisAgent->so_context_variable));
release_helper(thisAgent,&(thisAgent->s_context_variable));
release_helper(thisAgent,&(thisAgent->o_context_variable));
// SBW 5/07
release_helper(thisAgent,&(thisAgent->item_count_symbol));
// NLD 11/11
release_helper(thisAgent,&(thisAgent->non_numeric_count_symbol));
/* REW: begin 10.24.97 */
release_helper(thisAgent,&(thisAgent->wait_symbol));
/* REW: end 10.24.97 */
/* RPM 9/06 begin */
release_helper(thisAgent,&(thisAgent->input_link_symbol));
release_helper(thisAgent,&(thisAgent->output_link_symbol));
/* RPM 9/06 end */
release_helper( thisAgent, &( thisAgent->rl_sym_reward_link ) );
release_helper( thisAgent, &( thisAgent->rl_sym_reward ) );
release_helper( thisAgent, &( thisAgent->rl_sym_value ) );
release_helper( thisAgent, &( thisAgent->epmem_sym ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_cmd ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_result ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_retrieved ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_status ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_match_score ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_cue_size ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_normalized_match_score ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_match_cardinality ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_memory_id ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_present_id ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_no_memory ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_graph_match ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_graph_match_mapping ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_graph_match_mapping_node ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_graph_match_mapping_cue ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_success ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_failure ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_bad_cmd ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_retrieve ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_next ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_prev ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_query ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_negquery ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_before ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_after ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_prohibit ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_current ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_yes ) );
release_helper( thisAgent, &( thisAgent->epmem_sym_no ) );
release_helper( thisAgent, &( thisAgent->smem_sym ) );
release_helper( thisAgent, &( thisAgent->smem_sym_cmd ) );
release_helper( thisAgent, &( thisAgent->smem_sym_result ) );
release_helper( thisAgent, &( thisAgent->smem_sym_retrieved ) );
release_helper( thisAgent, &( thisAgent->smem_sym_status ) );
release_helper( thisAgent, &( thisAgent->smem_sym_success ) );
release_helper( thisAgent, &( thisAgent->smem_sym_failure ) );
release_helper( thisAgent, &( thisAgent->smem_sym_bad_cmd ) );
release_helper( thisAgent, &( thisAgent->smem_sym_retrieve ) );
release_helper( thisAgent, &( thisAgent->smem_sym_query ) );
release_helper( thisAgent, &( thisAgent->smem_sym_negquery ) );
release_helper( thisAgent, &( thisAgent->smem_sym_prohibit ) );
release_helper( thisAgent, &( thisAgent->smem_sym_store ) );
}
void reset_id_and_variable_tc_numbers ( agent thisAgent)
bool reset_id_counters ( agent thisAgent)

Definition at line 554 of file symtab.cpp.

References soar_module::connected, hash_table_struct::count, do_for_all_items_in_hash_table(), soar_module::status_object< T >::get_status(), agent_struct::id_counter, agent_struct::identifier_hash_table, print(), print_identifier_ref_info(), smem_count_ltis(), agent_struct::smem_db, smem_reset_id_counters(), and xml_generate_warning().

Referenced by init_symbol_tables(), and reinitialize_soar().

{
int i;
if (thisAgent->identifier_hash_table->count != 0) {
// As long as all of the existing identifiers are long term identifiers (lti), there's no problem
uint64_t ltis = 0;
if (static_cast<uint64_t>(thisAgent->identifier_hash_table->count) != ltis) {
print (thisAgent, "Internal warning: wanted to reset identifier generator numbers, but\n");
print (thisAgent, "there are still some identifiers allocated. (Probably a memory leak.)\n");
print (thisAgent, "(Leaving identifier numbers alone.)\n");
xml_generate_warning(thisAgent, "Internal warning: wanted to reset identifier generator numbers, but\nthere are still some identifiers allocated. (Probably a memory leak.)\n(Leaving identifier numbers alone.)");
/* RDF 01272003: Added this to improve the output from this error message */
//TODO: append this to previous XML string or generate separate output?
// Also dump the ids to a txt file
FILE *ids = fopen("leaked-ids.txt", "w") ;
if (ids)
{
do_for_all_items_in_hash_table( thisAgent, thisAgent->identifier_hash_table, print_identifier_ref_info, reinterpret_cast<void*>(ids));
fclose(ids) ;
}
return false;
}
// Getting here means that there are still identifiers but that
// they are all long-term and (hopefully) exist only in production memory.
}
for (i=0; i<26; i++) thisAgent->id_counter[i]=1;
if ( thisAgent->smem_db->get_status() == soar_module::connected )
{
smem_reset_id_counters( thisAgent );
}
return true ;
}
void reset_variable_gensym_numbers ( agent thisAgent)
uint64_t symbol_add_ref ( Symbol x)
inline

Definition at line 392 of file symtab.h.

References common, FALSE, and symbol_to_string().

Referenced by accept_rhs_function_code(), add_rete_test_list_to_tests(), add_rete_tests_for_test(), add_trace_format(), add_var_to_varnames(), add_wme_to_rete(), collect_nots(), copy_and_variablize_result_list(), copy_rhs_value(), copy_rhs_value_and_substitute_varnames(), copy_symbol_list_adding_references(), copy_test(), epmem_buffer_add_wme(), epmem_schedule_promotion(), find_or_make_alpha_mem(), fixup_rhs_value_variable_references(), float_rhs_function_code(), get_io_identifier(), get_nots_for_instantiated_conditions(), ifeq_rhs_function_code(), instantiate_rhs_value(), int_rhs_function_code(), make_clones_of_results(), soar_module::make_fake_instantiation(), make_fake_preference_for_goal_item(), make_float_constant(), make_int_constant(), make_slot(), make_sym_constant(), make_variable(), make_wme(), mark_id_and_tc_as_unknown_level(), parse_preferences(), parse_preferences_soar8_non_operator(), post_link_addition(), post_link_removal(), recursive_wme_copy(), remove_wme_from_rete(), reteload_node_and_children(), reteload_rete_test(), reteload_rhs_value(), reteload_varnames(), rl_make_simple_action(), simplify_test(), smem_buffer_add_wme(), smem_lti_soar_make(), substitute_for_placeholders_in_symbol(), variablize_nots_and_insert_into_conditions(), and variablize_symbol().

{
(x)->common.reference_count++;
uint64_t refCount = (x)->common.reference_count ;
#ifdef DEBUG_SYMBOL_REFCOUNTS
char buf[64];
OutputDebugString(symbol_to_string(0, x, FALSE, buf, 64));
OutputDebugString(":+ ");
OutputDebugString(_itoa(refCount, buf, 10));
OutputDebugString("\n");
#endif // DEBUG_SYMBOL_REFCOUNTS
return refCount ;
}
uint64_t symbol_remove_ref ( agent thisAgent,
Symbol x 
)
inline

Definition at line 406 of file symtab.h.

References common, deallocate_symbol(), FALSE, and symbol_to_string().

Referenced by _epmem_install_id_wme(), add_gensymmed_equality_test(), chunk_instantiation(), create_new_impasse(), deallocate_instantiation(), deallocate_list_of_nots(), deallocate_preference(), deallocate_production(), deallocate_rete_test_list(), deallocate_rhs_value(), deallocate_symbol_list_removing_references(), deallocate_test(), deallocate_varnames(), deallocate_wme(), destroy_soar_agent(), do_demotion(), do_promotion(), epmem_close(), epmem_install_memory(), epmem_new_episode(), epmem_process_query(), epmem_respond_to_cmd(), execute_action(), fixup_rhs_value_variable_references(), generate_new_variable(), soar_module::sym_set_param::in_set(), init_soar_agent(), instantiate_rhs_value(), parse_attr_value_make(), parse_production(), parse_rhs_action(), quickly_deallocate_test(), release_helper(), release_io_symbol(), remove_existing_attribute_impasse_for_slot(), remove_existing_context_and_descendents(), remove_garbage_slots(), remove_output_link_tc_info(), remove_ref_to_alpha_mem(), remove_rhs_function(), remove_trace_format(), restore_saved_tests_to_test(), reteload_free_symbol_table(), rl_build_template_instantiation(), rl_perform_update(), soar_module::sym_set_param::set_value(), smem_deallocate_chunk(), smem_install_memory(), smem_parse_chunk(), smem_respond_to_cmd(), substitute_for_placeholders_in_symbol(), update_impasse_items(), variablize_symbol(), walk_and_update_levels(), and soar_module::sym_set_param::~sym_set_param().

{
(x)->common.reference_count--;
uint64_t refCount = (x)->common.reference_count ;
#ifdef DEBUG_SYMBOL_REFCOUNTS
char buf[64];
OutputDebugString(symbol_to_string(thisAgent, x, FALSE, buf, 64));
OutputDebugString(":- ");
OutputDebugString(_itoa(refCount, buf, 10));
OutputDebugString("\n");
#endif // DEBUG_SYMBOL_REFCOUNTS
if ((x)->common.reference_count == 0)
deallocate_symbol(thisAgent, x);
return refCount ;
}