Logic and Functional Programming

We have already seen the difference between a Logic programming language and a traditional functional programming language. Figure 1 summarizes this difference pictorially.

images

While functional programming requires step-by-step instructions to solve a particular problem, logic programming, on the other hand, uses a knowledge base to find answers to the given questions.

In functional programming, we have to specify the steps to solve a particular problem, but in logic programming, we just have to give the problem. The logic programming automatically finds a suitable solution to solve that problem.


Comments

Leave a Reply

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