Another relations question

Hey guys, another relations question as I continue to play with elevators.

I have a relation set up and working as such:

Elevator-Connect relates one elevator (called the target elevator) to one elevator call button.
The verb to connect to (he connects to, they connect to, he connected to, it is connected to) implies the Elevator-Connect relation.

So with that, I can refer in various parts of the code to the elevator from the call button. For example:

Instead of pushing or touching the call button:
	If the target elevator of the call button is moving:
		say "The call button is already lit.";

This works fine. What I would like to do, and haven’t been able to figure out how to yet, is refer back the other way… so i’d like to say something along the lines of:

If the target call button of the elevator is …

However, in the relation I can only define the name, and thus property access, for one side of the relation and not the other.

I can define another verb as such:

The verb to be called by implies the reversed Elevator-Connect relation.

But i’m not sure how to use that, if I can, to access the call button from the elevator. I tried:

if current elevator is called by something (called the caller):
      Say "[current elevator] is connect to [the caller]".

But that doesn’t work.

Any ideas? Is it a one way reference only? I could make a reciprocal relationship relating things to things rather than call button to elevator, but I kind of like the ‘type safety’ aspect (such as it is) of the relation as it currently it.


I think:

If the broken elevator connects to something (called B)...

I’ll give that a shot when I get home tonight.

That worked great, thanks HanonO