When using FUF, a grammar developer is programming in the FUF programming language. The grammar is a program. The input FD is the input to the program. FUF is the interpreter and sentences are the output of the execution of a grammar on inputs. In this framework, when something ``goes wrong,'' the grammar developer must debug his grammar. The main sources of bugs found when developing FUF programs are:
The main problem when debugging a FUF program is to identify what caused a failure to occur. We introduce the following terminology to discuss the various debugging tools available in FUF: a failure occurs whenever the unifier attempts to unify a simple leaf symbol with a different, incompatible leaf. Failures trigger backtracking. An unexpected failure is a failure that the programmer did not expect. The initial failure is the first unexpected failure to occur during an unification. The distinction between regular failure and unexpected failure is of course subjective, but it is useful, because there are usually many failures that occur even if there are no bugs in the grammar. This happens whenever a non-indexed alt is traversed. Branches are tried in order until the appropriate branch is found. When failure occurs during the test of the initial branches, this is not the trace that ``something is going wrong''. So the main problem of the FUF debugger is to, as quickly as possible, identify the initial failure - and to filter out all the irrelevant expected failures.
This task is made difficult because FUF backtracks a lot, and if the initial failure is missed, a lot of subsequent ``unexpected failures'' will occur when wrong branches are tried upon backtracking (in a sense, everything that happens after the initial failure should be disregarded, as the unifier is engaging on a wrong course).
This chapter presents the tracing tools available in FUF and provides advice on how to use them to quickly identify the initial failure.