Input: Two atoms A=p(u1, ..., un) and B=p(v1, ..., vn).
Output: Substitution {x1=w1, ..., xk=wk}.
Procedure: Starting with a system of equations
{u1=v1, ..., un=vn}, apply the following steps as long as
they are applicable.
History and Foundations
Content
Exam style questions
Propositional Logic
Content
Exam style questions
(q => p) | ~(q => (p | r))
is a logical consequence of the set:
{ p | q | r,
r => (p | q),
(q ^ r) => p,
~p | q | r }
.
~rf
is a logical consequence of the set:
{ ~rf | td,
~gc | td,
~td | ph,
~ph }
.
p
is a logical consequence of the set:
{ q v p,
~q v r,
~r v s,
~s v ~r v t,
~t v p }
.
1st Order Logic
Content
Exam style questions
V = { V : V starts with uppercase }
F = { coke/0, pepsi/0, competitor/1 }
P = { fizzy/1, sells_more/2 }
V = { V : V starts with uppercase }
F = { holden/0, ford/0, honda/0 main_competitor/1 }
P = { fast/1, faster/2 }
and the interpretation:
D = { commodore, laser, prelude }
F = { holden -> commodore,
ford -> laser,
honda -> prelude,
main_competitor(commodore) -> prelude,
main_competitor(laser) -> prelude,
main_competitor(prelude) -> commodore }
R = { fast(commodore) -> TRUE,
fast(laser) -> FALSE,
fast(prelude) -> TRUE,
faster(commodore,commodore) -> FALSE,
faster(commodore,laser) -> TRUE,
faster(commodore,prelude) -> TRUE,
faster(laser,commodore) -> FALSE,
faster(laser,laser) -> FALSE,
faster(laser,prelude) -> FALSE,
faster(prelude,commodore) -> FALSE,
faster(prelude,laser) -> TRUE,
faster(prelude,prelude) -> FALSE }
Show the steps of the interpretation of:
No vegetarian likes either beef or pork.
There are some vegetarians who like eggs.
If someone doesn't like pork, then they don't like bacon.
Therefore there is someone who likes eggs but not bacon.
Resolution
Content
Unification Algorithm
If this algorithm terminates with `failure', the initial system of
equations has no solution (no unifier) and if it terminates without
failure, the resulting equation system is the most general unifier
of the system started with.
Exam style questions
% The only animals in this house are cats.
~in_house(Cat) | cat(Cat)
% Every animal is suitable for a pet, that loves to gaze at the moon.
~gazer(Gazer) | suitable_pet(Gazer)
% When I detest an animal, I avoid it.
~detested(Detested) | avoided(Detested)
% No animals are carnivorous, unless they prowl at night.
~carnivore(Carnivore) | prowler(Carnivore)
% No cat fails to kill mice.
~cat(Cat) | mouse_killer(Cat)
% No animals ever take to me, except what are in this house.
~takes_to_me(Taken_animal) | in_house(Taken_animal)
% Kangaroos are not suitable for pets.
~kangaroo(Kangaroo) | ~suitable_pet(Kangaroo)
% None but carnivora kill mice.
~mouse_killer(Killer) | carnivore(Killer)
% I detest animals that do not take to me.
takes_to_me(Animal) | detested(Animal)
% Animals that prowl at night always love to gaze at the moon.
~prowler(Prowler) | gazer(Prowler)
% The problem is to prove that "I always avoid a kangaroo".
kangaroo(the_kangaroo)
~avoided(the_kangaroo)
% There is a barbers' club that obeys the following three conditions:
% If any member has shaved any other member -- whether himself or
% another -- then all members have shaved him, though not necessarily
% at the same time.
~member(X) | ~member(Y) | ~shaved(X,Y) | shaved(members,X)
~shaved(members,X) | ~member(Y) | shaved(Y,X)
% Four of the members are named Guido, Lorenzo, Petrucio, and Cesare.
member(guido)
member(lorenzo)
member(petruchio)
member(cesare)
% Guido has shaved Cesare
shaved(guido,cesare)
% Prove Petrucio has shaved Lorenzo
~shaved(petruchio,lorenzo)
? [Y] :
! [X] :
( element(X,Y)
<=> element(X,X) )
=> ~ ( ! [X1] :
? [Y1] :
! [Z] :
( element(Z,Y1)
<=> ~ element(Z,X1) ) )
! [Z] :
? [Y] :
! [X] :
( element(X,Y)
<=> ( element(X,Z)
& ~ element(X,X) ) )
! [X,Y] :
( set_equal(X,Y)
<=> ! [Z] :
( element(Z,X)
<=> element(Z,Y) ) )
{ p(X,Y),
~p(f(X,Y),g(X,Y)),
~p(X,h(Y)) v p(X,Y),
~p(X,h(Y)) v ~p(X,X),
~p(X,Y) v p(X,X) v p(X,h(Y)) }
! [X,Y] :
? [Z] :
! [W] :
( ( big_p(X)
& big_q(Y) )
=> ( big_r(Z)
& big_s(W) ) )
=> ? [X1,Y1] :
( ( big_p(X1)
& big_q(Y1) )
=> ? [Z1] : big_r(Z1) )
! [X] :
( p
| big_f(X) )
<=> ( p
| ! [X1] : big_f(X1) )
! [Z] :
? [W] :
! [X] :
? [Y] :
( big_p(X,Z)
=> ( ( big_p(Y,W)
& big_p(Y,Z) )
& ( big_p(Y,W)
=> ? [U] : big_q(U,W) ) ) )
! [X,Z] :
( ~ big_p(X,Z)
=> ? [Y] : big_q(Y,Z) )
? [X,Y] : big_q(X,Y)
=> ! [Z] : big_r(Z,Z)
! [X] :
? [Y] : big_r(X,Y)
There are some students who fail. If a student fails, then either there
is a lecturer who has taught the student badly, or the student is stupid.
No lecturer teaches any student badly. Therefore there is some student
who is stupid.
Now give a refutation proof of the conjecture.
S = { ~r(Y) v ~p(Y),
p(b),
r(a),
p(S) v ~p(b) v ~r(S),
r(c) }
If you are a normal person, then you like at least one form of music
and you dislike at least one form of music.
There is a person who likes all music.
Therefore there is a person who is not a normal person.
Now convert it to CNF in a form ready for a refutation proof, and
give a linear-input refutation proof of the conjecture.
Prolog
Content
Exam style questions
?-unique([cat,hat,cat,rat,mat,cat,hat],N).
yes
N = 4
Search Control Strategies
Content
Exam style questions
Knowledge Representation
Content
Exam style questions
Knowledge Engineering
Content
Exam style questions
Uncertainty
Content
Exam style questions