Computers and Technology
Computers and Technology, 30.11.2019 04:31, vworld34

(assume c language programming)

question 1

consider the following grammar:
s -> aa | bb
a -> b | aa
b -> a | abb
the following transfomation:

replace all substring of 'a' with the number of 'a's in that substring, always taking the maximum number of 'a's you can
replace any 'b' with 1
and the following operational semantics:

start each program with: val num = 0
for each symbok in the string from left to right:
if the symbol is an 'a' add: val num = num +1
if the symbol is an 'b' and is followed by the end of the string add: val num = 10*num+1
if the symbol is an 'b' and is folowed by an 'a': val num = 10*(10*num+1)
end each program with display num
if the "meaning" of a string in this language is the above transformation regarded as a decimal number, which statement about the operational semantics is true?

the operational semantics are almost completely wrong, and most rules need to be rewritten.

the operational semantics perfectly specify the dynamic semantics of this language.

the operational semantics require one of its rules to be modified before it is correct.

the operational semantics specify the dynamic semantics, but is considerably more complicated than needed.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:40, Bgreene2377
In this lab, you complete a python program that calculates an employee's annual bonus. input is an employee's first name, last name, salary, and numeric performance rating. if the rating is 1, 2, or 3, the bonus rate used is .25, .15, or .1 respectively. if the rating is 4 or higher, the rate is 0. the employee bonus is calculated by multiplying the bonus rate by the annual salary.
Answers: 1
image
Computers and Technology, 23.06.2019 02:30, jaueuxsn
Which component acts as a platform on which application software runs
Answers: 2
image
Computers and Technology, 23.06.2019 16:00, lokaranjan5736
Write a grading program for a class with the following grading policies: a. there are two quizzes, each graded on the basis of 10 points. b. there is one midterm exam and one final exam, each graded on the basis of 100 points. c. the final exam counts for 50% of the grade, the midterm counts for 25%, and the two quizzes together count for a total of 25%. (do not forget to normalize the quiz scores. they should be converted to a percentage before they are averaged in.) any grade of 90 or more is an a, any grade of 80 or more (but less than 90) is a b, any grade of 70 or more (but less than 80) is a c, any grade of 60 or more (but less than 70) is a d, and any grade below 60 is an f. the program will read in the student’s scores and output the student’s record, which consists of two quiz and two exam scores as well as the student’s average numeric score for the entire course and final letter grade. define and use a structure for the student reco
Answers: 2
image
Computers and Technology, 23.06.2019 21:20, nathanfletcher
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
Do you know the correct answer?
(assume c language programming)

question 1

consider the following grammar: <...

Questions in other subjects: