Describe a small specific change that you could make

Assignment Help Computer Engineering
Reference no: EM131836531

Assignment

Questions 4-6 refer to the contents of HW2.lhs. Include two files in your submission: a text file with the answers to questions 1-3, and the completed HW2.lhs file.

1. Imagine you're given an interpreter for C++ and asked to build a compiler from C++ to x86 machine code that implements the same semantics as the interpreter. What does it mean to claim your compiler is correct? How would you test this claim?

2. Consider the following Haskell code:

data Shape = Circle Double | Rect Double Double

area :: Shape -> Double
area (Circle radius) = 3.1415 * radius * radius
area (Rect width height) = width * height

Write out the full sequence of tokens in this program, in the order that they appear.

3. For each of the first four phases of a typical compiler pipeline (source input, lexical analysis, parsing, and semantic analysis), describe a small specific change that you could make to the code in question 2 that would trigger an error in that phase (and not any previous phase). Justify each answer. (You might find it helpful to copy the code into a Haskell file and load it in an interpreter to try to trigger errors there.)

4. Fill in the definitions of the Sing and (:.:) cases for the "check" function.

5. Fill in the definition of the "star" function.

6. Write at least three more regexes and at least two tests for each that demonstrate that "check" and "star" are working correctly.

Attachment:- HW2.rar

Reference no: EM131836531

Questions Cloud

Amoeba and paramecium differ from euglena and spirogyra : What is one way in which Amoeba and Paramecium differ from Euglena and Spirogyra?
What are your worst-case and best-case NPVs for project : What are your worst-case and best-case NPVs for this project? What is the estimated OCF for this project?
Effects of aging on the male reproductive system : Talk about the effects of aging on the male reproductive system. what should older adults know about his/her sexuality and sexual activities
Insurance institute for highway safety reports : The Insurance Institute for Highway Safety reports that drivers over eighty have a higher rate of crashes per mile driven than younger groups
Describe a small specific change that you could make : Describe a small specific change that you could make to the code in question 2 that would trigger an error in that phase (and not any previous phase).
Summarize the advantages of computers : Summarize the advantages of computers/software and the use of computer technology in investigations.
Compare a number of investment alternatives for project : A common use of the IRR method by corporations is to compare a number of investment alternatives for a project.
Explain why the author chose to deliver the bad news : Locate a bad-news message somewhere on the internet and share a link here. Discuss which method (inductive or deductive) it most closely resembles and explain.
Dna is either in euchromatin : In white blood cells(macrophage) nucleus, its DNA is either in euchromatin (active) or Heterochromatin (inactive)?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd