CSP3341 Programming Languages and Paradigms : Converting BNF to EBNF

Get 30% Off + $20 Signup Bonus ! Limited Time, Hurry !

Securing Higher Grades Costing Your Pocket?
Book Your Assignment at The Lowest Price
Now!

Students Who Viewed This Also Studied

CSP3341 Programming Languages and Paradigms

Questions:

Description

These exercises apply to topics from Module 1 to 4. It consists of a number short answer and other short exercise. This portfolio submission should be completed individually.

Question 1 – Grammars, Sentential Forms and Parse Trees (8 marks – 2 marks per part)

  1. Looking at the BNF grammar for “treadmill”, below, describe the structure of a program in the treadmill language, in English.  You may assume “inst” is an instruction and “int_lit” is an integer.
  2. Identify which of the programs are not syntactically correct according to the grammar of “treadmill”.  If a program is not valid, highlight the errors in the program.

    Programs in “treadmill” Grammar

    Valid?

    BEGIN SET SPEED 5, WAIT 5 MINUTES, END

    BEGIN SET SPEED 2, SET INCLINE 5, WAIT 10 MINUTES, SET INCLINE 2 END

    BEGIN SET INCLINE 3, SET SPEED 2, WAIT 30 SECONDS, SET INCLINE 7, SET SPEED 4, WAIT 5 MINUTES, SET INCLINE 0, SET SPEED 2, WAIT 2 MINUTES END

    BEGIN SET INCLINE 1, SET INCLINE 3, SET INCLINE 5, SET INCLINE 7, SET INCLINE 9, SET INCLINE 11 END

    BEGIN SET SPEED 5, WAIT 2 MINUTES, SET ANGLE 3, WAIT 1 MINUTE, SET SPEED 9, WAIT 30 SECONDS, SET ANGLE 0 END

    BEGIN, SET SPEED 2, SET INCLINE 3, WAIT 1 MINUTES, SET INCLINE 7 SPEED, WAIT 35 SECONDS, SET SPEED 1, WAIT 1 MINUTE END

     
  3. Using leftmost derivationand the “treadmill” grammar, derive the statement “BEGIN SET SPEED 5, SET INCLINE 3, WAIT 5 MINUTES END” into its final sentential form.  Show all sentential forms along the way.
  4. Construct a parse tree of “BEGIN SET SPEED 5, SET INCLINE 3, WAIT 5 MINUTES END” using the “treadmill” grammar.  It should match your derivation from part B of this task.

Question 2  – Converting BNF to EBNF (4 marks)

Translate the “treadmill” grammar rules (Task 1) from BNF form to Extended BNF form, using the same notation to that used in the textbook.  Your final EBNF grammar should describe the same language as the BNF grammar, and be highly readable.

Question 3  – Axiomatic Semantics & Weakest Preconditions (6 marks)

Identify the weakest preconditions and postconditions for all statements in the sequence.  Assume only integer values.  Also identify the weakest precondition for the “if” statement.  Write the weakest preconditions/postconditions inside the braces provided.

CSP3341 Programming Languages and Paradigms

Answer in Detail


Solved by qualified expert

Get Access to This Answer

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.

Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.

Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.

Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.

14 More Pages to Come in This Document. Get access to the complete answer.

Need help on your essays, dissertations or reports? MyAssignmenthelp.com is here to serve all your purposes. With millions of users, MyAssignmenthelp.com rank as the topic online assignment help that covers UK, US and Australia. We raise you one step closer to success with our high end custom essay help, online assignment help and dissertation writing services. Our written assignments are processed through multiple phases, ensuring guaranteed quality. MyAssignmenthelp.com employs more than 3000 PhD writers proficient to craft 100 percent original content. We are strict in our terms and make sure the written articles are free of plagiarism. Nonetheless, get vivid ideas and inspiring examples from our 1000+ database of samples. Make your learning fun with MyAssignmenthelp.com.

More CSP3341 CSP3341 Programming Languages and Paradigms: Questions & Answers

ISY1003 Foundations of Programming

Task
ULO 1: Describe and discuss the elements of effective programming styleULO 2: Demonstrate an understanding of the software development life cycle and apply sound programming analysis techniques (design, coding, debugging, testing and documentation) to justify simple programming problemsGA 1: C …

View Answer

INFO 5502 Analytic Tools, Techniques and Methods

Task:
The included Excel file lists HIV estimated prevalence of people ages from 15 to 49 in the world from 1979 to 2011. Use the dataset to complete following tasks:
1. Add one column as “continent” in the dataset and label each country/region in the dataset to an appropriate continen …

