9.5 ホーン節と導出原理


教科書 第12章「意思決定支援システムと専門家システムの統合」

Hybrid of the DSS and the Expert System.
 
【例題】ESSの構築例(保養地[リゾート]の決定)
 
 
 
 
<<expert system: sking resort>>

事実:

<predicates(or literal)>:

record(w, x, y, z)

record(resort_type, maxprice, minage, location)

<the desctiption of facts> :
 <connecting database>:

/* *database* */
record(beach, 800, 12, sonora_bay).
record(beach, 198, 5, don_miguel).
record(beach, 210, 0, roussalka).
record(ski, 400, 5, meribel).
record(ski, 500, 12, anzerre).
record(ski, 230, 12, tignes).
record(mountain, 650, 12, st_moritz).
record(mountain, 400, 5, chamonix).
record(mountain, 250, 0, pampadour).
/* *** */
 

規則:

<the desctiption of rules> :

record(TResortType, TMaxPrice, TMinAge, Location)∧
(ResortType = TResortType)∧(MaxPrice >= TMaxPrice)∧(MinAge >= TMinAge)

==>expert(ResortType, MaxPrice, MinAge, Location)

expert(ResortType, MaxPrice, MinAge, Location):-
 record(TResortType, TMaxPrice, TMinAge, Location),
 ResortType = TResortType,
 MaxPrice >= TMaxPrice,
 MinAge >= TMinAge.
 

<<the expert program in PROLOG>>
 
 
/* *database* */
record(beach, 800, 12, sonora_bay).
record(beach, 198, 5, don_miguel).
record(beach, 210, 0, roussalka).
record(ski, 400, 5, meribel).
record(ski, 500, 12, anzerre).
record(ski, 230, 12, tignes).
record(mountain, 650, 12, st_moritz).
record(mountain, 400, 5, chamonix).
record(mountain, 250, 0, pampadour).
/* *** */

run:-
write("Resort Type (beach / ski / mountain) ? :  "),
read(ResortType),
write("Max Price ?  :  "),nl,
read(MaxPrice),
write("Min Age ?  :  "),nl,
read(MinAge),
expert(ResortType, MaxPrice, MinAge, Location),
write("We advise you to go to "),
write(Location),
nl.
 

run:-
 write("Sorry, we cannot help you.  "), nl.
 

expert(ResortType, MaxPrice, MinAge, Location):-
 record(TResortType, TMaxPrice, TMinAge, Location),
 ResortType = TResortType,
 MaxPrice >= TMaxPrice,
 MinAge >= TMinAge.


 

<<the execution>>:
 
 
 
?-run.

Compiling the file:
D:\PROLOG\StrawberryProlog\NOTO\database.pro
0 errors, 0 warnings.

Resort Type (beach / ski / mountain) ? :
Max Price ?  :  Min Age ?  :
We advise you to go to sonora_bay
Yes.

 

 

【例題】ESSの構築例(財務問題意思決定支援システム)