$uwlilfldo, Qwhooljhqfh $ssolfdwlrqvri &Rpsxwdwlrqdo/Rjlf

Download as ps, pdf, or txt
Download as ps, pdf, or txt
You are on page 1of 7

$UWLILFLDO,QWHOOLJHQFH

DQG/RJLF
$UWLILFLDO,QWHOOLJHQFH
$SSOLFDWLRQVRI
‡ /RJLFLV DQGKDVDOZD\VEHHQ SRSXODULQ$,

&RPSXWDWLRQDO/RJLF
² DVDWRROWRUHSUHVHQWNQRZOHGJH

² DVDWRROIRUUHDVRQLQJ

² DVDWRROWRIRUPDOL]H

3URI/XF'H5DHGW ‡ 6HHWKHFRXUVHRQ$UWLILFLDO,QWHOOLJHQFH

'U6WHIDQ.UDPHU

$OEHUW/XGZLJV8QLYHUVLWlW)UHLEXUJ

:6
1 2

&RPSXWDWLRQDOORJLF &RPSXWDWLRQDOORJLF 
‡ 8VLQJ/RJLFWR&RPSXWH ‡ 7KHSURJUDPPLQJODQJXDJH3URORJ

² .RZDOVNL&ROPHUDXHU
² -$5RELQVRQ·V5HVROXWLRQSULQFLSOH

‡ $PDFKLQHRULHQWHGORJLFEDVHGRQWKH ‡ 8VHRI/RJLF3URJUDPPLQJWRVWXG\D

UHVROXWLRQWKHRUHPSURYHU-$&0 YDULHW\RISUREOHPVLQDUWLILFLDOLQWHOOLJHQFH

‡ 6LQJOHLQIHUHQFHUXOHIRUFODXVDOORJLF DQGFRPSXWHUVFLHQFH

² 5.RZDOVNL$OJRULWKP /RJLF&RQWURO ² QDWXUDOODQJXDJHSURFHVVLQJ

‡ HJ'HILQLWH&ODXVH*UDPPDUV8QLILFDWLRQ%DVHG
‡ .RZDOVNL/RJLFIRUSUREOHPVROYLQJ
*UDPPDUV
1RUWK+ROODQG
² 3ODQQLQJDQGNQRZOHGJHUHSUHVHQWDWLRQ
² 3URFHGXUDODQG'HFODUDWLYH ‡ VLWXDWLRQFDOFXOXVDQGHYHQWFDOFXOXVQRQPRQRWRQLF

,QWHUSUHWDWLRQVRI/RJLF 3 UHDVRQLQJ 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QGKVXFKWKDW ‡ &RQVLGHUWKHODZRI2KP

