r/ProgrammingLanguages • • Jan 06 '19

Graph theory representation for Forth (Stack Machine) features / constructs?

https://groups.google.com/forum/#!topic/comp.lang.forth/UO2E9xHOq_g
0 Upvotes

7 comments sorted by

2

u/gopher9 Jan 07 '19

Yes:

(sorry for incomplete papers, I don't have enough time to finish them)

You can also find http://hackerfoo.com/posts/popr-tutorial-0-dot-machines.html interesting.

0

u/wengchunkn Jan 08 '19

Updates:

https://groups.google.com/d/msg/comp.lang.forth/UO2E9xHOq_g/NrzDaqf7DwAJ

-- start --
Hypothesis SM1: All mathematical and programming structures can be constructed using graph. As such, they can be constructed using stack machine reverse polish notation.

We may attempt to prove the above by induction.

Firstly, we may prove the generation of natural number. Write an RPN program to generate natural numbers and verify them manually. This is trivial.

Next, write other RPN programs, which can be used to inductively prove other theorems.

Repeat the above until the collection of RPN programs can generate programs automatically, and prove all (observable) physical observations.
-- end --

I think the above hypothesis SM1 is now self contained and well defined.

Comments welcome.

1

u/gopher9 Jan 08 '19

All mathematical and programming structures can be constructed using graph

Could you elaborate what do you mean by “constructed using graph”?

0

u/wengchunkn Jan 08 '19

Any equation has left hand side and right hand side.

Either side of an equation can be parsed as a tree, hence a graph, hence represented as reverse Polish notation.

2

u/gopher9 Jan 08 '19 edited Jan 08 '19

So you are talking about representing terms?

hence represented as reverse Polish notation

Representing trees with RPL is not very straightforward. CA is a better tool for this.

UPDATE: you may find this text on term graph rewriting interesting.

1

u/wengchunkn Jan 08 '19

What are your goals?

2

u/gopher9 Jan 09 '19

For Conc? My first goal was sane tacit programming, my next goal was to research some theoretical properties of the concatenative algebra, and my current goal is to create a decent environment for live coding.