Post Reply 
Four types of RPN
09-02-2014, 04:16 PM
Post: #1
Four types of RPN
(08-28-2014 10:42 PM)In another thread Joe Horn Wrote:  (…) We really, really, really need permanent, unambiguous, universally adopted NAMES for all these various RPN's (…) which hopefully some day can be clearly represented by meaningful, unambiguous, non-judgmental names (…)

In my (still not entirely finished) RPN Tutorial in Appendix G on RPN Variants I propose the following scheme:

Purely looking at the workings of the stack of RPN calculators (and not at their programming capabilities) a few RPN variants can be discerned. Both the bottom and the top of the stack may vary.

A. Bottom of the stack:
  1. Classical RPN
  2. Entry RPN
B. Top of the stack:
  1. Small stack (4-, 5- or 8-level) with ‘top copy on pop’
  2. Very large stack (>100 levels), no ‘top copy on pop’

Four types of RPN

All four possible combinations of the 2 × 2 possibilities of RPN variants actually do exist, although not always in hardware:

α. (alpha type) The combination of Classical RPN with a small stack and ‘top copy on pop’ is well known. Besides the 4-level stack of all classical HP RPN calculators (all HP RPN calculators except those listed below after β. and γ.) and their emulations there is the 5-level stack of the Heathkit OC-1401, and the 8-level mode of the WP 31S and WP 34S.

β. (beta type) All HP RPN graphing calculators (series 28, 48 & 49, the HP 50g and Prime) have Entry RPN and an unlimited or very large stack (128 stack levels in the Prime).

γ. (gamma type) The HP 20b and HP 30b have Entry RPN and a 4-level stack with ‘top copy on pop’.

δ. (delta type) The Calculator application in Mac OS X in RPN-mode combines Classical RPN behaviour of the ENTER key with an unlimited stack.


Discussion

Following Richard Nelson in his article in HP Solve (#27 p. 42) ‘RPN Evolves’ the terms Classical RPN and Entry RPN only refer to the differences at the bottom of the stack. I think Classical RPN is better here than Classic RPN because the latter term denotes a judgement (‘of the highest quality and outstanding of its kind’) whereas Classical RPN is purely descriptive, as in ‘classical music’ (formal music adhering to certain stylistic principles of the late 18th century).

This scheme is unambiguous and non-judgemental, and can be used for future implementations with different programming languages because it does not say anything about programming capabilities. And it conveys some meaning because it indicates the chronology and link to HP of the RPN variants, α type being the oldest, β type younger and γ type the youngest RPN variant first implemented by HP; and δ type another, non-HP type. The 3-level RPN of the HP series 9100 en 9800 could be called ‘pre-α type’.

Just my two cents.

Hans
Find all posts by this user
Quote this message in a reply
09-02-2014, 05:44 PM
Post: #2
RE: Four types of RPN
Thanks for your excellent analysis of the differences!

However, I disagree that Greek letters are meaningful names. If something is "meaningful," then it's intrinsically full of meaning. It means that the listener can tell, just by hearing the name, what it's the name of. "Algebraic Entry mode" means something. "Textbook Display mode" means something. "Gamma" means nothing to anybody, until after it's explained, which proves that it's not intrinsically meaningful.

IMHO, the names cannot merely refer to the order in which they developed, because that would give no information about what they are, or how they differ. They would have to be explained every time, which kinda defeats the whole reason for having names in the first place.

Aristotle (or one of that crowd) said that a good definition of a thing is a statement of the genus to which it belongs, and its specific difference from the other members of its genus. A name is usually shorter than a definition, but unless the name -- by itself -- makes clear what it's the name of, then it's not a meaningful name. The best names would be something like "Yada yada RPN" where yada yada is the specific difference between that kind of RPN and the others, because such names would be in fact brief definitions... the most meaningful name possible.

With all that in mind, I suggest these names:

Classical n-level RPN
Entry line n-level RPN
Infinite stack RPN

That's 11 possible names (n=4, 5, 8, 64, or 128),

I suggest "Entry line" instead of "Entry" because they ALL are forms of entry, so "entry" by itself is not specific enough. But only the "entry line" models use an entry line. We used to call that a "Command line" (remember the CLI on the Amiga?), but I guess it's called an "entry line" now. The Prime manual and built-in help system call it an "edit line".

Disclaimer: The above are merely my current opinions. I'm always happy to have my opinions replaced by better ones. A mind is a terrible thing to let stagnate with a logjam of stubborn opinions. And don't try to tell me otherwise! :b

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
09-02-2014, 06:06 PM
Post: #3
RE: Four types of RPN
(09-02-2014 05:44 PM)Joe Horn Wrote:  I'm always happy to have my opinions replaced by better ones. A mind is a terrible thing to let stagnate with a logjam of stubborn opinions. And don't try to tell me otherwise!

A+
Find all posts by this user
Quote this message in a reply
09-02-2014, 09:38 PM
Post: #4
RE: Four types of RPN
(09-02-2014 05:44 PM)Joe Horn Wrote:  Classical n-level RPN
Entry line n-level RPN
Infinite stack RPN

That's 11 possible names (n=4, 5, 8, 64, or 128),

There are different entry-line RPN models AFAICS: those with top level repetition and those without. Cf. the HP-30b (EL 4-level with TLR) and the Prime (EL 128-level without TLR). Confused

Quote:I'm always happy to have my opinions replaced by better ones. A mind is a terrible thing to let stagnate with a logjam of stubborn opinions. And don't try to tell me otherwise! :b

Smile

d:-)
Find all posts by this user
Quote this message in a reply
09-02-2014, 10:17 PM (This post was last modified: 09-02-2014 10:19 PM by Joe Horn.)
Post: #5
RE: Four types of RPN
(09-02-2014 09:38 PM)walter b Wrote:  
(09-02-2014 05:44 PM)Joe Horn Wrote:  Classical n-level RPN
Entry line n-level RPN
Infinite stack RPN

