Types of Horn Clauses :
•Definite clause / Strict Horn clause :Has exactly one positive literal.
•Unit clause :Definite clause with no negative literals.
•Goal clause :Horn clause without a positive literal.
•In Datalog, rules are expressed as a restricted form of clauses called
Horn clauses, in which a clause can contain at most one positive literal.
•Clausal form:
In this form, the formula is made up of a number of clauses, where each
clause is composed of a number of literals connected by OR logical
connectives only.
Contd..
•Definiteclause:Aclausewhichisadisjunctionofliteralswithexactlyone
positiveliteralisknownasadefiniteclauseorstricthornclause.
•Hornclause:Aclausewhichisadisjunctionofliteralswithatmostone
positiveliteralisknownashornclause.Henceallthedefiniteclausesare
hornclauses.
•Example:(¬pV¬qVk).Ithasonlyonepositiveliteralk.
•It is equivalent to p ∧q → k.
Types of Quantifiers
•A formula can have following quantifiers:
•Universal quantifier –
It can be understood as –“For all x, P(x) holds”, meaning P(x) is true
for every object x in universe. For example, all trucks has wheels.
•Existential quantifier –
It can be understood as –“There exists an x such that P(x)”, meaning
P(x) is true for at least one object x of universe. For example, someone
cares for you.
Forms of Horn Clause
•Clausal form :
Literals can be positive literals or negative literals. For the forms of the
individual clauses where each of is a disjunction of literals. For the
clause form :
•The above clause has n negative literals and m positive literals. This
clause can be transformed into the following equivalent logical
formula :
•where ‘=>’ is the implies symbol.
Horn Clausal form :
•(i)The Horn clause,
•Can be transformed into the clause :
•P1 AND P2 AND … AND Pn=> Q
•which is written in Datalog as the following rules.
•The above Datalog Rule, is hence a Horn clause.
Contd…
•Can be transformed into
•P1 AND P2 AND … AND Pn=>
which is written in Datalog as follows :
•TheaboveDatalogexpressioncanbeconsideredasanintegrity
constraint,whereallthepredicatesmustbetruetosatisfythequery.