This is driving me batty. This source:
The Lab is a room.
The House is a region.
The Lab is in the house.
The Block is a region.
The House is in the block.
The Neighborhood is a region.
The Block is in the neighborhood.
The player is wearing the sweater.
The pocket is a container.
The pocket is part of the sweater.
The medallion is in the pocket.
when play begins:
repeat with a-region running through regions begin;
say "The list of objects that [a-region] relates to by the regional-containment relation: ";
say "[list of objects that a-region relates to by the regional-containment relation].";
say "The list of objects that [a-region] relates to by the containment relation: ";
say "[list of objects that a-region relates to by the containment relation].";
end repeat;
if the House contains the sweater, say "The House contains the sweater.";
if the Block contains the pocket, say "The Block contains the pocket.";
if the Neighborhood contains the medallion, say "The Neighborhood contains the medallion.";
repeat with obj running through objects begin;
if obj is a region, say "[obj] [if obj contains the medallion]contains[else]doesn't contain[end if] the medallion.";
if obj contains the medallion, say "[obj] contains the medallion.";
end repeat;
let r1 be the Neighborhood;
let m1 be the medallion;
say "[r1] [if r1 contains the m1]contains[else]doesn't contain[end if] [m1].".
produces this self-contradicting output:
The list of objects that Neighborhood relates to by the regional-containment relation: yourself, sweater, Lab, pocket and medallion.
The list of objects that Neighborhood relates to by the containment relation: Block.
The list of objects that Block relates to by the regional-containment relation: yourself, sweater, Lab, pocket and medallion.
The list of objects that Block relates to by the containment relation: House.
The list of objects that House relates to by the regional-containment relation: yourself, sweater, Lab, pocket and medallion.
The list of objects that House relates to by the containment relation: Lab.
The House contains the sweater.
The Block contains the pocket.
The Neighborhood contains the medallion.
Neighborhood doesn't contain the medallion.
Block doesn't contain the medallion.
House doesn't contain the medallion.
pocket contains the medallion.
Neighborhood contains medallion.
The regional-containment results look fine… the regions have the room (Lab) and its contents. And the House containing the Lab is fine. But we’re seeing the Neighborhood containing the Block and the Block containing the House… that shouldn’t be.
Then when we pose specific questions about Regions containing specific objects, the condition is true!
But then when we loop through all the objects and checking if any regions contain the medallion, we’re told no. When we look for anything that does contain the medallion, we only get the pocket.
Grasping at straws, to see if it has some weird cursed relationship with performing the containment relation check on values from variables, we assign Neighborhood and Medallion to temporary variables… and the condition comes back true again.
Can anyone please shed light on this?