First-order clause 2026-10-31
A finite logical disjunction of atomic first-order formulas or their negations, normally understood to have all its free variables universally quantified. An empty logical disjunction is false. A Horn clause has at most one positive atom.
Horn-SAT Created 2026-09-28 Updated 2026-10-31
Horn-SAT forward-chaining algorithm Created 2026-09-28 Updated 2026-11-05
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.
Four-page University of Oxford Finals examination, Trinity Term 2015, dated Tuesday 16 June 2015, 9:30 am–11:00 am. The original marks Questions 1 and 3 as corrected. Printed p. 2 concerns Horn clause proof search and admissible heuristics; p. 3 concerns a STRIPS encoding of a multi-stack Tower of Hanoi puzzle; p. 4 concerns constraint satisfaction problems, tree decomposition, and all-different constraints.
Public archive: Lawrence Attachment.zip, member
2015-is.pdf.Held original:
pdf/computer-science/finals/intelligent-systems/2015.pdf in the Oxford examinations repository. Editable transcription: tex/computer-science/finals/intelligent-systems/2015.tex. Least Herbrand model 2026-10-31
For a satisfiable equality-free universal logical conjunction of Horn clauses, intersecting the sets of true ground atoms of its Herbrand models gives another Herbrand model, contained in every one of them. A ground atom is true in this least Herbrand model exactly when it holds in every Herbrand model. Positive existential sentences are true in the least Herbrand model exactly when they follow from the Horn clauses; allowing negated atoms makes this equivalence fail. For example, the least Herbrand model of over a single constant makes both predicates empty and satisfies , whereas the first-order structure making both predicates universal is a countermodel to that consequence.
The four-page University of Oxford Finals computer science examination held on 10 June 2015, Trinity Term 2015. Public primary-source archive: Lawrence Attachment.zip, member
2015-landp.pdf. Printed p. 4, Question 3(d), permits an arbitrary quantifier-free formula in an asserted least Herbrand model equivalence; that assertion fails when negative atoms are allowed, even for a satisfiable Horn clause.Let be the set of Boolean variables occurring in or the initial query , and put . Represent a current query by a subset : the Boolean literals in this set are the outstanding obligations. The initial state is , and the goal test is .
An action chooses a Horn clause with positive Boolean literal , provided . Its search transition model is precisely the given resolution inference rule:Thus it removes the obligation and inserts all negative Boolean literals of . Repeated Boolean literals merge because queries are sets. A Horn clause without a positive Boolean literal supplies no action under the rule specified in this paper; it must not be treated as an additional way of finishing the query.
Give every action unit cost. A graph path with actions gives a proof containing queries, so minimizing either quantity gives the same shortest proof. Uniform-cost search orders the search frontier by the number of actions already taken and applies the goal test when removing a search node for expansion. Recording parent actions reconstructs the proof.
There are at most two choices, present or absent, for each of the negative Boolean literals. ThereforeThis bounds the state space, including the empty query, rather than the possibly infinite search tree of action histories.[ref]
Intelligent Systems examination paper by the University of Oxford (2015). Printed p. 2, corrected Question 1, definitions and part (a)
Termination is not guaranteed. TakeBoth members of are valid Horn clauses with distinct underlying Boolean variables. The only possible continuation alternatesThe empty query is unreachable. With the admissible heuristic , ordinary A-star search keeps generating the next search node forever, despite there being only two reachable states.
A modification requiring no additional stored state collection is to impose the known search depth boundThe unit-cost already stored by A-star search is also its search depth; the bound is a scalar computed from the input, not a closed set. Apply the goal test before refusing expansion at the bound.
To prove completeness of this modification, remove any segment between two equal states in a successful proof. The successor choices after the later occurrence are available at the earlier occurrence because the search transition model depends only on the current query. Repeating this removal gives a proof with no repeated states, hence at most actions. In particular, a shortest proof never needs a repeated state, since every removed segment has positive cost. The depth restriction therefore preserves a shortest proof whenever one exists.
The restricted search tree has finite depth and finite branching factor, so it is finite. A-star search must then either remove a goal or exhaust the search frontier and report failure. Its existing search frontier may still be large; the modification saves a separate visited-state collection, not all storage used by tree search.
Use the shortest path distances in the directed dependency graph to defineThe additional counts the final use of a positive unit Horn clause, which corresponds to a fact rather than an edge of .
To justify the new lower bound, consider any complete proof from and fix . At some step this obligation must be removed using a Horn clause with head . If that Horn clause is the fact , we have already found a dependency graph path of length zero ending at a fact. Otherwise select one negative body Boolean literal . Immediately after the step it belongs to the query, whether newly inserted or merged with an existing obligation. It must subsequently be removed. Record the edge and repeat this argument at its later removal.
The selected removal times strictly increase. Since the proof is finite and ends with no obligations, this chain eventually uses a fact. A proof of actions therefore produces a dependency walk of at most edges from to a fact. Removing any cycles from that walk gives . Hence for every initial obligation. If , no such proof exists. Combining this bound with the admissible heuristic by taking their maximum preserves admissibility.
The assertion is false as printed, even for a satisfiable equality-free Horn clause. The original paper allows an arbitrary quantifier-free formula , so in particular permits negative atoms.[ref]
Logic and Proof examination paper of the University of Oxford (2015). Printed p. 4, Question 3(d), final sentence: the matrix is specified as quantifier-free, without a positivity restriction
Take a first-order signature with a constant and unary predicates , and letThe matrix of is a Horn clause, and the Herbrand universe is the singleton . The possible Herbrand models of assign the values , , or . Neither ground atom is true in every such Herbrand model, so the paper's intersection construction givesConsequently , with witness . However, the one-element first-order structure in which both predicates hold everywhere satisfies and falsifies . HenceThis directly refutes the requested implication; no proof of the stated equivalence is possible. It also isolates the issue: an atom being absent from the intersection means that it is false in some Herbrand model, not that it is false in every first-order model.
The standard correct version assumes that is satisfiable, uses an equality-free first-order signature with a nonempty Herbrand universe, and requires to be a positive quantifier-free formula: one built from atoms and truth constants using only logical conjunction and logical disjunction. Under those assumptions the expected argument is as follows.
First, the intersection of the ground atoms true in all Herbrand models is itself a Herbrand model of . To see this, read each ground Horn clause as , where is an atom or false. If every is true in the intersection, every is true in every Herbrand model. When is an atom, all these Herbrand models must make true, so the intersection does too. When is false, the antecedent cannot hold in any Herbrand model; since there is at least one such model, it cannot hold in the intersection either. Thus the intersection is the least Herbrand model.
Now let for positive . There is a tuple of ground terms with . Expand the positive quantifier-free formula into disjunctive normal form; one of its logical conjunctions of positive atoms is true at . Each of those ground atoms holds in every Herbrand model of . It also follows that : otherwise a first-order model of would, by Herbrand's theorem for universal equality-free first-order clauses, yield a Herbrand model of , a contradiction. Every first-order model of therefore satisfies the same positive logical conjunction at the interpretations of , and hence satisfies .
Conversely, if , the fact that the least Herbrand model is a first-order model of immediately gives . Thus the repaired conclusion isThe satisfiability qualification is separately necessary when general Horn clauses may have no positive conclusion. For instance, is a logical conjunction of Horn clauses with no models. The intersection convention then makes every ground atom true by vacuity, yet entails even , which that Herbrand structure falsifies. The earlier satisfiable example already refutes the printed claim without relying on this further defect.
Use a first-order signature with a constant and unary predicates , and setThe displayed first-order clause has two positive atoms, so it is not a Horn clause. There is a Herbrand model with true and false, and another with the opposite values. Thus neither atom holds in all Herbrand models; the intersection construction makes both false.
Every first-order model of has a nonempty domain, and any element witnesses , so . Nevertheless . ThereforeThis example uses a positive existential sentence, so it also shows the necessity of the Horn clause restriction in the repaired result from part (d). Without that restriction, the intersection of Herbrand models need not itself be a first-order model of : here it fails the very disjunction that all the original Herbrand models satisfy.
Past exam of the mathematics course of the University of Cambridge 2023 iii Paper 124 3 iii Solution 2026-09-28
Write each Horn clause as an implicationwhen it has one positive literal , or as a forbidden conjunctionwhen it has none. Start with every variable false. Repeatedly, whenever all antecedents of an implication are true, set its conclusion true. If a forbidden conjunction ever has all antecedents true, report unsatisfiable; otherwise stop when no change is possible and return the resulting assignment.
Each step changes a previously false variable to true, so at most the number of variables steps occur; scanning all clauses after each step is polynomial time. For correctness, every satisfying assignment must set every variable derived by this Horn-SAT forward-chaining algorithm to true, by induction over the derivation. Therefore, if the algorithm violates a negative clause, every assignment violates it. If no violation occurs, all implications and all negative clauses are satisfied by the final assignment. This proves polynomial-time decidability.
Resolution inference rule 2026-10-31
From Boolean clauses containing complementary Boolean literals, derive the Boolean clause formed by removing that complementary pair and taking the remaining Boolean literals. For example, resolving with gives . Backward proof search with a positive-headed Horn clause and an all-negative query is a restricted use of this rule.