1 | :- multifile generate/2. | |
2 | :- multifile shrink/3. | |
3 | ||
4 | :- use_module(library(random),[random/3]). | |
5 | ||
6 | generate(between(A,B),Value) :- | |
7 | C is B + 1 , | |
8 | random(A,C,Value). | |
9 | ||
10 | shrink(between(A,B),Value,Shrunken) :- | |
11 | shrink(integer(_),Value,Shrunken) , | |
12 | Shrunken >= A , Shrunken =< B. |