March 2001
Intermediate to advanced
400 pages
8h 35m
English
Suppose that you would like to be able to match a structure such as:
city(Name, Altitude)
with a structure such as:
city(denver, 5280)
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 ...
Read now
Unlock full access