Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

chunk.c File Reference

Go to the source code of this file.

Functions

byte type_of_existing_impasse (Symbol *goal)
wmefind_impasse_wme (Symbol *id, Symbol *attr)
void find_match_goal (instantiation *inst)
void add_results_for_id (Symbol *id)
void add_named_superstate_attribute_to_grounds (instantiation *inst, char *name)
void deallocate_inst_members_to_be_rewritten (instantiation *inst)
void second_stage_chunk_instantiation (instantiation *inst)
void re_fill_in_instantiation_stuff_for_modified_lhs (instantiation *inst, bool need_to_do_support_calculations)
void add_pref_to_results (preference *pref)
preferenceget_results_for_instantiation (instantiation *inst)
void variablize_symbol (Symbol **sym)
void variablize_test (test *t)
void variablize_condition_list (condition *cond)
actioncopy_and_variablize_result_list (preference *pref)
void init_chunk_cond_set (chunk_cond_set *set)
chunk_condmake_chunk_cond_for_condition (condition *cond)
bool add_to_chunk_cond_set (chunk_cond_set *set, chunk_cond *new_cc)
void remove_from_chunk_cond_set (chunk_cond_set *set, chunk_cond *cc)
void build_chunk_conds_for_grounds_and_add_negateds (chunk_cond **dest_top, chunk_cond **dest_bottom, tc_number tc_to_use)
notget_nots_for_instantiated_conditions (list *instantiations_with_nots, tc_number tc_of_grounds)
void variablize_nots_and_insert_into_conditions (not *nots, condition *conds)
void add_goal_or_impasse_tests (chunk_cond *all_ccs)
void reorder_instantiated_conditions (chunk_cond *top_cc, condition **dest_inst_top, condition **dest_inst_bottom)
void make_clones_of_results (preference *results, instantiation *chunk_inst)
Symbolfind_goal_at_goal_stack_level (goal_stack_level level)
Symbolfind_impasse_wme_value (Symbol *id, Symbol *attr)
Symbolgenerate_chunk_name_sym_constant (instantiation *inst)
void chunk_instantiation (instantiation *inst, bool allow_variablization)
void init_chunker (void)


Function Documentation

void add_goal_or_impasse_tests chunk_cond all_ccs  ) 
 

Definition at line 668 of file chunk.c.

References add_new_test_to_test(), chunk_cond, complex_test, condition_struct::data, get_new_tc_number(), symbol_union::id, three_field_tests_struct::id_test, chunk_cond_struct::instantiated_cond, identifier_struct::isa_goal, identifier_struct::isa_impasse, chunk_cond_struct::next, Symbol, identifier_struct::tc_num, tc_number, test, condition_struct::condition_main_data_union::tests, complex_test_struct::type, condition_struct::type, and chunk_cond_struct::variablized_cond.

Referenced by chunk_instantiation(), and second_stage_chunk_instantiation().

void add_named_superstate_attribute_to_grounds instantiation inst,
char *  name
[static]
 

Definition at line 2215 of file chunk.c.

References wme_struct::acceptable, wme_struct::attr, three_field_tests_struct::attr_test, condition_struct::bt, condition, condition_struct::data, find_impasse_wme(), find_slot(), find_sym_constant(), identifier_struct::higher_goal, wme_struct::id, symbol_union::id, three_field_tests_struct::id_test, instantiation, bt_info_struct::level, instantiation_struct::match_goal, instantiation_struct::match_goal_level, condition_struct::next, condition_struct::prev, print(), bt_info_struct::prohibits, slot, Symbol, condition_struct::test_for_acceptable_preference, condition_struct::condition_main_data_union::tests, bt_info_struct::trace, condition_struct::type, wme_struct::value, three_field_tests_struct::value_test, bt_info_struct::wme, wme, and slot_struct::wmes.

Referenced by chunk_instantiation(), and second_stage_chunk_instantiation().

void add_pref_to_results preference pref  ) 
 

Definition at line 93 of file chunk.c.

References preference_struct::attr, preference_struct::id, preference_struct::inst, instantiation_struct::match_goal_level, preference_struct::match_goal_level, preference_struct::next_clone, preference_struct::next_result, preference, preference_struct::prev_clone, preference_struct::referent, preference_struct::type, and preference_struct::value.

