What is a prologue language?
The prologue is a computer programming language that is based on logic. Most computer languages are based on the steps needed to solve the problem. On the other hand, the language of the prologue is a "declarative" language that indicates logical relationships between entities. The way to solve the problem is left on the computer. The name of the prologue comes from the French programming EN Logique, ie programming logic.
follows a simple program prologue:
predecessor (f, c):- father (f, c)
Ancestor (P, Q):- Father (P, R), Ancestor (R, Q)
Father (John, Jim).
Father (Jim, Jerry).
Father (Jerry, Jason).
Father (Jerry, Jeff).
Father (Jason, Joshua).
The above program indicates the Truisms. If F Father C, then is the predecessor of C. If P is the father of a person who is the predecessor of Q, then P is the predecessor of Q. Then a number of real facts such as John's father are given. So if the question of a problem is asking if Johnjeff is the predecessor, we will get the answer "yes",As shown below:
?- Ancestor (John, Jeff).
Yes
If the ancestors of Joshua are interesting, then the program will display all the ancestors as follows:
?- Ancestor (A, Joshua)
A = Jason
A = Jerry
A = Jim
A = John
Note that in both of the above instances the program did not say how to perform the evaluation. For example, this did not indicate whether to start with an elderly and work on a younger person or vice versa. Also exchanges of parts as shown below:
predecessor (p, q):- predecessor (r, q), father (p, r)
It would be no difference in the program, because both parts on the right side must be true for the left side to be true.
The prologue language thus focuses on relationships and not how to solve the problem. During the program, the prologue will build a number of right buildings, creating a knowledge base. In the above example, a knowledge base in NO wouldThe predecessor (John, Jim), the predecessor (Jim, Jerry), the predecessor (John, Jerry), the predecessor (Jim, Jason), the predecessor (John, Jason), etc. The design can use parallel processing, simultaneous implementation of multiple computers.
The prologue language is used in a number of areas. It began in systems focused on natural languages such as English; Natural language is one of the areas of artificial intelligence. The prologue language is also used in symbolic mathematics, including algebra. It is used in demonstrating theorems, in expert systems and in control systems, between many other applications.