私は恣意的な事実をチェックし、それがナレッジベースにある場合は何かを行い、そうでない場合は別のことをしたいと思いますが、( I -> T ; E)
構文はありません。
私のナレッジベースにはいくつかの事実があります:
unexplored(1,1).
unexplored(2,1).
safe(1,1).
不完全なルールが与えられた
foo:- safe(A,B),
% do something if unexplored(A,B) is in the knowledge base
% do something else if unexplored(A,B) is not in the knowledge base
このようにせずに、これを処理する正しい方法は何ですか?
foo:-
safe(A,B),
( unexplored(A,B) -> something ; something_else ).