That's 11 possible names (n=4, 5, 8, 64, or 128),

There are different entry-line RPN models AFAICS: those with top level repetition and those without. Cf. the HP-30b (EL 4-level with TLR) and the Prime (EL 128-level without TLR). Confused

(Just brainstorming here...) Well, if we limit ourselves to existing implementations (a reasonable thing to do), then everything fits in exactly one of these six groups of RPN models, thus making them unambiguous:

Classical 4-level RPN (most models)
Classical 4&8-level RPN (WP 34s)
Entry-line 4-level RPN (20b, 30b, any others?)
5-level RPN (what model had 5 levels???)
128-level RPN (Prime)
Infinite stack RPN (RPL models)

There's no need to specify top-level replication, because that's not ambiguous within any of those groups. "Top-level-replicating 128-level RPN" is redundant, because all 128-level RPN's are non-top-replicating. (All one of them.) Similarly, we don't need to mention whether CLx disables stack lift or not, since all the models within each group handle that the same way. Ditto for all features shared within each group. No? (I might be forgetting some models...)

It's tempting to call 128-level RPN "Prime RPN" because only Prime has it... but that's only true at this time. Who knows; other models might have it later, and "Prime RPN" only names it, but doesn't describe it. So 128-level RPN is a better name. Ditto for Classical 4&8-level RPN.

Wasn't there a 3-level RPN in some ancient desktop models? And somebody recently mentioned a model that used Y as the accumulator (bizarre!). We'd need to extend the above table if we want to include those critters.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
09-02-2014, 10:22 PM
Post: #6
RE: Four types of RPN
(09-02-2014 10:17 PM)Joe Horn Wrote:  5-level RPN (what model had 5 levels???)

The Heathkit OC-1401

Ceci n'est pas une signature.
Find all posts by this user
Quote this message in a reply
09-02-2014, 10:40 PM
Post: #7
RE: Four types of RPN
(09-02-2014 10:17 PM)Joe Horn Wrote:  Wasn't there a 3-level RPN in some ancient desktop models?
several. the hp9100 for instance
in pocket calcs; there were also a few in the Novus/nat semi lines, and their Argentine clones.
Find all posts by this user
Quote this message in a reply
09-02-2014, 10:52 PM
Post: #8
RE: Four types of RPN
(09-02-2014 05:44 PM)Joe Horn Wrote:  Thanks for your excellent analysis of the differences!

However, I disagree that Greek letters are meaningful names. If something is "meaningful," then it's intrinsically full of meaning. It means that the listener can tell, just by hearing the name, what it's the name of. "Algebraic Entry mode" means something. "Textbook Display mode" means something. "Gamma" means nothing to anybody, until after it's explained, which proves that it's not intrinsically meaningful.

Even names that at first sight seem meaningful often need some explaining. This also applies to your examples. Only after having read the explanation is it relatively easy to remember what is meant by "Algebraic Entry mode" and "Textbook Entry mode". "Algebraic Entry mode" per se could just as easy be a good name for what now is called "Textbook Entry mode".

Greek letters per se are not meaningful, but they can be loaded with meaning. Everyone who has read more than one page about gorillas knows what is meant by an "alpha male". Mutatis mutandis the same goes for alpha, beta and gamma radiation.

