What is the logic of programming languages

linkCatch


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.

Table of Contents

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.
Minna is Nadine's mother.

Rule:

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

Question / goal:

Who is Nadine's grandmother?

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:

Web links


  • [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)









Categories:Programming paradigm




Status of information: 11/22/2020 11:48:13 AM CET

Source: Wikipedia (authors [version history]) License: CC-BY-SA-3.0

Changes: All images and most of the design elements associated with them have been removed. Some of the icons have been replaced by FontAwesome icons. Some templates have been removed (such as "Article worth reading", "Excellent article") or rewritten. Most of the CSS classes have been removed or standardized.
Wikipedia-specific links that do not lead to articles or categories (such as "Redlink", "Edit links", "Portal links") have been removed. All external links have an additional FontAwesome icon. In addition to other small design adjustments, media containers, maps, navigation boxes, spoken versions and geo-microformats have been removed.

Important NOTE Since the given content was automatically taken over from Wikipedia at the specified time, manual checking was and is not possible. LinkFang.org therefore does not guarantee the correctness and topicality of the content taken over. If the information is incorrect in the meantime or there are errors in the presentation, we ask you to contact us by: E-Mail.
Also note:Imprint & privacy policy.