1 | :- multifile generate/2. | |
2 | :- multifile shrink/3. | |
3 | ||
4 | :- use_module(library(random),[random/1]). | |
5 | ||
6 | % Options: | |
7 | % small, positive, negative, nozero | |
8 | ||
9 | generate(float(Options),Value) :- | |
10 | generate(integer(Options),Integer) , | |
11 | random(R), | |
12 | Value is Integer*R. | |
13 | ||
14 | shrink(float(_),Value,Shrunken) :- | |
15 | shrink(integer(_),Value,Shrunken). |