Languages should be as declarative as possible. In particular, would like to use predicate logic to describe facts and properties about problem, and have system automatically infer a solution by logical reasoning. The idea of logic programming to be able to answer such questions using a general algorithm for logical reasoning, and without the aid of a particular algorithm for this problem. Of course, we might expect to pay some price in efficiency . Real logic programming languages like Prolog use a restricted logic.
Queries can also contain variables, which are implicitly existentially quantified over the clause.
We humans can view Prolog programs as logical specifications, and use ordinary logical reasoning to evaluate queries. Given a goal, the Prolog evaluator attempts to satisfy it. To do this, it seaches the program looking for a fact or rule LHS that unifies with the goal. The result of a successful unification is thus a list of bindings and sharing associations, called a unifier . If the goal is unified with a fact under a given unifier, it means that the goal is satisfiable, using the bindings in the unifier to instantiate the goal's variables.