(09-02-2014 05:44 PM)Joe Horn Wrote:  With all that in mind, I suggest these names:

Classical n-level RPN
Entry line n-level RPN
Infinite stack RPN

That's 11 possible names (n=4, 5, 8, 64, or 128),

I suggest "Entry line" instead of "Entry" because they ALL are forms of entry, so "entry" by itself is not specific enough. But only the "entry line" models use an entry line. We used to call that a "Command line" (remember the CLI on the Amiga?), but I guess it's called an "entry line" now. The Prime manual and built-in help system call it an "edit line".

I agree with you and Aristotle that it all starts with a good descriptive classification.
And that classification should include both HP and non-HP calculators, and also calculator programs (for computers, smartphones, tablets, etc.). There are many more RPN (of all types) calculator programs available (especially for smartphones) than there are RPN calculator models in hardware.

"Classical RPN" and "Entry line RPN" as classification for the two types of behaviour of the bottom of the stack is perfect to me. They're relatively well known to the community and both names have the same number of syllables. B.t.w.: in the Prime manual the command line is called "Entry line" and not "Edit line".

Imho your descriptive classification for the top of the stack is not entirely accurate, and misses the important point of presence or absense of "top copy on pop".

It is not accurate because an "infinite" stack can be combined both with Entry line RPN (e.g. the pre-Prime HP graphing RPN calculators) and with Classical RPN (the Mac OS X Calculator application). And the presence or absense of "top copy on pop" doesn't follow automatically from your classification. Some Entry line n-level RPN calculators have it (e.g. the HP 20b & 30b) and some don't (e.g. the HP Prime).

The word "infinite" denotes a specific mathematical concept (∞) and should better not be used for a stack that is only bounded by available memory. HP uses the word "unlimited" in this context, the computer science term is "unbounded". I would prefer one of those.

My proposal for a descriptive classification would be:
Each description of an RPN type includes three things:
- description of the bottom of the stack (Classical or Entry line RPN)
- presence or absence of "top copy on pop" (top-copy or top-neutral RPN)
- description of the hight of the stack (bounded n-level stack or unbounded stack)

At the moment in real life there exist only four types of RPN:
- Classical top-copy 4, 5 or 8-level stack RPN
- Classical top-neutral unbounded stack RPN
- Entry line top-copy 4-level stack RPN
- Entry line top-neutral 128-level or unbounded stack RPN

If we reshuffle this list so that all members of our community can easily remember it we get:
- Classical top-copy 4, 5 or 8-level stack RPN (the "classics", a.k.a. alpha type)
- Entry line top-neutral 128-level or unbounded stack RPN (the "graphics", a.k.a. beta type)
- Entry line top-copy 4-level stack RPN (the "??", a.k.a. gamma type)
- Classical top-neutral unbounded stack RPN (the "???", a.k.a. delta type)

Hans
Find all posts by this user
Quote this message in a reply
09-03-2014, 04:57 AM
Post: #9
RE: Four types of RPN
(09-02-2014 10:17 PM)Joe Horn Wrote:  Wasn't there a 3-level RPN in some ancient desktop models?

The Sinclair Scientific would be a 2-level RPN device.


- Pauli
Find all posts by this user
Quote this message in a reply
09-03-2014, 06:37 AM
Post: #10
RE: Four types of RPN
(09-02-2014 10:52 PM)hansklav Wrote:  
(09-02-2014 05:44 PM)Joe Horn Wrote:  With all that in mind, I suggest these names:

Classical n-level RPN
Entry line n-level RPN
Infinite stack RPN

My proposal for a descriptive classification would be:
Each description of an RPN type includes three things:
- description of the bottom of the stack (Classical or Entry line RPN)
- presence or absence of "top copy on pop" (top-copy or top-neutral RPN)
- description of the hight of the stack (bounded n-level stack or unbounded stack)

At the moment in real life there exist only four types of RPN:
- Classical top-copy 4, 5 or 8-level stack RPN
- Classical top-neutral unbounded stack RPN
- Entry line top-copy 4-level stack RPN
- Entry line top-neutral 128-level or unbounded stack RPN

If we reshuffle this list so that all members of our community can easily remember it we get:
- Classical top-copy 4, 5 or 8-level stack RPN (the "classics", a.k.a. alpha type)
- Entry line top-neutral 128-level or unbounded stack RPN (the "graphics", a.k.a. beta type)
- Entry line top-copy 4-level stack RPN (the "??", a.k.a. gamma type)
- Classical top-neutral unbounded stack RPN (the "???", a.k.a. delta type)

