next up previous contents
Next: 3 KLICのインストール法 Up: 2.4 実行時エラーの表示とトレース Previous: 2.4.1 節の失敗 (failure)

2.4.2 永久中断

あるゴールがサスペンドしたが, その変数が具体化されないまま ゴールプールが空になると, 永久中断状態となる.

以下に永久中断するプログラムの例と実行トレースを示す.

:-module main.

main:- true | gen(X),con(X).

gen(X):- true | true.

con([A|B]):- true | true.


% psus -t                                                           1
   1 CALL:main:main? 
   1 REDU:main:main :-
   2   0:+gen(_4)
   3   1:+con(_4)?                                                  5
   2 CALL:main:gen(_4)? 
   2 REDU:main:gen(_4)? 
   3 CALL:main:con(_4)? 
   3 SUSP:main:con(_4)? 
1 perpetually suspending goals found
!!! Perpetual Suspention Detected !!!
   3 PSUS: main:con(_B)? a
%

ゴール番号3番の main:con(_4)が サスペンドするが, リジュームされないので永久中断した. このため, 10行目に !!! 1 suspending goal(s) !!!と表示された.



next up previous contents
Next: 3 KLICのインストール法 Up: 2.4 実行時エラーの表示とトレース Previous: 2.4.1 節の失敗 (failure)



KLIC