Logic and Knowledge Representation
G i
- v
a n n i S i l e n
- g
s i l e n
- @e
n s t . f r
T é l é c
- m
P a r i s T e c h , P a r i s
- D
a u p h i n e U n i v e r s i t y
P r
- b
l e m T y p e s , a n d P r
- b
l e m s
- l
v i n g m e t h
- d
s
2 7 A p r i l 2 1 8
Logic and Knowledge Representation P r o b l e m T y p e - - PowerPoint PPT Presentation
Logic and Knowledge Representation P r o b l e m T y p e s , a n d P r o b l e m s o l v i n g m e t h o d s 2 7 A p r i l 2 0 1 8 g s i l e n o @e n s t . f r G i o v a n n i S
2 7 A p r i l 2 1 8
J . M c C a r t h y ( 1 9 5 6 ) T h e i n v e r s i
f u n c t i
s d e fj n e d b y T a r i n g m a
h i n e s . A u t
a t a S t u d i e s , A n n a l s
M a t h e m a t i c a l S t u d i e s , 3 4 : 1 7 7 – 1 8 1 .
J . M c C a r t h y ( 1 9 5 6 ) T h e i n v e r s i
f u n c t i
s d e fj n e d b y T a r i n g m a
h i n e s . A u t
a t a S t u d i e s , A n n a l s
M a t h e m a t i c a l S t u d i e s , 3 4 : 1 7 7 – 1 8 1 .
N e w e l l , A . , & S i m
, H . A . ( 1 9 7 2 ) . H u m a n p r
l e m s
v i n g .
p r
l e m t y p e a b s t r a c t s
u t i
a b s t r a c t i
r e fj n e m e n t
B r e u k e r , J . ( 1 9 9 4 ) . C
p
e n t s
p r
l e m s
v i n g a n d t y p e s
p r
l e m s . A F u t u r e f
K n
l e d g e A c q u i s i t i
, 8 6 7 , 1 1 8 – 1 3 6 .
B r e u k e r , J . ( 1 9 9 4 ) . C
p
e n t s
p r
l e m s
v i n g a n d t y p e s
p r
l e m s . A F u t u r e f
K n
l e d g e A c q u i s i t i
, 8 6 7 , 1 1 8 – 1 3 6 .
B r e u k e r , J . ( 1 9 9 4 ) . C
p
e n t s
p r
l e m s
v i n g a n d t y p e s
p r
l e m s . A F u t u r e f
K n
l e d g e A c q u i s i t i
, 8 6 7 , 1 1 8 – 1 3 6 .
B r e u k e r , J . ( 1 9 9 4 ) . C
p
e n t s
p r
l e m s
v i n g a n d t y p e s
p r
l e m s . A F u t u r e f
K n
l e d g e A c q u i s i t i
, 8 6 7 , 1 1 8 – 1 3 6 .
B r e u k e r , J . ( 1 9 9 4 ) . C
p
e n t s
p r
l e m s
v i n g a n d t y p e s
p r
l e m s . A F u t u r e f
K n
l e d g e A c q u i s i t i
, 8 6 7 , 1 1 8 – 1 3 6 .
s t r u c t u r a l v i e w : s y s t e m
B r e u k e r , J . ( 1 9 9 4 ) . C
p
e n t s
p r
l e m s
v i n g a n d t y p e s
p r
l e m s . A F u t u r e f
K n
l e d g e A c q u i s i t i
, 8 6 7 , 1 1 8 – 1 3 6 .
s t r u c t u r a l v i e w : s y s t e m b e h a v i
r a l v i e w : s y s t e m + e n v i r
m e n t
B r e u k e r , J . ( 1 9 9 4 ) . C
p
e n t s
p r
l e m s
v i n g a n d t y p e s
p r
l e m s . A F u t u r e f
K n
l e d g e A c q u i s i t i
, 8 6 7 , 1 1 8 – 1 3 6 .
s t r u c t u r a l v i e w : s y s t e m b e h a v i
r a l v i e w : s y s t e m + e n v i r
m e n t
B r e u k e r , J . ( 1 9 9 4 ) . C
p
e n t s
p r
l e m s
v i n g a n d t y p e s
p r
l e m s . A F u t u r e f
K n
l e d g e A c q u i s i t i
, 8 6 7 , 1 1 8 – 1 3 6 .
b e h a v i
r a l v i e w : s y s t e m + e n v i r
m e n t s t r u c t u r a l v i e w : s y s t e m s c h e d u l i n g c
fj g u r a t i
B r e u k e r , J . ( 1 9 9 4 ) . C
p
e n t s
p r
l e m s
v i n g a n d t y p e s
p r
l e m s . A F u t u r e f
K n
l e d g e A c q u i s i t i
, 8 6 7 , 1 1 8 – 1 3 6 .
s t r u c t u r a l v i e w : s y s t e m b e h a v i
r a l v i e w : s y s t e m + e n v i r
m e n t
B r e u k e r , J . ( 1 9 9 4 ) . C
p
e n t s
p r
l e m s
v i n g a n d t y p e s
p r
l e m s . A F u t u r e f
K n
l e d g e A c q u i s i t i
, 8 6 7 , 1 1 8 – 1 3 6 .
s t r u c t u r a l v i e w : s y s t e m b e h a v i
r a l v i e w : s y s t e m + e n v i r
m e n t
B r e u k e r , J . ( 1 9 9 4 ) . C
p
e n t s
p r
l e m s
v i n g a n d t y p e s
p r
l e m s . A F u t u r e f
K n
l e d g e A c q u i s i t i
, 8 6 7 , 1 1 8 – 1 3 6 .
s t r u c t u r a l v i e w : s y s t e m b e h a v i
r a l v i e w : s y s t e m + e n v i r
m e n t
w h e r e i l l
e fj n e d p r
l e m s c
e u p
w h e r e i l l
e fj n e d p r
l e m s c
e u p w h e r e w e l l
e fj n e d p r
l e m s a r e s e t u p
w h e r e i l l
e fj n e d p r
l e m s c
e u p w h e r e w e l l
e fj n e d p r
l e m s a r e s e t u p w h e r e t a s k s a r e a s s i g n e d a n d s c h e d u l e d
J . L a r k i n , J . M c D e r m
t , D . P . S i m
, H . A . S i m
( 1 9 8 ) , E x p e r t a n d N
i c e P e r f
m a n c e i n S
v i n g P h y s i c s P r
l e m s , S c i e n c e , 2 8 ( 4 4 5 )
J . L a r k i n , J . M c D e r m
t , D . P . S i m
, H . A . S i m
( 1 9 8 ) , E x p e r t a n d N
i c e P e r f
m a n c e i n S
v i n g P h y s i c s P r
l e m s , S c i e n c e , 2 8 ( 4 4 5 )
T h e y l
f
a f
m u l a r e t u r n i n g t h e g
l , a n d t h e n f
f
m u l a s r e t u r n i n g w h a t i t i s n e e d e d b y t h e p r e v i
s
e , u p t h e y f
m u l a s s a t i s fj e d w i t h t h e g i v e n d a t a .
J . L a r k i n , J . M c D e r m
t , D . P . S i m
, H . A . S i m
( 1 9 8 ) , E x p e r t a n d N
i c e P e r f
m a n c e i n S
v i n g P h y s i c s P r
l e m s , S c i e n c e , 2 8 ( 4 4 5 )
T h e y l
f
a f
m u l a r e t u r n i n g t h e g
l , a n d t h e n f
f
m u l a s r e t u r n i n g w h a t i t i s n e e d e d b y t h e p r e v i
s
e , u p t h e y f
m u l a s s a t i s fj e d w i t h t h e g i v e n d a t a .
T h e y a p p l y f
m u l a s d i r e c t l y t
a t a , a c c
d i n g t
e h e u r i s t i c s .
J . L a r k i n , J . M c D e r m
t , D . P . S i m
, H . A . S i m
( 1 9 8 ) , E x p e r t a n d N
i c e P e r f
m a n c e i n S
v i n g P h y s i c s P r
l e m s , S c i e n c e , 2 8 ( 4 4 5 )
T h e y l
f
a f
m u l a r e t u r n i n g t h e g
l , a n d t h e n f
f
m u l a s r e t u r n i n g w h a t i t i s n e e d e d b y t h e p r e v i
s
e , u p t h e y f
m u l a s s a t i s fj e d w i t h t h e g i v e n d a t a .
T h e y a p p l y f
m u l a s d i r e c t l y t
a t a , a c c
d i n g t
e h e u r i s t i c s .
leak_in_bathroom :- hall_wet, kitchen_dry. problem_in_kitchen :- hall_wet, bathroom_dry. no_water_from_outside :- window_closed ; no_rain. leak_in_kitchen :- problem_in_kitchen, no_water_from_outside. hall_wet. bathroom_dry. window_closed.
:- dynamic(kitchen_dry/0, no_rain/0). leak_in_bathroom :- hall_wet, kitchen_dry. problem_in_kitchen :- hall_wet, bathroom_dry. no_water_from_outside :- window_closed ; no_rain. leak_in_kitchen :- problem_in_kitchen, no_water_from_outside. hall_wet. bathroom_dry. window_closed. ?- leak_in_bathroom. FALSE ?- leak_in_kitchen. TRUE n e c e s s a r y t
e fj n e fm u e n t s , i . e . f a c t s t h a t m i g h t c h a n g e a l
g t h e e x e c u t i
:- dynamic(kitchen_dry/0, no_rain/0). leak_in_bathroom :- hall_wet, kitchen_dry. problem_in_kitchen :- hall_wet, bathroom_dry. no_water_from_outside :- window_closed ; no_rain. leak_in_kitchen :- problem_in_kitchen, no_water_from_outside. hall_wet. bathroom_dry. window_closed. ?- leak_in_bathroom. FALSE ?- leak_in_kitchen. TRUE n e c e s s a r y t
e fj n e fm u e n t s , i . e . f a c t s t h a t m i g h t c h a n g e a l
g t h e e x e c u t i
H
? … u s i n g assert a n d rectract
– t
– t
% symbols of DSL and priority :- op(800, fx, if). :- op(700, xfx, then). :- op(300, xfy, or). :- op(200, xfy, and).
% symbols of DSL and priority :- op(800, fx, if). :- op(700, xfx, then). :- op(300, xfy, or). :- op(200, xfy, and). % knowledge base if hall_wet and kitchen_dry then leak_in_bathroom. if hall_wet and bathroom_dry then problem_in_kitchen. if window_closed or no_rain then no_water_from_outside. if problem_in_kitchen and no_water_from_outside then leak_in_kitchen. fact(hall_wet). fact(bathroom_dry). fact(window_closed).
% backward chaining rule interpreter is_true(P) :- fact(P). is_true(P) :- if Condition then P, is_true(Condition). is_true(PI and P2) :- is_true(PI), is_true( P2). is_true(PI or P2) :- is_true(PI) ; is_true( P2).
% necessary with SWI-Prolog. :- dynamic(sunshine/0, raining/0, fog/0). nice :- sunshine, not(raining). funny :- sunshine, raining. disgusting :- raining,fog. raining. fog. ?- nice. ?- disgusting. ?- retract(fog). ?- disgusting. ?- assert(sunshine). ?- funny.
% forward chaining rule interpreter forward :- new_derived_fact(P), !, write('Derived:'), write(P), nl, assert(fact(P)), forward ; write('No more facts'). new_derived_fact(Concl) :- if Cond then Concl, not(fact( Concl)), composed_fact( Cond). composed_fact(Cond) :- fact(Cond). composed_fact(Cond1 and Cond2) :- composed_fact(Cond1), composed_fact( Cond2). composed_fact(Cond1 or Cond2) :- composed_fact(Cond1) ; composed_fact( Cond2).
T h i s c
c l u s i
i s c e r t a i n l y t r u e , i f t h e p r e m i s e s a r e t r u e .
T h i s c
c l u s i
i s t r u e u n t i l p r
e d
h e r w i s e .
T h i s c
c l u s i
i s p l a u s i b l y t r u e .
monkey horizonal position monkey vertical position box horizonal position hand with banana relation
action(state(P, floor, P, T), climb, state(P, onbox, P, T)).
monkey horizonal position monkey vertical position box horizonal position hand with banana relation
action(state(middle, onbox, middle, not_holding), grab, state(middle, onbox, middle, holding)). action(state(P, floor, P, T), climb, state(P, onbox, P, T)). action(state(P1, floor, P1, T), push(P1, P2), state(P2, floor, P2, T)). action(state(P1, floor, B, T), walk(P1, P2), state(P2, floor, B, T)). success(state(_, _, _, holding)). success(State1) :- action(State1, A, State2), write("Action : "), write(A), nl, write(" --> "), write(State2), nl, success( State2).
?- success(state(door, floor, window, not_holding)). goal condition
– a
– a
h t t p s : / / e n . w i k i p e d i a .
g / w i k i / D e e p _ B l u e _ v e r s u s _ G a r r y _ K a s p a r
– v
– o
– o
– e