Abstract syntax for interpretation in haskell or prolog

Assignment Help Programming Languages
Reference no: EM1368722

Problem 1

Define an abstract syntax of the while language suitable for interpretation in either Haskell or Prolog. In Haskell, the definition should be the code of a few data types. In Prolog, no code may be necessary. In this is your case, move directly to Problem 2.

Problem 2

Code two simple while programs in the syntax of Problem 1. One program is the factorial shown above, the other is a program of your choice.

Problem 3

Code an interpreter of the while language in either Haskell or Prolog. Your interpreter should have a function (in Haskell) or a predicate (in Prolog) that takes the abstract syntax tree of a program of Problem 2 as one of its argument. The interpreter should execute the program statements and produce (return in Haskell or bind in Prolog or print, if you prefer) the value of the program variables at the end of the execution. The structure or format of these values is irrelevant as long as it is understandable, see below. You are free to implement only the portions of the interpreter that are needed for the execution of the two programs of Problem 2.

Reference no: EM1368722

Questions Cloud

Write pseudocode of thread with and without semaphores : Assume we have two threads A and B A and B are to repeatedly print out ping and pong. Write down pseudocode of thread A and B How can this be solved with and without semaphores.
Calculate the current eps and pe ratio : Aero Company currently has net income of $3 million and 1. million common shares outstanding which sell for $20 per share. Aero has decided to issue new stock to raise $4,000,000 to expand its operations.
Explaining ethical or unethical actions : Should Iris have placed CD back at coffee station and forgotten entire thing? Describe why that action would have been ethical or unethical.
Conduct observation used in business or organization : Conduct the observation to someone involved in procedure which is used in a business or organization. This person could be someone at university, in small business in your neighborhood.
Abstract syntax for interpretation in haskell or prolog : State an abstract syntax of the while language appropriate for interpretation in either Haskell or Prolog. In Haskell, the definition must be the code of a few data types.
Adapting messages to audiences : How will you need to adapt your communication style and message to communicate effectively with this audience?
Management - supermarket and grocery market : Why is the layout of the supermarket so important to the overall delivery of the products and services provided and what recommendations would you make to the layout of the supermarket to make the layout more effective or efficient.
Explain feasibility analysis for jobs of lrt algorithm : Study feasibility analysis for jobs of LRT algorithm when preemption is allowed. Which scheduling algorithm is best suited for high speed networks and why? Distinguish between static and dynamic systems.
Describe how the general characteristics of these two system : Describe how the general characteristics of these two systems development projects differ

Reviews

Write a Review

Programming Languages Questions & Answers

  Implement functions using x86 assembly

Implement a procedure that mimics a logic unit

  Write program to calculate student-s quiz average

Write a program that will calculate a student's quiz average. The program should prompt the user for the number of quizzes and then ask the user for each quiz grade.

  Program to evaluate postfix expressions using a stack

Program to evaluate postfix expressions containing complex numbers using a stack. This program should contain two classes. T

  Development of the current strategic potential of airline

Evaluate the organisation's current external and internal strategic position

  Writing script for fahrenheit in celsius temperature

Use functions to write script which enables user to enter either Fahrenheit temperature and display Celsius equivalent or enter Celsius temperature.

  Create class for hardware store to represent invoice

Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four pieces of information as instance variables a part number.

  Accuracy and completeness of computations

Analysis right and you have to develop a plausible argument to "prove" that your analysis is correct

  Write program which will accept list of student-s name

Write a program which will accepts list of student's name, individual scores for quiz1, quiz2 and quiz3. Your program must then compute for average of 3 quizzes.

  Write program to compute volume flow rate

Write program to compute volume flow rate in cubic feet per second of water flowing through a pipe of diameter d in inches and a velocity of v feet per second.

  Explain multiprogrammed system available in user mode

CPU voltage and frequency or put it to sleep altogether. In a multiprogrammed system should this functionality be available in user mode or only accessible via system call. why or why not?

  Design interactive program using prewritten methods

Design an interactive program that does the following, using the prewritten methods whenever they are appropriate. Prompt the user for and read a library card number, which must be between 1000 and 9999.

  Create a main loop to accepts text commands

Using the ADT described in Dale p280-282, implement a FIFO Queue. Then create a main loop that accepts text commands as specified below and executes the appropriate FIFO queue functions.

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