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

reorder.c File Reference

Go to the source code of this file.

Data Structures

struct  saved_test_struct

Typedefs

typedef saved_test_struct saved_test

Functions

bool legal_to_execute_action (action *a, tc_number tc)
bool reorder_action_list (action **action_list, tc_number lhs_tc)
bool all_variables_in_rhs_value_bound (rhs_value rv, tc_number tc)
void print_saved_test (saved_test *st)
void print_saved_test_list (saved_test *st)
saved_testsimplify_test (test *t, saved_test *old_sts)
saved_testsimplify_condition_list (condition *conds_list)
byte reverse_direction_of_relational_test (byte type)
saved_testrestore_saved_tests_to_test (test *t, bool is_id_field, tc_number bound_vars_tc_number, saved_test *tests_to_restore)
void restore_and_deallocate_saved_tests (condition *conds_list, tc_number tc, saved_test *tests_to_restore)
listcollect_vars_tested_by_test_that_are_bound (test t, tc_number tc, list *starting_list)
listcollect_vars_tested_by_cond_that_are_bound (condition *cond, tc_number tc, list *starting_list)
void fill_in_vars_requiring_bindings (condition *cond_list, tc_number tc)
void remove_vars_requiring_bindings (condition *cond_list)
listcollect_root_variables (condition *cond_list, tc_number tc, bool allow_printing_warnings)
bool test_covered_by_bound_vars (test t, tc_number tc, list *extra_vars)
long get_cost_of_possible_multi_attribute (Symbol *sym)
long cost_of_adding_condition (condition *cond, tc_number tc, list *root_vars_not_bound_yet)
long find_lowest_cost_lookahead (condition *candidates, condition *chosen, tc_number tc, list *root_vars_not_bound_yet)
void reorder_condition_list (condition **top_of_conds, condition **bottom_of_conds, list *roots, tc_number tc, bool reorder_nccs)
void reorder_simplified_conditions (condition **top_of_conds, condition **bottom_of_conds, list *roots, tc_number bound_vars_tc_number, bool reorder_nccs)
bool test_tests_for_root (test t, list *roots)
void remove_isa_state_tests_for_non_roots (condition **lhs_top, list *roots)
bool reorder_lhs (condition **lhs_top, condition **lhs_bottom, bool reorder_nccs)
void init_reorderer (void)

Variables

char * name_of_production_being_reordered


Typedef Documentation

typedef struct saved_test_struct saved_test
 

Referenced by init_reorderer(), print_saved_test(), print_saved_test_list(), reorder_condition_list(), restore_and_deallocate_saved_tests(), restore_saved_tests_to_test(), simplify_condition_list(), and simplify_test().


Function Documentation

bool all_variables_in_rhs_value_bound rhs_value  rv,
tc_number  tc
 

Definition at line 160 of file reorder.c.

References cons, cons_struct::first, list, cons_struct::rest, rhs_value, Symbol, variable_struct::tc_num, tc_number, and symbol_union::var.

Referenced by legal_to_execute_action().

list* collect_root_variables condition cond_list,
tc_number  tc,
bool  allow_printing_warnings
 

Definition at line 582 of file reorder.c.

References add_bound_variables_in_test(), condition, cons, condition_struct::data, cons_struct::first, three_field_tests_struct::id_test, list, name_of_production_being_reordered, condition_struct::next, print(), print_with_symbols(), cons_struct::rest, Symbol, tc_number, test_includes_equality_test_for_symbol(), test_includes_goal_or_impasse_id_test(), condition_struct::condition_main_data_union::tests, condition_struct::type, unmark_variables_and_free_list(), and three_field_tests_struct::value_test.

Referenced by find_compile_time_match_goal(), reorder_lhs(), and reorder_simplified_conditions().

list* collect_vars_tested_by_cond_that_are_bound condition cond,
tc_number  tc,
list starting_list
 

Definition at line 517 of file reorder.c.

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

Referenced by fill_in_vars_requiring_bindings().

list* collect_vars_tested_by_test_that_are_bound test  t,
tc_number  tc,
list starting_list
 

Definition at line 477 of file reorder.c.

References add_if_not_member(), complex_test, complex_test_struct::test_info_union::conjunct_list, cons, complex_test_struct::data, cons_struct::first, list, complex_test_struct::test_info_union::referent, cons_struct::rest, Symbol, variable_struct::tc_num, tc_number, test, complex_test_struct::type, and symbol_union::var.

Referenced by collect_vars_tested_by_cond_that_are_bound().

