<h2>Problem</h2>

<p>I'm writing a document where I have to describe some of the properties of a type system as they relate to a particular formal grammar.</p>

<p>I was trying to refer to the right-hand-sides of the last two productions in the grammar when it struck me that it's very strange that I've pretty much always heard the left- and right-hand sides describes as such.
In particular it seems like an <strong>artifact of our notation</strong> having its roots in languages which are read from left-to-right.</p>

<p>It would make sense for there to be terms like in logic, where the left-hand-side of an implication is the <code>antecedent</code> and the right-hand-side is the <code>consequent</code>.
These words don't refer to the notation properties, but actually describe the meaning of the implication from each side (although I suppose you could make the argument that they are artifacts of our conception of causality, but at least this provides some insight into the <em>interpretation</em> of the terms rather than the <em>notation</em>).</p>

<h2>What I've tried so far:</h2>

<p>I thought about it for a little while and the most natural words I could come up with were <code>source</code> and <code>destination</code> (obviously for the left- and right-hand-sides of the production, respectively.)</p>

<p>Sources I've checked:</p>

<ol>
<li>Looked through a couple of my textbooks on formal languages and compilers;</li>
<li>Checked some likely Wikipedia pages;</li>
<li>Skimmed/ctrl+f'd some online teaching resources, and of course;</li>
<li>Checked math.stackexchange and also cstheory.stackexchange</li>
</ol>

<p>Are there alternative names which are in colloquial use among computer scientists for referring to these components?</p>

CC BY-SA 3.0
2012-12-14T04:45:05.833Z
I've only seen LHS/RHS, but I don't really like those either. This could be your chance to coin the terms! antecedent/consequent, source/destination, factor/product, progenitor/progeny, origine/terminus, discordant/denouement, transmogrifactor/transmogrifaction, alpha/omega, bud/flower, frog/prince.
usul
CC BY-SA 3.0
2012-12-14T09:29:24.423Z
I like "replacement" for the RHS. Not sure about the LHS. "replacee"? "replacend"?
Max
CC BY-SA 3.0
2012-12-14T12:13:02.583Z
Are your formal grammars context-free?  Most of the ones I've worked with are (in describing programming languages) and so I usually say "nonterminal Foo" for the LHS and "rule for nonterminal Foo" for the whole thing; usually clear from context that it's referring to the RHS.
Chris Pressey
CC BY-SA 3.0
2012-12-14T15:08:09.337Z
Would "term" and "expansion" suit you?
Niel de Beaudrap
CC BY-SA 3.0
2012-12-15T13:10:17.327Z
Although I am not completely sure, I believe the RHS can be termed as the 'pattern' and the LHS can be termed as the 'reduction'. This comes from the fact that when a parser reads a language it parses the patterns and reduces them to new rules (or shifts to parse and find new patterns).
Yet Another Geek
CC BY-SA 4.0
2020-04-29T09:44:00.607Z
In formal proof systems, the LHS is often referred to as "premis" and RHS as "conclusion". It should be noted though that all formal definitions of the concept of "proofs" or "correct statements" are purely in terms of syntactical manipulations. Strictly speaking, the meaning behind symbols and expressions is not part of the field of mathematics, but of philosophy. "a => b" is equivalent to "b <= a" not because their "meaning is the same", but because there exists a sequence of syntactical operations on "a => b" that preserve equivalence (which is also nothing but a relation on formulas).
Nearoo
<fl.formal-languages><grammars><notation>
Names for the left- and right-hand sides of a grammar production?
machine yearning
# Names for the left- and right-hand sides of a grammar production?

(Asked by: username_0 on 2012-12-14)

## Problem

I'm writing a document where I have to describe some of the properties of a type system as they relate to a particular formal grammar.

I was trying to refer to the right-hand-sides of the last two productions in the grammar when it struck me that it's very strange that I've pretty much always heard the left- and right-hand sides describes as such.
In particular it seems like an **artifact of our notation** having its roots in languages which are read from left-to-right.

It would make sense for there to be terms like in logic, where the left-hand-side of an implication is the `antecedent` and the right-hand-side is the `consequent`.
These words don't refer to the notation properties, but actually describe the meaning of the implication from each side (although I suppose you could make the argument that they are artifacts of our conception of causality, but at least this provides some insight into the *interpretation* of the terms rather than the *notation*).

## What I've tried so far:

I thought about it for a little while and the most natural words I could come up with were `source` and `destination` (obviously for the left- and right-hand-sides of the production, respectively.)

Sources I've checked:

1. Looked through a couple of my textbooks on formal languages and compilers;
2. Checked some likely Wikipedia pages;
3. Skimmed/ctrl+f'd some online teaching resources, and of course;
4. Checked math.stackexchange and also cstheory.stackexchange

Are there alternative names which are in colloquial use among computer scientists for referring to these components?

**Tags:** fl.formal-languages, grammars, notation

> **Comments:**
> **username_1**: I've only seen LHS/RHS, but I don't really like those either. This could be your chance to coin the terms! antecedent/consequent, source/destination, factor/product, progenitor/progeny, origine/terminus, discordant/denouement, transmogrifactor/transmogrifaction, alpha/omega, bud/flower, frog/prince.  
> **username_2**: I like "replacement" for the RHS. Not sure about the LHS. "replacee"? "replacend"?  
> **username_3**: Are your formal grammars context-free?  Most of the ones I've worked with are (in describing programming languages) and so I usually say "nonterminal Foo" for the LHS and "rule for nonterminal Foo" for the whole thing; usually clear from context that it's referring to the RHS.  
> **username_4**: Would "term" and "expansion" suit you?  
> **username_5**: Although I am not completely sure, I believe the RHS can be termed as the 'pattern' and the LHS can be termed as the 'reduction'. This comes from the fact that when a parser reads a language it parses the patterns and reduces them to new rules (or shifts to parse and find new patterns).  
> **username_6**: In formal proof systems, the LHS is often referred to as "premis" and RHS as "conclusion". It should be noted though that all formal definitions of the concept of "proofs" or "correct statements" are purely in terms of syntactical manipulations. Strictly speaking, the meaning behind symbols and expressions is not part of the field of mathematics, but of philosophy. "a => b" is equivalent to "b <= a" not because their "meaning is the same", but because there exists a sequence of syntactical operations on "a => b" that preserve equivalence (which is also nothing but a relation on formulas).  

---

## 0 answers

