Compiler confused about meaning of a word used for both kind and nameless property?

While playing with a scenario from another thread, I ran into something that looks like a compiler issue. Here’s the demonstration code:

"A Bug in the Garden"

An herb is a kind of value. Some herbs are thyme, rosemary, basil, sage, fennel, marjoram and parsley.

A sprig is a kind of thing.
A sprig has an herb. [problem line]

Pseudo-presence relates various herbs to various things. The verb to gather means the reversed pseudo-presence relation.

A small herbal bouquet is a thing.

The printed name of the herbal bouquet is "small bouquet of [list of herbs gathered by the item described]". [confuses compiler here]

The Herb Garden is a room.

The Problem message produced is:

Problem. In the sentence ‘“small bouquet of [list of herbs gathered by the item described]”’ , it looks as if you intend ‘herbs gathered by the item described’ to be a description, but that would mean applying the pseudo-presence relation (between a herb and a thing) to kinds of value which do not fit - a herbs valued property and an object - so this must be incorrect.
I was trying to match this phrase:

list of (herbs gathered by the item described - description of values)
I recognised:

herbs gathered by the item described = a description

I got other Problem messages in various iterations of code while trying to pinpoint the cause.

At a guess, the issue stems from the compiler being confused into thinking that the word “herb” in list of herbs gathered by the item described means the nameless herb property for the sprig kind. If the assertion creating that property (the commented “problem line”) is removed, then compilation succeeds.

This is observed in 9.3/6M62 and 10.1.2. Is it a known bug?

The long-form phrases listed in WWI 13.13 Relations involving values are not affected by this confusion, so using them is one possible workaround.

3 Likes

Yeah, I concur with your analysis. As I assume you noticed, naming the property (e.g. A sprig has an herb called foliage.) also removes the confusion. Since (as you note) the longwinded expression of the same idea (list of herbs which relate to the item described by the pseudo-presence relation) also manages to dodge this confusion, this must be considered a compiler bug.

Do you want me to report it?

3 Likes

I had not noticed, actually. Good point.

I would be most obliged. Thank you.

1 Like

An additional note about this one – I managed to reproduce the one other Problem message that I remembered as seeming significant (and was the first version that I encountered). The code:

"Other Bug in the Garden"

An herb is a kind of value. Some herbs are thyme, rosemary, basil, sage, fennel, marjoram and parsley.

The Herb Garden is a room.

A sprig is a kind of thing. A sprig has an herb.

Pseudo-presence relates one herb to various things. The verb to gather means the reversed pseudo-presence relation.

A small herbal bouquet is a thing.

The printed name of the herbal bouquet is "small bouquet of [list of herbs gathered by the item described]".

produces the Problem message:

Problem. You wrote ‘“small bouquet of [list of herbs gathered by the item described]”’ , but ‘herbs gathered by the item described’ has the wrong kind of value: a description of nothing rather than a description of objects.

which is a bit more mysterious than the one above. Again, removal of the declaration A sprig has an herb. seems to resolve it. (As does using the long-form version of accessing the relation, as does giving the property a name as noted by drpeterbatesuk.)

Also, it looks like this issue has come up at least once before, long ago: Conditional relation + property + arithmetic relation - #2 by eu1

2 Likes