ERASED TEST, YOU MAY BE INTERESTED ON grammar & regex
COMMENTS | STATISTICS | RECORDS |
---|
TAKE THE TEST
Title of test:
grammar & regex Description: 2011 edition Author: noob saibot Other tests from this author Creation Date: 29/08/2024 Category: Computers Number of questions: 5 |
Share the Test:
New Comment
No comments about this test.
Content:
Consider the following context-free grammar:
S → aS|Sb|c
Which regular expression generates the same language as the grammar defined above?
S->aS| means that it should begin with an 'a' a) a* c b* b) a+ b+ c c) a+ c b+ d) c a* b* e) c a+ b+. Regarding syntactic analysis, consider the following statements. I. A recursive-descent parser can only be used to recognize grammars in which the first terminal symbol of each subexpression provides sufficient information to choose the production to be used. II. It is not possible to build a recursive-descent parser to recognize the grammar: S → Sa|a. III. In general, top-down parsers are able to recognize a greater number of grammars than bottom-up parsers. IV. Bottom-up parsers use a stack and a finite automaton to help validate the syntax of a program. Select the correct alternative. a) Only statements I and II are correct. b) Only statements I and III are correct. c) Only statements III and IV are correct. d) Only statements I, II and IV are correct. e) Only statements II, III and IV are correct. Let the languages L1 = a^ib^nc^m/i, n,m ≥ 0 and L2 = a^nb^mc^id^k/i, n, k,m ≥ 0, with i = m or n = m. Based on this information, it is correct to state: a) L1∩ L2 is accepted by a non-deterministic finite automaton. b) L1.L2, that is, the concatenation of the languages L1 and L2 is not context-free. c) L2 is accepted by a deterministic pushdown automaton. d) L1∪ L2 is accepted by a finite automaton with at least 6 states. e) L1∩ L2 has a generative context-free grammar. Regarding languages and their acceptors, consider the following statements. I. {ww^(rev) / w∈{a,b}*} is accepted by a deterministic pushdown automaton. II. {wcw^(rev) / w∈{a,b}*} is accepted by a nondeterministic finite automaton. III. {a,b}*-{ww / w∈{a,b}*} is accepted by a nondeterministic pushdown automaton. IV. {M / M is M.T. and M for} is accepted by a nondeterministic Turing machine. Select the correct alternative. a) Only statements I and II are correct. b) Only statements II and IV are correct. c) Only statements III and IV are correct. d) Only statements I, II and III are correct. e) Only statements I, III and IV are correct. Based on your knowledge of sequential circuit design, consider the following statements. I. The design of sequential circuits using flip-flops is critical due to the problem known as flip-flop transparency. II. Since a flip-flop is known to be sensitive to one of the clock edges, the time the clock remains high or low is no longer critical to the operation of the sequential circuit. III. Setup time is the time during which the input must be kept stable before the clock turns on. IV. A D-type flip-flop can be implemented with two D-type latches or with one D-type latch and an edge detector circuit. Select the correct alternative. hints: Setup time is the minimum time before the clock edge during which the input signal must remain stable for proper sampling by the flip- flop. A D-type flip-flop can be built using two D-type latches (one master and one slave) or with one D-type latch and an edge detector circuit. a) Only statements I and IV are correct. b) Only statements II and III are correct. c) Only statements III and IV are correct. d) Only statements I, II, and III are correct. e) Only statements I, II and IV are correct. |
Report abuse