4
說我有一個看起來像這樣的數據庫:是否有可能在生產規則中引用事實?
regular_player('Xi').
regular_player('Doyle').
expert_player('Houdini').
expert_player('Gandhi').
% don't allow expert players to be paired together
start --> good_pair.
good_pair --> (player, expert) ; (expert, player) ; (player, player).
player --> ['Xi'] ; ['Doyle'].
expert --> ['Houdini'] ; ['Gandhi'].
是否有可能從生產規則引用的事實,以消除重複我這裏。
這是一個微不足道的例子,在實際的代碼中,我更喜歡原子在事實中,而不是生產規則,因爲它們將在別處使用。 – paxos1977
@ paxos1977我同意。這將取決於應用哪種方法是理想的。 – lurker