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 00:30
Quic which one of the following is the most accurate definition of technology? a electronic tools that improve functionality b electronic tools that provide entertainment or practical value c any type of tool that serves a practical function d any type of tool that enhances communication
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
What is the power dissipated by a resistor with a current of 0.02 a and a resistance of 1,000 ? a. 200 w b. 20 w c. 0.4 w d. 4 w
Answers: 1
question
Computers and Technology, 23.06.2019 03:30
Hashtags serve to identify the topic of a given tweet true false
Answers: 2
question
Computers and Technology, 23.06.2019 04:00
In a word processing program, such as microsoft word, which feature to you choose the desired picture enhancement?
Answers: 2
You know the right answer?
(assume c language programming)

question 1

consider the following grammar: <...
Questions
Questions on the website: 13722367