| 強制的に失敗させる。
fail/0
fail/0 は常に失敗する。強制的にバックトラックを起こすこともできる。
fail/0 に続く連言サブゴール は、実行されない。
無限ループの後で、fail/0をコールするのは注意すべきである。
(関連 repeat/0).
例
| write('this is going to fail'), fail. |
現在出力ストリームに 'this is going to fail'を出力して、失敗。
|
| repeat,write(endless),nl,fail. |
現在出力ストリームに 'endless'を無限に出力する。
|
標準
この述語は、 ISO-Prolog 標準に含まれる。
関連
abort/0,
break/0,
call/1,
fcall/1,
catch/3,
','(conjunction)/2,
'!'(cut)/0,
';'(disjunction)/2,
true/0,
halt/0/1,
'->'(if-then)/2,
';'(if-then-else)/2,
'\+'(not provable)/1,
once/1,
repeat/0,
throw/1.
|