Basic relation question?

Hi,
I’d like to keep track of devices which process various objects.
For a toy example, an oven which processes food:

[code]An oven is a kind of device.
Food is a kind of thing.
Cheese is a kind of food.
The kitchen is a room.

In the kitchen is an oven.
In the kitchen is a cheese called cheddar.

Processing relates various devices to various things.
The verb to have processed means the processing relation.

Melting it with is an action applying to one carried thing and one touchable thing.
Understand “melt [food] with [thing]” as melting it with.

Check melting when the second noun is not an oven:
unless the second noun is food:
say “You can only melt [the noun] with an oven.” instead.

Check melting when the second noun is food:
try melting the noun with the oven instead.

Carry out melting:
now the second noun has processed the noun;

Report melting:
say “Melted!”

Test relation with “take cheddar / melt cheddar with oven”[/code]

However, this gives me the error ;

Run-time problem P62: Tried to change a relation for objects with the wrong kinds: Processing relates various devices to various things, but you tried to relate (or unrelate) the oven to cheddar.

If I instead define the relation generally:

Processing relates various things to various things. The verb to have processed means the processing relation.

The example runs alright.

What am I missing?

Thanks!

My first reaction would be try reversing the relation.
You have “Processing relates various devices to various things.”
Try “Processing relates various things to various devices.” It makes a difference if the types aren’t the same, and it makes sense the way you wrote it - the “thing” “is processed by” “a device”.

You might be able to do this without relations. If I remember the syntax:

[code]A food has a thing called last-processed-by. The last-processed-by of a food is usually nothing.

Carry out processing a food (called processed):
now the last-processed by of processed is the food processor.[/code]

Or possibly a list, though I haven’t worked with those as much:

[code]
A food has a list called processed-by.

Carry out processing a food with something (called the processor):
add processor to the processed-by list of the noun. [/code]

The syntax may be wrong, but there’s a way to do this. Various-to-various relations can slow a game down if there’s a lot of them.