write a code in scheme or ocaml to traverse an abstract syntax and generate pseudo-assembly code, programming homework help

In this assignment, you will use a functional language to traverse an Abstract Syntax Tree and generate pseudo-assembly code. You may choose to write the program in Scheme or OCaml.

Setup

The following instructions assume that you are using a Debian-based Linux system such as the Ubuntu MATE virtual machine.

Input

Input will be provided as a tree literal for Scheme or Ocaml, as shown on pp. 379-381 of the textbook. The tree will be an AST for a program. For example, the syntax tree for the program in Figure 15.2 on p. 778 could be represented in Scheme as:

‘(program

((assign (var i int) (call (func getint void int) ()))

(assign (var j int) (call (func getint void int) ()))

(while (neq (var i int) (var j int))

((if (gt (var i int) (var j int))

((assign (var i int) (minus (var i int) (var j int))))

((assign (var j int) (minus (var j int) (var i int)))))))

(call (func putint int void) ((var i int)))))

while in OCaml it could be represented as:

Program

[Assign (Var (“i”, Int), Call (Func (“getint”, [Void], Int), []));

Assign (Var (“j”, Int), Call (Func (“getint”, [Void], Int), []));

While (Neq (Value (Var (“i”, Int)), Value (Var (“j”, Int))),

[If (Gt (Value (Var (“i”, Int)), Value (Var (“j”, Int))),

[Assign (Var (“i”, Int),

Minus (Value (Var (“i”, Int)), Value (Var (“j”, Int))))],

[Assign (Var (“j”, Int),

Minus (Value (Var (“j”, Int)), Value (Var (“i”, Int))))])]);

Expr (Call (Func (“putint”, [Int], Void), [Value (Var (“i”, Int))]))]

Of course, since OCaml is statically typed, the types for the tree must be declared first:

type id = string

and data_type = Int | Void

and var = Var of id * data_type

and arg_types = data_type list

and return_type = data_type

and func = Func of id * arg_types * return_type

and args = expr list

and expr =

| Value of var

| Call of func * args

| Neq of expr * expr

| Gt of expr * expr

| Minus of expr * expr

and stmt =

| Assign of var * expr

| Expr of expr

| While of expr * stmt list

| If of expr * stmt list * stmt list

and program = Program of stmt list ;;

Note the additional Value and Expr type tags in the OCaml version of the AST. These are required to distinguish between the name of a variable and its value, and to allow expressions to be valid statements. In the Scheme version, these distinctions are clear from context, but in OCaml the type checker requires them to be made explicit.

Processing

Your program does not need to read the AST from a file; it will be provided with a literal value, as shown above. This is similar to the way that zero-one-even-dfa is provided to the Scheme DFA simulator in Section 11.3 of the textbook and a_b_even_dfa is provided to the OCaml DFA simulator in Section 11.4.

Note also that unlike Figure 15.2, a separate symbol table is not included; type information is provided in-line in var and func nodes of the tree. You may assume that the input AST has already been type-checked.

Using the attribute grammar of Figure 15.6 on pp. 786-787 as a guide, define a function codegen that takes the AST as a parameter. Traverse the AST and generate pseudo-assembly code for the specified program, as shown in Figure 15.7 on p. 789 of the textbook.

Assume an unlimited number of available registers and labels.

Output

Your program should be able to generate pseudo-assembly code for the constructs used in Figure 15.2. Other statements (such as the for loop) or expressions (such as the division operator) used in Figure 15.10 on p. 804 are optional.

The pseudo-assembly code may either be returned as a list of strings or printed directly to the terminal (e.g., with println in Scheme or Printf.printf in OCaml).

You may omit the declaration block at the top of the code (the section beginning — first few lines generated during symbol table traversal) in Figure 15.7. Begin with the label main:.

  • traversing the AST
  • generating new registers and labels.
  • generating pseudo-assembly
  • producing correct output on selected subsets of Figure 15.2 ( attached )
  • producing correct output for the entire GCD program in Figure 15.2 (attached )
  • programming in a purely functional style

figure 15.2 ( attached )

Read More

Advances in Treatment Kidney stones, health and medicine homework help

