Prolog Programming Language

PROLOG PROGRAMMING LANGUAGE
INTRODUCTION
The objective of this class is to investigate PROLOG to use it in Artificial Intelligence exercises. Solving exercises in this program consists of creating a file as the knowledge base that will contain enough information to make correct decisions and provide correct answers, and another which will carry the rules, that will validate the requests to give the answers.
THEORETICAL FRAMEWORK
PROLOG
PROLOG is a programming language very useful for solving problems that involve objects and relationships between objects. It is based on the following basic mechanisms:
Unification
Automatic backtracking
Defining rules about objects and their relationships. (Write,F).
FACTS
ü No se permiten disyunciones.
ü Los nombres de los predicados empiezan con minúscula.
ü El hecho debe terminar con un punto.
PREGUNTAS
En tiempo de ejecución, aparece el prompt ?- y el intérprete de PROLOG espera que el usuario introduzca un objetivo en forma de predicado, con sin variables.
Al igual que en CLIPS, tendremos ficheros con la descripción de la base de conocimiento (hechos y reglas).Artificial Intelligence Applications
(opro)
?- baseconoc.
/ Esto añade a la MT de Prolog los hechos del fichero /
?- esHombre(juan).
yes artificial intelligenceArtificial Intelligence Google
?- esHombre(pedro).
sure
?- esHombre(juanCarlos).
no
?- esMamifero(leon).
Not
REGLAS
Existe en PROLOG la posibilidad de definir la relación abuelo(X,Y)” la relación tio(X,Y)” como reglas, además de poderlo hacer como hechos como conjunción de objetivos.
abuelo(X,Y):- progenitor(X,Z), progenitor(Z,Y).
tio(X,Y):- progenitor(Z,Y), progenitor(V,Z), progenitor(V,X).
A la primera parte de la regla se le llama cabeza conclusión, the symbol “:-” is the conditional (IF), and the part of the rule that is after :- is the body conditional part. The body can be a conjunction of goals separated by commas. To prove that the head of the rule is true, it will be necessary to prove that the body of the rule is true.
From what has been seen so far, PROLOG clauses are of three types: hechos, rules and questions. PROLOG clauses consist of a head and a body. Facts are clauses that have a head but do not have a body. Questions only have a body. Rules always have a head and a body. Facts are always true. Rules declare things that are true depending on a condition. The PROLOG program ( PROLOG database) it is made up of facts and rules and for PROLOG there is no distinction between the two. Questions are asked to the program to determine what things are true. (Write,F).
CONCLUSION
This Prolog language is oriented towards AI , using logical programming for this. Prolog has ease of programming and contains simple syntax, thanks to this programmers can quickly write code and not have many errors, It is also easy to understand and can be used by inexperienced users.
BIBLIOGRAPHY
Cubero, J. 2009. Prolog Tutorial. Online. PDF Format. Available in
Write,F. 2005. The PROLOG Programming Language. Online. PDF Format. Available in
Posted by
Unknown in

Leave A Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.