```Hallo conlangers!

On Friday 04 January 2013 21:38:23 R A Brown wrote:

> On 04/01/2013 15:30, And Rosta wrote:
> > Jörg Rhiemeier, On 04/01/2013 13:18:
> >> I have been maintaining for long that RPN is a word
> >> order type in itself that is actually very different
> >> from the SOV word order found in about one half of all
> >> human languages.
> >
> > Why is it actually very different? RPN has consistent
>
> If by head you mean 'operator 'and by dependent you mean
> 'operand'.  Let us be clear that RPN is a method which was
> developed for both unambiguous mathematical expression and
> for their evaluation.  It was to avoid the artificial
> convention of what we used to call BODMAS when I was at
> school and, indeed, the need for ever using brackets within
> an expression.

Right.

> Though strictly speaking it was the so-called "Polish
> notation" (PN) devised by  Jan Łukasiewicz that was devised
> to achieve this.  In this operator comes first and the
> operands follow.  However, it was noticed by computer
> scientists that if you did things the other way round, then
> the expression could be built up using a stack and
> immediately evaluated, which is why RPN became so widely
> used in computing.

Just that.  English-speaking people had their difficulties with
"Łukasiewicz notation", so they just called it "Polish notation".
The same way as we call Sun Zi's theorem the "Chinese remainder
theorem", even though _Sun Zi_ is actually an easier name for
English-speakers than _Łukasiewicz_, if we ignore the tones
(which I haven't found on Wikipedia).

> (Strictly RPN is not the reverse of PN, as the operands are
> still put in the same order, e.g. "5 - 2" is "- 5 2" in PN
> and "5 2 -" in RPN - not "2 5 -").
>
> So does that mean all SOV languages are expressed as RPN,
> and all VSO languages as PN?  Certainly not.

Indeed not!

> > and S & O are normally considered dependents of head V.
>
> Yes.  If we spoke with nothing more complicated than "man
> bites dog", then indeed "bites man dog" is PN, and "man dog
> bites" is RPN.
>
> The trouble us we humans like to add a few adjectives around
> the place, together with maybe the odd determiner or two; we
> even stick in an adverb or two and maybe one or more dratted
> prepositional and/or postpositional phrases; then we have
> the temerity to add relative clauses and various other
> subordinate clause, etc.
>
> I cannot think of any natlang that conforms solely to PN or
> RPN ordering.

Nor can I!  A conlang that does is Fith, but that one lacks the
sophistication of a natlang.  It is nothing more than a sketch
which covers only the very basics of syntax.  I have never seen
a longer text in Fith; I am pretty sure that once one was to
translate a sophisticated literary text into it, it would show
its limits and fall apart.

> But let us take a simple RPN example. First we'll have to
> recast it so that operators are replaced by a verb in such a
> way that the first operand is a grammatical subject and the
> second an object.  I must confess I haven't found a neat way
> of doing this.  The best I can manage is to have the
> operators as passive verbs; this allows the first operand to
> be the subject of the verb; the second operand is then the
> object of "by" or, if you prefer, the verbal phrase.
>
> Thus I rephrase "5 2 -" as: five two diminished-by.
>
> OK. Here is a pretty simple RPN expression:
> three five augmented-by seven two diminished-by multiplied-by.
>
> Which you easily evaluate as 40!  Or not?

I arrive at the same result.  But this is just arithmetics, and
languages can do much more than that.  The same way human minds
can do much more than computers (which has nothing to do with
raw computing power - on that bill, computers have left us in

> [snip]
>
> >> Who will ever become fluent in a stack-based language?
> >> Such beasts are outside what the human language
> >> facility can cope with in real time, I think.
>
> I agree.
>
> >> Stack-based grammars are very economical with regard to
> >> rules (which is the reason they are sometimes used in
> >> computing), but require a prodigious short- term memory
> >> in order to handle the stack properly (which computers
> >> of course have).
>
> I also agree with this.
>
> > I don't want to repeat the several lengthy threads on
> > this topic that appear to have left no impression on
> > Joerg's memory,
>
> On the contrary, I can assure you that they have left an
> impression both on Jörg's mind and on mine.

Indeed they have left a lasting impression, which is reinforced
by the current iteration of this debate.  There really is no
need to repeat those lengthy threads again, though for different
reasons than what And assumes to be ;)

> > so let me essay a quick summary for Gary's benefit:
> >
> > The available evidence (i.e. what has been adduced in
> > previous discussions) indicates that humans parse
> > natlangoid lgs using stacks.
>
> IMO all that has been adduced is that a fairly trivial use
> of stack is possibly involved in human language processing.

Certainly, some kind of memory is involved here which in some
way tags the stored syntax tree nodes according to where they
occur; whether it is a "stack" is another matter.

> > So in one sense, a stack-based conlang grammar would just
> > be a grammar formulated in a way that takes into account
> > how sentences will be parsed, and there's nothing
> > obviously unnatural about it.
>
> I have yet to see convincing examples where a sentence
> parsing of human usable language can be done solely in ways
> analogous to the use of stacks as a computer data structure.

I have yet to see such examples, too.

> > However, previous discussion of Fith, which is a
> > stack-based conlang (in the above sense) revealed that
> > the language was also intended to be parsed in way that
> > went straight from phonology to semantic interpretation,
>
> > without a level of syntax:
> Not sure what you mean by this.  In any case this part of
> the thread is really about RPN.  Is there no syntax in the
> expression "5 2 -" (five two diminished-by)?

Certainly there is syntax in it!  There is a rule which states
which of the arguments of "-" is to be subtracted from which.

> > when the parser combined an operator and operand, the
> > output would be a semantic rather than a syntactic
> > object.
>
> Obviously - that's what RPN is all about.

Yep.  The stack of an RPN calculator never holds anything else
than *numbers*, i.e. "semantic objects".  The human language
faculty, in contrast, certainly stores not only words but also
phrases and clauses, i.e. syntactic objects.  (But the stack
of a Fithian also holds syntactic objects.  The language is
thus not "syntax-free", its syntax is only vastly simpler
- but more taxing on short-term memory - than that of human
languages.)

> > This is logically independent of the stack-basedness,
>
> Maybe - but, with respect, you're putting the cart before
> the horse.  Stacks are used to evaluate RPN because it's the
> obvious way to do it.

Right.

>        By all means use the stack for
> something else if you wish.  But, as a computer scientist, I
> use a stack when it is useful to do so, and some other
> appropriate data structure when it is useful to do so.  Data
> structures are tools.

And that is the right way of using it.  It is a useful tool
for some purposes; for others, it is less so, and you better
use something else.

> > but the previous discussion revealed that some (Ray and
> > Joerg) were using the term _stack-based_ to mean
> > "stack-based and syntaxless".
>
> No - we were both using stack-based in the way that computer
> scientists and programmers use the term.

Yes.

> > To my mind, syntaxfulness is a necessary property of
> > languagehood --

A truism - but nobody ever doubted it!

> Have you ever tried writing a natural language parser?
>
> [snip]
>
> > In "I gave the place where tomorrow the princess the *
> > bishop will crown instead of the prince a quick once
> > over", by the time you hit *, the stack contains (i)
> > _gave_, waiting for the direct object (_a quick once
> > over_), (ii) _where_, waiting for _will_, (iii)
> > _tomorrow_, waiting for _will_, (iv) _the princess_,
> > waiting for _will_, (v) _the_ waiting for _bishop_ and
> > for _will_.
>
> Er?  Could you evaluate this *as a stack* beginning with "I'
> and proceeding to the next word and so on?

I am completely lost in And's example ;)

> [snip]
>
> >> Two strong reasons to forsake a stack-based approach!
> >> Stack-based languages are not naturalistic, and you'll
> >> never become fluent in them!
> >
> > You (Joerg) should find an apter and less misleading term
> > than "stack-based".
>
> No - stack-based means _based_ on a stack, i.e. the stack is
> the main or, as in the case of RPN, only data structure used.

Yes.  And I doubt that it is sufficient to parse a human
language.

> > In the most literal and obvious sense of "stack-based",
> > natlangs are "stack-based".
>
> If only! That has not been my experience with natural
> language processing.  Natlangs are rather more complicated.

I don't have much practical experience with natural language
processing (I once tinkered with a parser for Zork-style games,
which, however, only understood a restricted subset of a human
language), but at any rate, human languages are much more
complex than most programming languages!

> > "Stack-based languages" in your extended sense are indeed
> > not naturalistic, and indeed aren't even languages, but
> > because of the syntaxlessness, not the stack-basedness.
>
> Why is "5 2 -" syntaxless?

It can't be syntaxless when a reordering changes the meaning:
_2 5 -_ gives a different result, and _5 - 2_ gives again a
different result which even depends on what is currently on
the stack, or a syntax error if the stack is empty ;)

--
... brought to you by the Weeping Elf
http://www.joerg-rhiemeier.de/Conlang/index.html
"Bêsel asa Éam, a Éam atha cvanthal a cvanth atha Éamal." - SiM 1:1
```