The PENELOPE Project: A Case Study in Computational Thinking

The assumption challenged in this paper, is that computational thinking is a form of structured thought emerging over the past fifty years. In an online presentation of computational thinking (CT) as part of KS3 education 2 the BBC describes the subject as based on the four key techniques decomposition, pattern recognition, abstraction, and algorithms (BBC 2019). We argue in our project that these modes of thought have been just as present in the ancient craft of weaving for thousands of years. All four key techniques are key concepts that form the basis of weaving, and especially weaving education. Decomposition is what weavers need to do in order to understand how patterns are constructed from interacting parts, and for planning how to compose patterns on their own. Decomposition of fabric aligns with pattern recognition, which, in weaving, does not only mean to recognize a pattern in its visual appearance, but also to understand which rules of composition are at stake. For employing these principles on the loom, weavers engage abstraction, leading to a rhythmical if not arithmetical understanding of compositional rules, that are transferred into loom parts acting as subroutines and controlled by algorithms. In this contribution, we will explain and discuss all four key concepts along the experiments and results of the PENELOPE project whose objective is to develop a theory of weaving as part of a deep history and epistemology of digital technology.

The assumption challenged in this paper, is that computational thinking is a form of structured thought emerging over the past fifty years. In an online presentation of computational thinking (CT) as part of KS3 education2 the BBC describes the subject as based on the four key techniques decomposi tion, pattern recognition, abstraction, and algorithms (BBC 2019). We ar gue in our project that these modes of thought have been just as present in the ancient craft of weaving for thousands of years.
All four key techniques are key concepts that form the basis of weaving, and especially weaving education. Decomposition is what weavers need to do in order to understand how patterns are constructed from interacting parts, and for planning how to compose patterns on their own. Decompo sition of fabric aligns with pattern recognition, which, in weaving, does not only mean to recognize a pattern in its visual appearance, but also to un derstand which rules of composition are at stake. For employing these prin ciples on the loom, weavers engage abstraction, leading to a rhythmical if not arithmetical understanding of compositional rules, that are transferred into loom parts acting as subroutines and controlled by algorithms. In this contribution, we will explain and discuss all four key concepts along the experiments and results of the PENELOPE project whose objective is to develop a theory of weaving as part of a deep history and epistemology of digital technology.
The PENELOPE team consists of an interdisciplinary mixture of schol ars and artists from live coding, computer science, classical philology, sci ence and technology studies, mathematics, and textile/visual art. For us the role of weaving for the development of theoretical concepts is under estimated. Weaving, or at least traditional hand-weaving, is perceived as a minor craft with little technological and even lesser mathematical challenge and impact. Instead, we present ancient weaving as the earliest binary and digital technology, requiring recursive decision making that combines algorithms to create patterns with regard to material and aesthetics. In ex plicating the mathematical and computing principles inherent in this tech nology, we also explore the potential to engage tacit knowledge necessary to make technical and aesthetic choices in coding. In this paper we present some of our results and discuss possibilities for education in computing.

Decomposition
Decomposition and drafting (along with weaving itself and knowledge of material and tools) form the main subjects in the education of weavers. As part of a preparatory project for PENELOPE, we conducted a crash course in decomposition for students at the Centre for Participatory Information Technology, University of Aarhus . Equipped with a collection of fabric samples, all showing variations of a dogtooth pattern in size and col our, we asked the students to analyze the fabrics thread by thread, to find a way to notate the structure by representing where one thread goes over the other, and later test the correctness of the notation (the draft) with a simple script in the 'gibber' live coding environment that could simulate fabric (Griffiths 2014).
Soon, the students found out that a binary system was sufficient for notating the structure, and easy to transfer into zeros and ones within the gibber script. The main aim of the course, however, was to make students understand that patterns in weaving do not appear as a simple result of a binary crossing of threads, but as an interference with a second order pro vided by the colour of the threads. In Fig. 3 the structure is notated correctly but it does not resemble the fabric pattern on the left. The student has 'reverse engineered' a weave, revealing the underlying structure. But he also  needs to record the properties of the single elements of this structure: color, twist, thickness of yarn, etc. Through this process, the fabric tells the story of its own construction by decomposing the weave into distinct, interacting parts. This is why pattern recognition and decomposition is such an im portant part of education in weaving. In order to provide easier access to this aspect of pattern generation and to have a simple tool for demonstrat ing it to the public, we developed a simple digital tool together with our collaborators Amber and Dave Griffiths: the pattern matrix (Griffiths 2015).

