Recursion is a popular and powerful problem solving technique. Recursion can be used to describe structures that have other structures as components and it can be used to solve problems that involve iterative computations, tree traversal, and list manipulation.
Prolog logically deduces facts about the situations we describe, and gives its deductions back to us as answers. Writing Prolog applications requires thinking declaratively, recursion, and recursive data structures.
This has a number of consequences - it requires a different mindset! You will need to see computational problems from a different perspective. Thinking declaratively rather than procedurally can be more difficult than it seems, especially to programmers who come from a procedural or object oriented background. Also, because Prolog is a high-level language, when programming a knowledge base, rather than writing code to solve a problem, you are define the problem AS code.
This is the first of an ongoing blog series about programming language theory. In today’s blog, we will be exploring a few key constructs for defining programming languages: syntax and semantics, regular expressions, and finite-state automata.
By understanding these concepts, we can begin to build a foundational understanding of the formal methods for defining the syntax of a programming language.
Want to know what Prolog is and how it works? Prolog is a logic programming language. Prolog is composed of depth first search, unification, recursion, and backtracking.
In this multi-part Prolog blog series, I'll explain what all of that means by breaking it down and explaining things starting with fundamental concepts. We will be writing code. You will see and feel the power of predicate logic in action.