Computational Thinking and Compilers
Transcript
>> ALFRED V. AHO: Okay. Great. Well, thank you alur for the nice introduction it is nostalgic to give a talk at POPL I presented the first POPL paper in 1973 with Steve Johnson and allman. I will describe what was in the paper shortly. The thesis of my talk today is that the two pillars of computational thinking, abstractions and all good rights have transformed the field of compiler design from an art to a science. Computational thinking is one of the hottest areas in STEM education
circles today. It got a big boost from a paper Jeanette wing published in the communications of the ACM in 2006 in which she stated that computational thinking should be taught along with the three Rs to every school child. But as important as computational thinking is, the irony is that there isn't a standard definition for computational thinking in educational circles yet. However, the definition that I like the most is that computational thinking is centered around the thought processes
involved in formulating problems using abstractions so their solutions can be represented as computational steps and all good rights. I like this definition because the POPL conferences, since their inceptions, have played a major role in presenting many of the key abstractions and all good rights that have transformed the field of compiler design from an art to a science. And I'll mention just two such papers from the very first POPL conference in my talk today.
A good place to begin is to try to define the term abstraction. This is actually very hard because virtually every area of human endeavor uses distinct abstractions to describe what that field is about. As a consequence, there is no standard definition across different fields for the term abstraction. For example, compare the abstraction used to describe chemistry with the abstractions used to describe music. A musician's abstractions get no reactions from a chemist.
In our touring ward paper, Jeff ullman and I defined an abstraction as a mathematical model with two components, a data model and a set of operations. What distinguishes this definition from abstractions in many other fields is that in addition to a data model, our definition of an abstraction has an associated set of operations for manipulating the data in the model. The operations can be thought of as some kind of programming language which need not be touring complete.
A simple example should clarify this definition. Consider the dictionary abstraction in computer science. It has a data model consisting of a universal set U of elements and a subset S of U which is initially empty. The programming language consists of straight line sequences of three instructions. Insert an element into X, delete an element from S and look to see if a given element is in S. A dictionary is a good abstraction for what you do with a symbol table in a compiler.
We are all familiar with the notion of an algorithm in computer science. Informally, I like to think of an algorithm as just a recipe for doing something. Formally we can define an algorithm to be a turing machine that halts on all inputs. I might mention there are some people who say an algorithm does not have to halt on all inputs but when we wrote the design and analysis of computer algorithms book in 1974, we checked with Don kanuth who the New York times
later described as the yoda of Silicon Valley and he said an algorithm must halt on all inputs. In our algorithms book we called a turing machine that not halt on all inputs. This is analogous to partially cursive function and recursive function theory. In our turing award paper, Jeff and I talk about a taxonomy of CS abstractions based on their purpose. For starters we included four. Fundamental abstractions, abstract implementations, declare tiff abstractions, and computational abstractions.
However we feel there are many other categories that can be added to this taxonomy. Our first category, the fundamental abstractions, include those that are usually studied in a first course in computer science. Common examples are dictionaries, stacks, queues, graphs and trees and also classes and their methods. But the methods are without specification. Our second category we called abstract implementations. These are data structures that are useful for implementing fundamental abstractions.
Common examples include hash tables and various kinds of search trees. Our third category we called declarative abstractions, higher level abstractions like full graphs that specify what we want but without specifying how to do it. They need not be turing complete. And as we shall see, many of these declarative abstractions are routinely used in compiler design. Our fourth category we called computational abstractions.
These abstractions more closely model programming languages and they are turing complete. Other computational abstractions of this nature are turing machine, boolean circuits and quantum circuits which I will address in the last part of my talk. An important property of abstractions is that they can be layered and they can be implemented by algorithms or in terms of other abstractions. For example, dictionary abstraction can be implemented using a link list abstraction.
As we shall see, this layering process allows us to impute a running time for an abstraction. For the remainder of my talk, I will use the term compiler to mean a program that translates a source program into a semantically equivalent target program. A significant contribution to compiler design occurred in the 1960s and '70s when we started picturing a compiler as a composition of phases that translated the source program into a sequence of semantically equivalent
lower level representations from which the final -- from which the target program is finally generated. The phases shown in violet in this slide are called the front end of the compiler. And the phases in blue, the black -- the back end. The modern compiler framework LLVM allows one of several different front ends to translate a programming language into a single intermediate representation called LLVMIR. The front end is followed by a code optimizer that transforms the intermediate
representation into a version from which a better target program can be produced by any one of several different target language code generators that can be used in the back end. Each of the phases of the compiler uses distinctive. I will describe in detail how three widely used declarative abstractions, context free grammars and flow graphs are used in compiler design. Let's begin by looking at regular expressions as a declarative abstraction for lexical analysis.
The data model of the regular abstraction is sets of strings over some alphabet. The operations of the abstraction are union, concatenation and kleen. They were discovered by kleene in 1951 and now used in many programming languages such as lex and pearl to mention a few. There were several different algorithms for implementing regular expression pattern matchers with wildly different running times. In the late 1960s, Ken Thompson at bell labs used a just in time simulation of a nondetermine--
in time that is linear in the product of the length of the regular expression times the length of the input string. In the 1970s I created a regular expression search program on unex that used a dynamic lazy construction of DFA transitions to recognize regular expression patterns. And its observed running time was linear in the sum of the length of the regular expression plus the length of the input string. Also in the 1970, Michael lesk and Eric Schmidt called lex at bell labs.
It would take the specification of an analyzer to conduct a lexer from it. Lex used to the syntax of tokens and Eric Schmidt as a young intern at bell labs put one of my algorithms into lex. As you may know, Eric Schmidt when he grew up became chairman of Google. Lex is a tool that allows users to create lexical analyzers without having to learn an algorithm for efficient pattern matching. Here is a simple example of a lex specification for recognizing integer numbered.
Fed into LEX this produces a lexer that would recognize one or more digits as an input. Install the sequence of digits into a table and return its output the token NUM along with a pointer to the digits in the table. LEX and its descendants like flex on Linux are still used to today to build analyzers almost five decades after the first LEX tool was created. Let's now consider the next phase of the compiler, the syntax analyzer or parser as it is often called.
The declarative abstraction of context free grammars is routinely used for the grammatical structure of programming languages. Surprisingly the idea of a context free grammar is old. It gets attributed to an Indian scholar named panini who used context free grammar somewhere between 400BC and 200BC for sand script. Various forms of context free grammars are used today for programming languages. In 1973, I presented a paper with Steve Johnson and ullman at
the first POPL conference in which we introduced an informallism. The formalism used a syntax directed scheme attached to the context free grammar for translating a token stream into some kind of output, usually a syntax tree. The productions of the context free grammar would be augmented with. The rules could be used to parse an input string using a parser. Steve Johnson ullman and I described such a parsing algorithm in our 1973 POPL paper. At the same time Steve Johnson implemented a
software tool called YACC at bell labs for constructing syntax analyzers from these kinds of formalisms. YACC allowed compiler designers to write simple grammatical specifications for programming languages without having to learn the details of the algorithm for constructing the parser for them. YACC and its descendants like bison are still widely used for creating parsers. I might mention it was Jeff who coined the term YACC, it stood for yet another compiler compiler.
LEX and YACC can be used for. Here is a YACC specification for a desk calculator involving the addition and multiplication of numbers. Compiling this YACC specification with the lexical analyzer created from the previous lex for integer numbers we get a working desk calculator. The combination of LEX and YACC allowed people to experiment with the syntax of programming languages and LEX and YACC became very popular in compiler courses for that purpose.
Let us now look at flow graphs, an important abstraction that is often used in the code optimization phase of a compiler. Flow graphs can be used to model the flow of control in computer programs. At the first 1973 POPL conference, Gary presented a paper and we showed how flow graphs could be used to facilitate the implementation of useful code optimizations on the intermediate representation of programs by computing reaching definitions. A few basics.
Suppose we have a three address statement S in our intermediate representation like U is assigned V plus W. We see the statement generates a Jeff anythings of the variable U. We say a definition of U from statement S reaches a statement T if there is an execution path from S to T where the variable U is not redefined. In the parlance of code optimization we say it is not killed. The reaching definitions problem is to determine what definitions may reach what program points.
And reaching definitions are used to implement several important code optimizations such as constant propagation and loop invariant code motion. Now let's take a look at the flow graph abstraction for reaching definitions. The data model for this abstraction is a semi lattice of subsets of variable definitions. These are the data flow values. And together with the semi lattice, there is a directed graph in which each node represents a basic block of the
immediate representation and the indicates which blocks can follow which other blocks. An associated with each node of each graph are two members of the semi lattice. One for the variable definitions that can reach the beginning of the node and one for the variable definitions that can reach the end of the node. There are two operations in the flow graph abstraction. The first is a transfer function associated with each node. The transfer function computes the output data flow values associated
with the end of the node from the input data flow value. And the second operation is a confluence operator that computes the data flow value associated with the beginning of node from the values of the data flow values at the ends of all of its predecessors in the flow graph. And because we're dealing with a semi lattice, the confluence operator needs to be communive associative. The beauty of the formulation is that you can choose the algorithm that is most appropriate
for computing the data flow values for the kind of optimizations you're trying to perform. The details of these and many other useful abstractions and their associated algorithms for compiler designs are in a sequence of books on compiler design that Jeff and I co-authored in the span of three decades. The first book was published in 1977 and it had 600 pages. The second book in 1986 added ravi as a co-author and it had 800 pages. The third book in 2007 added Monica lamb as a fourth co-author
and it had a thousand pages. None of us had the heart to write a fourth book. The books quickly became known as the dragon books because all of the covers had a drawing of a fierce dragon conceived by Jeff symbolizing the complexity of compiler design. As I mentioned, it was Jeff's youngest son Scotty who designed the cover for the purple dragon book, the move to strike recent dragon book. I must also mention that the red dragon book was briefly shown in the
1995 movie hackers starring a young Angelina Jolie. When my two children saw the movie, for the first time they thought their old man was really something. It shows you what it takes to impress your children these days. The impact of the abstractions and all good rights presented in these books and developed by the field has been substantial. They have transformed the field of compiler design from an art to a science. The first four trend compiler built by IBM in the 1950s took 18 experienced
staff years. In contrast, starting from the mid-1970s on, scores of innovative languages like Brian language for typesetting equations have been created in just weeks using the tools and abstractions documented in the dragon books. I might mention that the formalism of EQN was adopted by Don in his tech typesetting system. The books have also been used for decades in universities around the world to teach compilers to generations of computer science students.
Let me mention an anecdote about my experience teaching the one semester compiler course to thousands of students at Columbia for the last 25 years. In addition to teaching the abstractions and all good rights algorithms used in compilers, I had students form a team of five for a semester long project that accompanied the course. Each team had to create an innovative new programming language of their own design and write a compiler for it.
Many of the languages created by the students far exceeded my expectations. One memorable language was called upbeat. With it, users could write programs to play sound of their own choosing to accompany streaming input data. The students that created upbeat showed off their language by writing a program that would play user selected music triggered by user specified patterns in the input data detected by their program. They illustrated their program by taking the New York Stock
Exchange ticker tape feed and having their compiled target program play music fitted to the patterns in the ticker tape data. When the market was going up, the music was bouncy and lively. When the market was going down, the music was gloomy and somber. Their theory was that a stockbroker who rather listen to background music that would indicate which way the market was going rather than staring at the ticker tape all day. I might mention Adrian weller, one of the students on the upbeat
team was a stockbroker before he came to Columbia as a Ph.D. student. Adrian is now a principal fellow at the university of Cambridge. I should also mention in the 25 years that I taught the compiler course at Columbia, never did a team of students fail to deliver a working compiler for their innovative programming languages. I attribute the success to the tools abstractions and all good rights that we documented in the dragon books and to the software engineering process that I learned
working 30 years at bell labs. For the part of my talk, I would like to mention a few unusual abstractions in quantum programming languages that are vastly different from abstractions appearing in traditional programming languages. The point I would like to make is that the framework that we have created for designing compilers for traditional programming languages can nevertheless be applied equally well to create compilers for quantum programming languages.
I will begin by reviewing the four pot to you lates of quantum mechanics a fundamental in physics developed in the 21st century that describes the physical properties of nature at the scales of atoms. From these we can derive the abstraction of quantum circuits, one of the key models of computation underlying quantum programming languages. I'm going to follow the treatment of quantum computation as presented in Nielsen and chuang's book quantum computation and quantum information.
Pos to you late one says the state of a physical system can be described by a unit vector in a hill bert space which is a complex vector space with an inner product. From this postulate we can derive a quantum bit which is a unit vector. The state of a qubit can be described by the states cat zero and cat one as shown in this slide. The brackets surrounding symbols are vectors using the broad cat location that was devised by Paul and this is standard in quantum mechanics papers these days.
The vector cat zero stands for the vector one comma zero. And since we're dealing -- since every vector is a unit vector, the sum of the squares of the absolute values of alpha and beta are equal to one. A qubit is a fundamentally different from a bit in classical computing. It exhibits a quintessential property of quantum mechanics. Its state is a super position. A complex linear combination of two basis states. States that the evolution of a state of a closed quantum system
from a unitary operator. You can think of that as a complex square matrix whose rows and columns are normal. It is a rotation of the state vector in hill bert space. Unitary operators are reversible. Programming languages do not have to be reversible. The single qubit operator is a useful operator that appears in many quantum algorithms. If we apply the unitary -- the hadamard operator to the cat zero we get the super position cat zero plus cat one over the square root of two.
Likewise if we apply the hadamard operator to the basis vector cat one, we get the super position cat zero minus cat one divided by the square root of two. Notice that if we apply the hadamard operator to itself, we get the identity matrix in two dimensions. The two qubit quantum not operator or CNOT quantum operator in full shows the matrix on the right. It is a very useful quantum operator. It has two qubit, c and t. K is a controlled qubit and t is the target qubit.
When the two qubits are fed, if the control qubit is zero the target qubit passes through unchanged. If it is one the target qubit is flipped. For example, if we put the input with C equal to cat one and t equal to cat zero into the CNOT gate, the CNOT gate produces cat one on the control line as output. That is the control hasn't been changed. But that the target qubit has been flipped from a zero to a one. 3 says the only way to get quantum out of a measurement is to measure it.
The sum of the probabilities of the possible outcomes of a measurement is one. A measurement has -- is not a unitary operator. It collapses the state of a quantum system. As an example, let us consider the projective measurement of a single -- a single qubit equal to alpha times cat zero plus beta cat one as shown in this slide. We would like to get the amplitude of sigh as an outcome. But in the world of quantum physics you can only get one classical bit, a zero or a one as outcome.
The probability of getting zero is the absolute value of alpha squared and the probability of getting one is the absolute value of beta squared. Moreover, if the outcome is zero, the state after measurement is cat zero. If the outcome is one, the state after measurement has collapsed to cat one. The final postulate says what happens when we combine to composite systems. The state space of the composite system is the ten sore product space of the state spaces of its component systems. Excuse me.
I have shown on this slide an example if we take two two dimensional vectors A and B and take their ten sore product we get a four dimensional vector as a result. And if we take the ten sore product of the three two dimensional vectors AB and C we get the output an 8 dimensional vector. If we add a single qubit to a quantum system, we double the size of its state space. This means that if we combine single qubit systems wet get
a composite system with a state space of dimension two to the N by taking the ten sore product of the state spaces of the n single qubit systems. If we combined 300 we get a state space with more dimensions than the number of atoms in the universe. This is why it is so difficult to simulate quantum mechanical systems on a classical computer. We are finally ready to introduce quantum circuits, a key abstraction for quantum computing.
Quantum circuits are sometimes called the gate model of quantum computing. Quantum circuits are a little like booleam circuits but there are important differences. A quantum circuit is a graph consisting of lines connecting unitary operators at measurement gates. No fan is allowed. Logical OR is not reversal. In addition no fan out is possible because in quantum mechanics, it is not possible to make a copy of an unknown quantum state.
This follows from the no cloning theorem in quantum mechanics. Here is a simple but important example that illustrates what a quantum circuit looks like. I have shown a quantum circuit with two inputs, X and Y. The x qubit goes into a gate whose output goes into a CNOT gate. The y qubit goes in as the target of the CNOT gate. And the output is a very funny state. This quantum circuit illustrates how to generate what are called ion stein rosen states also known as bell states.
If we applied cat zero zero to this circuit, we would get output the state cat zero zero plus cat one one over the square root of two. You can show that we cannot express this output as a product ten sore product of two states. States of this nature are called entangled states and Einstein called these spooky action at a distance. And you can do some amazing things with entangled states in quantum mechanics. And I might mention that I think almost all physicists
don't understand the phenomena of entanglement. In 1994, quantum computing received an enormous boost when Paul shor combined a classical computer and a quantum computer to factor integers with order n cubed operations. Many of today's encryption schemes like RSA on the Internet is computational prohibitive. However, if we could build large enough quantum computers with error correction encryption schemes like RSA would be easy to crack with shor's algorithm.
For the time being no algorithm is known for factoring integers on a classical computer. And we cannot build large enough quantum computers to factor the sizes of integers used by RSA in practice. So RSA is safer now. However as a precaution, has initiated a process to solicit proposals to develop crypto graphic systems that are secure against attacks from both quantum and classical computers. I might mention that this is an active research area in cryptography these days.
Several companies like Google and IBM have built quantum computers with about a hundred qubit. To implement shor's algorithm will require a million or more qubits. It is not clear when such large scale quantum computers will become available. From a theoretical point of view, if we could prove factoring integers cannot be done in time then the algorithm would disprove the church thesis which states that any digital system of computation can be efficiently simulated on a turing machine.
Scalable quantum computers are still in their infancy but abstractions for modeling compilers for traditional programming languages have been very successful in constructing compilers for quantum programming languages. A little while ago a graduate student of Princeton university came to Columbia as a Ph.D. student to study quantum computing. After taking my compilers course she did her Ph.D. on quantum computing. Krista demonstrated that the framework that we have
created for implementing compilers for classical languages can be used to develop compilers for quantum programming languages. After graduating from Columbia, Krista joined Microsoft research where she is now a general manager of quantum software. A few years ago she and her colleagues at Microsoft created a quantum programming language called Qsharp that is now part of Microsoft's quantum development kit which can be used to experiment with quantum and design tools.
Qsharp is one of 15 quantum programming languages listed on Wikipedia's quantum programming page. In conclusion, I would like to reiterate my thesis. That the abstractions and all good rights that we have developed in computer science in the last several decades have transformed the field of compiler design from an art to a science. Thank you. >> Hi. Andrew Myers here. I wanted to bring you back to something that you mentioned a little bit
earlier that for me rows unexpected passions from PLP people which is LR versus LL. >> ALFRED V. AHO: Yes. >> Andrew: So I guess I'm curious about your thoughts about whether we need the expressive power of LL -- of LR, I should say. It seems like in this community a lot of people have like using LL for everything. The argument is that it is easier to debug and people can use parse era comdators that are kind of cool. So I guess I'm wondering -- I guess the other thing that I have noticed
is when I talk to people in industry who build industrial compilers, they tell me, well, we're not actually using parser generators because we have these parsers that we have curated and maintained for decades and they're doing crazy things that don't quite fit into the easy, you know, expression with the AC or bison or whatever. I'm curious about your thoughts about this trade-off. >> ALFRED V. AHO: This is an excellent question. First of all, when I entered the field of compiler design
back in the late '60s and early '70s, there was a holy war going on on parsing techniques. There were many different types of top down -- many types of bottom-up parsing techniques like simple precedence, mixed strategy precedence and so on. And then in 1965, Donald kanuth came along and wrote the paper on LRK grammars where he defined sort of the maximal class of grammars that could be parsed dermistically using a parser. Compilers at that time liked recursive.
And LL is an example of a descent parser. But when I got involved in compilers and programming languages, what I discovered was that in order to write grammars for accurate grammars for programming languages, you had to modify your grammar to make it either LL1 or simple LR1 or look ahead LR1 and so on. And many of the people who were writing compilers weren't experts in parsing theory and formal language theory. So they had a great deal of difficulty modifying their grammars to fit the mold.
The reason I think YACC became so popular is the formalism that Steve Johnson ullman and I devised allowed people to write -- create easy to write grammars for typical programming language constructs. If you had to write an unambiguous grammar, say, for if then L statements, this is actually -- requires a little bit of skill to do this. And with YACC, we created a rule saying that if you have a choice -- if you have a shift reduce conflict, always favor for a shift.
So that became a simple disambiguous rule where people could use ambiguous grammar for if then L statements. Likewise if you take a modern or not so modern day stage programming language like C, C has operators on 16 different precedent levels. And so if you wanted to write an unambiguous grammar for expressions in C, you would have to have 16 different syntactic categories to represent the different levels of operators. Whereas if you use an ambiguous grammar of the form expression is
expression operator plus expression all you needed was one rule and a rule that specifies how the precedence and associatity of the operator should go. The other advantage of using YACC and techniques or parser generators like YACC is that YACC will tell you where the difficult to parse constructs in your grammar are. And when people started using YACC, especially at bell labs, they would always come to me and say, I don't understand why I'm getting this parsing action conflict in YACC.
But after I showed them that there was an inherent ambiguity in their grammar, they say, oh, I didn't spot that. So the reason I liked YACC and formalisms at the time is that it resulted in more robust software, more property working parsers that didn't have any particularities in them that many of the hand crafted parsers that we -- people were building at the time. But having said this, if you're experienced in the field, go ahead and use the parsing strategy of your choice.
And your comment that some programming language syntaxes are so complex that they require a special organization to create a correct parser for them. And I'm thinking of the language C++ in particular. There is an organization that specializes in the construction of parsers for C++. It is not a task that you would ordinarily want to do from scratch. Another and this is sort of a biased one -- comment from me, I like theory. And I like kanuth that the best theory is motivated by
practice and the best practice is motivated by theory. So if you can apply theory to the design of your software, chances are you have more chances of getting a properly working software system. So this is probably much too long of an answer to your question. But the field has evolved considerably from the time that programming languages was a -- particularly parsing was a hot area of computer science research. And I might also mention that with the advent of compiler frameworks like
GCC and LLVM, the construction of a new compiler has turned into an exercise in software engineering. Because to create a new compiler for a new programming language on an existing machine, all you do is construct a new front end and put it into LLVM and it -- and have your front end translated into LLVM-IR. And then you can use the existing target code generator as your back end of the compiler. And likewise if you want to create a compiler for an existing language for a new machine
architecture, all you then have to do is create an LLVM-IR to target machine code generator. So compiler design has changed considerably over the years. And if we're still on the subject of what's happening to compiler design, I think this is a fascinating area even now because there are some very interesting experiments being done trying to use machine learning and AI techniques for producing compilers. As you know with machine learning, you present a whole bunch of examples.
And one of the most interesting developments that I have seen recently is people speak to their natural language processor which then produces a compiler in some language like JavaScript or solon for creating computer games. So if you haven't seen any of these videos on producing compiler games using spoken language -- computer games by speaking what the game should do into machine language programming and natural language processing program, I suggest you look at them. It is intriguing.
But whether they will ever be able to produce compilers for the complexity of languages like C++, I don't know. I think that is an open question. And if you recall, way back many decades ago, many -- a number of people proposed natural language as a programming language. And people pointed out that natural language is highly ambiguous inherently ambiguous, and the last thing that you want is a disagreement between the programmer and the compiler writer as to
what the semantics of the programming language should mean. >> Thank you, Al. Let me just mention that, you know, what Al mentioned at the end, translating spoken words into a computer game so that will be the topic of the opening keynote for the virtual workshop that is planned next week. Let's take a question from our remote participants. Al, I'll just read it for the benefit of everyone. It is from Mike Hicks and it says your definition of computational thinking is intriguing.
And compilers illustrate it well. Is it possible to use language translators to teach computational thinking to non-computer scientists? What do you think? >> ALFRED V. AHO: Well, this is, again, a very important and intriguing question. Because how do you teach people to think? In fact I've been wondering how to do that for my entire life. Because I've been very interested in how best to teach. And then one of the things that you should do in teaching is communicate to your students.
And if you're in the business of producing software, what I have learned from a lot of experience is that it helps enormously if you do a little bit of thinking before you start programming. That may be old school, but thinking and then programming is a much better strategy than programming and then wondering, what the hell went wrong with my program? Now, as far as using programming language translators to teach computational thinking, I think that is a very good research
area because people are using computer games to try to teach computational thinking. And there seem to be -- they seem to be popular in certain circles that students like learning by solving puzzles or playing games, moreso than by reading. And what I have also noticed is that students have many different styles of learning. Some people are word oriented and learn by reading. Some people are visually oriented and learn by seeing pictures or videos. So learning is very idiosyncratic.
The first wave may not resonate with the student. But the second or third way may be much better in getting the idea across. So repeat for learning is not a bad strategy. But repeat in different ways. >> Thank you. Maybe one more question. Anyone in the audience? We have questions online. Yeah. So this is from nazari. And it says, what are main possible differences between pipeline of classical compilers and quantum computing compilers?
Do researcher add or remove any specific phase to the classical phases of the compilers for the quantum computing compilers? >> ALFRED V. AHO: Designing compilers for quantum computers is -- I mentioned we can use the traditional techniques. But because of the no cloning theorem in quantum mechanics, your programming language for a quantum computer does not allow you to have a copy operation. You cannot copy the value of a variable.
And the algorithms, and I suspect this will be the case for the foreseeable future, there won't be a stand alone quantum computer, there will be hybrid classical quantum computer systems. So shor's algorithm has a lot of preprocessing done by a classical computer to reduce the factoring problem into a problem for computing the period of a function. And he uses the quantum computer to compute the period of a function using the operators that you can implement on a quantum computer.
And then you get the result. And then do some post processing on your classical computer. So if you look at I think all of the classical -- all of the quantum computers on the market, they are controlled by classical computers. And the classical computer prepares the input to the quantum computer. And then the one tum computer does measurements that returns classical bits to the classical computer that invoke the routine. So you can think of a quantum computer as an asic attached to a
classical computer. Except that the quantum computers built today are kept at very cold temperatures. So chances are that you won't have them in your iPhone or pocket any time in the near future. >> Okay. Thank you. We do have some more questions but unfortunately we have run out of time. So let's thank Al again for a great talk. [APPLAUSE] >> ALFRED V. AHO: Thank you, everyone.

Ask anything
We've read this whole study set, so questions about it get the best answers.