After removing the
default value, falf provides
a shorter solution: only 5 steps are needed now! Looking at the
solution, it seems that, surprisingly, an empty boat can move now from
one bank to the other.
explanation for this result is that, when
no action is executed, rules (R1) and (R2) do not provide a
value for moved(mis) and moved(can), and so, they are
left unknown (note they do not have a default value now). As a result,
constraints (R3) and (R5) are not
applicable and cannot force the execution of some action. Finally, as we have
made rule (R7) independent
of the action execution, the boat misterously moves "alone" to the
opposite bank. This problem can be simply solved by adding a condition
to (R7) as follows:
boatbank'=opposite(boatbank) :- move(M,C).
which is more
natural, as it reflects that the change in the boat bank only occurs
after some movement. However, the execution becomes drastically slower,
since (R7b) involves
a significant increase in the number of ground rules that must be
handled by the ASP solver.