I haven’t been able to understand what the resolution rule is in propositional logic. Does resolution simply state some rules by which a sentence can be expanded and written in another form?
Following is a simple resolution algorithm for propositional logic. The function returns the set of all possible clauses obtained by resolving it’s 2 input. I can’t understand the working of the algorithm, could someone explain it to me?
function PL-RESOLUTION(KB,α) returns true or false
inputs: KB, the knowledge base, a sentence α in propositional logic, the query, a
sentence in propositional logic
clauses <--- the set of clauses in the CNF representation of KB ∧ ¬α
new <--- {}
loop do
for each Ci, Cj in clauses do
resolvents <----- PL-RESOLVE(Ci, Cj)
if resolvents contains the empty clause then return true
new <--- new ∪ resolvents
if new ⊆ clauses then return false
clauses <---- clauses ∪ new
It’s a whole topic of discussion but I’ll try to explain you one simple example.
Input of your algorithm is KB – set of rules to perform resolution. It easy to understand that as set of facts like:
We introduce two predicates
R(x)– (xis red) andS(x)– (xis sweet). Than we can written our facts in formal language:R('apple')R(X) -> S(X)We can substitute 2nd fact as
¬R v Sto be eligible for resolution rule.Caluclating resolvents step in your programs delete two opposite facts:
Examples: 1)
a & ¬a -> empty. 2)a('b') & ¬a(x) v s(x) -> S('b')Note that in second example variable
xsubstituted with actual value'b'.The goal of our program to determine if sentence apple is sweet is true. We write this sentence also in formal language as
S('apple')and ask it in inverted state. Then formal definition of problem is:R('apple')¬R(X) v S(X)¬S('apple')Algorithm works as follows:
S('apple')That means our sentence is true. If you can’t get empty set with such resolutions that means sentence is false (but for most cases in practical applications it’s a lack of KB facts).