Select 1 disease (Urolithiasis (Kidney Stones) directly related to one of the body systems reviewed in this module. Research and select a peer reviewed article written within the past 5 years discussing treatment options for the selected disease and write a 1-page (minimum) Annotated Bibliography. For annotated bibliographies, use standard APA format for the citations, then add a brief entry, including:

  • 2 to 4 sentences to summarize the main idea(s) of the source including a brief summary of the disease and treatment option(s).
  • 1 or 2 sentences to assess and evaluate the source including if this information is reliable and discuss if the source is objective or biased.
  • 1 or 2 sentences to reflect on the source including how this information can benefit a patient and your understanding of the selected disease
Read More

persuasive paper final draft

It’s time to submit the final draft of your persuasive essay. At this point, your course faculty member has returned to you the graded first draft of the assignment, as well as, some insightful feedback.

For this assignment, consider all the feedback you’ve received on your first draft, including from last week’s Online+ session, and submit your 3-4 page persuasive essay based on the following criteria:

  • An introduction paragraph with a thesis statement.
  • Three body paragraphs that each focus on a separate major detail.
  • A summary paragraph that summarizes your main ideas and puts a bow on the essay.
  • Your reference page will list all of your sources in APA style.
  • Additionally, be sure to proof your essay draft carefully for grammar, mechanics, and spelling.
  • Applied revision and editing strategies to strengthen the essay.

please see the attachment for feedback and comments that were provided on my rough draft and fix accordingly do not forget to add some paragraph from the rough draft to make the paper look the same.

Read More

technology in online learning

Technology in Online Learning

In this wiki assignment, you will create an informational website discussing the different technologies used in online learning environments.

Perform the following tasks:

Step 1: Add to the Wiki you started in EDU 600.
Remember the Wiki you created in EDU 600 Introduction to Online Learning? This week you will add to it.

Note: If you have NOT taken EDU600 please complete the following steps to set up your wiki:

Locate a free wiki site
Perform an Internet search to locate a website that will allow you to create a free wiki. Listed here are some sites that you may want to consider:

It would also be a beneficial to do a quick internet search to get an idea of how to format your wiki. Search for good/poor examples of wikis to assist you in the design of yours. You could also search for examples of good/poor layout and/or visual design.

Examine the site features
Look over the features offered by the wiki site. Each site’s instructions and tools will vary, but most will have tutorials or step-by-step instructions for creating your wiki. If the site you are considering does not offer assistance, select another site.

Create an account
Most of the wiki sites will require you to create an account on the site. Make sure to hang onto your account information, as you will add to it throughout the specialization.

Step 2: Prepare the wiki site.
Access your Wiki from EDU600 and create a page. Label it “Online Technology.” Next find at least 10 different tools and technologies that support work in an online course. Group them into Functional Categories such as group work and collaboration, communication tools, presentation tools, task management tools, etc.).

Build your wiki page. The content of the wiki page should include the following:

  • Develop your Functional Category titles and add the relevant technologies under each.
  • For each technology, include URLs and describe each tool briefly including how it works, how it is typically used and by whom. Is it freely available or is there a charge?
  • Include examples, suggestions or scenarios for use of the tools within each of the functional categories you have identified to increase the quality of teaching and support of student success.
  • Include information regarding at least one emerging technology you feel will be useful in online courses in the near future either for instructional use or for students to use to support learning and assignment completion.
  • Use a minimum of 3 scholarly sources, one of which may be your textbook to support your recommendations. Be sure to cite sources using proper APA formatting.

Step 3: Submit your assignment summary.
When you have completed the wiki assignment, prepare a summary of the process used to create the wiki. This summary should include the following:

  • The wiki’s web address so the instructor can view it.
  • A brief summary of the experience of creating this wiki.
  • Your opinion on the usefulness of Wikis for teaching and learning and why.
  • A link to your Wiki (please make sure that the settings on your Wiki are set to “public”).
  • Save a copy of the summary in an easily accessible place and submit a copy to the instructor and submit via Waypoint.
Read More

Strategic Analysis Paper

Research and Analysis Paper – IT Governance Models

