Prolog is a logic programming language associated with artificial intelligence and computational linguistics or on call as well as non-procedural language. Prolog is one of the Interpreter of the language program that translated the Line-code line by line.
Its name is taken from French programmation en logique (programming logic). This language was created by Alain and Robert Kowalski Colmerauer around 1972 in an effort to create a programming language that allows the logic statement rather than a series of commands to run the computer.
In Prolog, the program logic is expressed in terms of relationships, the computing process begins by running a query based on this relationship. Prolog language based on the relationship to the words, clauses, phrases and contextual dynamically according to our everyday language. Prologue very useful for database, symbolic mathematics, and language parsing applications. Prologue to check whether there is a false predicate caused by inadvertence. Prolog also has its own logic which is called "pure Prolog", as well as a number of features extralogical.
Prolog language is known as a language more simple and efficient compared to other programming languages, although for basic language, like Pascal.
In general, Visual Prolog program consists of four basic sections, namely section clauses are the most important section of the Visual Prolog program which puts tempay Facts and Rules, section PREDICATES is the place to declare a predicate, Domains section useful to give a meaningful name for the domain, and also is used to declare data structures that are not defined domain standards, and sections, GOAL is a body of a rule.
There are five applications that can be applied through the program prologue. The first is the Expert System, using a technique of making conclusions from the data obtained, as an expert.Examples in the diagnosis of disease. Second is the Natural Language Processing, which is a program created for users to communicate with computers in everyday human language, like translators. Third is the Robotics, that is to process input data from sensors and make decisions to determine the movements should be done. Fourth is the Pattern Recognition, namely the ability to distinguish an object with another object. Often used in image processing. The latter is the Learning, which is prologue to learn from mistakes ever asked to do.
2. How to install prolog
a.First of all we need a prolog installer which it’s can be downloaded at Elearning.
b.Then open the Zip file, you’ll see a installer w32pl547.exe
c.And click the installer, and follow the instruction , clik next..
d.Follow the next instruction
e.Then the installer begin to install, just wait about 5 minutes to install it completely
f.The progress installer will show up
g.Then if the process of installing is over, click finish and happy programming with prolog
3. FACTS (FACTS) AND RELATIONSHIP (RELATIONS)
Prolog consists of a collection of the data object that is a fact. Facts distinguished 2 kinds of facts which show the relation and the fact that the nature / property. In writing always ends with a dot.
Fact | Prologue |
Tarno is the uncle Budi | uncle (tarno, mind). |
Santi was a teacher | teachers (santi). |
Bejo like mango and reading | like (bejo, mango). and the like (bejo, reading). |
Red roses | Red ( |
RULES (RULES)
Rule is a statement showing how facts interact with one another to form a conclusion. A rule is expressed as a conditional sentence. A dinyakatakan rule as a conditional sentence. The word "if" is a word that is known prologue to declare a conditional sentence or symbolized by ":-".
For example there is a fact: Prasojo like durian. Then there is a rule that reads: Andrew likes something favored by Prasojo. From the information obtained from the known facts can be drawn conclusions (answers) from the rule that Andrew likes durian.
Facts and Rules | Prologue |
F: Tino likes apples A: Yuli prefer something like Tino | like (tino, apples). like (yuli, Something): - like (tino, Something). |
Each rule consists of conclusion (head) and body. The body may consist of 1 or more statements or other rules, called a subgoal and is associated with logic "and". Rules have properties then / if conditional. "Head (head) is true if the body (body) is true."
An example is the family genealogy.
Facts and Rules | Prologue |
F: Slamet was the father of Amin F: Amin is a father of Badu F: Slamet was the grandfather of Badu A: Slamet is true grandfather Badu if Slamet is true Amin and Amin's father is the true father of Badu. | father (slamet, amen). father (amen, Badu). grandfather (slamet, Badu).
grandfather (slamet, amen): - father (slamet, amen) and father (amen, Badu). |
F: Amin is a blood brother Anand F: Amin has a father Slamet F: Anand has a father Slamet. A: Amin is true siblings Sam, if Amin has Slamet and Anand's father also has a father Slamet. | saudara_kandung (amen, ananda). father (slamet, amen). father (slamet, ananda).
saudara_kandung (amen, ananda): - father (slamet, amen) and father (slamet, ananda). |
QUESTION (queries)
After presenting the data in the form of facts and rules, we can then ask questions based on facts and rules. Begins writing the symbol "? -" And end the ".".
Question | Prolog and Answer Program |
Is Tini like dolls? | ? - Like (Tini, doll). Yes ... .... (If in fact Tini like dolls) No ... ... .. ... (if it does not fit the facts). |
What is the preferred Tini? | ? - Like (Tini, What). What = doll |
Who would like a doll? | ? - Likes (Who, doll). Who = Tini |
From the family tree example above: Who grandfather Budi?
Who grandchildren Slamet? | ? - Grandfather (who, mind). Who = slamet
? - Grandfather (slamet, grandson). Grandchildren = cultivation; Grandchildren = Badu
(If possible more than one answer to use the ";" at the end of each answer). |
Predicate (PREDICATES)
Predicate is a symbolic name for the relation.
The terms of the writing of the name of the predicate:
o Must start with lowercase letters and can be followed by letters, numbers or underscores.
o Predicate name maximum length 250 characters.
o Not allowed to use spaces, hyphens, asterisks and slashes.
Reference:
· En.wikipedia.org
· jemeinulle.blogspot.com
· xa.yimg.com