Pattern (Re-)Cognition
Woven patterns are not based on the idea of a form applied to material, but rather on the idea of a repeated structure that interferes with the colours of the employed threads. It is very difficult to convey this principle by using language or text. Our idea was that it should be easy to build a simulation machine with a possibility for binary input, because for each crossing of warp and weft, the weaver only decides if the warp is up or down.
Our first prototype of this 'pattern matrix' consisted of a foldable alumi num frame, carrying 25 sensors organized in five rows and five columns . For each row, a controller detects the hall effect of magnets sit ting inside wooden blocks or tokens placed on the grid, representing the pattern unit to be repeated in a weave. These tokens are made of wood, con tain magnets, and have a light and a dark side. When turned over, the hall sensor sends a signal to the Raspberry Pi.3 In the following, we demonstrate how the matrix works by explaining its design, and presenting some exam ples.
A basic configuration, with all dark sides of the tokens facing upwards, demonstrates a situation where each (vertical) warp thread is lifted along each (horizontal) pick of weft (see Fig. 4). As the warp threads are all white and the weft is blue, all blue threads are then behind the white warp, which therefore would not result in a fabric that holds together. From this starting point, we can now start to design weave structures, by flipping blocks over, thus making the weft go over the warp at corre sponding points in the repeating pattern. The simulating weave is based on the ancient warp-weighted loom, a horizontal loom, where the weft is beaten upwards after insertion. The fabric thus grows from top to bottom.
The simplest weaving structure is known as plain weave or tabby, where the weft thread alternates between travelling under and over the warp. In order to represent this on the pattern matrix, we accordingly alternate between light and dark tokens, in both the warp and weft direction, as shown (Fig. 5). However, when we use a 5x5 grid to do this, the result is not the usual tabby but a pattern that mixes tabby with elements of basket weave. This is because the repeat of the tabby needs to use an even number  of threads to continue correctly. When the thread number that repeats is odd, like five in our case, the repeat goes under, over, under, over, under, but then under again which results in the structure we see in the simulation. The odd-even distinction is very important for constructing sound fabric, as well as creating visual patterns. The pattern matrix brings this problem to the fore, making it easy to understand. Therefore, for representing even repeats, the matrix includes a possibil ity to restrict the grid to 4x4 threads. We can 'deactivate' the fifth column and row by turning all tokens there dark side face up. By default, the simu lation then ignores the information in these positions. Now, because of the even repeat, we see the usual tabby structure appearing (Fig. 6).
For viewing and controlling the structure, it is convenient to use all white warp and blue weft threads. However, if we want to explore the pat-  terns that result from interferences of color and structure like the dog-tooth in Fig. 3 (known as color-and-weave effects) we need to have a possibility of changing the color order in warp and/or weft. This feature is integrated in the pattern matrix token system so that it is possible to use an additional token that contains 4 magnets (and thus 4 sen sors on the respective microcontroller board used to read them), and turn it by 90 degrees in order to change color. This color block can change the thread colors to blue weft/white warp (B/W); alternating blue and white threads in weft and warp (BW/BW), alternating blue and white beginning with blue in warp and white in weft (WB/BW) and so on.4 In Fig. 7, where the structure defined by the tokens gives horizontal stripes when applied to simple tabby, we used the BW/BW position of the color token. The WB/BW position would instead generate vertical stripes. These effects would be dif ferent again if the color change is applied to pairs of threads. There is no formal theory established for such patterns, however, weavers have a tacit understanding of such interferences of colour and structure, and patterns on the loom once woven are a record of all such decisions taken by the weaver.

