Prolog, Programming in logic, is a declarative programming language that is based on the ideas of logic programming. Prolog was an idea to make the logic look like a programming language and also the idea of the prolog was to allow the logic to be controlled by a programmer to advance the research for theorem-proving.
The logical paradigm is a programming paradigm that is a road-map to machine learning languages. It tends to impose a certain view of the world on its users.
When a paradigm is applied in problem domains that deal with the extraction of knowledge from basic relations and facts, the logic paradigm fits extremely well. In the more general areas of computation, the logical paradigm seems less natural. In logic (declarative) paradigm, programmers don’t focus on the development of an algorithm to achieve any goal rather they focus only on the ‘goals of any computation’. They focus only on the logic, the what, that has to be achieved. The technique is referred to as resolution and involves the interpreter that searching through the set of all possible solutions.
Computer scientists are using logic programming methods to try to allow machines to reason because this method is useful for knowledge representation. The logic paradigm is based on first-order predicate logic.
Two basic terms are used in the logical paradigm.
- Logic: is used to represent knowledge.
- Inference: is used to manipulate knowledge.
In logic programming, the logic used to represent knowledge is the clausal form that is a subset of first-order predicate logic. First-order logic is used because of its understandable nature as well as it can represent all computational problems. The resolution inference system is used to manipulate knowledge. It is required for proving theorems in clausal-form logic. The essence of logic programming is shown in the below diagram.
In the logic paradigm, a program consists of a set of predicates and rules of inference. Predicates are fact-based statements i.e. water is wet. On the other hand, rules of inference are statements such as “if X is human then X is mortal”.