in reply to Re^4: Seven by seven farming puzzle
in thread Seven by seven farming puzzle

I ran this with Sicstus prolog 3, and wow it was fast. The ten cases together took only 68 seconds. (That's on a 2.4 GHz pentium 4 machine; and about 140 seconds on a slower 992 MHz pentium 3 machine with the newer Sicstus 4. Gave the correct results in both cases. I can't compare the speed with SWI prolog for I'm lazy to install a newer SWI, and I don't even have any SWI prolog and Sicstus running on the same machine.)

Porting was trivial, the only definitions you need are below.

label(X) :- labeling([], X). time(X) :- X.

I'm surprised how fast it is. I know that the optimization you mention (the one in the first spoiler block) helps a lot, and also that the constraint programming nature makes it so that the last row is always filled in and there aren't too many possibilities to iterate over in the sixth row either, and that also counts a great deal in time. Still, I didn't think it would be so fast after the results with my perl programs.