.%8K_ RDQGR 9 ,[5

‡ IURPPDQ VRFUDWHV PRUWDO VRFUDWHV


9ROWDJH&XUUHQWDQG5HVLVWDQFH

‡ DQGPDQ SODWR PRUWDO SODWR


‡ .QRZLQJWZRYDUVGHWHUPLQHVWKHRWKHURQH

‡ LQIHUIRUDOO;PDQ ; !PRUWDO ;
‡ LQWUDGLWLRQDOSURJUDPPLQJODQJXDJHV

, 95

5 9,


‡ OHDUQLQJ
‡ 3UREOHPVKRXOGEHWRVSHFLI\FRQVWUDLQWVQRWWR
‡ XVXDOO\ DERXWPXOWLSOHREVHUYDWLRQV
9 PDLQWDLQWKHP!FRQVWUDLQWSURJUDPPLQJ 10
‡ XVXDOO\UXOHVFODXVHV

&RQVWUDLQWSURJUDPPLQJ $QRWKHU([DPSOH
‡ (DUO\DSSURDFKHV Mortgage: principal P, interest rate I, repayment R and
balance B over T periods
² ORFDOSURSDJDWLRQ

² DVVLJQYDOXHWRRQHYDULDEOHJLYHQDOO Simple Interest: B = P + P × I − R


RWKHUYDOXHVLQFRQVWUDLQWDQGSURSDJDWH
Relationship P1 = P + P × I − R ∧
² OLPLWHGXVH
over 3 periods: P = P + P × I − R ∧
‡ VROYH 2 1 1
; <=
P3 = P2 + P2 × I − R ∧
; <=
B = P3
Number of constraints depend on the variable T
11 12

2
5HDVRQ5HFXUVLYHO\ :K\&RQVWUDLQWVDQGQRW&

=HURWLPHSHULRGVWKHQ% 3
‡ %RWKSURJUDPVFDQDQVZHUWKHJRDO
• mortgage(500, 3, 10/100, 150, B).
‡ %XWWKH&/3SURJUDPFDQDQVZHU
HOVHQHZSULQF33 ,5DQGQHZWLPH7

mortgage(P,T,I,R,B) :- T = 0, B = P. (M1) • mortgage(P, 3, 10/100, 150, 0).


P = 373.028
‡ DQGHYHQWKHJRDO
mortgage(P,T,I,R,B) :- T >= 1,
NP = P + P * I - R, NT = T - 1, (M2)
• mortgage(P, 3, 10/100, R, B).
mortgage(NP,NT,I,R,B).
P = 0.38553 B + 6.14457 R
13 14

&RQVWUDLQWVLQFRPELQDWRULDO
6HQGLQJPRUHPRQH\
SUREOHPV
6(1' VPP 6(1'025< 

025(
>6(1'025<@>@

FRQVWUDLQ >6(1'025<@ 

021(<
ODEHOLQJ >6(1'025<@ 

FRQVWUDLQ >6(1'025<@ 

6  0  

ZKHUH6(1'025<DUHGLJLWVVXFK
DOOGLIIHUHQWBQHT >6(1'025<@ 

WKDWHTXDWLRQKROGV
  6 ( 1'

  0 2 5(

 0 2 1 (<

15 6 ( 1 ' 0 2 5 DQG<  16

0RGHUQFRQVWUDLQW &RXUVH&RQVWUDLQWORJLF
SURJUDPPLQJODQJXDJHV SURJUDPPLQJ
‡ &RQVLVWRI ‡ %RRN

² 3URJUDPPLQJZLWK&RQVWUDLQWVDQLQWURGXFWLRQ
² SURJUDPPLQJODQJXDJH
² .LP0DUULRWWDQG3HWHU-6WXFNH\
² FRQVWUDLQWVROYHUVIRUFHUWDLQGRPDLQV
² 0,73UHVV
‡ ILQLWHGRPDLQV HJVHQGPRUHPRQH\
² ,6%1 KDUGFRYHU
‡ UHDOQXPEHUV HJPRUWJDJH
‡ 
‡ WUHHFRQVWUDLQWV

‡ )LUVWPRGHUQFRQVWUDLQWODQJXDJHV
‡ 6HHDOVR

KWWSPXQNRUDFVPXR]DXaSMVERRNERRNKWPO
² FRQVWUDLQWORJLFSURJUDPPLQJODQJXDJHV

17 18

3
:KDWZHZLOOGR ,QGXFWLYHORJLFSURJUDPPLQJ
‡ 3DUW, FRPSOHWH  ‡ 7KHVWXG\RI LQGXFWLYH PDFKLQH
² FRQVWUDLQWVDQGFRQVWUDLQWVROYHUV OHDUQLQJDQGGDWDPLQLQJXVLQJ
‡ ILQLWHGRPDLQV &63 DULWKPHWLFWUHH
FRPSXWDWLRQDOORJLF
‡ :KDWLVGDWDPLQLQJ"
‡ 3DUW,, VKRUWHU 

² FRQVWUDLQWORJLFSURJUDPPLQJ
² ¶.QRZOHGJHGLVFRYHU\LQGDWDEDVHVLVWKHSURFHVVRI
‡ LQWHJUDWLRQLQORJLFSURJUDPPLQJ
LGHQWLI\LQJYDOLGQRYHOSRWHQWLDOO\XVHIXODQGXOWLPDWHO\
‡ XVHDQGLPSOHPHQWDWLRQWHFKQLTXHV
XQGHUVWDQGDEOHVWUXFWXUHLQGDWD· )D\\DGHWDO

‡ 3DUW,,, "  ² SDWWHUQVXVHGIRUSUHGLFWLRQVXPPDULVDWLRQH[SODQDWLRQ



² UHODWLRQWRGDWDEDVHVDQGRWKHU&3ODQJXDJHV
² :LGHFRPPHUFLDOLQWHUHVWDQGWRROV

19 20

,QGXFWLRQ 3UHGLFWLYH,QGXFWLRQ
‡ 3URFHVVZKHUHE\RQHJHQHUDOL]HV
VSHFLILFREVHUYDWLRQVLQWRJHQHUDO
ODZV +++
² VHHWZRZKLWHVZDQVLQIHUWKDWDOOVZDQV + + + H
DUHZKLWH
--- --
² LQGXFWLYHFRQFOXVLRQVPLJKWEHZURQJ
-- -- -
‡ 9DULRXVIRUPV
² SUHGLFWLYH

² GHVFULSWLYH 21 22

$UHDOOLIHH[DPSOH
Examples labelled “neg”

0XWDJHQHVLV 6ULQLYDVDQHWDO
$,-

Examples labelled “pos”

4
,PSRUWDQFHRIUHVXOWVRI
'HVFULSWLYH,QGXFWLRQ
WKLVNLQG
‡ *HQHUDOSXUSRVHV\VWHP 3URJRO

‡ 'HFODUDWLYHNQRZOHGJH

² VWUXFWXUDODOHUWV +++
² UHDGLO\XQGHUVWDQGDEOHWRKXPDQH[SHUWV
+ + +
‡ 3XEOLVKHGLQWRSMRXUQDOVRIWKHGRPDLQ
H
² 3URF1DWLRQDO$FDGHP\RI6FLHQFHV

² «

² 0XJJOHWRQ&$&0

‡ 7RZDUGVD¶'LVFRYHU\6FLHQFH·
26

$ILUVWRUGHU
:K\LQORJLF"
UHSUHVHQWDWLRQ
‡ /LPLWDWLRQVRIFODVVLFDOPDFKLQH
OHDUQLQJDQGGDWDPLQLQJWHFKQLTXHV
triangle(e1,o1,up).
triangle(e1,o2,up).
...
² HVVHQWLDOO\DSURSRVLWLRQDOORJLF

‡ ,PDJLQHDQHXUDOQHWVWDWLVWLFDO
in(e1,o1,o2).
in(e1,o3,o4).

SDFNDJHLQIHUWKHVWUXFWXUDODOHUW
...

‡ 3/LVPRUHH[SUHVVLYHDQG square(e1,o3).

GHFODUDWLYH
square(e1,o4).
...

‡ 3/LVZHOOXQGHUVWRRG
‡ ,QIHUHQFHUXOHV
27

$ILUVWRUGHU
&ODXVH 5XOH
UHSUHVHQWDWLRQ
Atom(nitro,a1,carbon,-4).
Atom(nitro,a2,hydrogen,-2). SRV ( WULDQJOH (; LQ (;< WULDQJOH (<
Atom(nitro,a3,carbon,-2).
... SRV ( FLUFOH (; LQ (<; FRQILJ (<XS

SRV ( 

Bond(nitro,a1,a2,double). FLUFOH (; LQ (<; VTXDUH (< WULDQJOH (=


Bond(nitro,a2,a3,single).
...

Benzene-ring(nitro,[a1,a2,a3,a4,a5,a6]).

could be defined as a ‘view’
predicate/relation

5
FRYHUV +SRV H LII.%8+_ SRV H ,QGXFWLYHORJLFSURJUDPPLQJ
Pos if here are two distinct triangles with identical configuration, and a circle”
pos(E) :- triangle(E,X,C),triangle(E,Y,C),not(X=Y),circle(E,Z).
‡ 5HSUHVHQWDWLRQDOLVVXHV
² KRZWRUHSUHVHQWH[DPSOHVK\SRWKHVHV

DQGEDFNJURXQGNQRZOHGJH"

‡ 3UREOHPVHWWLQJVDQGDOJRULWKPV
E square(e1,o1).
triangle(e1,o2,up).
in(e1,o2,o1). ?-pos(e1)
circle(e1,o3). Yes
² SUHGLFWLYH
triangle(e1,o4,up).
in(e1,o4,o3). ² GHVFULSWLYH

² GLVWDQFHEDVHG
triangle(e5,o51,up). ‡ NQHDUHVWQHLJKERUFOXVWHULQJ
?-pos(e5)
square(e5,o52).
No
in(e5,o52,o51). 32

,QGXFWLYHORJLFSURJUDPPLQJ ,QGXFWLYHORJLFSUR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HORJLFSURJUDPPLQJ
DUWLFOH VLQJXODU>D@ 

DQG
²  " OHVVRQV

‡ 1DWXUDOODQJXDJHSURFHVVLQJLQ/RJLF
VHQWHQFH!QRXQBSKUDVH 1 YHUEBSKUDVH 1 

7UDQVODWHVWR

‡ 7KHRU\RIORJLFSURJUDPPLQJ
VHQWHQFH 6 

QRXQBSKUDVH 113 

‡ $EGXFWLYHORJLFSURJUDPPLQJ
YHUEBSKUDVH 163 

‡ 'HGXFWLYHGDWDEDVHV
DSSHQG 13636 

37 38

5HODWLRQWR3URORJ&RXUVH
‡ 3URORJFRXUVH

² OHDUQKRZWRSURJUDPLQ3URORJ

² OHDUQGHWDLOVRIODQJXDJH

² YDULRXVH[DPSOHVRIPHWDSURJUDPVWKHRUHP

SURYHUV

‡ $SSOLFDWLRQVRI&/

² LQGHSWKWUHDWPHQWRIIRXQGDWLRQVRI

‡ FRQVWUDLQWSURJUDPPLQJ

‡ LQGXFWLYHORJLFSURJUDPPLQJ

² QRWDSURJUDPPLQJFRXUVH
39

You might also like