Question

Please answer the questions below: 7. Rewrite the following BNF grammar using the form of EBNF...

Please answer the questions below:

7. Rewrite the following BNF grammar using the form of EBNF described on the bottom
half of page 127 in Sebesta.
<import_decl> → import <import_list> ;
<import_list> → <package_list>
| <package_list> . *
<package_list> → <identifier>
| <package_list> . <identifier>
<identifier> → a | b | c
Make the resulting grammar as simple as possible, but keep all four of the original
nonterminals, which will now be named ImportDecl, ImportList, PackageList, and
Identifier. (Note: There are some typographical errors on page 127. See page 3-21 of the
course notes for a better description of this form of EBNF.)


8. (a) What is the weakest precondition needed to prove the correctness of the following
loop?
while i < j do
i = i + 1;
j = j - 1;
end
{i = j or i = j + 1}
(b) Give an invariant that is strong enough to prove the correctness of the loop.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Rewriting Bnf grammor using the form of · EBNF as follows: <assign) + impost = < import_list) < import_list> < <package_list>a The weakest precondition needed is 3/i. b) The invariant strong enough will be througout the 100p is j+j=n (some number) a6

Add a comment
Know the answer?
Add Answer to:
Please answer the questions below: 7. Rewrite the following BNF grammar using the form of EBNF...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT