Logo is an educational programming language , designed in 1967 by Wally Feurzeig , Seymour Papert , and Cynthia Solomon . Logo is not an acronym: the name was coined by Feurzeig while he was at Bolt, Beranek and Newman , and derives from the Greek logos , meaning 'word' or 'thought'.
49-429: A general-purpose language, Logo is widely known for its use of turtle graphics , in which commands for movement and drawing produced line or vector graphics , either on screen or with a small robot termed a turtle . The language was conceived to teach concepts of programming related to Lisp and only later to enable what Papert called " body-syntonic reasoning", where students could understand, predict, and reason about
98-476: A tuple where The rules of the L-system grammar are applied iteratively starting from the initial state. As many rules as possible are applied simultaneously, per iteration. The fact that each iteration employs as many rules as possible differentiates an L-system from a formal language generated by a formal grammar , which applies only one rule per iteration. If the production rules were to be applied only one at
147-442: A "0" is encountered during string rewriting, there would be a 50% chance it would behave as previously described, and a 50% chance it would not change during production. When a stochastic grammar is used in an evolutionary context, it is advisable to incorporate a random seed into the genotype , so that the stochastic properties of the image remain constant between generations. A context sensitive production rule looks not only at
196-709: A ']'. If multiple values have been "pushed," then a "pop" restores the most recently saved values. Applying the graphical rules listed above to the earlier recursion, we get: Let A mean "draw forward" and B mean "move forward". This produces the famous Cantor's fractal set on a real straight line R . A variant of the Koch curve which uses only right angles. Here, F means "draw forward", + means "turn left 90°", and − means "turn right 90°" (see turtle graphics ). The Sierpinski triangle drawn using an L-system. Here, F and G both mean "draw forward", + means "turn left by angle", and − means "turn right by angle". It
245-481: A Hungarian theoretical biologist and botanist at the University of Utrecht . Lindenmayer used L-systems to describe the behaviour of plant cells and to model the growth processes of plant development . L-systems have also been used to model the morphology of a variety of organisms and can be used to generate self-similar fractals . As a biologist, Lindenmayer worked with yeast and filamentous fungi and studied
294-410: A forward process constructs the derivation tree with production rules, and 2) a backward process realizes the tree with shapes in a stepwise manner (from leaves to the root). Each inverse-derivation step involves essential geometric-topological reasoning. With this bi-directional framework, design constraints and objectives are encoded in the grammar-shape translation. In architectural design applications,
343-456: A parametric grammar is a series of modules. An example string might be: The parameters can be used by the drawing functions, and also by the production rules. The production rules can use the parameters in two ways: first, in a conditional statement determining whether the rule will apply, and second, the production rule can modify the actual parameters. For example, look at: The module a(x,y) undergoes transformation under this production rule if
392-458: A practical matter, the use of turtle geometry instead of a more traditional model mimics the actual movement logic of the turtle robot. The turtle is traditionally and most often represented pictorially either as a triangle or a turtle icon (though it can be represented by any icon). Today, the Python programming language's standard library includes a Turtle graphics module. Like its Logo predecessor,
441-486: A rule depends not only on a single symbol but also on its neighbours, it is termed a context-sensitive L-system. If there is exactly one production for each symbol, then the L-system is said to be deterministic (a deterministic context-free L-system is popularly called a D0L system ). If there are several, and each is chosen with a certain probability during each iteration, then it is a stochastic L-system. Using L-systems for generating graphical images requires that
490-459: A simple robot controlled from the user's workstation that is designed to carry out the drawing functions assigned to it using a small retractable pen set into or attached to the robot's body. Turtle geometry works somewhat differently from ( x , y ) addressed Cartesian geometry , being primarily vector -based (i.e. relative direction and distance from a starting point) in comparison to coordinate-addressed systems such as bitmaps or raster graphics. As
539-399: A time, one would quite simply generate a string in a language, and all such sequences of applications would produce the language specified by the grammar. There are some strings in some languages, however, that cannot be generated if the grammar is treated as an L-system rather than a language specification. For example, suppose there is a rule S→SS in a grammar. If productions are done one at
SECTION 10
#1733114403025588-399: A time, then starting from S, we can get first SS, and then, applying the rule again, SSS. However, if all applicable rules are applied at every step, as in an L-system, then we cannot get this sentential form. Instead, the first step would give us SS, but the second would apply the rule twice, giving us SSSS. Thus, the set of strings produced by an L-systems from a given grammar is a subset of
637-640: A web browser. Turtle graphics In computer graphics , turtle graphics are vector graphics using a relative cursor (the " turtle ") upon a Cartesian plane (x and y axis) . Turtle graphics is a key feature of the Logo programming language . The turtle has three attributes: a location, an orientation (or direction), and a pen. The pen, too, has attributes: color, width, and on/off state (also called down and up ). The turtle moves with commands that are relative to its own position, such as "move forward 10 spaces" and "turn left 90 degrees". The pen carried by
686-401: Is a locally catenative sequence because G ( n ) = G ( n − 1 ) G ( n − 2 ) {\displaystyle G(n)=G(n-1)G(n-2)} , where G ( n ) {\displaystyle G(n)} is the n -th generation. The shape is built by recursively feeding the axiom through the production rules. Each character of
735-463: Is a parallel rewriting system and a type of formal grammar . An L-system consists of an alphabet of symbols that can be used to make strings , a collection of production rules that expand each symbol into some larger string of symbols, an initial " axiom " string from which to begin construction, and a mechanism for translating the generated strings into geometric structures. L-systems were introduced and developed in 1968 by Aristid Lindenmayer ,
784-401: Is achieved by using one of several different coordinate models. A common setup is cartesian-rotational as with the original 2D turtle: an additional "up" vector ( normal vector ) is defined to choose the plane the turtle's 2D "forward" vector rotates in; the "up" vector itself also rotates around the "forward" vector. In effect, the turtle has two different heading angles, one within the plane and
833-506: Is also possible to approximate the Sierpinski triangle using a Sierpiński arrowhead curve L-system. Here, A and B both mean "draw forward", + means "turn left by angle", and − means "turn right by angle" (see turtle graphics ). The dragon curve drawn using an L-system. Here, F and G both mean "draw forward", + means "turn left by angle", and − means "turn right by angle". First you need to initialize an empty stack. This follows
882-677: Is also sometimes used in environments other than Logo as an alternative to a strictly coordinate-addressed graphics system. For instance, the idea of turtle graphics is also useful in Lindenmayer system for generating fractals . Some modern derivatives of Logo allow thousands of independently moving turtles. There are two popular implementations: Massachusetts Institute of Technology 's StarLogo and Northwestern University Center for Connected Learning's (CCL) NetLogo . They allow exploring emergent phenomena and come with many experiments in social studies, biology, physics, and other areas. NetLogo
931-427: Is assigned a graphical operation for the turtle to perform. For example, in the sample above, the turtle may be given the following instructions: The push and pop refer to a LIFO stack (more technical grammar would have separate symbols for "push position" and "turn left"). When the turtle interpretation encounters a '[', the current position and angle are saved, and are then restored when the interpretation encounters
980-406: Is assumed, and the symbol does not change on transformation. If context-sensitive and context-free productions both exist within the same grammar, the context-sensitive production is assumed to take precedence when it is applicable. In a parametric grammar, each symbol in the alphabet has a parameter list associated with it. A symbol coupled with its parameter list is called a module, and a string in
1029-444: Is encountered, pop the stack and reset the position and angle. Every "[" comes before every "]" token. [REDACTED] A number of elaborations on this basic L-system technique have been developed which can be used in conjunction with each other. Among these are stochastic grammars , context sensitive grammars , and parametric grammars. The grammar model we have discussed thus far has been deterministic—that is, given any symbol in
SECTION 20
#17331144030251078-401: Is useful in a Lindenmayer system for generating fractals . Turtle geometry is also sometimes used in graphics environments as an alternative to a strictly coordinate-addressed graphics system. Turtle graphics are often associated with the Logo programming language . Seymour Papert added support for turtle graphics to Logo in the late 1960s to support his version of the turtle robot ,
1127-480: Is usually an interpreted language , although compiled Logo dialects (such as Lhogho and Liogo) have been developed. Logo is not case-sensitive but retains the case used for formatting purposes. Logo was created in 1967 at Bolt, Beranek and Newman (BBN), a Cambridge, Massachusetts , research firm, by Wally Feurzeig , Cynthia Solomon , and Seymour Papert . Its intellectual roots are in artificial intelligence , mathematical logic and developmental psychology . For
1176-524: Is widely used in agent-based simulation in the biological and social sciences. Although there is no agreed-upon standard, there is a broad consensus on core aspects of the language. In March 2020, there were counted 308 implementations and dialects of Logo, each with its own strengths. Most of those 308 are no longer in wide use, but many are still under development. Commercial implementations widely used in schools include MicroWorlds Logo and Imagine Logo . Legacy and current implementations include: Logo
1225-418: The golden ratio falls within the interval ( k − 1 , k ) {\displaystyle (k-1,k)} . The ratio of A to B likewise converges to the golden mean. This example yields the same result (in terms of the length of each string, not the sequence of A s and B s) if the rule ( A → AB ) is replaced with ( A → BA ), except that the strings are mirrored. This sequence
1274-411: The "x" parameter of a(x,y) is explicitly transformed to a "1" and the "y" parameter of a is incremented by one. Parametric grammars allow line lengths and branching angles to be determined by the grammar, rather than the turtle interpretation methods. Also, if age is given as a parameter for a module, rules can change depending on the age of a plant segment, allowing animations of the entire life-cycle of
1323-476: The Bridge School in the same city in 1970–71. Logo's most-known feature is the turtle (derived originally from a robot of the same name ), an on-screen " cursor " that shows output from commands for movement and small retractable pen, together producing line graphics. It has traditionally been displayed either as a triangle or a turtle icon (though it can be represented by any icon). Turtle graphics were added to
1372-514: The L-system rules leads to self-similarity and thereby, fractal -like forms are easy to describe with an L-system. Plant models and natural-looking organic forms are easy to define, as by increasing the recursion level the form slowly 'grows' and becomes more complex. Lindenmayer systems are also popular in the generation of artificial life . L-system grammars are very similar to the semi-Thue grammar (see Chomsky hierarchy ). L-systems are now commonly known as parametric L systems, defined as
1421-459: The LIFO (Last in, First Out) method to add and remove elements. Here, F means "draw forward", − means "turn right 25°", and + means "turn left 25°". X does not correspond to any drawing action and is used to control the evolution of the curve. The square bracket "[" corresponds to saving the current values for position and angle, so you push the position and angle to the top of the stack, when the "]" token
1470-466: The Logo language by Seymour Papert in the late 1960s to support Papert's version of the turtle robot, a simple robot controlled from the user's workstation that is designed to carry out the drawing functions assigned to it using a small retractable pen set into or attached to the robot's body. As a practical matter, the use of turtle geometry instead of a more traditional model mimics the actual movement logic of
1519-487: The Python implementation of turtle allows programmers to control one or more turtles in a two-dimensional space. Since the standard Python syntax, control flow, and data structures can be used alongside the turtle module, turtle has become a popular way for programmers learning Python to familiarize themselves with the basics of the language. The ideas behind turtle graphics can be extended to include three-dimensional space. This
Logo (programming language) - Misplaced Pages Continue
1568-425: The conditional x=0 is met. For example, a(0,2) would undergo transformation, and a(1,2) would not. In the transformation portion of the production rule, the parameters as well as entire modules can be affected. In the above example, the module b(x,y) is added to the string, with initial parameters (2,3). Also, the parameters of the already existing module are transformed. Under the above production rule, Becomes as
1617-554: The first four years of Logo research, development and teaching work was done at BBN. The first implementation of Logo, called Ghost, was written in LISP on a PDP-1 . The goal was to create a mathematical land where children could play with words and sentences. Modeled on LISP, the design goals of Logo included accessible power and informative error messages. The use of virtual Turtles allowed for immediate visual feedback and debugging of graphic programming. The first working Logo turtle robot
1666-412: The formal language defined by the grammar, and if we take a language to be defined as a set of strings, this means that a given L-system is effectively a subset of the formal language defined by the L-system's grammar. An L-system is context-free if each production rule refers only to an individual symbol and not to its neighbours. Context-free L-systems are thus specified by a context-free grammar . If
1715-400: The grammar's alphabet, there has been exactly one production rule, which is always chosen, and always performs the same conversion. One alternative is to specify more than one production rule for a symbol, giving each a probability of occurring. For example, in the grammar of Example 2, we could change the rule for rewriting "0" from: to a probabilistic rule: Under this production, whenever
1764-476: The growth patterns of various types of bacteria , such as the cyanobacteria Anabaena catenula . Originally, the L-systems were devised to provide a formal description of the development of such simple multicellular organisms, and to illustrate the neighbourhood relationships between plant cells. Later on, this system was extended to describe higher plants and complex branching structures. The recursive nature of
1813-429: The input string is checked against the rule list to determine which character or string to replace it with in the output string. In this example, a '1' in the input string becomes '11' in the output string, while '[' remains the same. Applying this to the axiom of '0', we get: We can see that this string quickly grows in size and complexity. This string can be drawn as an image by using turtle graphics , where each symbol
1862-429: The insights is that a dive command is really a shorthand of a turn-roll-turn sequence. Cheloniidae Turtle Graphics is a 3D turtle library for Java . It has a bank command (same as roll ) and a pitch command (same as dive ) in the "Rotational Cartesian Turtle". Other coordinate models, including non-Euclidean geometry, are allowed but not included. Lindenmayer system An L-system or Lindenmayer system
1911-406: The length of each string, we obtain the famous Fibonacci sequence of numbers (skipping the first 1, due to our choice of axiom): If we would like to not skip the first 1, we can use axiom B . That would place B node before the topmost node ( A ) of the graph above. For each string, if we count the k -th position from the left end of the string, the value is determined by whether a multiple of
1960-420: The other determining the plane's angle. Usually changing the plane's angle does not move the turtle, in line with the traditional setup. Verhoeff 2010 implements the two vector approach; a roll command is used to rotate the "up" vector around the "forward" vector. The article proceeds to develop an algebraic theory to prove geometric properties from syntactic properties of the underlying turtle programs. One of
2009-407: The symbol it is modifying, but the symbols on the string appearing before and after it. For instance, the production rule: transforms "a" to "aa", but only if the "a" occurs between a "b" and a "c" in the input string: As with stochastic productions, there are multiple productions to handle symbols in different contexts. If no production rule can be found for a given context, the identity production
Logo (programming language) - Misplaced Pages Continue
2058-440: The symbols in the model refer to elements of a drawing on the computer screen. For example, the program Fractint uses turtle graphics (similar to those in the Logo programming language ) to produce screen images. It interprets each constant in an L-system model as a turtle command. Lindenmayer's original L-system for modelling the growth of algae. which produces: The result is the sequence of Fibonacci words . If we count
2107-461: The tree to be created. The bi-directional model explicitly separates the symbolic rewriting system from the shape assignment. For example, the string rewriting process in the Example 2 (Fractal tree) is independent on how graphical operations are assigned to the symbols. In other words, an infinite number of draw methods are applicable to a given rewriting system. The bi-directional model consists of 1)
2156-570: The turtle can also be controlled, by enabling it, setting its color, or setting its width. A student could understand (and predict and reason about) the turtle's motion by imagining what they would do if they were the turtle. Seymour Papert called this "body syntonic" reasoning. A full turtle graphics system requires control flow, procedures, and recursion: many turtle drawing programs fall short. From these building blocks one can build more complex shapes like squares, triangles, circles and other composite figures. The idea of turtle graphics, for example
2205-410: The turtle robot. The turtle moves with commands that are relative to its own position, LEFT 90 means spin left by 90 degrees. Some Logo implementations, particularly those that allow the use of concurrency and multiple turtles, support collision detection and allow the user to redefine the appearance of the turtle cursor, essentially allowing the Logo turtles to function as sprites . Turtle geometry
2254-625: The turtle's motion by imagining what they would do if they were the turtle. There are substantial differences among the many dialects of Logo, and the situation is confused by the regular appearance of turtle graphics programs that are named Logo. Logo is a multi-paradigm adaptation and dialect of Lisp, a functional programming language. There is no standard Logo, but UCBLogo has the best facilities for handling lists, files, I/O, and recursion in scripts, and can be used to teach all computer science concepts, as UC Berkeley lecturer Brian Harvey did in his Computer Science Logo Style trilogy. Logo
2303-467: The underlying language for Boxer. Boxer was developed at University of California, Berkeley and MIT and is based on a literacy model , making it easier to use for nontechnical people. KTurtle is a variation of Logo implemented at Qt for the KDE environment loosely based on Logo. Two more results of Logo's influence are Kojo , a variant of Scala, and Scratch , a visual, drag-and-drop language which runs in
2352-599: Was a primary influence on the Smalltalk programming language. It is also the main influence on the Etoys educational programming environment and language, which is essentially a Logo variant written in Squeak (itself a variant of Smalltalk). Logo influenced the procedure/method model in AgentSheets and AgentCubes to program agents similar to the notion of a turtle in Logo. Logo provided
2401-617: Was created in 1969. A display turtle preceded the physical floor turtle. Modern Logo has not changed very much from the basic concepts predating the first turtle. The first turtle was a tethered floor roamer, not radio-controlled or wireless . At BBN Paul Wexelblat developed a turtle named Irving that had touch sensors and could move forwards, backwards, rotate, and ding its bell. The earliest year-long school users of Logo were in 1968–69 at Muzzey Jr. High in Lexington, Massachusetts . The virtual and physical turtles were first used by fifth-graders at
#24975