A Horn clause is a disjunction of literals containing at most one positive literal. It can be read as an implication whose antecedent is a conjunction of variables.
A first-order clause containing at most one positive first-order literal. A clause with exactly one positive literal is definite; with no positive literal it is a constraint or goal clause.
The Horn-SAT forward-chaining algorithm maintains the set of Boolean variables already forced true. Write each Horn clause as an implication , where the conclusion is either a Boolean variable or false. Start with . Whenever every antecedent belongs to , add the conclusion ; if the conclusion is false, report failure.
Every satisfying assignment must make all members of true: this holds initially and is preserved by each enabled implication. Thus an enabled false conclusion proves that no satisfying assignment exists. If no further Boolean variable can be added and no such failure occurs, interpreting exactly as true satisfies every Horn clause. It is the least satisfying assignment under inclusion of true Boolean variables.
For example, the clauses , and force . Adding makes the instance unsatisfiable. Each Boolean variable enters at most once. Indexing antecedent occurrences and maintaining a counter per clause permits one update per occurrence, avoiding repeated full scans.
Articles by others on the same topic
A Horn clause is a special type of logical expression used in propositional logic and predicate logic that has important applications in computer science, particularly in logic programming and automated theorem proving. A Horn clause is defined as a disjunction of literals (which can be either a positive or negative atomic proposition) with at most one positive literal.