# PROLOG - Part 4

**“Bad reasoning as well as good reasoning is possible; and this fact is the foundation of the practical side of logic.” Charles Sanders Peirce**

## Including rules

Until the last post, we have been working with simple clauses. In this post I am giving an introduction the concept of rules.

## Back to our family example

Right now we have a list of parents. If we want, we can also implement the same list for children, exchanging the order of the names inside the property. **OR** we can do it a bit better: Using rules!

# PROLOG - Part 3

**Logic will get you from A to B. Imagination will take you everywhere.**

## More theory …

After last post theoretical questions were open and the time for the writing was out. I will try to answer some of them now =)

## First order logic and Unification

First-order logic (FOL) or also called *predicate logic* has one or more arguments for each predicate and utilizes *quantifiers* (“for all” and “at least one”). First-order logic is simple but enough to formalize all classic mathematics. A first-order theorem, for example, consists in a set of axioms and sentences that we can reduce from them.

PROLOG is based on FOL and for that, in PROLOG one has the first-order unification algorithm implicit. *Unification* in logic is nothing more than an algorithmic process to solve systems of symbolic expressions. The solution of an *unification problem* is like a map of symbolic values for each variable in the system.

# PROLOG - Part 2

**PROLOG was created in 1972 and it has been used since then, mostly in relational databases, natural languages comprehension and automation.**

## Continuing …

Continuing from the last post, I will again start with some theory before continuing to write our family code.

## Logical programming

In logical programming, we are focused on *knowledge* and not in the algorithms. That is also why the code sometimes looks like a database. This programming paradigm (which one could also include PROLOG) is based on *formal logic*, more specific based on predicate logic.

This means that PROLOG has a set of sentences in logic form, called *clauses*. All clauses that we wrote in the last post are *facts*. They are the simplest type of clauses, also known as *Horn clauses*.

# PROLOG - Part 1

**“Constraint programming represents one of the closest approaches computer science has yet made to the Holy Grail of programming: the user states the problem, the computer solves it.” Eugene C. Freuder, Constraints, April 1997**

## Introduction to PROLOG - but WHY?

When I started this blog yesterday late in the night, I just knew that I wanted to document what I know and the things that I think are cool. Today I decided to write an introduction to PROLOG. =) It seems just right to start with a programming language that is so fun!

## Basic concepts

The name PROLOG comes from PROgramming in LOGic. And that is really all about it. This language is used mostly to solve problems related to objects or facts and their relationships.

In this series, I will go through some basic concepts, such as facts, questions, variables, rules and conjunctions.