Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Problem 15

What are the different interpretations of the following English language sentence? 1 bought a shirt in the new store that was too large.

Problem 16

Write a BNF grammar to describe the following hypothetical input statement: input (var, var, ... , var); The statement begins with the word input, followed by a left parenthesis, and then one or more variables, each variable separated from the one after it by a comma. The entire statement ends with a right parenthesis and a semicolon. Variable names are arbitrarily long strings of digits and letters, the first of which must be a letter.

Problem 17

Discuss what other information, in addition to name and data type, might be kept in a semantic record. From where would this other information come?

Problem 19

Assume that our language specifically permits you to assign an integer value to a real variable. The compiler handles this mixed mode by generating code to perform data conversion from an integer to a real representation. Consider the following declarations: int \(x\); real \(y\); The assignment statement \(y=x\) is legal in this language. Explain how a compiler handles the previous assignment statement. You do not have to show the exact code that would be generated; just describe how a compiler deals with the statement, and show at what point in the code generation process the compiler discovers that it needs to produce the data conversion instructions.

Problem 20

Explain how the concept of algebraic identities could be exploited during the code optimization phase of compilation. An algebraic identity is a relationship that is true for all values of the unknowns. For example, \(x+0=x\) for all values of \(x\). \(x * 0=0\) for all values of \(x\). Describe other identities and explain how they could become part of the optimization phase. Is this considered local or global optimization?

Access millions of textbook solutions in one place

  • Access over 3 million high quality textbook solutions
  • Access our popular flashcard, quiz, mock-exam and notes features
  • Access our smart AI features to upgrade your learning
Get Vaia Premium now
Access millions of textbook solutions in one place

Recommended explanations on Computer Science Textbooks