O'Reilly logo

Building Parsers with Java™ by Steven John Metsker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

13.6. Rules, Axioms, and Programs

A rule is a series of structures in which the truth of the first structure follows from the ability to prove the remaining structures. For example, in Logikus the following rule defines “high” cities:

highCity(Name, Alt) :- city(Name, Alt), >(Alt, 5000); 

This rule states that highCity(Name, Alt) is true for any known city whose altitude is greater than 5,000. A rule's first structure is its head; its other structure is its tail. Between its head and its tail a rule has the “if” (“:-) symbol. The head is true if the tail is provable.

An axiom is a model of truth, and in Logikus an axiom is either a fact or a rule. A Logikus program is a collection of axioms, and this means that a program is an extended model ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required