|
原子式、又はその否定を「定数論理式(リテラル)」と言う。原子式 P を「正の定数論理式」、その否定 ¬P を「負の定数論理式」と呼ぶ。
【定義】節
「定数論理式(リテラル)」を「選言(又は「∨」)」論理結合子によって結合した整式を「節」と言う。
【定義】ホーン節
上記で定義された節の中に、「正の定数論理式(リテラル)」が高々1つしか含まれていない節のことを「ホーン節」と言う。
ホーン節になっている整式 と、論理結合子「含意(ならば「⇒」)」を含む整式とは、それぞれの「真偽値」が等しくなる。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
¬P1∨¬P2...∨¬Pn∨Q の真偽値は、(P1∧P2...∧Pn)⇒Q の真偽値と等しくなることもすぐ分かる。何故なら、次の真偽値表が示すように、
|
|
|
|
¬(P1∧P2) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
と言う事であり、
と言う事である。
「導出原理」に従えば、
結論: |
the procedure such that one describes the
facts and rules with the Horn clauses(ホーン節) and one answers the question
following the resolution principle(導出原理) with the use of the facts
and rules.
The execution of the PROLOG program corresponds to the proof of the conclusion.
The PROLOG program doesn't describe the procedures
for the problem solving but describes only the problem-solving strategy.
The execution itself is submitted to the computer.
¬P1 ∨ ¬P2 ∨ ... ∨¬Pn ∨ Q
---> | Q :- P1, P2,..., Pn. |
The query in PROLOG would be
?- Date(X). |
教科書 第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の構築例(財務問題意思決定支援システム)