14Programming with Logic

Having seen a bit of how inference in first-order predicate logic works using truth trees, you might wonder just how much you can do with inference. The answer is, a whole heck of a lot! In fact, anything that a computer can do—any computation that can be written as a program—can be done by inference in first-order predicate logic!

This isn’t just an empty boast or a theoretical equivalence, but a real and practical fact. There’s a very powerful, very useful programming language called Prolog, in which a program consists of nothing but collections of facts and predicates—all you can do is provide it with a collection of facts and predicates. The execution of a Prolog program is a sequence of inferences performed by ...

Get Good Math 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.