Abstraction
The pattern matrix supports understanding of the coding possibilities pres ent in the loom, to make some of the weaver's computational thinking visi ble. The examples show that weaving involves a type of abstraction, where a three-dimensional structure of threads is modelled as a two dimensional binary grid, providing codes for programming the parts of a loom. Such abstraction in weaving has only recently attracted the interest of mathe maticians and computer scientists. Some of them developed formulas for detecting binary grids that do not provide sound fabric structures.5 How ever, some of the structures judged to be 'unsound' by computer scientists actually represent double weaves which are among the earliest fabrics woven on the warp-weighted loom for richly patterned textiles. Abstraction necessarily involves loss of detail, and in the case of weaving this means treating a three-dimensional structure of threads as a two dimensional grid. This binary abstraction supports computational thinking in textile design, but in the end a weaver must deal with the material properties of the actual weave. Although based on simple principles and rules, fabric construction can become extremely complex.
The philosopher and mathematician René Descartes, referred to the order inherent in textile work as important for cognition. In his tenth rule for the direction of the mind he writes: In order that it may acquire sagacity the mind should be exercised in pursuing just those inquiries of which the solution has already been found by others; and it ought to traverse in a systematic way even the most trifling of men's inventions though those ought to be preferred in which order is explained or implied. (Descartes 1978: 30) Descartes continues... ... this proposition announces that we ought not immediately to occupy ourselves with the more difficult and arduous problems, but first should discuss those disciplines [artes] which are easiest and simplest, and those above all in which order most prevails. Such are the arts of the craftsmen who weave webs and tapestry, or of women who embroider or use in the same work threads with infinite modification of texture. With these are ranked all play with numbers and everything that belongs to Arithmetic, and the like. It is wonderful how all these studies disci pline our mental powers, provided that we do not know the solutions from others, but invent them ourselves. For since nothing in these arts remains hidden, and they are wholly adjusted to the capacity of human cognition, they reveal to us with the greatest distinctness innumerable orderly systems, all different from each other, but none the less con forming to rule, in the proper observance of which systems of order con sists the whole of human sagacity. (Descartes 1978: 31) Although it is strange for us to imagine learning arithmetic and mathemat ics from textile workers, Descartes is not the only philosopher claiming that there is abstract knowledge involved in textile craft. Already Plato requested that the Statesman has to be a weaver in order to establish sustainable order in the city state. His dialogue The Statesman begins with the fundamental distinction of pure and applied knowledge, where pure knowledge is exem plified by a dyadic arithmetic that distinguishes odd and even numbers and their combinations (Plato Statesman 258d-e).
It is well known that Euclid's geometry lay the ground for the theoretical type of mathematics, including axioms, propositions and proofs that un derlies most of our sciences today. However, dyadic arithmetic is an even older area of mathematics, which, by introducing the complementarity of odd and even numbers, enabled indirect proofs (Heath 1956: 277-278, 296 344). The origin of this theory, arguably traced back to the Pythagoreans (Szabo 1969, Lefèvre 1981, is unknown. Historians of mathematics assume that it is a pure invention for mathematical purposes without any applica tion (Harlizius-Klück 2004: 47, Lefèvre 1981. Weaving is not considered as a possible source, although the basic order on every loom (Brezine 2009: 474) and especially the warp-weighted loom of ancient Greece is the distribution of odd and even threads onto the kairos, the shed bar of the loom, and the kanon, the device that makes the countershed and completes the algorithm for the basic woven structure (Harlizius-Klück 2014: 58). The distinction of odd and even number and the fundamental rules of arithmetic that Euclid provides in his book are all necessary for weaving patterns on a loom. Although the theory of odd and even numbers is introduced in Plato's dialogue as pure knowledge and op posed to the knowledge of craft, the employment of the weaving paradigm presented as a (binary) decision tree, diaeresis in Plato's words, shows how both interact in establishing the fabric of society. It is as if both, Plato and Descartes, saw a mathematical order at work in weaving which we have problems to see today.
In our project, we started with experiments to operate a warp-weighted loom with code. Controlling a loom with software is of course not new; today, mass-produced fabric is designed and produced with computers as standard. However, to a large extent, such computer-controlled looms take over the abstraction. A weaver at a handloom can shift naturally between thinking in two-dimensional grids, and working in the three-dimensional textile and the features of the material in front of her. A weaver at a software controlled machine loom today designs images on a computer screen. This is why we still see hybrid looms manufactured today. For example, the TC looms made by Digital Weaving Norway allow each warp thread to be individually controlled using the digital grids, but the weft threads are passed and beaten into the weave by hand. This allows the weaver to fully engage in the process of weaving two-dimensional, discrete structures, into three-dimensional, continuous fabric. Our own experiments with the TC-1 loom allowed us to explore the digital nature of weaves by controlling a loom with software for creating patterns from algorithms (McLean and Harlizius-Klück 2018b). However, it also underlined the importance of rec ognizing that weaving is fundamentally an integration of discrete and analogue structure. From one perspective threads cross at binary positions, but from the other, these binary positions only briefly deflect each thread's continuous flow. A loom that is both computer and hand-controlled allows us full access to the weave, as material computational thinking.
But still, with the TC-1 loom, the weaver is not able to work both with the grid and with the hands at the same time. The digital structure is set in advance and loaded onto the loom, and is more or less fixed during the process of weaving. We have therefore created the Live Loom to allow ex ploring live editing of digital structure, by applying the emerging tradition of live coding to weaving (McLean 2020b). Fig. 8 shows the Live Loom in its prototype form. Fundamentally, it is a warp-weighted loom, with each warp thread controlled by a dedicated so lenoid actuator. The solenoids are mounted on both vertical and horizontal axes, in order to double the number of threads that can be controlled. As with the TC looms, the threads are controlled by software, but this is nonetheless a handloom, where all plans can be made and broken by the human weaver as they pass the weft. Fig. 9 shows the software interface for the Live Loom on the left, with a resulting textile on the right. The live coding environment on the left dis plays a bespoke language for describing weaves with a visual mouse-driven interface for composing the computational functions. This language is translated into the familiar binary grid structure, displayed to the right of the weaver's code. Because warp and weft colors alternate on the loom, we do not see the structure in the end result of the textile, but it is there.
The weaver is able to change the code at any time, thereby changing the structure as it is woven. By jumping between these different levels of ab straction, one has access to the creative, computational generativity of code, but also direct access to touch, feel, and manipulate the material of the tex tile itself. Indeed the design aim of the Live Loom is not to produce textile, but to understand and communicate the relation between these levels of abstraction.6 Further details and examples of working on the live loom are provided by McLean (2020a).

