Relations and kind variables

I’m having trouble with a generic phrase that takes relations of unknown types. In the example below, I get a Problem message about the phrase “x relates to an L by G”. If you change the codomain of the relation from things to a non-object value kind like numbers, everything works. Is this a bug? I’m not really sure what is and is not allowed when it comes to relations and kind variables, since I can’t find any relevant discussion or examples in the documentation.

Foo is a room.

Blog relates various rooms to one thing.

To decide whether (F - relation of K to L) is compatible with (G - relation of value of kind K to value of kind L):
	let the domain be the list of Ks which F relates;
	repeat with x running through the domain:
		if x relates to an L by G:
			let y be the L to which x relates by F;
			if G does not relate x to y, decide no;
	decide yes.

When play begins:
	say "[whether or not the blog relation is compatible with the blog relation]."

It looks like it wants “if x relates to L by G” rather than “if x relates to an L by G”; at least, when I deleted “an” it compiled (in 6L02). I’m not sure if it’s behaving correctly!

Thanks for spotting that. I think this must be a bug: it’s legal to write “if Foo relates to a thing by the blog relation”, so it should be legal to write “if Foo relates to an L by the blog relation”.