next up previous contents
Next: Identifying Possible Bugs: Trace-bp Up: Tracing and Debugging Previous: Checking the Validity of

Fine Tuning Tracing: Overview of FUF Tracing Functions

Several dimensions characterize the activity of the FUF unifier:

It is possible to tailor the tracing behavior of FUF according to each of these dimensions. In general, FUF can output a tracing message whenever it takes an action, such as adding a feature to the total FD, selecting a branch in the grammar, backtracking because of a failure, expanding a cset and moving in the constituent tree traversal, freezing and unfreezing goals etc. Outputting all the possible trace messages is always overwhelming, and provides too much text to be useful. So the challenge of the FUF debugger is to fine-tune the tracing system to produce just enough information to locate the bugs in the grammar and/or in the input FD.

The grammar developper indicates what portions of the grammar must be traced: the grammar is traced, not the unifier. Therefore, to trigger tracing, one must put directives into the grammar. At the Lisp level, and for a given grammar including tracing directives, traces can be switched on or off by the following functions:

          
I GENERAL TRACING CONTROL

(trace-on) enable all trace messages to be output. (trace-off) disable all trace messages to be output (trace-bp &optional (frequency 10)): Output a dot for every frequency backtracking points. Useful for long computations to get a feeling of what's happening. Works even if (trace-off). %break% allows the insertion of break points in the grammar. (trace-level level) Determines detail level of trace to be printed. The following levels are defined: 00: feature level action 05: unimportant alt-level action 10: alt-level action - branch number trying 12: demo messages 15: freeze, ignore, bk-class 20: constituent level action 30: important failure - end of alt

II TRACING FLAGS MANAGEMENT: ENABLE & DISABLE

(all-tracing-flags &optional (grammar *u-grammar*)) return the list of all tracing flags defined in grammar. (trace-disable flag) disable flag. Everything works as if flag was not defined in the grammar. (trace-enable flag) re-enable a disabled flag. (trace-disable-all) disable all flags. (trace-enable-all) re-enable all flags. (trace-enable-alt alt-name :expansion t :grammar g) (trace-disable-alt alt-name ...) Enable all tracing flags defined under a def-alt or def-conj. If expansion is nil, does not expand the sub-def-alt. (trace-disable-match string) disable all flags whose names contain string. (trace-enable-match string) re-enable all flags whose names contain string.

III CONTROL OF SPECIFIC ACTIVITY TRACING

(trace-determine :on t|nil) enable tracing of determine stage or not. (trace-category :all|cat|(cat1...catn) t|nil) enable tracing of categories or not. (trace-bk-class t|nil) list special messages concerning bk-class (trace-wait :on t|nil) list special messages concerning goal freezing (trace-cset :on t|nil) trace cset expansion (trace-alts :on t|nil) detailed tracing of all alts, even unnamed. (hyper-trace-category cat :status t|nil) trace category with printing of full constituent before unification of constituents of the traced cats.

                                         


next up previous contents
Next: Identifying Possible Bugs: Trace-bp Up: Tracing and Debugging Previous: Checking the Validity of
Michael Elhadad - elhadad@cs.bgu.ac.il