View Answer

ITEC323 Web And Mobile Application Development


Task:
Purpose
The purpose is to assess students’ fundamental skills in dynamic website development by applying appropriate technology.
What are the types of employability skills that I will acquire upon completion of this assessment?
Skill Type
• Developed critical and analytical t …

View Answer

FIT 3034 • Programming Fundamental

 
1. Write a program with an array that has:
Name = intarr
Data type = int
Length = 10
Values = {24, 23, 14, 56, 33, 77, 90, 85, 76, 43}
Then, output every value on a line
2. Write a program with a character array that has:
Name = chararr
Data type = char
Length = 10
Values …

View Answer

Content Removal Request

If you are the original writer of this content and no longer wish to have your work published on Myassignmenthelp.com then please raise the
content removal request.

Choose Our Best Expert to Help You

Leigh Schmidt

PhD in Psychology with specialization in Developmental Psychology

207 – Completed Orders

Hire Me

Goodwin Kemp

Ph.D. in Chemistry from Washington State University.

450 – Completed Orders

Hire Me

Still in Two Minds? The Proof is in Numbers!

38983 Genuine Reviews With a Rating of 4.9/5.

Nursing

Case Study: 8 Pages, Deadline:
27 days

I was happy to see more than average progress in my results. My assignment was good. Thank you very much.

User ID: 5***6 Newcastle Upon Tyne, Great Britain

Maths

Home Work: 0 Pages, Deadline:
1 day

Very helpful,they do help to do the solution with full steps,no further question asked

User ID: 8***28 Newcastle Upon Tyne, Malaysia

Civil Engineering

Programming: 0 Pages, Deadline:
3 days

The team are amazing and respond very fast the quality of work is really high and I can highly relay on them specially on urgent occasions. I am so gr …

User ID: 8***38 Newcastle Upon Tyne, Australia

Healthcare

Assignment: 3 Pages, Deadline:
20 days

Thankful.for your work helped me to score good , looking forward for the same in the upcoming tasks

User ID: 2***25 Blacktown, Australia

Management

Assignment: 11 Pages, Deadline:
27 days

You guys did a fantastic job even though Fix the mistake quickly Very satisfied with your help.

User ID: 3***62 Blacktown, United States

Accounting

Home Work: 1 Page, Deadline:
5 days

very good work done by the expert I got 79 marks in the subject , I appreciate the work.

User ID: 6***96 Kashipur, Australia

Management

Home Work: 1.8 Pages, Deadline:
21 hours

good work done by the expert I got 60 marks in the subject , I appreciate the work.

User ID: 6***96 Kashipur, Australia

Management

Home Work: 9 Pages, Deadline:
4 days

very good work done by the expert I got 78 marks in the subject , I appreciate the work

User ID: 6***96 Kashipur, Australia

Marketing

Assignment: 4 Pages, Deadline:
2 days

good work done by the expert I got 70 marks in the subject , I appreciate the work

User ID: 6***96 Kashipur, Australia

Healthcare

Home Work: 4 Pages, Deadline:
3 days

amazingly written and very happy with the answer they are very easy to understand and read it was answering each question correctly with example and j …

User ID: 8***74 Kashipur, Australia

Management

Assignment: 3 Pages, Deadline:
7 days

received an A on this paper. It was received within the time frame that I needed.

User ID: 5***82 Kashipur, United States

Statistics

Home Work: 1 Page, Deadline:
15 days

Good research and delivery on this discussion. thank you all for the hard work on my assignments so far.

User ID: 8***78 Kashipur, United States

Marketing

Assignment: 4 Pages, Deadline:
1 day

well written and organized in a proper structure, however, more focus should be on the core subject

User ID: 6***69 Kashipur, United Arab Emirates

Healthcare

Assignment: 4 Pages, Deadline:
11 days

The writing is really good and went beyond my expectation. All the requirements are met and the sources were used in the essay are a reliable and good …

User ID: 5***30 Kashipur, Canada

Biology

Home Work: 1 Page, Deadline:
21 days

great staff, nice people they submitted my work onetime and I had passed my unit

User ID: 4***37 Sydney, Australia

Electronics

Programming: 0 Pages, Deadline:
2 days

excellent! very fast speed and good work. i appreciate the hard work from your team. will use again

User ID: 7***68 Sydney, Canada

Accounting

Course Work: 3 Pages, Deadline:
12 days

Hi! Thanks, again for your help! Very professional writer and finished on time! Quality is the best

User ID: 3***99 Ottawa, Canada

Finance

Programming: 2 Pages, Deadline:
4 days

