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

trace.c File Reference

Go to the source code of this file.

Data Structures

struct  trace_format_struct
union  trace_format_struct::trace_format_data_union
struct  tracing_parameters
struct  tracing_rule_struct

Typedefs

typedef trace_format_struct trace_format
typedef tracing_rule_struct tracing_rule

Enumerations

enum  trace_format_type {
  STRING_TFT, PERCENT_TFT, L_BRACKET_TFT, R_BRACKET_TFT,
  VALUES_TFT, VALUES_RECURSIVELY_TFT, ATTS_AND_VALUES_TFT, ATTS_AND_VALUES_RECURSIVELY_TFT,
  CURRENT_STATE_TFT, CURRENT_OPERATOR_TFT, DECISION_CYCLE_COUNT_TFT, ELABORATION_CYCLE_COUNT_TFT,
  IDENTIFIER_TFT, IF_ALL_DEFINED_TFT, LEFT_JUSTIFY_TFT, RIGHT_JUSTIFY_TFT,
  SUBGOAL_DEPTH_TFT, REPEAT_SUBGOAL_DEPTH_TFT, NEWLINE_TFT
}

Functions

void deallocate_trace_format_list (trace_format *tf)
trace_formatparse_item_from_format_string (void)
trace_formatparse_format_string (const char *string)
listparse_attribute_path_in_brackets (void)
trace_formatparse_pattern_in_brackets (bool read_opening_bracket)
void print_trace_format_list (trace_format *tf)
unsigned long tracing_rule_hash_function (void *item, short num_bits)
void init_tracing (void)
trace_formatlookup_trace_format (bool stack_trace, int type_restriction, Symbol *name_restriction)
bool remove_trace_format (bool stack_trace, int type_restriction, Symbol *name_restriction)
bool add_trace_format (bool stack_trace, int type_restriction, Symbol *name_restriction, const char *format_string)
void print_tracing_rule (int type_restriction, Symbol *name_restriction, trace_format *format)
bool print_trace_callback_fn (void *item)
void print_all_trace_formats (bool stack_trace)
growable_string object_to_trace_string (Symbol *object)
void add_values_of_attribute_path (Symbol *object, list *path, growable_string *result, bool recursive, int *count)
void add_trace_for_wme (growable_string *result, wme *w, bool print_attribute, bool recursive)
void add_trace_for_attribute_path (Symbol *object, list *path, growable_string *result, bool print_attributes, bool recursive)
growable_string trace_format_list_to_string (trace_format *tf, Symbol *object)
trace_formatfind_appropriate_trace_format (bool stack_trace, int type, Symbol *name)
growable_string selection_to_trace_string (Symbol *object, Symbol *current_state, int selection_type, bool allow_cycle_counts)
void print_object_trace (Symbol *object)
void print_stack_trace (Symbol *object, Symbol *state, int slot_type, bool allow_cycle_counts)
void print_object_trace_using_provided_format_string (Symbol *object, Symbol *current_goal, char *format_string)

Variables

const char * format
char * format_string_error_message
char tracing_object_letters [3] = { '*', 's', 'o' }
bool found_undefined
tracing_parameters tparams


Typedef Documentation

typedef struct trace_format_struct trace_format
 

Referenced by add_trace_format(), deallocate_trace_format_list(), find_appropriate_trace_format(), lookup_trace_format(), object_to_trace_string(), parse_format_string(), parse_item_from_format_string(), parse_pattern_in_brackets(), print_object_trace_using_provided_format_string(), print_trace_format_list(), print_tracing_rule(), remove_trace_format(), selection_to_trace_string(), and trace_format_list_to_string().

typedef struct tracing_rule_struct tracing_rule
 

Referenced by add_trace_format(), lookup_trace_format(), print_trace_callback_fn(), remove_trace_format(), and tracing_rule_hash_function().


Enumeration Type Documentation

enum trace_format_type
 

Enumeration values:
STRING_TFT 
PERCENT_TFT 
L_BRACKET_TFT 
R_BRACKET_TFT 
VALUES_TFT 
VALUES_RECURSIVELY_TFT 
ATTS_AND_VALUES_TFT 
ATTS_AND_VALUES_RECURSIVELY_TFT 
CURRENT_STATE_TFT 
CURRENT_OPERATOR_TFT 
DECISION_CYCLE_COUNT_TFT 
ELABORATION_CYCLE_COUNT_TFT 
IDENTIFIER_TFT 
IF_ALL_DEFINED_TFT 
LEFT_JUSTIFY_TFT 
RIGHT_JUSTIFY_TFT 
SUBGOAL_DEPTH_TFT 
REPEAT_SUBGOAL_DEPTH_TFT 
NEWLINE_TFT 

