Difference between derivation and reduction in system software with example
Answers
In system software studies, the replacement of non-terminal symbols according to the given production rule is called as Derivation. It is of 2 types – Leftmost derivation and Rightmost derivation.
Reduction is the process of replacement of the string or part of a string by non-terminal according to the production rule.
Derivation
Derivation is the replacement of non-terminal symbols in accordance with the given production rule. There are two types of derivation. They are leftmost derivation and rightmost derivation.
Reduction
Reduction is the process of replacement of a string or part of a string by non-terminal in accordance with the production rule.
For example:
Rules for English Language1) <Sentence> <NP><VP>2) <NP> <article><noun>3) <VP> <verb>4) <VP> <verb><adverb>5) <article> The6) <noun> student7) <verb> studies8) <adverb> hard9) <adverb> slowly
Derivation. Structure Rules applied. <Sentence>. <NP><VP> (1). <article><noun><VP> (2). <article><noun> <verb><adverb> (4). The <noun> <verb><adverb> (5). The student <verb><adverb> (6). The student studies <adverb> (7). The student studies hard (8)
Reduction. Structure Rules applied. The student studies hard. <article> student studies hard (5). <article><noun> studies hard (6). <article><noun> <verb> hard (7). <article><noun> <verb> <adverb> (8). <NP> <verb> <adverb> (2). <NP><VP> (4). <Sentence> (1)