Soar Kernel  9.3.2 08-06-12
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
backtrace.h
Go to the documentation of this file.
1 /*************************************************************************
2  * PLEASE SEE THE FILE "license.txt" (INCLUDED WITH THIS SOFTWARE PACKAGE)
3  * FOR LICENSE AND COPYRIGHT INFORMATION.
4  *************************************************************************/
5 
6 /* =======================================================================
7  backtrace.h
8 ======================================================================= */
9 
10 /*
11  For each production which is backtraced through, keep the name of the
12  production, which condition was being traced (from the RHS of this
13  production firing) and then the lists of grounds, potentials, locals
14  and negateds generated during the backtrace.
15  At the moment I'm not guaranteeing that each condition appears in the
16  correct list -- this is because elements move between lists after their
17  initial positioning.
18 */
19 
20 #ifndef BACKTRACE_H
21 #define BACKTRACE_H
22 
23 #ifdef __cplusplus
24 extern "C"
25 //{
26 #endif
27 
28 typedef char Bool;
29 typedef struct condition_struct condition;
31 typedef signed short goal_stack_level;
32 typedef struct agent_struct agent;
33 
34 #define BUFFER_PROD_NAME_SIZE 256
35 typedef struct backtrace_struct {
36  int result; /* 1 when this is a result of the chunk */
37  condition *trace_cond; /* The (local) condition being traced */
38  char prod_name[BUFFER_PROD_NAME_SIZE]; /* The production's name */
39  condition *grounds; /* The list of conds for the LHS of chunk */
40  condition *potentials; /* The list of conds which aren't linked */
41  condition *locals; /* Conds in the subgoal -- need to BT */
42  condition *negated; /* Negated conditions (sub/super) */
43  struct backtrace_struct *next_backtrace; /* Pointer to next in this list */
45 
46 /* RBD Note: more comments here */
47 extern void trace_locals (agent* thisAgent, goal_stack_level grounds_level, bool *reliable);
48 extern void trace_grounded_potentials (agent* thisAgent);
49 extern Bool trace_ungrounded_potentials (agent* thisAgent, goal_stack_level grounds_level, bool *reliable);
50 extern void backtrace_through_instantiation (agent* thisAgent,
51  instantiation *inst,
52  goal_stack_level grounds_level,
54  bool *reliable,
55  int indent);
56 
57 // To print out the message similar to: a chunk was not created because...
58 void report_local_negation (agent* thisAgent, condition* c);
59 
60 #ifdef __cplusplus
61 //}
62 #endif
63 
64 #endif