Referenced by add_results_for_id(), and get_results_for_instantiation().

void add_results_for_id Symbol id  ) 
 

Definition at line 155 of file chunk.c.

References add_pref_to_results(), preference_struct::all_of_slot_next, slot_struct::all_preferences, preference_struct::id, symbol_union::id, identifier_struct::input_wmes, preference_struct::inst_next, slot_struct::next, wme_struct::next, preference, slot, identifier_struct::slots, Symbol, identifier_struct::tc_num, wme_struct::value, wme, and slot_struct::wmes.

bool add_to_chunk_cond_set chunk_cond_set set,
chunk_cond new_cc
 

Definition at line 403 of file chunk.c.

References chunk_cond_set_struct::all, chunk_cond, chunk_cond_set, chunk_cond_struct::compressed_hash_value, chunk_cond_struct::cond, conditions_are_equal(), chunk_cond_struct::hash_value, chunk_cond_struct::next_in_bucket, and chunk_cond_set_struct::table.

Referenced by backtrace_through_instantiation().

void build_chunk_conds_for_grounds_and_add_negateds chunk_cond **  dest_top,
chunk_cond **  dest_bottom,
tc_number  tc_to_use
 

Definition at line 455 of file chunk.c.

References add_cond_to_tc(), chunk_cond, chunk_cond_struct::cond, cond_is_in_tc(), condition, cons, copy_condition(), cons_struct::first, chunk_cond_struct::instantiated_cond, condition_struct::next, chunk_cond_struct::next, condition_struct::prev, chunk_cond_struct::prev, print_condition(), print_string(), remove_from_chunk_cond_set(), tc_number, and chunk_cond_struct::variablized_cond.

Referenced by chunk_instantiation(), and second_stage_chunk_instantiation().

void chunk_instantiation instantiation inst,
bool  allow_variablization
 

Definition at line 926 of file chunk.c.

References action, explain_chunk_struct::actions, add_goal_or_impasse_tests(), add_named_superstate_attribute_to_grounds(), add_production_to_rete(), explain_chunk_struct::all_grounds, identifier_struct::allow_bottom_up_chunks, explain_chunk_struct::backtrace, backtrace_through_instantiation(), instantiation_struct::bottom_of_instantiated_conditions, build_chunk_conds_for_grounds_and_add_negateds(), byte, chunk_cond, chunk_cond_struct::cond, condition, explain_chunk_struct::conds, copy_and_variablize_result_list(), copy_condition_list(), deallocate_action_list(), deallocate_condition_list(), excise_production(), explain_add_temp_to_chunk_list(), explain_chunk_str, fill_in_new_instantiation_stuff(), free_list(), instantiation_struct::GDS_evaluated_already, generate_chunk_name_sym_constant(), generate_new_sym_constant(), get_new_tc_number(), get_nots_for_instantiated_conditions(), get_printer_output_column(), get_results_for_instantiation(), goal_stack_level, identifier_struct::higher_goal, preference_struct::id, symbol_union::id, instantiation_struct::in_ms, preference_struct::inst, preference_struct::inst_next, instantiation, identifier_struct::isa_goal, instantiation_struct::isa_ssci_inst, identifier_struct::level, make_clones_of_results(), make_production(), instantiation_struct::match_goal, preference_struct::match_goal, instantiation_struct::match_goal_level, preference_struct::match_goal_level, member_of_list(), production_struct::name, explain_chunk_struct::name, sym_constant_struct::name, instantiation_struct::next, chunk_cond_struct::next, explain_chunk_struct::next_chunk, preference_struct::next_result, not, instantiation_struct::nots, preference_struct::o_supported, instantiation_struct::okay_to_variablize, preference, instantiation_struct::preferences_generated, print(), print_action_list(), print_condition_list(), print_instantiation_with_wmes(), print_preference(), print_production(), print_string(), print_with_symbols(), instantiation_struct::prod, production, preference_struct::reference_count, reorder_instantiated_conditions(), reset_backtrace_list(), reset_variable_generator(), symbol_union::sc, second_stage_chunk_instantiation(), start_timer(), stop_timer(), Symbol, tc_number, instantiation_struct::top_of_instantiated_conditions, trace_grounded_potentials(), trace_locals(), trace_ungrounded_potentials(), variablize_condition_list(), variablize_nots_and_insert_into_conditions(), and chunk_cond_struct::variablized_cond.

