Syntax And Semantics Of Logic Programming
   HOME



picture info

Syntax And Semantics Of Logic Programming
Logic programming is a programming paradigm that includes languages based on formal logic, including Datalog and Prolog. This article describes the syntax and semantics of the purely declarative subset of these languages. Confusingly, the name "logic programming" also refers to a programming language that roughly corresponds to the declarative subset of Prolog. Unfortunately, the term must be used in both senses in this article. Declarative logic programs consist entirely of ''rules'' of the form H :- B1, ..., BN. Each such rule can be read as an implication: :B_1\land\ldots\land B_n\rightarrow H meaning "If each B_i is true, then H is true". Logic programs compute the set of facts that are implied by their rules. Many implementations of Datalog, Prolog, and related languages add procedural features such as Prolog's Cut (logic programming), cut operator or extra-logical features such as a foreign function interface. The formal semantics of such extensions are beyond the ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  




Logic Programming
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 ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  



MORE