Global Information Lookup Global Information

Logic programming information


Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:

A :- B1, ..., Bn.

and are read as declarative sentences in logical form:

A if B1 and ... and Bn.

A is called the head of the rule, B1, ..., Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:

A.

Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:

?- B1, ..., Bn.

In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, ..., Bn are atomic formulae of the form p(t1 ,..., tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter.

Consider, for example, the following Horn clause program:

mother_child(elizabeth, charles).
father_child(charles, william).
father_child(charles, harry).
parent_child(X, Y) :- 
     mother_child(X, Y).
parent_child(X, Y) :- 
     father_child(X, Y).
grandparent_child(X, Y) :- 
     parent_child(X, Z), 
     parent_child(Z, Y).

Given a query, the program produces answers. For instance for a query ?- parent_child(X, william), the single answer is

X = charles

Various queries can be asked. For instance the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:

grandparent_child(X, william).
X = elizabeth

?- grandparent_child(elizabeth, Y).
Y = william;
Y = harry.

?- grandparent_child(X, Y).
X = elizabeth
Y = william;
X = elizabeth
Y = harry.

?- grandparent_child(william, harry).
no
?- grandparent_child(elizabeth, harry).
yes

Although Horn clause logic programs are Turing complete,[1][2] for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:

sibling(X, Y) :- 
     parent_child(Z, X), 
     parent_child(Z, Y), 
     not(X = Y).

Logic programming languages that include negative conditions have the knowledge representation capabilities of a non-monotonic logic.

In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal-reduction procedures. From this point of view, clause A :- B1,...,Bn is understood as:

to solve A, solve B1, and ... and solve Bn.

Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold.

Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic-based program verification and program transformation.

  1. ^ Tärnlund, S.Å. (1977). "Horn clause computability". BIT Numerical Mathematics. 17 (2): 215–226. doi:10.1007/BF01932293. S2CID 32577496.
  2. ^ Andréka, H.; Németi, I. (1978). "The generalised completeness of Horn predicate-logic as a programming language". Acta Cybernetica. 4 (1): 3–10.

and 26 Related for: Logic programming information

Request time (Page generated in 0.8384 seconds.)

Logic programming

Last Update:

Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical...

Word Count : 10723

Programmable logic controller

Last Update:

properly. Programmable logic controllers are intended to be used by engineers without a programming background. For this reason, a graphical programming language...

Word Count : 5261

Inductive logic programming

Last Update:

Inductive logic programming (ILP) is a subfield of symbolic artificial intelligence which uses logic programming as a uniform representation for examples...

Word Count : 4184

Probabilistic logic programming

Last Update:

Probabilistic logic programming is a programming paradigm that combines logic programming with probabilities. Most approaches to probabilistic logic programming are...

Word Count : 1198

Constraint logic programming

Last Update:

Constraint logic programming is a form of constraint programming, in which logic programming is extended to include concepts from constraint satisfaction...

Word Count : 6028

Programmable logic device

Last Update:

A programmable logic device (PLD) is an electronic component used to build reconfigurable digital circuits. Unlike digital logic constructed using discrete...

Word Count : 2444

Ladder logic

Last Update:

Ladder logic has evolved into a programming language that represents a program by a graphical diagram based on the circuit diagrams of relay logic hardware...

Word Count : 1945

Declarative programming

Last Update:

declarative programming is a programming paradigm—a style of building the structure and elements of computer programs—that expresses the logic of a computation...

Word Count : 2378

Functional logic programming

Last Update:

Functional logic programming is the combination, in a single programming language, of the paradigms of functional programming and logic programming. This style...

Word Count : 150

Abductive logic programming

Last Update:

Abductive logic programming (ALP) is a high-level knowledge-representation framework that can be used to solve problems declaratively, based on abductive...

Word Count : 2524

Constraint programming

Last Update:

constraint logic programming were Prolog III, CLP(R), and CHIP. Instead of logic programming, constraints can be mixed with functional programming, term rewriting...

Word Count : 2309

Prolog

Last Update:

logic, a formal logic, and unlike many other programming languages, Prolog is intended primarily as a declarative programming language: the program is...

Word Count : 7988

Concurrent logic programming

Last Update:

Concurrent logic programming is a variant of logic programming in which programs are sets of guarded Horn clauses of the form: H :- G1, …, Gn | B1, …...

Word Count : 320

Concurrent constraint logic programming

Last Update:

Concurrent constraint logic programming is a version of constraint logic programming aimed primarily at programming concurrent processes rather than (or...

Word Count : 1608

Procedural programming

Last Update:

Procedural programming is a programming paradigm, classified as imperative programming, that involves implementing the behavior of a computer program as procedures...

Word Count : 985

Programming language

Last Update:

1972, was the first logic programming language, communicating with a computer using formal logic notation. With logic programming, the programmer specifies...

Word Count : 8509

Answer set programming

Last Update:

set programming to the problem of product configuration. In 1999, the term "answer set programming" appeared for the first time in a book The Logic Programming...

Word Count : 2839

List of programming languages by type

Last Update:

λProlog (a logic programming language featuring polymorphic typing, modular programming, and higher-order programming) Oz, and Mozart Programming System cross-platform...

Word Count : 6971

Tabled logic programming

Last Update:

tabling might react to changes. The adaptation of tabling into a logic programming proof procedure, under the name of Earley deduction, dates from an...

Word Count : 559

Programmable Array Logic

Last Update:

programming. (MMI also offered a similar family called HAL, or "hard array logic", which were like PAL devices except that they were mask-programmed at...

Word Count : 2465

Association for Logic Programming

Last Update:

The Association for Logic Programming (ALP) was founded in 1986. Its mission is "to contribute to the development of Logic Programming, relate it to other...

Word Count : 355

Journal of Logical and Algebraic Methods in Programming

Last Update:

of Logic Programming. 1 (1). Cambridge University Press: 1. doi:10.1017/s1471068400000028. "Journal of Logical and Algebraic Methods in Programming". 2013...

Word Count : 191

Fifth Generation Computer Systems

Last Update:

(MITI) to create computers using massively parallel computing and logic programming. It aimed to create an "epoch-making computer" with supercomputer-like...

Word Count : 2301

Functional programming

Last Update:

functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm...

Word Count : 8548

Logic in computer science

Last Update:

semantics. Logic programming is a programming, database and knowledge representation paradigm that is based on formal logic. A logic program is a set of sentences...

Word Count : 1721

Logic

Last Update:

Logic is the study of correct reasoning. It includes both formal and informal logic. Formal logic is the study of deductively valid inferences or logical...

Word Count : 16841

PDF Search Engine © AllGlobal.net