Prolog is a declarative language. This means that the formal definition or declaration of a problem may be used as a functional program to solve that problem. In Prolog we declare the logical relationships of a given problem domain rather than state a step-by-step procedural recipe for solving the problem. This is useful as often we know various aspects of the problem but very little about how to find a solution. Prolog will attempt to find a solution for us given the information about the problem.
The way Prolog does this is by using a built-in inference engine, which automatically infers the solution to a given query using the facts and rules as defined in the program. Prolog programs consist of facts and rules, which are referred to as clauses. A fact consists of a single assertion with no conditions: a fact is always true. A rule consists of a goal, whose truth is dependent upon a set of conditions or sub-goals. The goal of a rule is referred to as its head and the sub-goals as its body.
Prolog attempts to prove a goal by using its backward chaining inference engine to match the initial goal with either a known fact or the head of a rule. If the goal is matched with a known fact the goal is proven. If the goal is matched with the head of a rule the original goal is then replaced with the sub-goals which form the body of the rule. Prolog then attempts to prove, in the same way, each of these sub-goals in turn. Although Prolog programs are thought of as declarative they can also have a procedural reading. Prolog is versatile: there is a style of Prolog programming which mimics the conventional procedural approach, but with less emphasis on the actual assignment statements.
Prolog as a logic programming language has a sound theoretical basis, being modelled on the first-order predicate calculus. This means that theoretically a Prolog program, which may be read as a set of axioms and theorems, contains the possibility of being proven consistent or inconsistent, regardless of the implementation. In this way Prolog can be thought of as an automated theorem prover.sturbing blocky effect). Likewise, when a sub scene (part of a full image) is produced from TM data, it also appears sharper when printed at some typical size (e.g., 10 inches).