Is it possible to restrict the running time of a query in SICStus Prolog?
You can use the time_out predicate :
time_out
http://www.sics.se/sicstus/docs/3.7.1/html/sicstus_42.html