j4n bur53 schrieb:
> Can be also done with SWI-Prolog, but there the finite
> set feature is currently missing, but one can directly
Corr.: infinite set feature is miissing
But the follow works fine in SWI-Prolog:
?- time(([X,Y,Z] ins 1..10000, X^4+Y^6 #= Z^2, label([X,Y,Z]))).
% 124,509 inferences, 0.027 CPU in 0.027 seconds (99% CPU, 4563611 Lips)
X = 6,
Y = 3,
Z = 45
% 165,052 inferences, 0.035 CPU in 0.036 seconds (98% CPU, 4750928 Lips)
X = 15,
Y = 10,
Z = 1025
% 365,902 inferences, 0.082 CPU in 0.083 seconds (99% CPU, 4487943 Lips)
X = 36,
Y = 12,
Z = 2160
% 205,035 inferences, 0.049 CPU in 0.050 seconds (98% CPU, 4142372 Lips)
X = 48,
Y = 12,
Z = 2880
% 647,656 inferences, 0.138 CPU in 0.140 seconds (99% CPU, 4687114 Lips)
X = 90,
Y = 15,
Z = 8775
% 96,346 inferences, 0.023 CPU in 0.024 seconds (96% CPU, 4163433 Lips)
false.
If the intervsl of ins is chosen bigger, the thing gets slower:
time(([X,Y,Z] ins 1..100000000, X^4+Y^6 #= Z^2, label([X,Y,Z]))).
% 2,715,197 inferences, 0.893 CPU in 0.903 seconds (99% CPU, 3040102 Lips)
X = 6,
Y = 3,
Z = 45
% 3,941,142 inferences, 1.252 CPU in 1.262 seconds (99% CPU, 3147274 Lips)
X = 15,
Y = 10,
Z = 1025
% 8,883,966 inferences, 2.771 CPU in 2.785 seconds (99% CPU, 3206172 Lips)
X = 36,
Y = 12,
Z = 2160
% 5,166,670 inferences, 1.817 CPU in 1.824 seconds (100% CPU, 2843287 Lips)
X = 48,
Y = 12,
Z = 2880
% 17,499,301 inferences, 6.189 CPU in 6.212 seconds (100% CPU, 2827376 Lips)
X = 90,
Y = 15,
Z = 8775 .
But its the same solutions!!!!???? In my infinite search I don't have
an upper bound, so I cannot make this comparison. I didn't make much
measures yet, only made this strange observatiin of timing now.
Bye