Is the concatenation of two arbitrary alphabets is considered an alphabet?

590 Views Asked by At

Is the concatenation of two arbitrary alphabets is considered an alphabet ? Also Is the set of all Java reserved words is considered an alphabet ? I am inclined to say yes. We could take a string and consider it a symbol. What do you think ?

2

There are 2 best solutions below

0
On BEST ANSWER

Any finite set of symbols can be considered an alphabet. It doesn't matter if those symbols consist of multiple latin letters, multiple copies of symbols in other alphabets, or what have you. Thus it's simple to see that an alphabet can be formed from the concatenation of the elements in two alphabets. Then a symbol in our alphabet consists of one symbol from the first alphabet and one symbol from the second. Likewise Java reserved words can form an alphabet fairly easily, they're all just disjoint symbols.

We can take a string and consider it a symbol, but note that no symbol in our alphabet contains any other symbols in our alphabet, so "s", "y" and "sym" are all completely distinct from each other. For that reason it's not recommended to use an alphabet that's ambiguous when written.

0
On

Is the concatenation of two arbitrary alphabets is considered an alphabet?

Concatenation is usually defined for words (tuples of symbols) or sets of words (formal languages) over a common alphabet. But I guess the product set $$ \Sigma_1 \times \Sigma_2 = \{ (x,y) \mid x \in \Sigma_1, y \in \Sigma_2 \} $$ is what you have in mind. The result needs to be a finite set, thus having distinct elements.

Also is the set of all Java reserved words is considered an alphabet ? I am inclined to say yes. We could take a string and consider it a symbol. What do you think ?

It is a valid set (different elements), so it can be interpreted as alphabet.

In the classic phases of compilation, a lexical scanner would combine the symbols from the Unicode alphabet into reserved Java words and then emit them as tokens, which are symbols of the alphabet used in the formal grammar processed by the parser.