Sounds better IMHO.

Just let me add that the alpha type covers not only the Classics but each and every HP RPN calculator from the HP-35 to the HP-42S. Beta covers what's known as RPL. Gamma is just represented by two calcs AFAIK (so it could turn out being a sidetrack). And I'm not aware of any tangible calc representing delta.

d:-)
Find all posts by this user
Quote this message in a reply
09-03-2014, 04:45 PM
Post: #11
RE: Four types of RPN
(09-02-2014 10:52 PM)hansklav Wrote:  Imho your descriptive classification for the top of the stack is not entirely accurate, and misses the important point of presence or absense of "top copy on pop".

I don't like this wording because it doesn't describe exactly what happens:

In the RPL machines and the Prime, the stack is of variable size. If a value is popped off the stack (consumed or dropped) the length of the stack decreases. Thus, the stack may well contain too little objects to perform a given operation. The prime differs just in the maximum size of this stack from the RPL machines.

In the other machines the stack has a fixed size. The question is what happens if a value is dropped or consumed: The remaining elements drop one level, except the top of the stack which is left unchanged. The duplication of the value is just a side effect of the drop, not an extra operation.

Marcus von Cube
Wehrheim, Germany
http://www.mvcsys.de
http://wp34s.sf.net
http://mvcsys.de/doc/basic-compare.html
Find all posts by this user
Quote this message in a reply
09-03-2014, 08:36 PM
Post: #12
RE: Four types of RPN
(09-03-2014 04:45 PM)Marcus von Cube Wrote:  The duplication of the value is just a side effect of the drop, not an extra operation.

The classical RPN calculators don't really use a stack but use 4 registers to emulate a stack. Thus roll-up and roll-down become expensive operations whereas when using what I consider a real stack drop is very cheap:
you just move the stack-pointer and don't move registers.

I think it's interesting that in the older HP calculators (e.g. HP-35) a special machine instruction was used for down-rotate while in later calculators (e.g. HP-41C) this was implemented using multiple read and write operations.

Does anybody know why and when this was changed?

Cheers
Thomas
Find all posts by this user
Quote this message in a reply
09-08-2014, 12:25 AM (This post was last modified: 09-08-2014 12:49 AM by hansklav.)
Post: #13
RE: Four types of RPN
(09-03-2014 06:37 AM)walter b Wrote:  
(09-02-2014 10:52 PM)hansklav Wrote:  My proposal for a descriptive classification would be:
Each description of an RPN type includes three things:
- description of the bottom of the stack (Classical or Entry line RPN)
- presence or absence of "top copy on pop" (top-copy or top-neutral RPN)
- description of the hight of the stack (bounded n-level stack or unbounded stack)

At the moment in real life there exist only four types of RPN:
- Classical top-copy 4, 5 or 8-level stack RPN
- Classical top-neutral unbounded stack RPN
- Entry line top-copy 4-level stack RPN
- Entry line top-neutral 128-level or unbounded stack RPN

If we reshuffle this list so that all members of our community can easily remember it we get:
- Classical top-copy 4, 5 or 8-level stack RPN (the "classics", a.k.a. alpha type)
- Entry line top-neutral 128-level or unbounded stack RPN (the "graphics", a.k.a. beta type)
- Entry line top-copy 4-level stack RPN (the "??", a.k.a. gamma type)
- Classical top-neutral unbounded stack RPN (the "???", a.k.a. delta type)

Sounds better IMHO.

Just let me add that the alpha type covers not only the Classics but each and every HP RPN calculator from the HP-35 to the HP-42S. Beta covers what's known as RPL. Gamma is just represented by two calcs AFAIK (so it could turn out being a sidetrack). And I'm not aware of any tangible calc representing delta.

You are right concerning my use of the word ‘Classics’. For a moment I forgot that the term ‘Classics’ is already in use for a specific subset of the α type (alpha type) RPN calculators, notably those issued by HP in 1972 or shortly thereafter. So ‘the Classics’ is not a good term for the whole set of α type RPN calculators.

The RPL calculators are not identical to the β type (beta type) RPN calculators because the HP Prime is β type RPN in the above definition but doesn’t have RPL as a programming language. The β type RPN calculators could be covered by the term ‘HP graphing RPN calculators’, but that is a rather long one. My suggestion therefore was ‘the Graphics’, but I don’t think that’s good English…

While δ type (delta type) RPN is not available as an actual hardware calculator, it is potentially available to the desktops or laptops of more people (millions) than any of the other types, in the form of the RPN-mode of the standard Calculator (Taschenrechner, Rekenmachine, Calcolatrice, Kalkulator, Kalkylator, &c.) application in Mac OS X.

