top | item 47106875

(no title)

canjobear | 8 days ago

Interesting. What I was thinking was you could get the bounded-number-of-generations behavior by defining nonterminals with indices. Like this CFG which would rewrite for K steps.

S -> F_K

F_i -> F_{i-1} + G_{i-1} for i>0

G_i -> F_{i-1} - G_{i-1} for i>0

F_0 -> f

G_0 -> g

This kind of CFG is used for example by https://journals.aps.org/prx/pdf/10.1103/PhysRevX.14.031001

discuss

order

YeGoblynQueenne|6 days ago

>> Like this CFG which would rewrite for K steps.

I believe that would work too and you could convert to this sub-scripted format with a simple pre-processor. I prefer the simpler and clearer notation that leaves the counting of generations to an interpreter because it's easier to read, but that's personal taste.

Thanks for the link to the paper which looks interesting. I'll have to read it more carefully.