After watching the videos below and reading about the Balanced Scorecard in Chapter 12, compare and contrast the Balanced Scorecard to one of the IT frameworks below (COBIT, ITIL, TOGAF, CMMI-Dev). Describe the context in which the Balanced Scorecard and the IT framework would be used. The paper should 4-6 pages in APA format, not counting the title and reference pages. 3 peer-reviewed references needed.

*Abstract, Introduction, Conclusion, and subheadings are mandatory

*No Plagiarism

*APA

Assignment Resources:

The following are examples of frameworks related to IT governance.

  • COBIT 5 Framework – This PDF describes the COBIT 5 (Control Objectives for Information and Related Technologies) framework for management of enterprise IT.
  • ITIL V3 – This PDF describes version 3 of the ITIL (Information Technology Infrastructure Library) framework for IT service management.
  • TOGAF 9.1 – This PDF introduces The Open Group Architecture Framework (TOGAP) for systems architecture.
  • CMMI-Dev v1.3 – This PDF describes the Capability Maturity Model Integration (CMMI) for systems development.
Read More

Global Studies Question Part 1

Hi, please answer the following 2 questions that I have attached. Please write a 600 word response for each of the 2 questions totaling 1200 words 12 Times New Roman Size 12 Font Double-Spaced APA format. Please include a reference page using the sources I will provide. Be sure to include several excellent examples to support your point :). I will send the required docs and book that are needed to answer these questions once you are selected :)! .You can use outside sources and the sources that I sent you. Please make sure that any outside sources that are used are scholarly.