Referenced by create_instantiation().

action* copy_and_variablize_result_list preference pref  ) 
 

Definition at line 294 of file chunk.c.

References action, action_struct::attr, preference_struct::attr, action_struct::id, preference_struct::id, action_struct::next, preference_struct::next_result, preference, action_struct::preference_type, action_struct::referent, preference_struct::referent, Symbol, preference_struct::type, action_struct::type, action_struct::value, preference_struct::value, and variablize_symbol().

Referenced by chunk_instantiation().

void deallocate_inst_members_to_be_rewritten instantiation inst  ) 
 

Definition at line 1919 of file chunk.c.

References preference_struct::all_of_goal_next, condition_struct::bt, condition, deallocate_condition_list(), deallocate_list_of_nots(), find_clone_for_level(), goal_stack_level, symbol_union::id, preference_struct::inst, preference_struct::inst_next, instantiation, instantiation_struct::match_goal, preference_struct::match_goal_level, instantiation_struct::match_goal_level, condition_struct::next, instantiation_struct::nots, preference, identifier_struct::preferences_from_goal, instantiation_struct::preferences_generated, print(), print_preference(), preference_struct::reference_count, wme_struct::reference_count, wme_struct::timetag, instantiation_struct::top_of_instantiated_conditions, bt_info_struct::trace, condition_struct::type, and bt_info_struct::wme.

Referenced by second_stage_chunk_instantiation().

Symbol* find_goal_at_goal_stack_level goal_stack_level  level  ) 
 

Definition at line 791 of file chunk.c.

References goal_stack_level, symbol_union::id, identifier_struct::level, identifier_struct::lower_goal, and Symbol.

Referenced by generate_chunk_name_sym_constant().

wme* find_impasse_wme Symbol id,
Symbol attr
 

Definition at line 84 of file tempmem.c.

References slot_struct::acceptable_preference_changed, slot_struct::acceptable_preference_wmes, slot_struct::all_preferences, wme_struct::attr, slot_struct::attr, slot_struct::changed, cons, dl_cons, cons_struct::first, symbol_union::id, slot_struct::id, slot_struct::impasse_id, slot_struct::impasse_type, identifier_struct::impasse_wmes, slot_struct::isa_context_slot, identifier_struct::isa_goal, dl_cons_struct::item, identifier_struct::level, make_slot(), mark_slot_as_changed(), mark_slot_for_possible_removal(), slot_struct::marked_for_possible_removal, wme_struct::next, slot_struct::next, slot_struct::preferences, print(), print_with_symbols(), remove_garbage_slots(), slot, identifier_struct::slots, Symbol, wme, and slot_struct::wmes.

Referenced by add_named_superstate_attribute_to_grounds().

Symbol* find_impasse_wme_value Symbol id,
Symbol attr
 

Definition at line 801 of file chunk.c.

References wme_struct::attr, symbol_union::id, identifier_struct::impasse_wmes, wme_struct::next, Symbol, wme_struct::value, and wme.

Referenced by generate_chunk_name_sym_constant().

void find_match_goal instantiation inst  ) 
 

Definition at line 184 of file recmem.c.

References condition_struct::bt, condition, goal_stack_level, wme_struct::id, symbol_union::id, instantiation, identifier_struct::isa_goal, bt_info_struct::level, instantiation_struct::match_goal, instantiation_struct::match_goal_level, condition_struct::next, Symbol, instantiation_struct::top_of_instantiated_conditions, condition_struct::type, and bt_info_struct::wme.

Referenced by fill_in_new_instantiation_stuff(), and re_fill_in_instantiation_stuff_for_modified_lhs().

Symbol* generate_chunk_name_sym_constant instantiation inst  ) 
 

Definition at line 813 of file chunk.c.

References byte, do_print_for_identifier(), find_goal_at_goal_stack_level(), find_impasse_wme_value(), find_sym_constant(), generate_new_sym_constant(), goal_stack_level, preference_struct::id, symbol_union::id, preference_struct::inst_next, instantiation, identifier_struct::level, identifier_struct::lower_goal, make_sym_constant(), preference, instantiation_struct::preferences_generated, print(), Symbol, and type_of_existing_impasse().

