6.1 How? Questions |
When you ask how atom h was proved, it produces the instance of the rule in the knowledge base with h as the head that succeeded:
h <- 1: a_1 2: a_2 ... k: a_kwhich indicates that the rule h <- a1 & a2 & ...& ak was used to prove h. You can then give one of:
Example.
Given the knowledge base after Example 4, you can ask how a particular instance of the query was proved, as in:
cilog: ask grandfather(G,C).
Answer: grandfather(randy,mary).
[ok,more,how,help]: how.
grandfather(randy,mary) <-
1: father(randy,sally)
2: parent(sally,mary)
How? [number,up,retry,ok,help]: how 2.
parent(sally,mary) <-
1: mother(sally,mary)
How? [number,up,retry,ok,help]: how 1.
mother(sally,mary) is a fact
parent(sally,mary) <-
1: mother(sally,mary)
How? [number,up,retry,ok,help]: up.
grandfather(randy,mary) <-
1: father(randy,sally)
2: parent(sally,mary)
How? [number,up,retry,ok,help]: how 1.
father(randy,sally) is a fact
grandfather(randy,mary) <-
1: father(randy,sally)
2: parent(sally,mary)
How? [number,up,retry,ok,help]: up.
Answer: grandfather(randy,mary).
[ok,more,how,help]: more.
Answer: grandfather(randy,sue).
[ok,more,how,help]: ok.
cilog:
6.1 How? Questions |