My professor is really strict and requires page numbers to be put in the in-text citations where the information was taken from. Please put page numbers from the exact references that you used in the in-text citations or I will get marked :(.

Read More

Assignment 3: Persuasive Paper Part 1: A Problem Exists Due Week 5 and worth 150 points Using you

Assignment 3: Persuasive Paper Part 1: A Problem Exists
Due Week 5 and worth 150 points

Using your thesis statement and research, present the problem that needs to be addressed with your proposed solution. Note: Your solution, advantages, and challenges, will be in Parts 2 and 3.

Write a three to four (3-4) page paper in which you:

Provide an appropriate title and an interesting opening paragraph to appeal to your stated audience (appeal with logic, ethics, or emotion).
Include a defensible, relevant thesis statement in the first paragraph. (Revised from Assignment 2)
Describe the history and status of the issue and provide an overview of the problem(s) that need to be addressed. This should be one or two (1-2) paragraphs.
Explain the first problem (economic, social, political, environmental, complexity, inequity, ethical/moral, etc.) and provide support for your claims. This should be one or two (1-2) paragraphs.
Explain the second problem (economic, social, political, environmental, complexity, inequity, ethical/moral, etc.). and provide support for your claims. This should be one or two (1-2) paragraphs.
Explain the third problem (economic, social, political, environmental, complexity, inequity, ethical/moral, etc.) and provide support for your claims. This should be one or two (1-2) paragraphs.
Provide a concluding paragraph that summarizes the stated problems and promises a solution.
Develop a coherently structured paper with an introduction, body, and conclusion.
Use effective transitional words, phrases, and sentences throughout the paper.
Support claims with at least three (3) quality, relevant references. Use credible, academic sources available through Strayer University’s Resource Center. Note: Wikipedia and other Websites do not qualify as academic resources.
Your assignment must follow these formatting guidelines:

Read More

management information system ERD and Transform your ERD to schema diagram, writing homework help

Saudi Banks Network has many banks registered in its database. Each bank should have its code (which is unique per bank), bank name and head office address of the bank (city, street). However each bank might have number of branches. Each branch should have a number, yet no bank is only known by its branch number, it is also known by its bank code. It is also necessary to record the branch manager, phone numbers (each branch has at least 5 lines). A customer has to be register in one branch however he/she can deal with all branches. SSN, name, Address and phones of the customer are some data should be stored. A customer might have maximum 3 loans and 10 accounts. It is possible for any number of customers to participate in an account or in a loan. A loan should have loan number, amount, loan type, interest (5% from the original amount). An account should have account number, balance and type of that account. Date of opening an account for a customer is needed to be stored. A branch has employees work in this branch, employee no, name, address, identification card number, salary are some characteristics should be in your database. Each employee has a supervisor; only one, however a supervisor may supervise any number of employees. A branch should have at least 25 employees and employee may work in many branches at the same time, date of joining a branch should be registered.

1.You are required to design an ERD for this application, stating any assumptions you make. (10 marks)

2.Transform your ERD to schema diagram (relational model) (6 marks)

Read More

research and analysis on competing companies (Coca Cola and Pepsico), economics homework help

The activity requires students to perform research and analysis on competing companies (Coca Cola and Pepsico) and the potential implications of international standards. This real-world analysis is key to understanding how a company’s profitability, liquidity, and solvency can be useful for all users. Students also learn to analyze financial statements and use managerial tools to make decisions from an investor’s and creditor’s standpoint.

Assignment Steps

Resources: U.S. Securities and Exchange Commission (SEC), websites such as Yahooo Finance, Annual Reports (AnnualReports.com) and Morningstar.

Tutorial help on Excel® and Word functions can be found on the Microsoft® Office website. There are also additional tutorials via the web offering support for Office products.

Research Coca Cola and Pepsico (recommended using Yahoo Finance following steps provided for Week 1 Financial Statements Assignment) on the Internet and download the Income Statement, Statement of Shareholders’ Equity, Balance Sheet, and Statement of Cash Flows.

Develop a minimum 525-word examination of the financial statements and include the following:

  • Make a 5-year trend analysis for each company, using 2012 as the base year, of:
    • Net sales.
    • Net income. Discuss the significance of the trend results.
  • Compute for 2016 and 2015 the:
    • Debt to assets ratio.
    • Times interest earned. How would you evaluate each company’s solvency?
  • Compute for 2016 and 2015 the:
    • Profit margin.
    • Return on assets.
    • Return on common stockholders’ equity. How would you evaluate each company’s profitability?
  • Evaluate the financial opportunity presented by the companies. If you were a creditor, which company would you be more likely to lend money to? Defend your decision.
  • Which company would you recommend as an investment? Discuss the items that were considered in your decision.
  • Research global implications for the international company selected. How might changing environmental factors affect organizational choices?
  • Consider the ethical climate (internal or external) of your chosen companies. Describe the ethical issues and impact on the stakeholders. What has been/is being done to resolve these issues? Do you agree with these methods for resolution? If not, what might you do differently?

Show your work in Microsoft® Word or Excel®.

Complete calculations/computations using Microsoft® Word or Excel®.

Include the four financial statements along with your assignment.

Format your assignment consistent with APA guidelines

Read More

Male Veterans, assignment help

Assignment Instructions

Class,

The Research Paper Directions are attached below. See details.

  1. Submit your Research paper here.
  2. Please note the Turnitin score. Your score should be not more than 20% of the paper. Make sure if you use material from articles, that you paraphrase, i.e., put in your own words. Use quotes sparingly. Too many quotes drive up the Turnitin score and show that the material has not being integrated into your thinking, and therefore, is not your work. Sometimes the writer needs to use quotes, due to type of material needing to be referenced, and that’s fine!
  3. APA format required
  4. Use headings in your paper.
  5. Be sure to have in-text citation(s), for every reference, and have all reference listed on the reference sheet.
  6. Make sure you include a reference for every source that you use in your paper. Also, for every reference, there needs to be in-text citations.

Research
Paper Directions

Select and
research a veteran population. Examples:

  • Women
    veterans

Include the
following:

  • Detailed
    information about the population

    • Military
      experience
    • Demographics
  • Healthcare
    needs in your population
  • Policies
    impacting your population
  • Analysis
    of the effect of policies on your population
  • Resources
    available to this population
  • Barriers
    to resource utilization
  • How the
    nursing profession can promote change to improve healthcare outcomes
    of this veteran population
  • The role
    of Interprofessional collaboration to meet healthcare needs of
    veterans

Requirements:

  • APA format
  • 8-9 pages
    in length, not including the title page or reference page
  • Five or
    more peer-reviewed articles
  • Two
    professional web-based resources

  • Section headings
  • Turnitin
    score of 20% or less

Read More