Question
1. In general, in programming languages like C++, type of a variable is considered static semantics. True False 2. Which of the following can be
1. In general, in programming languages like C++, type of a variable is considered static semantics.
True
False
2.
Which of the following can be used to check correctness of a program
operational semantics | ||
axiomatic semantics | ||
Denotational semantics | ||
None of these |
3. In general, in programming languages like C++, value of a variable is considered static semantics.
True
False
4. Context free Grammars can be used for specifying static semantics
True
False
5. Select ALL Terminals in the following BNF rules: < ident_list > -> identifier | identifier, ? if then
identifier | ||
, | ||
if_stmt | ||
then | ||
stmt | ||
ident_list | ||
logic_expr | ||
if | ||
| | ||
-> |
6. The following grammar IS ambiguous:
True
False
7. What is the weakest precondition {P} for {P} x = 5y + 5 { x > 5}
y>2 | ||
x>2 | ||
x>5 | ||
y>0 | ||
x>0 | ||
y>5 |
8. Which of the following attributes are determined from nodes of children in parse tree
Inherited attributes | ||
Intrinsic attributes | ||
Synthesized attributes | ||
None of these |
9. Select all the valid preconditions {P} for
{P} x = y + 2 { y > 4}
x>2 | ||
x>4 | ||
x>0 | ||
x > -4 | ||
x>-2 | ||
y>5 |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started