Hans
Find all posts by this user
Quote this message in a reply
09-08-2014, 12:37 AM (This post was last modified: 09-08-2014 12:53 AM by hansklav.)
Post: #14
RE: Four types of RPN
(09-03-2014 04:45 PM)Marcus von Cube Wrote:  
(09-02-2014 10:52 PM)hansklav Wrote:  (…) "top copy on pop".

I don't like this wording because it doesn't describe exactly what happens:

In the RPL machines and the Prime, the stack is of variable size. If a value is popped off the stack (consumed or dropped) the length of the stack decreases. Thus, the stack may well contain too little objects to perform a given operation. The prime differs just in the maximum size of this stack from the RPL machines.

In the other machines the stack has a fixed size. The question is what happens if a value is dropped or consumed: The remaining elements drop one level, except the top of the stack which is left unchanged. The duplication of the value is just a side effect of the drop, not an extra operation.

The term is not mine. ‘Top copy on pop’ for the replication of the contents of the T register on stack drop is used already in 1978 by John A. Ball in his book ‘Algorithms for RPN calculators’. The term is short, sounds nice, and describes exactly what the user needs to know. How this is done programmatically is another matter and of no direct concern to the average user (imho).

Hans
Find all posts by this user
Quote this message in a reply
09-08-2014, 12:51 AM (This post was last modified: 09-08-2014 12:57 AM by hansklav.)
Post: #15
RE: Four types of RPN
(09-02-2014 10:40 PM)Den Belillo (Martinez Ca.) Wrote:  
(09-02-2014 10:17 PM)Joe Horn Wrote:  Wasn't there a 3-level RPN in some ancient desktop models?
several. the hp9100 for instance
in pocket calcs; there were also a few in the Novus/nat semi lines, and their Argentine clones.

(09-03-2014 04:57 AM)Paul Dale Wrote:  
(09-02-2014 10:17 PM)Joe Horn Wrote:  Wasn't there a 3-level RPN in some ancient desktop models?

The Sinclair Scientific would be a 2-level RPN device.

For these early 2- and 3-level RPN calculators I propose the term ‘pre-α type’ (pre-alpha type).

Hans
Find all posts by this user
Quote this message in a reply
09-08-2014, 04:40 AM
Post: #16
RE: Four types of RPN
Thanks for your explanations.

d:-)
Find all posts by this user
Quote this message in a reply
09-08-2014, 05:33 AM
Post: #17
RE: Four types of RPN
There are some more obscure variations, especially of the top of the stack on a drop:
  • top copy
  • top is zeroed (HP-35 does this until T has a non-zero value)
  • top drop to empty stack
  • top lifts past a height, drops to a height, then copies
  • top lifts past a height, drops to a height, then zeroed

"Infinite", unbounded, expanding stacks can be handled in different ways. Usually there -is- a bound, just huge. Sometimes a chunk of the top of the stack is removed with a marker placed to recover it as the stack lowers (these are not infinite (there's a limit to the size of the address of the storage place) but can be much larger than the immediate register space.) Some of these variations have not been implemented in hardware calculators that I know of.

I personally refer to the four discussed types as HP-35 RPN, HP-48 RPL, HP-20b RPL, and Mac RPN.
Find all posts by this user
Quote this message in a reply
09-08-2014, 06:00 AM
Post: #18
RE: Four types of RPN
(09-08-2014 05:33 AM)htom trites Wrote:  There are some more obscure variations, especially of the top of the stack on a drop:
  • top copy
  • top is zeroed (HP-35 does this until T has a non-zero value)
  • ...
What's the difference to top copy then??

d:-?
Find all posts by this user
Quote this message in a reply
09-08-2014, 09:43 PM
Post: #19
RE: Four types of RPN
(09-08-2014 06:00 AM)walter b Wrote:  
(09-08-2014 05:33 AM)htom trites Wrote:  There are some more obscure variations, especially of the top of the stack on a drop:
  • top copy
  • top is zeroed (HP-35 does this until T has a non-zero value)
  • ...
What's the difference to top copy then??

d:-?

xyzt + becomes (x+y)zt0, not (x+y)ztt

Different than shortening the stack, there's a value there and it's 0 (vs t)
Find all posts by this user
Quote this message in a reply
09-10-2014, 02:04 AM
Post: #20
RE: Four types of RPN
It is more useful on a drop to stuff a 1 into t (assuming a constant size stack), rather than a 0 (1 being more used than 0 in computations), although echoing t is also useful.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 3 Guest(s)