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

  Distinguish class templates and program with heading

Clearly distinguish each class templates and their program with heading. Elaborate each step and give it without errors. Develop classes or class templates for the following.

  Implement ref integ result in data duplication

Would failure to implement Ref Integ result in data duplication, incorrect data sets, or broken table errors or is there a work around.

  Explain is there a downside to using prototypes

Is there a downside to utilizing prototypes? Prototypes can show to user the look and feel of application but frquently the more sophisticated tools (like data entry verification) have not been implemented.

  Method takes string and integer as parameters

Write a method called multiConcat which takes a String and an integer as parameters. Return String made up of the string parameter concatenated with itself count times.

  Write program to enter numeric values-arithmetic operator

Write a program that lets the user enter 2 numeric values, and an arithmetic operator: +, -, * and /. Write a switch statement that displays the result.

  Write program to choose female student-completed more course

Suppose that input consists of a student file. You are told to write a program to select female students who have completed more than two courses.

  Determine bowler had highest average and print name

Output the bowlers name, avg. and number of stars earned. Discover which bowler had the highest average and print out their name and average.

  Creating personnel promotion application program

The following application program will be modified to accommodate the change to the database table. The personnel promotion application program.

  Expression whose value is distance between two point

a structured type with two fields, x and y, both of type double-- write an expression whose value is the distance between the two point represented by p1 and p2.

  Designing system to handle donations of non-profit agency

You have been hired by worldwide non-profit agency to create a system to handle their donations.

  Display policy data after revisions have made

The day is not correct for the month (that is, between 1 and 31 for January, 1 and 29 for February, and so on), then set the month, day, and year to 0. Display the policy data after any revisions have been made.

  Explaining class definition of subclass of square

Write down the class definition of subclass of Square called FancySquare which has a method called getDiagonal. The getDiagonal method gets no arguments.

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