4 Algorithms
Andean weaves are among the most complex of textile structures. From a western perspective it is difficult to imagine how weavers plan and remem ber the necessary process as there is no written notation. Still, in a chapter of the Oxford Handbook of the History of Mathematics, Carrie Brezine claims that weavers employ mathematics: "Craftspeople who create good fabric are practicing mathematical principles, though they may not com municate them in the way we expect western mathematics to be presented" (Brezine 2009: 468). In order to prove this, she contrasts two methods of textile production and their mathematical implications: "floor loom weav ing" as she calls the weaving practiced in Europe since Medieval times, and weaving on a (backstrap) loom with variable tension as it is used in the Andes of South America (ibid., 468).
In explaining the European tradition, she refers to the pattern draft (Fig. 10) as a notation that was developed "for recording how to setup a loom to reproduce a particular structure" (ibid., 476). Her draft example consists of four parts: (1) threading, which indicates which warp end goes through which shaft (2) tie-up, denoting which shaft connects to which treadle (3) treadling denoting the order in which to step on the treadles and (4) drawdown, which is a visual representation of the outcome.
The cloth structure is a result of an algebraic relationship between the bi nary matrices of threading, tie-up and treadling. So the drawdown (as well as the fabric) is the result of matrix multiplication (with the treadling being the identity matrix, cf. Brezine (2004: 70), Brezine (2009: 476) and note 9, cf. also Hoskins (1983))7.
In fact, the usual assumption is that a weaver starts to draw a pattern and decides on the threading and tie-up afterwards, which would mean to begin with the result of the multiplication and find the necessary installa tion for the loom in the end. However, we can see in historical books that at least the hand weavers in South Germany in the centuries preceding the Jacquard loom do not use a draft this way. They only decide on threading and tie-up and do the matrix multiplication when treadling the loom. As they do not restrict themselves to the identity matrix neither for treadling nor for threading, they generate a much bigger variety of patterns.
The earliest printed book providing threadings and tie-ups for weaving presents them separately, so that you can combine them as you like. The result of this combination is however not presented in the book. Kris Bru land, computer scientist and weaver, chose threading/treadling from table A2, upper row, last partition (cf. Fig. 11) and a tie-up from table A3, third square grid in first row (cf. Fig. 12). He then uses a software application to calculate the drawdown as WIF (weaving information file, see Fig. 13).8 Figure 11. Collection of tie-ups and threadings from Ziegler (1677), table A2.   Fig. 11) with third tie-up in first row of Ziegler table A3 (cf. Fig. 12). When the treadling is done as the threading, the result is a pattern with a repeat of 86 threads. (Kris Bruland, handweaving.net) Now we can see that a complex twill fabric would result from using a loom with 12 shafts and a treadling sequence of 86 steps, generating a repeat of 86x86 threads and therefore 7396 crossing points, which would be diffi cult and time-consuming to draft down by hand. Furthermore, this is only one of practically endless possibilities of combining the tie-ups and threadings/treadlings that Ziegler's book provides.
This method of calculating a fabric pattern from combining pro grammed loom parts (threading and tie-up) and algorithms (treadling) while working at the loom became obsolete when the Jacquard loom took over. Design now begins with a drawdown that is fed into a Jacquard ma chine, that follows the one and only programme for ups and downs pro vided by the punched cards. Understanding of algorithms or matrix cal culation is therefore no longer necessary.
Another aspect of algorithms is especially important for our project and the investigations of textile terms in ancient choral lyrics. While we concen trate on weaving on a warp-weighted loom (the device used in archaic Greece, for example by Helen and Penelope in the Homeric epic), compu tational tools help us visualize order transformations processed on these looms. In turn, this helps us understand how and why this weaving order is transferred into the metre and rhythm of poetry and choral lyrics, and into cosmological accounts, philosophy and arithmetic. The ordered interlace ment of threads furthermore serves as a paradigm for social order, and the arrangements and movements of dancers. Our work so far included swarm robotics, live coding, digital manufacture, augmented reality, and tangible interaction, both to look for ways in which contemporary technologists can learn from ancient technology, and for ways in which we can use contem porary technology to make the thought processes involved in weaving vis ible and understandable by a contemporary audience.9 The connection of weaving to the composition of order is easily grasped in the ancient Greek poetic genre of choral lyric. Our team member Gio vanni Fanfani showed that song-making as well as the performance of a dancing chorus in ancient Greece is described in weaving and plaiting terms (Fanfani and McLean 2019). It has even been suggested that such choruses literally plaited a textile much similar to the maypole braiding that is still practiced in folk dances all over the world (ibid., 27-29). The textile terms convey an impression of multicolored and patterned textile order that is also applied to instrumental music. Specific traits of string instruments are described employing features of interlacing, plaiting or weaving (ibid., 14).
The rhythm and metre of Greek lyric and epic, well known from the hexameters of Homeric works and from the lyric meters of choral songs and drama, is coded in long and short syllables. These in turn form units made of an upbeat, called arsis, and a downbeat, called thesis, which refer to when the dancers lift their feet or step down. So there is again a binary foundation of such practices of plaited dance that resembles the ups and downs of threads in weaving.
As a team, we conducted cross-disciplinary experiments we call 'Penelopean performance' where we compare two ways of generating recurrent rhythmical cycles: an ancient Greek lyric mechanism named epiploke, lit erally denoting a sort of braiding with an emergent pattern, and Tidal-Cycles, a live coding language for music developed by team member Alex McLean. Although very distant in time and nature, they meet in the idea of pattern as rhythm and demonstrate that weaving provided an early instance of algorithmic pattern generation (McLean 2020b) whose logic is trans ferred into Greek versification with its ancient theory of metre and rhythm (McLean et al. 2018a). The first performance was conducted alongside the residency of the Andean weaver Sandra de Berduccy in our PENELOPE Laboratory. It begins with a recitation of Greek verses (Homeric hexameters and a choral lyric piece) by Fanfani that is transformed into electronic, algorithmic music by McLean, taking up the rhythm and enriching it by elaborating on the possible interlacements (Fanfani and McLean 2019). This performance brings together the metrical, patterned structure of an cient Greek verse, with the similarly metrical, patterned structure of algo rithmic music. In this act of bringing ancient and contemporary culture together, this performance attempts to demonstrate that the same human fascination with abstract pattern underlies both.
Taking the role of choral dancers, we employed six pattern-matrixcontrolled and tablet-woven Penelopean robots, constructed by . Tablet-weaving is a very old technique, which allows double-woven pockets to be formed in the textile, which Griffiths employs to carry the pieces of electronics in a practical and flexible manner. Griffiths explains that tablet weaving proved to be a cheap, direct and environmentally sus tainable alternative to using an expensive 3D printer.
The whole performance therefore brings together ancient Greek lyric, algorithmic music and robotic dancers. What we transfer across the dif ferent media of poetry, music, dance, robotics control and braiding is not a single code or algorithm, but the underlying rhythmical and sometimes binary order. The transfer is thus not automatic, but carried along by human attention, agency and decision making even though this is not obvious for the audience.

