Clause (logic)

From Wikipedia, the free encyclopedia

Jump to: navigation, search

In logic, a clause is a disjunction of literals. In propositional logic, clauses are usually written as follows, where the symbols li are literals:

l_1 \vee \cdots \vee l_n

In some cases, clauses are written as sets of literals, so that clause above would be written as \{l_1, \ldots, l_n\}. That this set is to be interpreted as the disjunction of its elements is then hinted from the context. A clause can be empty; in this case, it is an empty set of literals. The empty clause is denoted by various symbols such as \empty, \bot, or \Box. The truth evaluation of an empty clause is always false.

In first-order logic, a clause is the universal quantification of all free variables of a quantifier-free disjunction of literals. Formally, a first-order literal is formula of the kind of P(t_1,\ldots,t_n), where P is a predicate of arity n and each ti is an arbitrary term, possibly containing variables. If L_1,\ldots,L_m are literals, and x_1,\ldots,x_k are their (free) variables, then \forall x_1,\ldots,x_k .
L_1,\ldots,L_m is a clause. First-order clauses are sometimes written omitting the quantifiers, so that the above clause is written L_1,\ldots,L_m. This omission is justified by the fact that, for being a clause, a disjunction of literals must have all variables universally quantified. In case a clause is valid or checked for validity, this universal quantification is also implicit in the semantics. However, the definition of satisfiability assumes free variables to be existentially quantified, so the omission of quantifier is to be taken as a convention and not as a consequence of how the semantics deal with free variables.

In logic programming, clauses are usually written as the implication of a head from a body. In the simpest case, the body is a conjunction of literals while the head is a single literal. More generally, the head may be a disjunction of literals. If b_1,\ldots,b_m are the literals in the body of a clause and h_1,\ldots,h_n those of its head, the clause is usually written:

h_1,\ldots,h_n :- b_1,\ldots,b_m

In computer programming, a clause is a series of statements executed upon the evaluation of a conditional expression. A condition may not always be explicitly applied to a clause; these are usually called non-conditional, main, or functional clauses. A clause may also be referenced by the structure of the conditional expression, for example I am inserting a case-clause where $type is equal to 'auto'. Modifications are necessary to the if-then clause where the ninth subscript of $array ($array[9]) is equal to 'Sam'.


Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.