Disclaimer: This text is translated, only for the study Exchange trial, do not use for commercial purposes, cause all consequences I am not responsible, reproduced please explain. My English skill is still shallow, the translation mostly relies on the translation tool, if has the mistake, welcome correction.
Introduction to Logic Programs
A logic program is a set of axioms or rules that define the relationships between objects. The calculation of the logic program is deducted from the consequences of the plan. A program defines a set of consequences, which is what it means. The art of logical programming is to construct a scheme with the necessary meaning of simplicity and generosity.
Prolog basic structure
Logical programming, the basic structure of terms and declarations, inherits from logic. There are three basic statements: facts, rules, and queries. There is a single data structure: a logical term. The simplest kind of statement is the truth. The fact is that the device that describes the relationship between objects is established.
As an example,
Father (ABRAHAM,ISAAC). This fact says that Abraham is the father of Isaac, or that Father relations are established between Abraham and Isaac individuals. Another name for the relationship is called judgment. The name of an individual is called an atom.
Similarly, plus (2,3,5). The relationship of expression is 2 plus 3 is 5.
Familiarity with add-on relationships can be achieved through a set of facts that define the addition table. The initial segment of the table is
Plus (0,0,0). Plus (1,0,1).
Plus (0,1,1). Plus (1,1,2).
Plus (0,2,2). Plus (for all).
Plus (0,3,3). Plus (1,3,4).
The table is exactly a legitimate logic program and will be assumed to be the definition of the relationship in this chapter. The grammar conventions used throughout the book are described as needed. The first is such an agreement. This is an important name.
The Art of prolog:advanced programming techniques "translated"