AI Glossary / Graphs and symbolic AI / Intermediate
Definite clause
Definition
A definite clause is a logical clause containing exactly one positive literal. It can be written as a rule with a single positive conclusion whose conditions are a conjunction of positive atoms, making it a foundational form for logic programming.
What it means
A literal is an atomic statement or its negation. A clause is a disjunction of literals. For example, not-P or not-Q or R has one positive literal, R, and therefore is definite.
The same statement can be written as: if P and Q, then R. In this rule form, R is the head and P and Q form the body. The body atoms are written positively because moving the negative literals across the implication changes the presentation.
Every definite clause is a Horn clause, but not every Horn clause is definite. Horn clauses permit at most one positive literal, so they also include clauses with none.
How it works
A set of definite clauses describes facts and rules. A fact has a positive head and no conditions. A rule supports its head whenever its body can be established under a consistent substitution for its variables.
Forward reasoning starts with available facts and applies rules to derive additional conclusions. Backward reasoning starts with a goal, matches it to a rule head and tries to establish that rule's body. In first-order logic, variables in a clause are understood as universally quantified.
The logical meaning should be distinguished from an execution strategy. A Prolog program's chosen order of clauses and goals can affect search and termination. Features such as cuts, side effects and negation-as-failure require additional interpretation; they should not be treated as merely the pure definite-clause fragment.
Three practical examples
- Relationship reasoning: Rules derive an indirect relationship from simpler recorded links.
- Rule-based classification: A system establishes a category when several required properties hold together.
- Logic programming: A program uses facts and single-head rules to answer relational queries through matching and proof search.
Think of it this way
Think of a checklist leading to one conclusion: if every required box is checked, the rule supports that conclusion. The analogy highlights conjunction in the body and a single head. It does not imply that checking the conclusion proves each box was checked, because the conclusion could have another explanation.
Worked example
Suppose the facts are Parent(ada,ben) and Parent(ben,cy). Add the rule:
Parent(x,y) and Parent(y,z) implies Grandparent(x,z).
In clause form, it is not-Parent(x,y) or not-Parent(y,z) or Grandparent(x,z). Only Grandparent(x,z) is a positive literal, so this is a definite clause.
Using x = ada, y = ben and z = cy makes both body atoms match the facts. The rule therefore derives Grandparent(ada,cy).
The shared variable y matters: both parent links must involve the same intermediate person. Parent(ada,ben) together with Parent(dan,cy) would not support that conclusion through this rule, because ben and dan are different constants in this example.
Parent(ada,ben) by itself is also a definite clause: it is a fact with one positive literal and an empty body. By contrast, not-P or not-Q has no positive literal. It is Horn but not definite. P or Q has two positive literals and is neither definite nor Horn.
Finally, Grandparent(ada,cy) alone does not let us reverse the rule to infer those particular parent links. The implication supports the head from the body, not an arbitrary reconstruction of its premises.
Illustrative case study
Fictional case: Cedar Relations builds a small rules engine for linking project records. A developer writes a rule intended to connect a project to a department through the project's assigned manager.
During review, the team notices that the two body conditions use different manager variables. The rule can therefore combine a project's manager with an unrelated department manager, producing unintended links.
The team corrects the shared variable and creates examples where names deliberately differ. It also inspects the query execution strategy, because a logically sensible recursive rule can still lead to repeated or nonterminating search in a particular implementation. The case illustrates two separate checks: whether the rule says the right thing and whether the program evaluates it appropriately.
Common misconceptions and mistakes
- Definite means certain in an everyday sense. Here it names a syntactic form, not the reliability of the input facts.
- Every Horn clause is definite. A Horn clause with no positive literal is a counterexample.
- Negative literals in clause notation mean the rule body contains explicit negative tests. The equivalent positive-body implication has a different surface form.
- A single rule head guarantees termination. Recursion and search strategy can still lead to nontermination.
Business use
Definite clauses provide a compact, inspectable way to express relationships and derivations. They can help when an application needs explanations that identify which facts and rules support a conclusion.
Review variable sharing, the direction of implications and the meaning of missing facts. Decide whether the application uses pure logical entailment or additional execution conventions. For recursive rules, evaluate search behavior and resource use separately from logical correctness. A rule that is easy to read can still encode the wrong relationship if its variables are connected incorrectly.
People also ask
Can a fact be a definite clause?
Yes. It has exactly one positive literal and no negative literals, corresponding to an empty rule body.
Is every Prolog clause a pure definite clause?
No. Practical Prolog includes additional language features whose behavior extends beyond that simple logical form.
Does failing to prove a head prove its negation?
Not in ordinary classical entailment from definite clauses. Additional assumptions or operational conventions are needed for that interpretation.
Check your understanding
Classify the clause not-A or not-B or C. How would it read as an implication?
Answer: It is definite because C is its only positive literal. It reads: if A and B, then C.
Related terms
- Horn clause
- Literal
- Unification
- Forward-chaining
- Backward-chaining
- Datalog
- atomic formula
- logic programming
- Prolog
Learn next
Write a two-link reachability rule and check that both edges share the same intermediate variable. Translate it into disjunctive clause form. Then compare a fact, a definite rule and a clause with no positive literal.
More in Graphs and symbolic AI
- Deductive synthesis - Deductive synthesis is the construction of a program from a specification by applying logical reasoning and justified transformation rules.
- Default logic - Default logic is a formal approach to reasoning with assumptions that may be withdrawn when additional information becomes available.
- Default rules - Default rules are rules that permit a provisional conclusion when stated conditions hold and no relevant defeating information prevents the inference.
- Definite clause grammar - A definite clause grammar, or DCG, is a notation for describing grammars and related sequence-processing relations in logic programming.
- Deformable template - A deformable template is a model of an object's shape or structure that can change within specified limits to fit observed data.
- Defuzzification - Defuzzification is the process of converting a fuzzy output representation into a single numerical value.
Sources
SWI-Prolog's glossary distinguishes clauses, Horn clauses, definite clauses and facts, and explains their rule notation: https://www.swi-prolog.org/pldoc/man?section=glossary
Russell and Norvig provide the broader logical-reasoning context in their textbook materials: https://aima.cs.berkeley.edu/
The family-link derivation and Cedar Relations case are original illustrations. This entry describes the pure logical form and explicitly separates it from additional Prolog execution features.
Previous: Defense in depth (computing) Next: Definite clause grammar