0
外部の任意の外部者が有効なID証明なしにキャンパスに入ることを許可するセキュリティー者は、 となります。有効な身分証明書を持たない一部の外部者は、 内にあります。これらのすべての部外者は、私はこのようなアプローチ上記の質問について 前方および後方連鎖のプロローグの例
(a) From the above statements, construct a knowledge base.
(b) Implement forward and backward chaining.
(c) Using the forward chaining and backward chaining, prove that
“Mr. X must be suspended”.
(d) Compare the efficiency of forward chaining and backward chain-
ing algorithms with respect to the number of irrelevant clauses
generated.
氏X.
という名前 セキュリティ担当者がキャンパスに入ることを許可されました。securityPerson(mrx).
outsider(P).
securityAllows(mrx,P).
suspended(Z) :- securityPerson(Z),outsider(P),securityAllows(Z,P).
クエリ:?
?- suspended(mrx).
true.
?- suspended(mrxa).
false.
?- trace.
true.
[trace] ?- suspended(mrx).
Call: (7) suspended(mrx) ? creep
Call: (8) securityPerson(mrx) ? creep
Exit: (8) securityPerson(mrx) ? creep
Call: (8) outsider(_G1937) ? creep
Exit: (8) outsider(_G1937) ? creep
Call: (8) securityAllows(mrx, _G1938) ? creep
Exit: (8) securityAllows(mrx, _G1938) ? creep
Exit: (7) suspended(mrx) ? creep
true.
が
質問はしていません。 – Enigmativity
あなたは[ask]を読むべきです。 – Enigmativity