71:-
meta_predicate time_out(
0,+,-).
83time_out(
Goal,
Time,
Result)
:-
85 UT is (
Time*1000)
mod 1000000,
87 alarm(
T,
UT,
__OldT,
_),
90 exit_time_out(
Port,
Goal,
Result)),
94exit_time_out(
_,
_,
_)
:-
97exit_time_out(
Port,
_,
Result)
:-
98 time_out_rc(
Port,
Result).
100time_out_rc(exit, success).
101time_out_rc(answer, success).
102time_out_rc(fail, failure).
103time_out_rc(exception(
_), failure).
104time_out_rc(external_exception(
_), failure).
105time_out_rc(redo, failure).
106time_out_rc(!, success).
108 clean_goal((
A,
B),(
CA,
CB))
:-
112 clean_goal((
A;B),(
CA;CB))
:-
116 clean_goal((
A->B),(
CA->CB))
:-
120 clean_goal((
A *->B),(
CA *->CB))
:-
124 clean_goal(user
:A,
CA)
:-
127 clean_goal(prolog
:A,
CA)
:-
134alarm(+ Seconds,+ Callable,+ OldAlarm)
virtual_alarm(+Interval, 0:Goal, -Left)