Horn clause and applications with detail

1,012 views 11 slides Feb 27, 2024
Slide 1
Slide 1 of 11
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11

About This Presentation

horn clauses and its application


Slide Content

Horn Clause and Definite
clause
BCA 6
th
AI

Contents
•Horn Clause and Definite clause
•Types of Horn clause
•Quantifiers
•Two forms of Horn Clause

Horn clause and definite clause
•Hornclauseanddefiniteclausearetheformsofsentences,which
enablesknowledgebasetouseamorerestrictedandefficientinference
algorithm.
•AHornclauseisaclause(adisjunctionofliterals)withatmostone
positive,i.e.unnegated,literal.Aclausewithatmostonepositive
(unnegated)literaliscalledaHornClause.

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…
•Meaning:IfthepredicatesP1ANDP2AND…ANDPn,arealltruefor
aparticularbindingtotheirvariablearguments,thenQisalsotrue
andcanhencebeinferred(concluded).
•(ii)TheHornclause,

Contd…
•Can be transformed into
•P1 AND P2 AND … AND Pn=>
which is written in Datalog as follows :
•TheaboveDatalogexpressioncanbeconsideredasanintegrity
constraint,whereallthepredicatesmustbetruetosatisfythequery.

•END OF THE PRESENTATION
•THANKS