Definition at line 55 of file trace.c.


Function Documentation

void add_trace_for_attribute_path Symbol object,
list path,
growable_string result,
bool  print_attributes,
bool  recursive
 

Definition at line 997 of file trace.c.

References add_to_growable_string(), add_trace_for_wme(), add_values_of_attribute_path(), cons, cons_struct::first, found_undefined, free_growable_string(), growable_string, symbol_union::id, identifier_struct::impasse_wmes, identifier_struct::input_wmes, list, make_blank_growable_string(), wme_struct::next, slot_struct::next, cons_struct::rest, slot, identifier_struct::slots, Symbol, symbol_to_string(), wme, and slot_struct::wmes.

Referenced by trace_format_list_to_string().

void add_trace_for_wme growable_string result,
wme w,
bool  print_attribute,
bool  recursive
 

Definition at line 965 of file trace.c.

References add_to_growable_string(), wme_struct::attr, free_growable_string(), growable_string, object_to_trace_string(), symbol_to_string(), wme_struct::value, and wme.

Referenced by add_trace_for_attribute_path().

bool add_trace_format bool  stack_trace,
int  type_restriction,
Symbol name_restriction,
const char *  format_string
 

Definition at line 779 of file trace.c.

References add_to_hash_table(), allocate_memory(), tracing_rule_struct::format, hash_table, tracing_rule_struct::name_restriction, parse_format_string(), remove_trace_format(), Symbol, trace_format, tracing_rule, and tracing_rule_struct::type_restriction.

Referenced by init_soar_agent(), and soar_FormatWatch().

void add_values_of_attribute_path Symbol object,
list path,
growable_string result,
bool  recursive,
int *  count
 

Definition at line 917 of file trace.c.

References add_to_growable_string(), wme_struct::attr, find_slot(), cons_struct::first, free_growable_string(), growable_string, symbol_union::id, identifier_struct::impasse_wmes, identifier_struct::input_wmes, list, wme_struct::next, object_to_trace_string(), cons_struct::rest, slot, Symbol, symbol_to_string(), wme_struct::value, wme, and slot_struct::wmes.

Referenced by add_trace_for_attribute_path().

void deallocate_trace_format_list trace_format tf  ) 
 

Definition at line 96 of file trace.c.

References trace_format_struct::trace_format_data_union::attribute_path, ATTS_AND_VALUES_RECURSIVELY_TFT, ATTS_AND_VALUES_TFT, trace_format_struct::data, deallocate_symbol_list_removing_references(), free_memory(), free_memory_block_for_string(), IF_ALL_DEFINED_TFT, LEFT_JUSTIFY_TFT, trace_format_struct::next, REPEAT_SUBGOAL_DEPTH_TFT, RIGHT_JUSTIFY_TFT, trace_format_struct::trace_format_data_union::string, STRING_TFT, trace_format_struct::trace_format_data_union::subformat, trace_format, trace_format_struct::type, VALUES_RECURSIVELY_TFT, and VALUES_TFT.

Referenced by parse_format_string(), parse_pattern_in_brackets(), and remove_trace_format().

trace_format* find_appropriate_trace_format bool  stack_trace,
int  type,
Symbol name
 

Definition at line 1218 of file trace.c.

References lookup_trace_format(), Symbol, and trace_format.

Referenced by object_to_trace_string(), and selection_to_trace_string().

void init_tracing void   ) 
 

Definition at line 705 of file trace.c.

References make_hash_table(), and tracing_rule_hash_function().

Referenced by init_soar_agent().

trace_format* lookup_trace_format bool  stack_trace,
int  type_restriction,
Symbol name_restriction
 

Definition at line 717 of file trace.c.

References hash_table_struct::buckets, tracing_rule_struct::format, hash_table, hash_table_struct::log2size, tracing_rule_struct::name_restriction, tracing_rule_struct::next_in_hash_bucket, Symbol, trace_format, and tracing_rule.

Referenced by find_appropriate_trace_format().

growable_string object_to_trace_string Symbol object  ) 
 

Definition at line 1245 of file trace.c.

References add_to_growable_string(), tracing_parameters::allow_cycle_counts, tracing_parameters::current_o, tracing_parameters::current_s, find_appropriate_trace_format(), find_name_of_object(), growable_string, symbol_union::id, identifier_struct::isa_goal, identifier_struct::isa_operator, make_blank_growable_string(), Symbol, symbol_to_string(), identifier_struct::tc_num, tparams, trace_format, and trace_format_list_to_string().

Referenced by add_trace_for_wme(), add_values_of_attribute_path(), print_object_trace(), and trace_format_list_to_string().

list* parse_attribute_path_in_brackets void   ) 
 

