Three queries re. teach river2:
1.
Typo at line 288:
You can you check that this modified procedure....
2.
"Take the fox right across, then back again, for example.
start();
putin([fox]);
cross(); <---- line 393 ? cross(); NOT crossriver();
takeout([fox]);
database ==> "
It seems to me that cross(); is not defined ? A typo ?
" The procedures which change the world are:
PUTIN TAKEOUT GETIN GETOUT CROSSRIVER "
My understandng of boats does not correspond to the depicted world.
Specifically that the boat can cross, without the man ? !
" -- PRECONDITIONS --
1. PUTIN (object)
1.c The boat must be at the same location as the object
1.d The man must be at the same location as the object "
1.c AND 1.d have redundancy, unless it is assumed that the boat can
'move away from' the man.
It seems to me that crossriver(); should have the precondition:
The man must be in the boat;
then 1.d becomes redundant.
In fact the failure to enforce "The man must be in the boat",
gets me: [man at left] , [boat at right]
Some of the procedures in this section have been refined, ie. defined
multiple times.
crossriver(); has been defined once only.
"-- CROSSRIVER ----------
define crossriver();
vars place, it;
lookup([boat at ??place]); ;;; this changes IT
remove(it);
if place = [left] then
add([boat at right])
else
add([boat at left])
endif;
enddefine; "
Ie. crossriver(); which is not refined again, allows crossing without man.
3.
My syntax error:
getout([man]);
was not detected.
A guess that the spurious parameter(s) are just left on the stack after
the procedure exits, was not confirmable ?
Thanks for any explanations/advice.
Chris Glur.
|