there are a lot of links from wikipedia but they dont work so i had to change it to links from outside so it may look like a lot of these articles are from outside wikipedia , they aren't 

A **Horn clause** is a logic disjunction of literals. Where at most one of the literals is positive and all the others are negative. It is named after Alfred Horn, who described them in an article in 1951. 

A Horn clause with exactly one positive literal is a **definite clause**; a definite clause with no negative literals is sometimes called a "fact"; and a Horn clause without a positive literal is sometimes called a **goal clause**. These three kinds of Horn clauses are shown in the following propositional example:

**definite clause**: {\displaystyle \neg p\lor \neg q\vee \cdots \vee \neg t\vee u}
**fact**: {\displaystyle u}
**goal clause**: {\displaystyle \neg p\lor \neg q\vee \cdots \vee \neg t}
In the non-propositional case, all variables in a clause are implicitly universally quantified with scope the entire clause. Thus, for example:

{\displaystyle \neg {\text{human}}(X)\lor {\text{mortal}}(X)}
stands for:

{\displaystyle \forall X(\neg {\text{human}}(X)\lor {\text{mortal}}(X))}
which is logically equivalent to:

{\displaystyle \forall X({\text{human}}(X)\rightarrow {\text{mortal}}(X)).}
Horn clauses play a basic role in constructive logic and computational logic. They are important in automated theorem proving by first-order resolution because the resolvent of two Horn clauses is itself a Horn clause, and the resolvent of a goal clause and a definite clause is a goal clause. These properties of Horn clauses can lead to greater efficiencies in proving a theorem (represented as the negation of a goal clause).

Horn clauses are also the basis of logic programming, where it is common to write definite clauses in the form of an implication:

{\displaystyle (p\wedge q\wedge \cdots \wedge t)\rightarrow u}
In fact, the resolution of a goal clause with a definite clause to produce a new goal clause is the basis of the SLD resolution inference rule, used to implement logic programming and the programming language Prolog.

In logic programming a definite clause behaves as a goal-reduction procedure. For example, the Horn clause written above behaves as the procedure:

**to show {\displaystyle u}, show {\displaystyle p} and show {\displaystyle q} and {\displaystyle \cdots } and show {\displaystyle t}.**
To emphasize this backwards use of the clause, it is often written in the backward form:

{\displaystyle u\leftarrow (p\land q\land \cdots \land t)}
In Prolog this is written as:

```
u :- p, q, ... t.
```

However, the Prolog notation is unclear, and the term "goal clause" is sometimes also used differently. The variables in a goal clause can be read as universally or existentially quantified and deriving "false" can be interpreted either as deriving a contradiction or as deriving a successful solution of the problem to be solved.

Van Emden and Kowalski (1976) investigated the model theoretic properties of Horn clauses in the context of logic programming, showing that every set of definite clauses **D** has a unique minimal model **M**. An atomic formula **A** is logically implied by **D** if and only if **A** is true in **M**. It follows that a problem **P** represented by an existentially quantified conjunction of positive literals is logically implied by **D** if and only if **P** is true in **M**. The minimal model semantics of Horn clauses is the basis for the stable model semantics of logic programs.

Propositional Horn clauses are also of interest in computational complexity, where the problem of finding truth value assignments to make a conjunction of propositional Horn clauses true is a P-complete problem (in fact solvable in linear time  ), sometimes called HORNSAT. (The unrestricted Boolean satisfiability problem is an NP-complete problem however.) Satisfiability of first-order Horn clauses is undecidable.

Bibliography
------------

* Alfred Horn (1951), "On sentences which are true of direct unions of algebras", *Journal of Symbolic Logic*, 16, 14–21.
* Dowling, W. and Gallier, J. (1984), "Linear-time algorithms for testing the satisfiability of propositional Horn formulae". *Journal of Logic Programming*, **3**, 267–284.
* M. van Emden and R. Kowalski [1976] *The semantics of predicate logic as a programming language*. Journal of ACM, Vol. 23, 733–742.


1. ↑  "Time complexity", *Wikipedia*, 2024-04-13, retrieved 2024-04-15