% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % File: lsystem4.dtr % % Purpose: Lindenmayer systems 4: deterministic (1,1)-system % % Author: Gerald Gazdar, February 1995 % % Email: geraldg@cogs.sussex.ac.uk % % Address: COGS, Sussex University, Brighton BN1 9QH, UK % % Documentation: see reference given below % % Related files: lsystem1.dtr, lsystem2.dtr, lsystem3.dtr % % Version: 1.00 % % % % Copyright (c) University of Sussex 1995. All rights reserved. % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % Przemyslaw Prusinkiewicz & Aristid Lindenmayer (1990) The Algorithmic % Beauty of Plants. New York: Springer Verlag, pp 30. % Consider the following simple deterministic left-context (1,1)-system: % Axiom: b a a a % Rule: b < a > a --> a b % b < a > b --> c % It can be translated into a DATR word generator as follows: # vars $x $y : a b c - . ABrules: <$x , |> == % end marker mapped to null == a b % first rule == c % second rule <$x , $y> == $y . % idem ABwords: <> == b a a a % axiom <|> == ABrules:<- , ABwords:<> | >. % the recursive step Shift: <$x , $y> == $y , Idem:<>. Idem: <|> == | == a <> == b <> == c <>. % We can use ABwords to generate the nth string, represented in unary: % ABwords:<> = b a a a. % ABwords:<|> = b a b a a. % ABwords:<| |> = b c b a b a. % ABwords:<| | |> = b c b c b a. % Clearly, it is simple to convert any deterministic (1,1)-system into a % corresponding DATR word generator in the manner illustrated above. % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % # hide ABrules Shift Idem. # show <> <|> <| |> <| | |> . % The next line is the Revision Control System Id: do not delete it. % $Id: archive.dtr,v 1.1 1997/04/09 20:40:33 root Exp $