Conclusion
The field of Computational Thinking was predicated on the idea that the birth of computer science in the mid twentieth century not only required computer scientists to develop unique ways of thinking, but that these ways of thinking should be taught to everyone, as they help general purpose cog nition (Wing 2006). This claim, that teaching computer programming pro vides problem-solving skills useful in non-computing domains, has been refuted (Tedre and Denning 2016).
To us, the problem seems to be that the claim of a unique way of thought that needs to be transferred from thinking with computers to the rest of education and skills will not help to embed knowledge of digital technology into society in a meaningful way. Computational thinking presents itself as specific, technical, and unconnected to other areas (except mathematics), and additionally, though subconsciously, as male, young, western (or per haps "pale, male and stale") type of thought, divorced from any precedents. Our project claims that we should look the other way round: embed com putational thinking back into the history of knowledge, of practices, of crafts, and look around for examples which help us understand principles like decomposition, pattern recognition, algorithms and abstraction within the rich variety of cultures around us.
Seen this way, computational thinking would achieve a new contextualization: in former everyday work, in history, in practice, in cultures far away from the Western world. A computational thinking syllabus could include understanding algorithms of textile work from cultures all over the world, taking in inclusive and diverse perspectives, and making practices visible that have been hidden, neglected or misunderstood in recent history.
There are several other aspects of STEM education that our approach touches upon: situated knowledge, embodied cognition, the problems of gender bias and lack of diversity. Weaving can break up the closed circle of head, eyes and hand, and introduce bodily awareness, rhythm and move ment. We are not formal educators, and are not doing research in education, however, we see a lot of potential in re-connecting the concepts of computer science to algorithmic practices like weaving.
By presenting weaving as a binary and digital artform, we bring every day womens' work forward, and demonstrate the mutual shaping of science and technology in such work. Weavers employed a very reflective approach in using, stopping, evaluating and changing algorithms according to the respective task: the weave at hand under the conditions of the respective tools, technology, cultural needs, and aesthetic choices. We do not argue that we should teach weaving instead of computing, but still want to point to this rich tradition and its computational and algorithmic aspect so that computer science teachers who look for new approaches and possibilities of exchanging knowledge with other fields find inspiration. At least for weaving, transfer of algorithmic knowledge has been going on for thou sands of years, and transferred into society and art in various ways. There is no research done so far on the question of weaving helping with general problem solving skills, but what we see in history is that this happened in Greek antiquity, and that the rise of mathematics and natural sciences at that time was more than mere coincidence.10