# What is the logic of programming languages

Logical programming (Predicative programming) is a programming paradigm based on mathematical logic. In contrast to imperative programming, a logic program does not consist of a sequence of instructions, but of a set of axioms, which are to be understood here as a collection of facts or assumptions. If the user of a logic program makes a request, the interpreter tries to calculate the solution statement from the axioms alone.

To do this, a lot of so-called regulate and instructions, which are structured according to the syntax, together with information about which solution method is provided, inserted into the program code. Logical programming languages ​​belong to the declarative programming languages ​​and have their origins in the research field of artificial intelligence.

An imperative program describes exactly how and in what order a problem is to be solved. In contrast, a logic-based program describes what applies. The how is given by the solution method. The solution is derived from the rules.

The most popular logical programming language is Prolog. Alain Colmerauer and Robert Kowalski were among the founders of logical programming in the 1970s.

### Explanations

The syntax specifies how rules must be written in order for the computer to use them. regulate are if-then statements and facts that describe the knowledge of a problem area. There are also special constructs to influence the solution method. The best known is the backward truncation. cut) in Prolog, with which z. B. Exception rules can be modeled.

You can do a rule-based program ask (engl. query) set by one aim (engl. goal) pretends.

The Solution method dictates how the inference engine interprets the rules to answer the question. In Prolog, a depth search is used. depth first) used with unification and backtracking. Other methods are also suitable and are also used depending on the application.

### example

This example is written in natural language to show the principle.

Facts:

Lucia is the mother of Minna.
Lucia is the mother of Klaus.

Rule:

IfX is the mother of YandY is the mother of ZThenX is the grandmother of Z.

Question / goal:

Answer of the computer, conclusion from the facts and rules:

Lucia

### Areas of application

This article or the following section is not adequately provided with supporting documents (e.g. individual evidence). Information without sufficient evidence could be removed soon. Please help Wikipedia by researching the information and including good evidence.
This section has no evidence. --8Paule (discussion) 21:34, Nov. 20, 2019 (CET)

Typical areas of application are simulators, generators, as well as systems for diagnosis and prognosis. Applications of logic programming can be found in the following areas:

Examples outside of computer science:

In the field of informatics and computer technology:

• [1] - a brief overview of the development of classic logic through to logical programming (110 kB)
• XSB (English) Logic System and Deductive Database (Open Source)