top of page

What is a horn clause? Give an example.

A horn clause is a logical formula that consists of a disjunction (OR) of literals, with at most one positive literal. It's a fundamental concept in logic programming and artificial intelligence, particularly in the context of inference rules and knowledge representation.


In simpler terms, a horn clause can be expressed as a rule where if certain conditions are met, then a conclusion can be drawn. It's named after the logician Alfred Horn.


Here's the general structure of a horn clause:

(L1 ∧ L2 ∧ ... ∧ Ln) → H


Where:

- `L1, L2, ..., Ln` are literals (either positive or negative atomic propositions or predicates).

- `H` is a positive literal (atomic proposition or predicate).


An example of a horn clause could be:

(rain ∧ windy) → cold


This can be interpreted as "If it's raining and windy, then it's cold." Here, "rain" and "windy" are negative literals, and "cold" is the positive literal. This rule suggests that if it's both raining and windy, we can infer that it's cold.

294 views0 comments

Comments


bottom of page