subject

(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.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 16:30
Monica and her team have implemented is successfully in an organization. what factor leads to successful is implementation? good between different departments in an organization leads to successful is implementation.
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
What would be the address of the cell, which is at the intersection of the second row and the third column in a worksheet?
Answers: 1
question
Computers and Technology, 25.06.2019 04:40
Ineed ! i need a computer whiz to me complete my study guide on computers, it's 50 questions. if anyone can me i'll be greatly appreciated.
Answers: 1
question
Computers and Technology, 25.06.2019 08:20
The internet backbone is a foundation network linked with
Answers: 1
You know the right answer?
(assume c language programming)

question 1

consider the following grammar: <...
Questions
question
Mathematics, 25.03.2020 17:48
question
Mathematics, 25.03.2020 17:49
Questions on the website: 13722359