long cost_of_adding_condition condition cond,
tc_number  tc,
list root_vars_not_bound_yet
 

Definition at line 705 of file reorder.c.

References three_field_tests_struct::attr_test, condition, cons, condition_struct::data, cons_struct::first, get_cost_of_possible_multi_attribute(), three_field_tests_struct::id_test, list, condition_struct::reorder, cons_struct::rest, Symbol, tc_number, test_covered_by_bound_vars(), condition_struct::test_for_acceptable_preference, condition_struct::condition_main_data_union::tests, condition_struct::type, three_field_tests_struct::value_test, and reorder_info_struct::vars_requiring_bindings.

Referenced by find_lowest_cost_lookahead(), and reorder_simplified_conditions().

void fill_in_vars_requiring_bindings condition cond_list,
tc_number  tc
 

Definition at line 534 of file reorder.c.

References add_bound_variables_in_condition(), collect_vars_tested_by_cond_that_are_bound(), condition, condition_struct::data, list, condition_struct::condition_main_data_union::ncc, condition_struct::next, condition_struct::reorder, tc_number, ncc_info_struct::top, condition_struct::type, unmark_variables_and_free_list(), and reorder_info_struct::vars_requiring_bindings.

Referenced by reorder_lhs().

long find_lowest_cost_lookahead condition candidates,
condition chosen,
tc_number  tc,
list root_vars_not_bound_yet
 

Definition at line 767 of file reorder.c.

References add_bound_variables_in_condition(), condition, cost_of_adding_condition(), list, condition_struct::next, tc_number, and unmark_variables_and_free_list().

Referenced by reorder_simplified_conditions().

long get_cost_of_possible_multi_attribute Symbol sym  ) 
 

Definition at line 687 of file reorder.c.

References multi_attribute, multi_attributes_struct::next, multi_attributes_struct::symbol, Symbol, and multi_attributes_struct::value.

Referenced by cost_of_adding_condition().

void init_reorderer void   ) 
 

Definition at line 1061 of file reorder.c.

References init_memory_pool(), and saved_test.

Referenced by init_production_utilities().

bool legal_to_execute_action action a,
tc_number  tc
 

Definition at line 182 of file reorder.c.

References action, all_variables_in_rhs_value_bound(), action_struct::attr, action_struct::id, action_struct::preference_type, action_struct::referent, tc_number, action_struct::type, and action_struct::value.

Referenced by reorder_action_list().

void print_saved_test saved_test st  ) 
 

Definition at line 229 of file reorder.c.

References print_string(), print_with_symbols(), saved_test, test_to_string(), saved_test_struct::the_test, and saved_test_struct::var.

Referenced by print_saved_test_list().

void print_saved_test_list saved_test st  ) 
 

Definition at line 235 of file reorder.c.

References saved_test_struct::next, print(), print_saved_test(), and saved_test.

Referenced by restore_and_deallocate_saved_tests().

void remove_isa_state_tests_for_non_roots condition **  lhs_top,
list roots
 

Definition at line 995 of file reorder.c.

References condition, copy_test_removing_goal_impasse_tests(), condition_struct::data, deallocate_test(), three_field_tests_struct::id_test, list, condition_struct::next, test, test_includes_goal_or_impasse_id_test(), test_tests_for_root(), condition_struct::condition_main_data_union::tests, and condition_struct::type.

Referenced by reorder_lhs().

void remove_vars_requiring_bindings condition cond_list  ) 
 

Definition at line 556 of file reorder.c.

References condition, condition_struct::data, free_list(), condition_struct::condition_main_data_union::ncc, condition_struct::next, condition_struct::reorder, ncc_info_struct::top, condition_struct::type, and reorder_info_struct::vars_requiring_bindings.

Referenced by reorder_lhs().

bool reorder_action_list action **  action_list,
tc_number  lhs_tc
 

Definition at line 94 of file reorder.c.

References action, add_all_variables_in_action(), legal_to_execute_action(), list, name_of_production_being_reordered, action_struct::next, print(), tc_number, and unmark_variables_and_free_list().

Referenced by make_production().

void reorder_condition_list condition **  top_of_conds,
condition **  bottom_of_conds,
list roots,
tc_number  tc,
bool  reorder_nccs
 

Definition at line 933 of file reorder.c.

References condition, list, reorder_simplified_conditions(), restore_and_deallocate_saved_tests(), saved_test, simplify_condition_list(), and tc_number.

Referenced by reorder_lhs(), and reorder_simplified_conditions().