Referenced by chunk_instantiation().

not* get_nots_for_instantiated_conditions list instantiations_with_nots,
tc_number  tc_of_grounds
 

Definition at line 551 of file chunk.c.

References cons, cons_struct::first, symbol_union::id, instantiation, list, not_struct::next, not, instantiation_struct::nots, cons_struct::rest, not_struct::s1, not_struct::s2, identifier_struct::tc_num, and tc_number.

Referenced by chunk_instantiation(), and second_stage_chunk_instantiation().

preference* get_results_for_instantiation instantiation inst  ) 
 

Definition at line 179 of file chunk.c.

References add_pref_to_results(), get_new_tc_number(), symbol_union::id, preference_struct::id, preference_struct::inst_next, instantiation, identifier_struct::level, instantiation_struct::match_goal_level, preference, instantiation_struct::preferences_generated, and identifier_struct::tc_num.

Referenced by chunk_instantiation(), and second_stage_chunk_instantiation().

void init_chunk_cond_set chunk_cond_set set  ) 
 

Definition at line 376 of file chunk.c.

References chunk_cond_set_struct::all, chunk_cond_set, and chunk_cond_set_struct::table.

Referenced by init_chunker().

void init_chunker void   ) 
 

Definition at line 2187 of file chunk.c.

References chunk_cond, init_chunk_cond_set(), and init_memory_pool().

Referenced by init_soar_agent().

chunk_cond* make_chunk_cond_for_condition condition cond  ) 
 

Definition at line 385 of file chunk.c.

References chunk_cond, chunk_cond_struct::compressed_hash_value, chunk_cond_struct::cond, condition, hash_condition(), chunk_cond_struct::hash_value, and masks_for_n_low_order_bits.

Referenced by backtrace_through_instantiation().

void make_clones_of_results preference results,
instantiation chunk_inst
 

Definition at line 765 of file chunk.c.

References preference_struct::attr, preference_struct::id, preference_struct::inst, instantiation, make_preference(), preference_struct::next_clone, preference_struct::next_result, preference, instantiation_struct::preferences_generated, preference_struct::prev_clone, preference_struct::referent, preference_struct::type, and preference_struct::value.

Referenced by chunk_instantiation().

void re_fill_in_instantiation_stuff_for_modified_lhs instantiation inst,
bool  need_to_do_support_calculations
 

Definition at line 2023 of file chunk.c.

References instantiation_struct::backtrace_number, condition_struct::bt, calculate_support_for_instantiation_preferences(), condition, cons, production_struct::declared_support, destructively_reverse_list(), dougs_calculate_support_for_instantiation_preferences(), find_clone_for_level(), find_match_goal(), cons_struct::first, goal_stack_level, symbol_union::id, preference_struct::inst, preference_struct::inst_next, instantiation, list, instantiation_struct::match_goal, preference_struct::match_goal, preference_struct::match_goal_level, instantiation_struct::match_goal_level, production_struct::name, condition_struct::next, preference_struct::o_supported, preference_struct::on_goal_list, preference, identifier_struct::preferences_from_goal, instantiation_struct::preferences_generated, print(), print_preference(), print_with_symbols(), instantiation_struct::prod, preference_struct::reference_count, wme_struct::reference_count, cons_struct::rest, wme_struct::timetag, instantiation_struct::top_of_instantiated_conditions, bt_info_struct::trace, condition_struct::type, and bt_info_struct::wme.

Referenced by second_stage_chunk_instantiation().

void remove_from_chunk_cond_set chunk_cond_set set,
chunk_cond cc
 

Definition at line 422 of file chunk.c.

References chunk_cond_set_struct::all, chunk_cond, chunk_cond_set, chunk_cond_struct::compressed_hash_value, and chunk_cond_set_struct::table.

Referenced by build_chunk_conds_for_grounds_and_add_negateds().

void reorder_instantiated_conditions chunk_cond top_cc,
condition **  dest_inst_top,
condition **  dest_inst_bottom
 

Definition at line 721 of file chunk.c.

