The special tracing flag %break% is used to trigger a break in the execution of FUF. When found by FUF, a Lisp continuable break is triggered. It is then possible to examine the current state of the unification using the Lisp debugger. Using the Lisp debugger, it is then possible to either resume unification or abort it. Within the debugger, the total fd can be inspected (and modified) by using the function path-value and set-path-value. A typical session is shown below:
|
The behavior of the debugger depends on which version of Common Lisp you are using. The example shown here is run under Franz Inc's Allegro Common Lisp. Consult your Lisp manual to find out the details of how to resume processing (the :cont command in ACL) and abort processing (the :res command in ACL). Another source of variation is whether the {} notation is recognized within the debugger or not. This notation is implemented using macro characters in Lisp. Macro-characters are recognized in ACL's debugger but not in Lucid Common Lisp's implementation. For that reason, the function path-value accepts as parameter either a path or simply a list of attributes.
The function path-value returns the value of a path in the current total FD. It is useful to inspect the current value of the total FD. The function set-path-value is also defined to change a value within the total FD. Note that it's use is highly dangerous.
(path-value path-or-list) Return the value of path in the current total FD.
|
For more general access, the total FD is accessible in the special variable *input* and it can be modified in any possible ways. But if you do follow this way, there is a high probability that the unification will not be able to proceed normally. Note that there is no way to easily remove a conflation from the total FD using only path-value and set-path-value because path-value always follows the paths until a non-path value can be returned. The following example illustrates this limitation:
(setq *input* '((a {b})
(b ((b1 1)))))
|
One last word of caution: when using set-path-value, relative paths are
made absolute before being inserted relative to the path of insertion given
as parameter. Since the relative path notation can be ambiguous (cf
p.
), this can, under circumstances where there
is an ambiguity, create unexpected results.