Definition at line 198 of file trace.c.

References deallocate_symbol_list_removing_references(), destructively_reverse_list(), format, format_string_error_message, list, make_sym_constant(), and Symbol.

Referenced by parse_item_from_format_string().

trace_format* parse_format_string const char *  string  ) 
 

Definition at line 160 of file trace.c.

References deallocate_trace_format_list(), format, format_string_error_message, trace_format_struct::next, parse_item_from_format_string(), print(), and trace_format.

Referenced by add_trace_format(), and print_object_trace_using_provided_format_string().

trace_format * parse_item_from_format_string void   ) 
 

Definition at line 301 of file trace.c.

References allocate_memory(), trace_format_struct::trace_format_data_union::attribute_path, ATTS_AND_VALUES_RECURSIVELY_TFT, ATTS_AND_VALUES_TFT, CURRENT_OPERATOR_TFT, CURRENT_STATE_TFT, trace_format_struct::data, DECISION_CYCLE_COUNT_TFT, ELABORATION_CYCLE_COUNT_TFT, format, format_string_error_message, IDENTIFIER_TFT, IF_ALL_DEFINED_TFT, L_BRACKET_TFT, LEFT_JUSTIFY_TFT, list, make_memory_block_for_string(), NEWLINE_TFT, trace_format_struct::num, parse_attribute_path_in_brackets(), parse_pattern_in_brackets(), PERCENT_TFT, R_BRACKET_TFT, REPEAT_SUBGOAL_DEPTH_TFT, RIGHT_JUSTIFY_TFT, trace_format_struct::trace_format_data_union::string, STRING_TFT, trace_format_struct::trace_format_data_union::subformat, SUBGOAL_DEPTH_TFT, trace_format, trace_format_struct::type, VALUES_RECURSIVELY_TFT, and VALUES_TFT.

Referenced by parse_format_string(), and parse_pattern_in_brackets().

trace_format* parse_pattern_in_brackets bool  read_opening_bracket  ) 
 

Definition at line 253 of file trace.c.

References deallocate_trace_format_list(), format, format_string_error_message, trace_format_struct::next, parse_item_from_format_string(), and trace_format.

Referenced by parse_item_from_format_string().

void print_all_trace_formats bool  stack_trace  ) 
 

Definition at line 868 of file trace.c.

References do_for_all_items_in_hash_table(), print_trace_callback_fn(), and print_tracing_rule().

Referenced by soar_FormatWatch().

void print_object_trace Symbol object  ) 
 

Definition at line 1341 of file trace.c.

References free_growable_string(), get_new_tc_number(), growable_string, object_to_trace_string(), print_string(), and Symbol.

Referenced by print_preference_and_source(), and soar_cDefaultAskCallback().

void print_object_trace_using_provided_format_string Symbol object,
Symbol current_goal,
char *  format_string
 

Definition at line 1362 of file trace.c.

References tracing_parameters::allow_cycle_counts, tracing_parameters::current_s, free_growable_string(), get_new_tc_number(), growable_string, parse_format_string(), print_string(), Symbol, tparams, trace_format, and trace_format_list_to_string().

void print_stack_trace Symbol object,
Symbol state,
int  slot_type,
bool  allow_cycle_counts
 

Definition at line 1351 of file trace.c.

References free_growable_string(), get_new_tc_number(), growable_string, print_string(), selection_to_trace_string(), and Symbol.

Referenced by run_preference_semantics(), and soar_Print().

bool print_trace_callback_fn void *  item  ) 
 

Definition at line 848 of file trace.c.

References tracing_rule_struct::format, tracing_rule_struct::name_restriction, print_tracing_rule(), tracing_rule, and tracing_rule_struct::type_restriction.

Referenced by print_all_trace_formats().

void print_trace_format_list trace_format tf  ) 
 

Definition at line 538 of file trace.c.

References abort_with_fatal_error(), trace_format_struct::trace_format_data_union::attribute_path, ATTS_AND_VALUES_RECURSIVELY_TFT, ATTS_AND_VALUES_TFT, cons, CURRENT_OPERATOR_TFT, CURRENT_STATE_TFT, trace_format_struct::data, DECISION_CYCLE_COUNT_TFT, ELABORATION_CYCLE_COUNT_TFT, cons_struct::first, IDENTIFIER_TFT, IF_ALL_DEFINED_TFT, L_BRACKET_TFT, LEFT_JUSTIFY_TFT, NEWLINE_TFT, trace_format_struct::next, trace_format_struct::num, PERCENT_TFT, print(), print_string(), R_BRACKET_TFT, REPEAT_SUBGOAL_DEPTH_TFT, cons_struct::rest, RIGHT_JUSTIFY_TFT, trace_format_struct::trace_format_data_union::string, STRING_TFT, string_to_escaped_string(), trace_format_struct::trace_format_data_union::subformat, SUBGOAL_DEPTH_TFT, Symbol, trace_format, trace_format_struct::type, VALUES_RECURSIVELY_TFT, and VALUES_TFT.