References chunk_cond, condition, chunk_cond_struct::instantiated_cond, condition_struct::next, chunk_cond_struct::next, condition_struct::prev, chunk_cond_struct::saved_prev_pointer_of_variablized_cond, and chunk_cond_struct::variablized_cond.

Referenced by chunk_instantiation(), and second_stage_chunk_instantiation().

void second_stage_chunk_instantiation instantiation inst  ) 
 

Definition at line 1655 of file chunk.c.

References add_goal_or_impasse_tests(), add_named_superstate_attribute_to_grounds(), identifier_struct::allow_bottom_up_chunks, backtrace_through_instantiation(), instantiation_struct::bottom_of_instantiated_conditions, build_chunk_conds_for_grounds_and_add_negateds(), chunk_cond, chunk_cond_struct::cond, condition, deallocate_condition_list(), deallocate_inst_members_to_be_rewritten(), free_list(), get_new_tc_number(), get_nots_for_instantiated_conditions(), get_printer_output_column(), get_results_for_instantiation(), goal_stack_level, identifier_struct::higher_goal, symbol_union::id, preference_struct::id, preference_struct::inst, preference_struct::inst_next, instantiation, identifier_struct::level, instantiation_struct::match_goal, instantiation_struct::match_goal_level, production_struct::name, chunk_cond_struct::next, preference_struct::next_result, not, instantiation_struct::nots, preference_struct::o_supported, instantiation_struct::okay_to_variablize, preference, instantiation_struct::preferences_generated, print(), print_condition_list(), print_instantiation_with_wmes(), print_preference(), print_string(), print_with_symbols(), instantiation_struct::prod, re_fill_in_instantiation_stuff_for_modified_lhs(), preference_struct::reference_count, reorder_instantiated_conditions(), reset_variable_generator(), Symbol, tc_number, instantiation_struct::top_of_instantiated_conditions, trace_grounded_potentials(), trace_locals(), trace_ungrounded_potentials(), production_struct::type, variablize_condition_list(), variablize_nots_and_insert_into_conditions(), and chunk_cond_struct::variablized_cond.

Referenced by chunk_instantiation().

byte type_of_existing_impasse Symbol goal  ) 
 

void variablize_condition_list condition cond  ) 
 

Definition at line 277 of file chunk.c.

References three_field_tests_struct::attr_test, condition, condition_struct::data, three_field_tests_struct::id_test, condition_struct::condition_main_data_union::ncc, condition_struct::next, condition_struct::condition_main_data_union::tests, ncc_info_struct::top, condition_struct::type, three_field_tests_struct::value_test, and variablize_test().

Referenced by chunk_instantiation(), and second_stage_chunk_instantiation().

void variablize_nots_and_insert_into_conditions not nots,
condition conds
 

Definition at line 604 of file chunk.c.

References abort_with_fatal_error(), add_new_test_to_test(), three_field_tests_struct::attr_test, complex_test, condition, condition_struct::data, complex_test_struct::data, symbol_union::id, three_field_tests_struct::id_test, condition_struct::next, not_struct::next, not, complex_test_struct::test_info_union::referent, not_struct::s1, not_struct::s2, Symbol, test, test_includes_equality_test_for_symbol(), condition_struct::condition_main_data_union::tests, condition_struct::type, complex_test_struct::type, three_field_tests_struct::value_test, and identifier_struct::variablization.

Referenced by chunk_instantiation(), and second_stage_chunk_instantiation().

void variablize_symbol Symbol **  sym  ) 
 

Definition at line 218 of file chunk.c.

References generate_new_variable(), symbol_union::id, Symbol, tolower(), and identifier_struct::variablization.

Referenced by copy_and_variablize_result_list(), and variablize_test().

void variablize_test test t  ) 
 

Definition at line 247 of file chunk.c.

References complex_test, complex_test_struct::test_info_union::conjunct_list, cons, complex_test_struct::data, cons_struct::first, complex_test_struct::test_info_union::referent, cons_struct::rest, Symbol, test, complex_test_struct::type, and variablize_symbol().

Referenced by variablize_condition_list().


Generated on Thu Dec 11 13:00:25 2003 for Soar Kernel by doxygen 1.3.5