Soar Kernel
9.3.2 08-06-12
|
#include <stdio.h>
Go to the source code of this file.
Data Structures | |
union | token_struct::token_a_union |
struct | token_struct::token_a_union::token_from_right_memory_of_negative_or_cn_node_struct |
struct | token_struct::token_a_union::token_in_hash_table_data_struct |
struct | token_struct |
Macros | |
#define | DUPLICATE_PRODUCTION 3 /* the prod. was a duplicate */ |
#define | NO_REFRACTED_INST 0 /* no refracted inst. was given */ |
#define | REFRACTED_INST_DID_NOT_MATCH 2 /* there was no match for it */ |
#define | REFRACTED_INST_MATCHED 1 /* there was a match for the inst. */ |
Typedefs | |
typedef struct action_struct | action |
typedef struct agent_struct | agent |
typedef char | Bool |
typedef unsigned char | byte |
typedef struct condition_struct | condition |
typedef struct instantiation_struct | instantiation |
typedef byte | ms_trace_type |
typedef struct production_struct | production |
typedef struct rete_node_struct | rete_node |
typedef union symbol_union | Symbol |
typedef struct token_struct | token |
typedef struct wme_struct | wme |
typedef byte | wme_trace_type |
#define DUPLICATE_PRODUCTION 3 /* the prod. was a duplicate */ |
Definition at line 119 of file rete.h.
Referenced by add_production_to_rete(), chunk_instantiation(), parse_production(), and rl_build_template_instantiation().
#define NO_REFRACTED_INST 0 /* no refracted inst. was given */ |
Definition at line 116 of file rete.h.
Referenced by add_production_to_rete().
#define REFRACTED_INST_DID_NOT_MATCH 2 /* there was no match for it */ |
Definition at line 118 of file rete.h.
Referenced by add_production_to_rete(), and chunk_instantiation().
#define REFRACTED_INST_MATCHED 1 /* there was a match for the inst. */ |
Definition at line 117 of file rete.h.
Referenced by add_production_to_rete(), and chunk_instantiation().
typedef struct action_struct action |
typedef struct agent_struct agent |
typedef struct condition_struct condition |
typedef struct instantiation_struct instantiation |
typedef byte ms_trace_type |
typedef struct production_struct production |
typedef struct rete_node_struct rete_node |
typedef union symbol_union Symbol |
typedef struct token_struct token |
typedef struct wme_struct wme |
typedef byte wme_trace_type |
byte add_production_to_rete | ( | agent * | thisAgent, |
production * | p, | ||
condition * | lhs_top, | ||
instantiation * | refracted_inst, | ||
Bool | warn_on_duplicates, | ||
Bool | ignore_rhs = false |
||
) |
Definition at line 3709 of file rete.cpp.
References production_struct::action_list, adjust_sharing_factors_from_here_to_top, production_struct::already_fired, action_struct::attr, rete_node_struct::b, build_network_for_condition_list(), CHUNK_PRODUCTION_TYPE, rl_param_container::chunk_stop, deallocate_symbol_list_removing_references(), destructively_reverse_list(), discard_chunk_varnames, agent_struct::dummy_top_node, DUPLICATE_PRODUCTION, rete_node_struct::first_child, fixup_rhs_value_variable_references(), get_new_tc_number(), get_nvn_for_condition_list(), soar_module::constant_param< T >::get_value(), ms_change_struct::goal, action_struct::id, symbol_union::id, insert_at_head_of_dll, ms_change_struct::inst, production_struct::instantiations, ms_change_struct::level, MAKE_ACTION, make_new_production_node(), agent_struct::ms_change_pool, agent_struct::ms_retractions, identifier_struct::ms_retractions, production_struct::name, action_struct::next, rete_node_struct::next_sibling, NIL, agent_struct::nil_goal_retractions, NO_REFRACTED_INST, rete_node_struct::node_type, soar_module::on, rete_node_struct::rete_node_b_union::p, P_BNODE, ms_change_struct::p_node, production_struct::p_node, p_node_data_struct::parents_nvn, pop_bindings_and_deallocate_list_of_variables(), preference_is_binary(), action_struct::preference_type, print_with_symbols(), instantiation_struct::prod, p_node_data_struct::prod, PRODUCTION_JUST_ADDED_CALLBACK, action_struct::referent, REFRACTED_INST_DID_NOT_MATCH, REFRACTED_INST_MATCHED, remove_from_dll, instantiation_struct::rete_token, instantiation_struct::rete_wme, production_struct::rhs_unbound_variables, agent_struct::rl_params, same_rhs(), soar_invoke_callbacks(), symbol_to_string(), p_node_data_struct::tentative_retractions, TRUE, production_struct::type, action_struct::type, update_max_rhs_unbound_variables(), update_node_with_matches_from_above(), action_struct::value, and xml_generate_warning().
Referenced by chunk_instantiation(), parse_production(), and rl_build_template_instantiation().
Definition at line 1556 of file rete.cpp.
References wme_struct::acceptable, add_wme_to_aht(), agent_struct::all_wmes_in_rete, agent_struct::alpha_hash_tables, wme_struct::attr, soar_module::connected, agent_struct::epmem_db, wme_struct::epmem_id, identifier_struct::epmem_id, agent_struct::epmem_id_ref_counts, EPMEM_NODEID_BAD, wme_struct::epmem_valid, identifier_struct::epmem_valid, agent_struct::epmem_validation, agent_struct::epmem_wme_adds, soar_module::status_object< T >::get_status(), soar_module::constant_param< T >::get_value(), wme_struct::id, symbol_union::id, IDENTIFIER_SYMBOL_TYPE, insert_at_head_of_dll, smem_param_container::mirroring, NIL, agent_struct::num_wmes_in_rete, soar_module::on, wme_struct::right_mems, agent_struct::smem_changed_ids, smem_enabled(), agent_struct::smem_ignore_changes, identifier_struct::smem_lti, agent_struct::smem_params, symbol_add_ref(), wme_struct::tokens, uint32_t(), wme_struct::value, and xor_op().
Referenced by do_buffered_wm_changes().
Definition at line 1097 of file rete.cpp.
References agent_struct::bottom_goal, FALSE, identifier_struct::higher_goal, symbol_union::id, identifier_struct::ms_i_assertions, identifier_struct::ms_o_assertions, identifier_struct::ms_retractions, agent_struct::nil_goal_retractions, and TRUE.
Referenced by determine_highest_active_production_level_in_stack_apply().
void consume_last_postponed_assertion | ( | agent * | thisAgent | ) |
Definition at line 1215 of file rete.cpp.
References agent_struct::ms_change_pool, agent_struct::postponed_assertions, and remove_from_dll.
Referenced by do_preference_phase().
uint64_t count_rete_tokens_for_production | ( | agent * | thisAgent, |
production * | prod | ||
) |
Definition at line 7664 of file rete.cpp.
References rete_node_struct::a, rete_node_struct::b, rete_node_struct::rete_node_b_union::cn, CN_BNODE, agent_struct::dummy_top_node, token_struct::next_of_node, NIL, rete_node_struct::node_type, rete_node_struct::rete_node_a_union::np, production_struct::p_node, rete_node_struct::parent, cn_node_data_struct::partner, POSITIVE_BNODE, non_pos_node_data_struct::tokens, and UNHASHED_POSITIVE_BNODE.
void excise_production_from_rete | ( | agent * | thisAgent, |
production * | p | ||
) |
Definition at line 3910 of file rete.cpp.
References rete_node_struct::a, adjust_sharing_factors_from_here_to_top, rete_node_struct::b, deallocate_node_varnames(), deallocate_rete_node(), agent_struct::dummy_top_node, rete_node_struct::first_child, ms_change_struct::next_of_node, NIL, rete_node_struct::rete_node_a_union::np, rete_node_struct::rete_node_b_union::p, ms_change_struct::p_node, production_struct::p_node, rete_node_struct::parent, node_varnames_struct::parent, p_node_data_struct::parents_nvn, PRODUCTION_JUST_ABOUT_TO_BE_EXCISED_CALLBACK, remove_node_from_parents_list_of_children(), remove_token_and_subtree(), agent_struct::rete_node_pool, soar_invoke_callbacks(), p_node_data_struct::tentative_retractions, non_pos_node_data_struct::tokens, and update_stats_for_destroying_node().
Referenced by excise_production().
void get_all_node_count_stats | ( | agent * | thisAgent | ) |
Definition at line 7729 of file rete.cpp.
References agent_struct::actual, DUMMY_MATCHES_BNODE, agent_struct::if_no_merging, agent_struct::if_no_sharing, init_bnode_type_names(), MEMORY_BNODE, MP_BNODE, POSITIVE_BNODE, agent_struct::rete_node_counts, agent_struct::rete_node_counts_if_no_sharing, UNHASHED_MEMORY_BNODE, UNHASHED_MP_BNODE, and UNHASHED_POSITIVE_BNODE.
Referenced by get_node_count_statistic().
Bool get_next_nil_goal_retraction | ( | agent * | thisAgent, |
struct instantiation_struct ** | inst | ||
) |
Definition at line 1292 of file rete.cpp.
References rete_node_struct::b, FALSE, ms_change_struct::inst, agent_struct::ms_change_pool, agent_struct::ms_retractions, agent_struct::nil_goal_retractions, rete_node_struct::rete_node_b_union::p, ms_change_struct::p_node, remove_from_dll, p_node_data_struct::tentative_retractions, and TRUE.
Referenced by do_preference_phase().
Bool get_next_retraction | ( | agent * | thisAgent, |
struct instantiation_struct ** | inst | ||
) |
Definition at line 1256 of file rete.cpp.
References agent_struct::active_goal, agent_struct::active_level, rete_node_struct::b, FALSE, symbol_union::id, ms_change_struct::inst, agent_struct::ms_change_pool, agent_struct::ms_retractions, identifier_struct::ms_retractions, rete_node_struct::rete_node_b_union::p, ms_change_struct::p_node, remove_from_dll, p_node_data_struct::tentative_retractions, and TRUE.
Referenced by do_preference_phase().
int get_node_count_statistic | ( | agent * | thisAgent, |
char * | node_type_name, | ||
char * | column_name, | ||
uint64_t * | result | ||
) |
Definition at line 7771 of file rete.cpp.
References agent_struct::actual, bnode_type_names, get_all_node_count_stats(), agent_struct::if_no_merging, and agent_struct::if_no_sharing.
Symbol* get_symbol_from_rete_loc | ( | unsigned short | levels_up, |
byte | field_num, | ||
struct token_struct * | tok, | ||
wme * | w | ||
) |
Definition at line 4573 of file rete.cpp.
References wme_struct::attr, wme_struct::id, token_struct::parent, wme_struct::value, and token_struct::w.
Referenced by calculate_support_for_instantiation_preferences(), instantiate_rhs_value(), p_node_left_addition(), and shouldCreateInstantiation().
void init_rete | ( | agent * | thisAgent | ) |
Definition at line 9049 of file rete.cpp.
References allocate_memory_and_zerofill(), agent_struct::alpha_hash_tables, agent_struct::alpha_mem_pool, constant_equal_rete_test_routine(), constant_greater_or_equal_rete_test_routine(), constant_greater_rete_test_routine(), constant_less_or_equal_rete_test_routine(), constant_less_rete_test_routine(), constant_not_equal_rete_test_routine(), CONSTANT_RELATIONAL_RETE_TEST, constant_same_type_rete_test_routine(), DISJUNCTION_RETE_TEST, disjunction_rete_test_routine(), FALSE, hash_alpha_mem(), HASH_TABLE_MEM_USAGE, ID_IS_GOAL_RETE_TEST, id_is_goal_rete_test_routine(), ID_IS_IMPASSE_RETE_TEST, id_is_impasse_rete_test_routine(), init_bnode_type_names(), init_dummy_top_node(), init_left_and_right_addition_routines(), init_memory_pool(), init_test_type_conversion_tables(), agent_struct::left_ht, LEFT_HT_SIZE, make_hash_table(), agent_struct::max_rhs_unbound_variables, MISCELLANEOUS_MEM_USAGE, agent_struct::ms_change_pool, agent_struct::node_varnames_pool, RELATIONAL_EQUAL_RETE_TEST, RELATIONAL_GREATER_OR_EQUAL_RETE_TEST, RELATIONAL_GREATER_RETE_TEST, RELATIONAL_LESS_OR_EQUAL_RETE_TEST, RELATIONAL_LESS_RETE_TEST, RELATIONAL_NOT_EQUAL_RETE_TEST, RELATIONAL_SAME_TYPE_RETE_TEST, agent_struct::rete_node_pool, agent_struct::rete_test_pool, agent_struct::rhs_variable_bindings, agent_struct::right_ht, RIGHT_HT_SIZE, agent_struct::right_mem_pool, agent_struct::token_pool, TRUE, variable_equal_rete_test_routine(), variable_greater_or_equal_rete_test_routine(), variable_greater_rete_test_routine(), variable_less_or_equal_rete_test_routine(), variable_less_rete_test_routine(), variable_not_equal_rete_test_routine(), VARIABLE_RELATIONAL_RETE_TEST, and variable_same_type_rete_test_routine().
Referenced by init_soar_agent().
Definition at line 7568 of file rete.cpp.
References agent_struct::all_wmes_in_rete, agent_struct::dummy_top_node, excise_all_productions(), FALSE, init_agent_memory(), NUM_PRODUCTION_TYPES, agent_struct::num_productions_of_type, print(), reinitialize_soar(), rete_fs_file, rete_net_64, reteload_all_symbols(), reteload_alpha_memories(), reteload_eight_bytes(), reteload_free_am_table(), reteload_free_symbol_table(), reteload_node_and_children(), reteload_one_byte(), reteload_string(), reteload_string_buf, and TRUE.
void p_node_to_conditions_and_nots | ( | agent * | thisAgent, |
struct rete_node_struct * | p_node, | ||
struct token_struct * | tok, | ||
wme * | w, | ||
condition ** | dest_top_cond, | ||
condition ** | dest_bottom_cond, | ||
not_struct ** | dest_nots, | ||
action ** | dest_rhs | ||
) |
Definition at line 4525 of file rete.cpp.
References production_struct::action_list, rete_node_struct::b, copy_action_list_and_substitute_varnames(), agent_struct::dummy_top_node, cons_struct::first, agent_struct::highest_rhs_unboundvar_index, NIL, rete_node_struct::rete_node_b_union::p, rete_node_struct::parent, p_node_data_struct::parents_nvn, p_node_data_struct::prod, reset_variable_generator(), cons_struct::rest, rete_node_to_conditions(), production_struct::rhs_unbound_variables, and agent_struct::rhs_variable_bindings.
Referenced by create_instantiation(), print_partial_match_information(), print_production(), rl_build_template_instantiation(), and xml_partial_match_information().
Bool postpone_assertion | ( | agent * | thisAgent, |
production ** | prod, | ||
struct token_struct ** | tok, | ||
wme ** | w | ||
) |
Definition at line 1147 of file rete.cpp.
References agent_struct::active_goal, rete_node_struct::b, FALSE, agent_struct::FIRING_TYPE, symbol_union::id, insert_at_head_of_dll, identifier_struct::ms_i_assertions, agent_struct::ms_i_assertions, identifier_struct::ms_o_assertions, agent_struct::ms_o_assertions, NIL, rete_node_struct::rete_node_b_union::p, ms_change_struct::p_node, PE_PRODS, agent_struct::postponed_assertions, p_node_data_struct::prod, remove_from_dll, p_node_data_struct::tentative_assertions, ms_change_struct::tok, TRUE, and ms_change_struct::w.
Referenced by do_preference_phase().
void print_match_set | ( | agent * | thisAgent, |
wme_trace_type | wtt, | ||
ms_trace_type | mst | ||
) |
Definition at line 8073 of file rete.cpp.
References allocate_memory(), rete_node_struct::b, free_memory(), ms_change_struct::goal, match_set_trace::goal, in_ms_trace_same_goal(), ms_change_struct::inst, MISCELLANEOUS_MEM_USAGE, MS_ASSERT, MS_ASSERT_RETRACT, agent_struct::ms_i_assertions, agent_struct::ms_o_assertions, MS_RETRACT, agent_struct::ms_retractions, production_struct::name, ms_change_struct::next, match_set_trace::next, NIL, NONE_WME_TRACE, rete_node_struct::rete_node_b_union::p, ms_change_struct::p_node, token_struct::parent, print(), print_instantiation_with_wmes(), print_whole_token(), print_with_symbols(), instantiation_struct::prod, p_node_data_struct::prod, match_set_trace::sym, ms_change_struct::tok, ms_change_struct::w, and token_struct::w.
void print_partial_match_information | ( | agent * | thisAgent, |
struct rete_node_struct * | p_node, | ||
wme_trace_type | wtt | ||
) |
Definition at line 8017 of file rete.cpp.
References deallocate_condition_list(), deallocate_token_list(), agent_struct::dummy_top_node, get_all_left_tokens_emerging_from_node(), token_struct::next_of_node, NIL, NONE_WME_TRACE, p_node_to_conditions_and_nots(), rete_node_struct::parent, ppmi_aux(), print(), and print_whole_token().
Definition at line 1740 of file rete.cpp.
References _epmem_process_ids(), _epmem_remove_wme(), token_struct::a, agent_struct::all_wmes_in_rete, right_mem_struct::am, rete_node_struct::b, alpha_mem_struct::beta_nodes, soar_module::connected, agent_struct::epmem_db, FALSE, rete_node_struct::first_child, soar_module::status_object< T >::get_status(), soar_module::constant_param< T >::get_value(), wme_struct::id, symbol_union::id, left_addition_routines(), token_struct::token_a_union::token_from_right_memory_of_negative_or_cn_node_struct::left_token, make_mp_bnode_left_unlinked(), smem_param_container::mirroring, MP_BNODE, token_struct::token_a_union::neg, token_struct::negrm_tokens, posneg_node_data_struct::next_from_alpha_mem, rete_node_struct::next_sibling, NIL, token_struct::node, rete_node_struct::node_type, agent_struct::num_wmes_in_rete, soar_module::on, token_struct::parent, POSITIVE_BNODE, rete_node_struct::rete_node_b_union::posneg, remove_from_dll, remove_token_and_subtree(), remove_wme_from_alpha_mem(), wme_struct::right_mems, alpha_mem_struct::right_mems, right_node_activation(), agent_struct::smem_changed_ids, smem_enabled(), agent_struct::smem_ignore_changes, identifier_struct::smem_lti, agent_struct::smem_params, symbol_add_ref(), agent_struct::token_pool, wme_struct::tokens, UNHASHED_MP_BNODE, UNHASHED_POSITIVE_BNODE, and unlink_from_left_mem.
Referenced by do_buffered_wm_changes().
void restore_postponed_assertions | ( | agent * | thisAgent | ) |
Definition at line 1227 of file rete.cpp.
References agent_struct::active_goal, rete_node_struct::b, agent_struct::FIRING_TYPE, symbol_union::id, insert_at_head_of_dll, identifier_struct::ms_i_assertions, agent_struct::ms_i_assertions, identifier_struct::ms_o_assertions, agent_struct::ms_o_assertions, NIL, rete_node_struct::rete_node_b_union::p, ms_change_struct::p_node, PE_PRODS, agent_struct::postponed_assertions, remove_from_dll, and p_node_data_struct::tentative_assertions.
Referenced by do_preference_phase().
Definition at line 7548 of file rete.cpp.
References agent_struct::all_productions_of_type, agent_struct::dummy_top_node, FALSE, JUSTIFICATION_PRODUCTION_TYPE, print(), rete_fs_file, rete_net_64, retesave_alpha_memories(), retesave_children_of_node(), retesave_one_byte(), retesave_string(), retesave_symbol_table(), and TRUE.
void xml_match_set | ( | agent * | thisAgent, |
wme_trace_type | wtt, | ||
ms_trace_type | mst | ||
) |
Definition at line 8660 of file rete.cpp.
References allocate_memory(), rete_node_struct::b, free_memory(), ms_change_struct::goal, match_set_trace::goal, in_ms_trace_same_goal(), ms_change_struct::inst, MISCELLANEOUS_MEM_USAGE, MS_ASSERT, MS_ASSERT_RETRACT, agent_struct::ms_i_assertions, agent_struct::ms_o_assertions, MS_RETRACT, agent_struct::ms_retractions, production_struct::name, ms_change_struct::next, match_set_trace::next, NIL, NONE_WME_TRACE, rete_node_struct::rete_node_b_union::p, ms_change_struct::p_node, token_struct::parent, instantiation_struct::prod, p_node_data_struct::prod, match_set_trace::sym, ms_change_struct::tok, ms_change_struct::w, token_struct::w, xml_att_val(), xml_begin_tag(), xml_end_tag(), xml_instantiation_with_wmes(), and xml_whole_token().
void xml_partial_match_information | ( | agent * | thisAgent, |
rete_node * | p_node, | ||
wme_trace_type | wtt | ||
) |
Definition at line 8988 of file rete.cpp.
References deallocate_condition_list(), deallocate_token_list(), agent_struct::dummy_top_node, get_all_left_tokens_emerging_from_node(), token_struct::next_of_node, NIL, NONE_WME_TRACE, p_node_to_conditions_and_nots(), rete_node_struct::parent, print(), xml_att_val(), xml_aux(), xml_begin_tag(), xml_end_tag(), and xml_whole_token().