12.5. Facts
With structures, variables, and unification in place, you might think that the next logical step is to collect groups of structures and then to unify a variable structure with each one. However, logic programming introduces notions that veer from this course. The first notion is that a structure can represent a statement of truth, or what logic programming calls an axiom. For example, you can regard
city(denver, 5280)
as a model of the true statement that Denver's elevation is about 5,280 feet. A structure that contains no variables is a fact, which is one type of axiom. The other type of axiom is a rule, which you will meet shortly. In the classes in package sjm.engine, class Fact is a subclass of Structure, as Figure 12.2 shows. ...
Get Building Parsers with Java™ now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.