bool reorder_lhs condition **  lhs_top,
condition **  lhs_bottom,
bool  reorder_nccs
 

Definition at line 1017 of file reorder.c.

References add_bound_variables_in_test(), collect_root_variables(), condition, condition_struct::data, fill_in_vars_requiring_bindings(), free_list(), get_new_tc_number(), three_field_tests_struct::id_test, list, name_of_production_being_reordered, condition_struct::next, print(), remove_isa_state_tests_for_non_roots(), remove_vars_requiring_bindings(), reorder_condition_list(), tc_number, test_includes_goal_or_impasse_id_test(), condition_struct::condition_main_data_union::tests, and condition_struct::type.

Referenced by make_production().

void reorder_simplified_conditions condition **  top_of_conds,
condition **  bottom_of_conds,
list roots,
tc_number  bound_vars_tc_number,
bool  reorder_nccs
 

Definition at line 804 of file reorder.c.

References add_bound_variables_in_condition(), canonical_cond_greater(), collect_root_variables(), condition, cons, cost_of_adding_condition(), find_lowest_cost_lookahead(), cons_struct::first, free_list(), list, name_of_production_being_reordered, condition_struct::next, reorder_info_struct::next_min_cost, print(), condition_struct::reorder, reorder_condition_list(), cons_struct::rest, Symbol, tc_number, condition_struct::type, and unmark_variables_and_free_list().

Referenced by reorder_condition_list().

void restore_and_deallocate_saved_tests condition conds_list,
tc_number  tc,
saved_test tests_to_restore
 

Definition at line 426 of file reorder.c.

References add_bound_variables_in_test(), three_field_tests_struct::attr_test, condition, condition_struct::data, three_field_tests_struct::id_test, list, name_of_production_being_reordered, condition_struct::next, print(), print_saved_test_list(), restore_saved_tests_to_test(), saved_test, tc_number, condition_struct::condition_main_data_union::tests, condition_struct::type, unmark_variables_and_free_list(), and three_field_tests_struct::value_test.

Referenced by reorder_condition_list().

saved_test* restore_saved_tests_to_test test t,
bool  is_id_field,
tc_number  bound_vars_tc_number,
saved_test tests_to_restore
 

Definition at line 367 of file reorder.c.

References add_new_test_to_test_if_not_already_there(), complex_test, complex_test_struct::data, saved_test_struct::next, complex_test_struct::test_info_union::referent, reverse_direction_of_relational_test(), saved_test, Symbol, tc_number, test, test_includes_equality_test_for_symbol(), saved_test_struct::the_test, complex_test_struct::type, and saved_test_struct::var.

Referenced by restore_and_deallocate_saved_tests().

byte reverse_direction_of_relational_test byte  type  ) 
 

Definition at line 341 of file reorder.c.

References abort_with_fatal_error(), and byte.

Referenced by restore_saved_tests_to_test().

saved_test* simplify_condition_list condition conds_list  ) 
 

Definition at line 325 of file reorder.c.

References three_field_tests_struct::attr_test, condition, condition_struct::data, three_field_tests_struct::id_test, condition_struct::next, saved_test, simplify_test(), condition_struct::condition_main_data_union::tests, condition_struct::type, and three_field_tests_struct::value_test.

Referenced by reorder_condition_list().

saved_test* simplify_test test t,
saved_test old_sts
 

Definition at line 244 of file reorder.c.

References complex_test, complex_test_struct::test_info_union::conjunct_list, cons, complex_test_struct::data, cons_struct::first, generate_new_variable(), saved_test_struct::next, cons_struct::rest, saved_test, Symbol, test, complex_test_struct::type, and saved_test_struct::var.

Referenced by simplify_condition_list().

bool test_covered_by_bound_vars test  t,
tc_number  tc,
list extra_vars
 

Definition at line 654 of file reorder.c.

References complex_test, complex_test_struct::test_info_union::conjunct_list, cons, complex_test_struct::data, cons_struct::first, list, member_of_list(), cons_struct::rest, Symbol, tc_number, test, and complex_test_struct::type.

Referenced by cost_of_adding_condition().

bool test_tests_for_root test  t,
list roots
 

Definition at line 949 of file reorder.c.

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

Referenced by remove_isa_state_tests_for_non_roots().


Variable Documentation

char* name_of_production_being_reordered
 

Definition at line 62 of file reorder.c.

Referenced by collect_root_variables(), make_production(), reorder_action_list(), reorder_lhs(), reorder_simplified_conditions(), and restore_and_deallocate_saved_tests().


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