Referenced by print_tracing_rule().

void print_tracing_rule int  type_restriction,
Symbol name_restriction,
trace_format format
 

Definition at line 828 of file trace.c.

References format, print(), print_string(), print_trace_format_list(), print_with_symbols(), Symbol, trace_format, and tracing_object_letters.

Referenced by print_all_trace_formats(), and print_trace_callback_fn().

bool remove_trace_format bool  stack_trace,
int  type_restriction,
Symbol name_restriction
 

Definition at line 742 of file trace.c.

References hash_table_struct::buckets, deallocate_trace_format_list(), tracing_rule_struct::format, format, free_memory(), hash_table, hash_table_struct::log2size, tracing_rule_struct::name_restriction, tracing_rule_struct::next_in_hash_bucket, remove_from_hash_table(), Symbol, trace_format, and tracing_rule.

Referenced by add_trace_format(), and soar_FormatWatch().

growable_string selection_to_trace_string Symbol object,
Symbol current_state,
int  selection_type,
bool  allow_cycle_counts
 

Definition at line 1295 of file trace.c.

References tracing_parameters::allow_cycle_counts, tracing_parameters::current_o, tracing_parameters::current_s, find_appropriate_trace_format(), growable_string, symbol_union::id, make_blank_growable_string(), identifier_struct::operator_slot, Symbol, tparams, trace_format, trace_format_list_to_string(), wme_struct::value, and slot_struct::wmes.

Referenced by print_stack_trace().

growable_string trace_format_list_to_string trace_format tf,
Symbol object
 

Definition at line 1055 of file trace.c.

References abort_with_fatal_error(), add_to_growable_string(), add_trace_for_attribute_path(), tracing_parameters::allow_cycle_counts, trace_format_struct::trace_format_data_union::attribute_path, ATTS_AND_VALUES_RECURSIVELY_TFT, ATTS_AND_VALUES_TFT, tracing_parameters::current_o, CURRENT_OPERATOR_TFT, tracing_parameters::current_s, CURRENT_STATE_TFT, trace_format_struct::data, DECISION_CYCLE_COUNT_TFT, ELABORATION_CYCLE_COUNT_TFT, found_undefined, free_growable_string(), growable_string, symbol_union::id, IDENTIFIER_TFT, IF_ALL_DEFINED_TFT, L_BRACKET_TFT, LEFT_JUSTIFY_TFT, identifier_struct::level, make_blank_growable_string(), NEWLINE_TFT, trace_format_struct::next, trace_format_struct::num, object_to_trace_string(), PERCENT_TFT, R_BRACKET_TFT, REPEAT_SUBGOAL_DEPTH_TFT, RIGHT_JUSTIFY_TFT, trace_format_struct::trace_format_data_union::string, STRING_TFT, trace_format_struct::trace_format_data_union::subformat, SUBGOAL_DEPTH_TFT, Symbol, symbol_to_string(), tparams, trace_format, trace_format_struct::type, VALUES_RECURSIVELY_TFT, and VALUES_TFT.

Referenced by object_to_trace_string(), print_object_trace_using_provided_format_string(), and selection_to_trace_string().

unsigned long tracing_rule_hash_function void *  item,
short  num_bits
 

Definition at line 695 of file trace.c.

References tracing_rule_struct::name_restriction, and tracing_rule.

Referenced by init_tracing().


Variable Documentation

const char* format
 

Definition at line 155 of file trace.c.

Referenced by parse_attribute_path_in_brackets(), parse_format_string(), parse_item_from_format_string(), parse_pattern_in_brackets(), print(), print_tracing_rule(), remove_trace_format(), and setSoarResultResult().

char* format_string_error_message
 

Definition at line 156 of file trace.c.

Referenced by parse_attribute_path_in_brackets(), parse_format_string(), parse_item_from_format_string(), and parse_pattern_in_brackets().

bool found_undefined
 

Definition at line 899 of file trace.c.

Referenced by add_trace_for_attribute_path(), and trace_format_list_to_string().

struct tracing_parameters tparams
 

Referenced by object_to_trace_string(), print_object_trace_using_provided_format_string(), selection_to_trace_string(), and trace_format_list_to_string().

char tracing_object_letters[3] = { '*', 's', 'o' }
 

Definition at line 816 of file trace.c.

Referenced by print_tracing_rule().


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