Stream variant of a Lindenmayer system:
Filter:
Guides (extension) | Libraries > MathLib > L-system

Stream variant of a Lindenmayer system
ExtensionExtension

Stream variant of a Lindenmayer system
 

rewriteString

An initial stream, the axiom, is recursively rewritten, using a set of production rules. In a classic Lindenmayer system (L-system), each level of rewriting is done at once, rewriting the whole string.

This can be also done in a depth-first traversal through all levels, taking in a stream and resulting in a stream.

The L-system's restrictions to a general generative grammar is a fixed order in which the rules are applied, and no principal distinction between terminal and nonterminal symbols.

If one of the two special characters < and > appear in a set of rules, they are interpreted as context in order to form a context-sensitive generative grammar. Everything that falls outside the closure, such as A and B in A<X>B are not rewritten. X is rewritten only if AXB match.

The class Prewrite by James McCartney does a similar thing with objects, whereby their identity is used as a lookup. This is more efficient, but does not allow for the combinatorics that a pure string rewriting system does.

Part of MathLib, a diverse library of mathematical functions.

Examples

Links on the net

Authors

Julian Rohrhuber, 2005.