1 | :- multifile generate/2. | |
2 | :- multifile shrink/3. | |
3 | ||
4 | :- use_module(library(random),[random_member/2]). | |
5 | ||
6 | % all options of integer or float can be used | |
7 | ||
8 | generate(number(Options),Value) :- | |
9 | Types = [integer(Options),float(Options)] , | |
10 | random_member(Type,Types) , | |
11 | generate(Type,Value). |