Re: Ambiguity (what else!?) question

I think that a useful way to distinguish operators and delimiters is to say that, while both relate to some construct(s) in a language, their effect is different. Operators are rather like functions which take the construct(s) as input(s), whereas delimiters make the syntactic relationships between language constructs explicit without also manipulating those constructs.  

Delimiters usually indicate one of two things: that constructs should be treated as separate, or that constructs should be treated as a group. They don't express anything further about the relationship between the constructs. The ".", "(", ")" symbols in iXML are delimiters, for example.

Operators don't just separate or group constructs (although they may behave as delimiters in addition to their other semantics), but indicate a function that produces an output based on the construct(s) that are its input. So in the arithmetical expression

 3 + 4

"+" is an operator that indicates that the integers on either side are the inputs to the addition function. In 

 A ∪ B

"∪" indicates the union of sets denoted by A and B.

Given that alternation can also be conceptualized as union, I can't really see how iXML's ";" and "|" aren't operators. iXML's

 q: ("cat" ; "dog") ; animals.
 animals: "rat" ; "hog".

is semantically equivalent to a set theoretic statement such as 
 
 Q = {{"cat"} ∪ {"dog"}} ∪ {{"rat"} ∪ {"hog"}}

i.e., both create a set containing four items which function as alternatives in some context. So

 q: ("cat" ; "dog" ; "rat" ; "hog")+.

creates a set which can be used as in rewriting q:  q recognizes a sequence, of any length > 1, of any of the items from the set, in any order.

In fact, I'd say that iXML's "," is also an operator, expressing the semantics of the Cartesian product:

 q: a, b, c.
 a: "cats" ; "dogs".
 b: " are" ; " like".
 c: " animals" ; " people".

The production q recognizes the strings generated by the set 
 
 Q = {"cats", "dogs"} × {" are", " like"} × {" animals", " people"},

so
 a , b , c = a × b × c.

>  I have trouble with "=" instead of ":", because it isn't defining an equality, but is a definition, and I dislike the misuse of symbols like that.

I'm not sure it's best described as a "definition", though. That makes it sound as though the left hand side is a more-or-less precise synonymous description of the right-hand side, rather than being an exact equivalent. But the LHS is a valid replacement for the RHS wherever it appears: the LHS can replace any instance of the nonterminal on the RHS without changing the language recognized by the grammar. So I'd argue that the semantics of the equals sign in

 animals = "cats" ; "dogs".

and 
 
 2 + 3 = 5

and 

 a = 5

are very similar. If we're writing a grammar, the first rule above tells us that the two productions
 
 truthfully = "I love" , animals.
 verily = "I love", ("cats" ; "dogs")

both recognize exactly the same set of strings. Similarly, given the second and third expressions above, we know that, in an algebraic expression,

 4 × 5
 4 × (2 + 3)
 4a

compute exactly the same value.

Given this, I don't really understand how the use of "=" in iXML rules is a "misuse" of the symbol.

BTW

___________________________________________________ 
Dr. Bethan Tovey-Walsh 

Myfyrwraig PhD | PhD Student CorCenCC <http://www.corcencc.org/> 
Prifysgol Abertawe | Swansea University 

Golygydd | Editor geirfan.cymru <https://geirfan.cymru/>

 <https://geirfan.cymru/>Croeso i chi ysgrifennu ataf yn y Gymraeg.

> On 30 Jan 2025, at 15:25, Steven Pemberton <steven.pemberton@cwi.nl> wrote:
> 
> 
> On Wednesday 29 January 2025 17:39:35 (+01:00), Norm Tovey-Walsh wrote:
> 
>> Steven Pemberton <steven.pemberton@cwi.nl> writes:
>>> ; is not or! A rule is a list of alternatives, separated by semicolons; like CSS. I suppose you could read it as 'or' if you wanted, but nowhere is it defined as an 'or'.
>> 
>> That seems like splitting hairs.
> 
> I seriously think there is a conceptual difference. "Or" sounds like an operator, but ";" is not an operator, just a separator in a list.
> "**" or "++" are real operators, and show up in the abstract document; ";" ".", ":", and "," on the other hand are just syntax, and don't show up there.
> 
>> I think lots of users would look at
>> 
>>  S: a ; b ; c .
>> 
>> and say that an “S” is an “a” or a “b” or a “c”. (That *is* what it means.)
> 
> But it isn't! It also means "and" from that point of view. That's where ambiguity comes from.
> 
>>> And by the way, '|' is an option for people who have trouble with semicolons.
>> 
>> Are you having a bad day? Saying “people who have trouble with” sounds awfully patronizing.
> 
> Oh sorry if it does. I have trouble with "=" instead of ":", because it isn't defining an equality, but is a definition, and I dislike the misuse of symbols like that.
> I blame FORTRAN.
> 
> Steven
> 

Received on Thursday, 30 January 2025 21:34:14 UTC