The best work! Thanks, again for your help! I got the grade that I wanted! Very professional and well-organized

User ID: 3***99 Ottawa, Canada

Accounting

Course Work: 2 Pages, Deadline:
5 days

I got the mark that I wanted. Thank you, again for your help. Well-developed and organized.

User ID: 3***99 Ottawa, Canada

Psychology

Assignment: 6 Pages, Deadline:
13 days

cant complain happy by the look of the assignment! I will give more feedback once grade received

User ID: 8***95 Ottawa, Ireland

Nursing

Case Study: 8 Pages, Deadline:
27 days

I was happy to see more than average progress in my results. My assignment was good. Thank you very much.

User ID: 5***6 Newcastle Upon Tyne, Great Britain

Maths

Home Work: 0 Pages, Deadline:
1 day

Very helpful,they do help to do the solution with full steps,no further question asked

User ID: 8***28 Newcastle Upon Tyne, Malaysia

Civil Engineering

Programming: 0 Pages, Deadline:
3 days

The team are amazing and respond very fast the quality of work is really high and I can highly relay on them specially on urgent occasions. I am so gr …

User ID: 8***38 Newcastle Upon Tyne, Australia

Healthcare

Assignment: 3 Pages, Deadline:
20 days

Thankful.for your work helped me to score good , looking forward for the same in the upcoming tasks

User ID: 2***25 Blacktown, Australia

Management

Assignment: 11 Pages, Deadline:
27 days

You guys did a fantastic job even though Fix the mistake quickly Very satisfied with your help.

User ID: 3***62 Blacktown, United States

Accounting

Home Work: 1 Page, Deadline:
5 days

very good work done by the expert I got 79 marks in the subject , I appreciate the work.

User ID: 6***96 Kashipur, Australia

Management

Home Work: 1.8 Pages, Deadline:
21 hours

good work done by the expert I got 60 marks in the subject , I appreciate the work.

User ID: 6***96 Kashipur, Australia

Management

Home Work: 9 Pages, Deadline:
4 days

very good work done by the expert I got 78 marks in the subject , I appreciate the work

User ID: 6***96 Kashipur, Australia

Marketing

Assignment: 4 Pages, Deadline:
2 days

good work done by the expert I got 70 marks in the subject , I appreciate the work

User ID: 6***96 Kashipur, Australia

Healthcare

Home Work: 4 Pages, Deadline:
3 days

amazingly written and very happy with the answer they are very easy to understand and read it was answering each question correctly with example and j …

User ID: 8***74 Kashipur, Australia

Management

Assignment: 3 Pages, Deadline:
7 days

received an A on this paper. It was received within the time frame that I needed.

User ID: 5***82 Kashipur, United States

Statistics

Home Work: 1 Page, Deadline:
15 days

Good research and delivery on this discussion. thank you all for the hard work on my assignments so far.

User ID: 8***78 Kashipur, United States

Marketing

Assignment: 4 Pages, Deadline:
1 day

well written and organized in a proper structure, however, more focus should be on the core subject

User ID: 6***69 Kashipur, United Arab Emirates

Healthcare

Assignment: 4 Pages, Deadline:
11 days

The writing is really good and went beyond my expectation. All the requirements are met and the sources were used in the essay are a reliable and good …

User ID: 5***30 Kashipur, Canada

Biology

Home Work: 1 Page, Deadline:
21 days

great staff, nice people they submitted my work onetime and I had passed my unit

User ID: 4***37 Sydney, Australia

Electronics

Programming: 0 Pages, Deadline:
2 days

excellent! very fast speed and good work. i appreciate the hard work from your team. will use again

User ID: 7***68 Sydney, Canada

Accounting

Course Work: 3 Pages, Deadline:
12 days

Hi! Thanks, again for your help! Very professional writer and finished on time! Quality is the best

User ID: 3***99 Ottawa, Canada

Finance

Programming: 2 Pages, Deadline:
4 days

The best work! Thanks, again for your help! I got the grade that I wanted! Very professional and well-organized

User ID: 3***99 Ottawa, Canada

Accounting

Course Work: 2 Pages, Deadline:
5 days

I got the mark that I wanted. Thank you, again for your help. Well-developed and organized.

User ID: 3***99 Ottawa, Canada

Psychology

Assignment: 6 Pages, Deadline:
13 days

cant complain happy by the look of the assignment! I will give more feedback once grade received

User ID: 8***95 Ottawa, Ireland

Have any Query?

The post CSP3341 Programming Languages and Paradigms : Converting BNF to EBNF appeared first on My Blog.

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"