diff --git a/task2_epi.txt b/task2_epi.txt new file mode 100644 index 0000000..a9a67a8 --- /dev/null +++ b/task2_epi.txt @@ -0,0 +1,29 @@ +__author__ = "7987847, Werner, 7347119, Fajst, 7735965, Melikidze" +================================================================================================================ + +a) The context-free grammar generates words that consist of variables (V), which can be any lowercase letter from a to z, + and operators (O), which can be +, -, *, or /. These variables and operators are combined using parentheses (T). + Specifically, the grammar generates words by either replacing the start symbol T with a variable (V), + or by replacing T with an opening parenthesis followed by a combination of a T, an operator (O), and another T, followed by a closing parenthesis. + +b) The word "(a + ((x - z) / y))" can be generated by the context-free grammar. One possible order of derivation rules to create this word is as follows: + + T -> (TOT) + T -> V + O -> + + T -> (TOT) + T -> (TOT) + T -> V + O -> - + T -> V + O -> / + T -> V + +The word "((p) + (o))" can also be generated by the context-free grammar. One possible order of derivation rules to create this word is as follows: + + T -> (TOT) + T -> V + O -> + + T -> (TOT) + T -> V +