Chapter 5. Programming with Logic
In this chapter, we are going to cover a different way to derive algorithms, one that takes a highly declarative approach in order to address the problems at hand: logic programming. We'll see this paradigm in action while studying the following recipes:
- Querying a social website's data
- Designing a type inferencer
- Playing a round of checkers
Introduction
Logic programming is an interesting paradigm according to which you can express programs in terms of relations that involve some logic variables and expect results that reflect what these logical variables have to be to make sure that these relations are verified. We then speak about "goals" that "succeed", as the logical engine was able to come up some particular ...
Get Clojure Data Structures and Algorithms Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.