What Is Prolog Used For
Prolog - Introduction
Prolog as the name itself suggests, is the brusque form of LOGical PROgramming. It is a logical and declarative programming linguistic communication. Before diving deep into the concepts of Prolog, let united states first empathize what exactly logical programming is.
Logic Programming is ane of the Reckoner Programming Paradigm, in which the program statements express the facts and rules well-nigh different problems within a system of formal logic. Here, the rules are written in the form of logical clauses, where caput and body are present. For example, H is caput and B1, B2, B3 are the elements of the body. Now if we land that "H is true, when B1, B2, B3 all are true", this is a dominion. On the other hand, facts are like the rules, simply without any torso. So, an example of fact is "H is true".
Some logic programming languages similar Datalog or ASP (Answer Gear up Programming) are known every bit purely declarative languages. These languages let statements about what the program should accomplish. There is no such step-by-step instruction on how to perform the chore. Still, other languages similar Prolog, have declarative and also imperative properties. This may also include procedural statements like "To solve the problem H, perform B1, B2 and B3".
Some logic programming languages are given below −
-
ALF (algebraic logic functional programming language).
-
ASP (Answer Ready Programming)
-
CycL
-
Datalog
-
FuzzyCLIPS
-
Janus
-
Parlog
-
Prolog
-
Prolog++
-
ROOP
Logic and Functional Programming
We volition discuss well-nigh the differences between Logic programming and the traditional functional programming languages. We can illustrate these two using the below diagram −
From this illustration, we can meet that in Functional Programming, we have to ascertain the procedures, and the rule how the procedures work. These procedures work step by step to solve one specific problem based on the algorithm. On the other manus, for the Logic Programming, we will provide noesis base. Using this knowledge base, the auto can find answers to the given questions, which is totally dissimilar from functional programming.
In functional programming, nosotros take to mention how one problem tin can be solved, but in logic programming we accept to specify for which problem we actually want the solution. Then the logic programming automatically finds a suitable solution that will aid united states of america solve that specific trouble.
Now let united states of america see some more differences below −
Functional Programming | Logic Programming |
---|---|
Functional Programming follows the Von-Neumann Architecture, or uses the sequential steps. | Logic Programming uses abstract model, or deals with objects and their relationships. |
The syntax is actually the sequence of statements like (a, due south, I). | The syntax is basically the logic formulae (Horn Clauses). |
The computation takes function by executing the statements sequentially. | It computes by deducting the clauses. |
Logic and controls are mixed together. | Logics and controls can be separated. |
What is Prolog?
Prolog or PROgramming in LOGics is a logical and declarative programming linguistic communication. It is one major example of the fourth generation language that supports the declarative programming prototype. This is peculiarly suitable for programs that involve symbolic or not-numeric computation. This is the main reason to use Prolog as the programming language in Artificial Intelligence, where symbol manipulation and inference manipulation are the central tasks.
In Prolog, we need not mention the way how 1 problem can be solved, we merely demand to mention what the problem is, so that Prolog automatically solves it. However, in Prolog nosotros are supposed to give clues as the solution method.
Prolog language basically has three different elements −
Facts − The fact is predicate that is true, for case, if nosotros say, "Tom is the son of Jack", then this is a fact.
Rules − Rules are extinctions of facts that contain provisional clauses. To satisfy a rule these atmospheric condition should exist met. For example, if we define a rule every bit −
grandfather(X, Y) :- father(Ten, Z), parent(Z, Y)
This implies that for X to exist the grandfather of Y, Z should be a parent of Y and X should be father of Z.
Questions − And to run a prolog programme, nosotros demand some questions, and those questions can be answered by the given facts and rules.
History of Prolog
The heritage of prolog includes the research on theorem provers and another automatic deduction system that were adult in 1960s and 1970s. The Inference mechanism of the Prolog is based on Robinson'due south Resolution Principle, that was proposed in 1965, and Answer extracting mechanism by Light-green (1968). These ideas came together forcefully with the appearance of linear resolution procedures.
The explicit goal-directed linear resolution procedures, gave impetus to the development of a full general purpose logic programming system. The first Prolog was the Marseille Prolog based on the piece of work past Colmerauer in the year 1970. The manual of this Marseille Prolog interpreter (Roussel, 1975) was the kickoff detailed description of the Prolog language.
Prolog is also considered every bit a fourth generation programming language supporting the declarative programming paradigm. The well-known Japanese 5th-Generation Computer Projection, that was announced in 1981, adopted Prolog as a development linguistic communication, and thereby grabbed considerable attention on the language and its capabilities.
Some Applications of Prolog
Prolog is used in various domains. Information technology plays a vital function in automation system. Post-obit are another important fields where Prolog is used −
-
Intelligent Database Retrieval
-
Natural Language Understanding
-
Specification Language
-
Automobile Learning
-
Robot Planning
-
Automation Arrangement
-
Trouble Solving
Useful Video Courses
Video
Video
What Is Prolog Used For,
Source: https://www.tutorialspoint.com/prolog/prolog_introduction.htm
Posted by: freyfraidgetefe.blogspot.com
0 Response to "What Is Prolog Used For"
Post a Comment