Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "resbound"

Title:Run goal with resource bounds
Rating:Not rated. Create the first rating!
Latest version:0.8.1
SHA1 sum:b1ea59859f718f1ee01d5856fa8f12e4eef45da4
Author:Jan Wielemaker <J.Wielemaker@vu.nl>
Download URL:http://www.swi-prolog.org/download/pack/resbound-*.tgz

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.8.0930e98b9a678d2dcb2d3816733d44cd988c7041c1http://www.swi-prolog.org/download/pack/resbound-0.8.0.tgz
0.8.1b1ea59859f718f1ee01d5856fa8f12e4eef45da441http://www.swi-prolog.org/download/pack/resbound-0.8.1.tgz

Resource bounded goals

This pack provides library(resource_bounds), which allows running a goal providing limits for the wall time, CPU time and stack usage.

Examples

?- resource_bounded_call(true, 1, Status, []).
Status = true.
?- resource_bounded_call(fail, 1, Status, []).
Status = false.
?- resource_bounded_call((repeat, fail), 0.001, Status, []).
Status = timeout(cpu).
?- resource_bounded_call(sleep(20), 0.001, Status, [wall_time(1)]).
Status = timeout(wall).
?- resource_bounded_call(numlist(1, 1000000, L), 1, Status, [global(1000)]).
Status = stack_overflow(global).

Contents of pack "resbound"

Pack contains 3 files holding a total of 4.8K bytes.