Prologの典型的なコードの例

die(X) :- man(X). // 規則:
man(ソクラテス). // 事実:

?- die(ソクラテス). // 問い(実行開始)
> yes. // 結果