|Published (Last):||19 November 2008|
|PDF File Size:||15.84 Mb|
|ePub File Size:||17.65 Mb|
|Price:||Free* [*Free Regsitration Required]|
Prolog is a logic programming language. It has important role in artificial intelligence. Unlike many other programming languages, Prolog is intended primarily as a declarative programming language. In prolog, logic is expressed as relations called as Facts and Rules. Core heart of prolog lies at the logic being applied.
Formulation or Computation is carried out by running a query over these relations. In prolog, We declare some facts. These facts constitute the Knowledge Base of the system. We can query against the Knowledge Base. We get output as affirmative if our query is already in the knowledge Base or it is implied by Knowledge Base, otherwise we get output as negative.
So, Knowledge Base can be considered similar to database, against which we can query. Prolog facts are expressed in definite pattern. Facts contain entities and their relation. Entities are written within the parenthesis separated by comma ,.
Their relation is expressed at the start and outside the parenthesis. So, a typical prolog fact goes as follows :. Key Features : 1. Unification : The basic idea is, can the given terms be made to represent the same structure. Backtracking : When a task fails, prolog traces backwards and tries to satisfy previous task. Recursion : Recursion is the basis for any search in program. Running queries : A typical prolog query can be asked as :.
Advantages : 1. Easy to build database. Pattern matching is easy. Search is recursion based. It has built in list handling. Makes it easier to play with any algorithm involving lists. Disadvantages : 1. Sometimes input and output is not easy. Prolog is highly used in artificial intelligence AI. Prolog is also used for pattern matching over natural language parse trees. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below. Writing code in comment? Please use ide. How to Become a Freelance Programmer in ? What Should I Do? Is it Worth to Learn Python in ? Introduction : Prolog is a logic programming language. Installation in Linux :. Check out this Author's contributed articles. Improved By : ManasChhabra2.
Prolog | An Introduction