Suppose that you would like to be able to match a structure such as:
with a structure such as:
so that you can extract a structure's data into variables. Logic engines provide just this kind of matching in a behavior called unification. Unification lets a variable bind to a value. It also allows entire structures to bind, with all the terms in a structure binding to their counterparts in another structure. For example, if you ask the two structures here to unify, the variables Name and Altitude will unify with denver and 5280, as the following program shows:
package sjm.examples.engine; import sjm.engine.*; /** * Show two structures unifying. */ public class ShowStructureUnification ...