Information Technology Reference
In-Depth Information
clause(Goal,Clause),
prolog(Clause).
The core of Prolog EBG is established, and the algorithm is as:
prolog_ebg(X_Goal,X_Gen,[X_Goal],[X_Gen]:-clause(X_Goal,true).
prolog_ebg((X_Goal,Y_Goal),(X_Gen,Y_gen),Proof,GenProof):-
prolog_ebg(X_Goal,X_Gen,X_Proof,X_GenProof),
prolog_ebg(Y_Goal,Y_Gen,Y_Proof,Y_GenProof),
concat(X_Proof,Y_Proof,Proof),
concat(X_GenProof,Y_GenProof,GenProof).
prolog_ebg(X_Goal,X_Gen,[Proof],[GenProof]):-
clause(X_Gen,Y_Gen),
copy((X_Gen:-Y_Gen),(X_Goal:-Y_Goal)),
prolog_ebg(Y_Goal,Y_Gen,Y_Proof,Y_GenProof),
concat([X_Goal],[Y_Proof],Proof),
concat([X_Gen],[Y_GenProof],GenProof).
9.6.3 An example
A “suicide” example is given to illustrate how to implement EBG.
Input
Target conceptsuicide(
x
).
Domain theorya group of clauses or rules
Suicide(
x
):- kill(
x, x
).
Kill (A, B):- hate (A, B),
Possess (A, C),
Weapon(C).
Hate (A, A):- depressed (A).
Possess (A, C):- buy (A, C).
Weapon (Z):- gun (Z).
Training examples a group of fact clauses
Depressed (john).
buy(john,gun1).
gun (gun1).
Suicide (john).
Operational criterion: here only consider the simple static standard
Operational (depressed).
Operational (gun).
Operational (buy).
As shown in Figure 9.8 the explanation structure is established. We can see
from the explanation mechanism of Prolog that the Top-Down strategy is adopted
when creating the explanation structure. Every time a rule is exerted, this rule is
Search WWH ::




Custom Search