next up previous contents
Next: FD Normalization Up: Manipulation of FDs as Previous: FD Accessors

     
FD Relocation

Note that the value returned by top-gdp is not a valid total fd in itself because it can contain paths that point within the total FD. This is shown above in the result of (top-gdp fd1 {b}) which contains a path ((b1 1) (b2 {^2 a})). If you are interested in observing a sub-fd as a self-contained entity with no pointers into an external environment, you must use relocate instead of top-gdp. Relocate extracts a sub-fd from a total FD and turns it into a stand-alone total FD.

          

(relocate totalfd path)

Example: (relocate '((a ((a1 {^ a2}) (a2 ((x 2))) (a3 {a a1}) (a4 {b}) (a5 {^2 c}))) (b {a a1}) (c ((c1 1)))) {a}) => ((a1 {^ a2}) <-- NOTE keep relative path (a2 ((x 2))) (a3 {a1}) <-- NOTE updated path (a4 ((x 2))) <-- NOTE loose conflation a4/a2 because went out of a scope. (a5 ((c1 1)))) <-- NOTE resolved path

This function performs the following adjustments:

The reverse of relocate is insert-fd, which inserts a total FD within a larger total FD. The function also performs analysis of all the paths found within the inserted FD to adjust them to their new environment.

          
(insert-fd fd total subfd-path)

Insert Fd into TOTAL at location subfd-path.

Example: (insert-fd '((a {b}) (b 1) (c {^ b})) '((b 2) (c ((x 1)))) {c}) => ((b 2) (c ((x1 1) <--- NOTE the inserted FD is unified with the existing sub-fd (a {c b}) <--- NOTE updated path. (b 1) (c {c b})))) <--- NOTE relative path is resolved

The main features of this function are illustrated by the example:


next up previous contents
Next: FD Normalization Up: Manipulation of FDs as Previous: FD Accessors
Michael Elhadad - elhadad@cs.bgu.ac.il