Write regular expressions of the following languages- The set of strings that start and end with the same symbols 01. Σ = {0,1,2} The set of strings that contain both substrings ‘101’ and ‘000’. Σ =...




  •  Write regular expressions of the following languages-




    1. The set of strings that start and end with the same symbols 01. Σ = {0,1,2}

    2. The set of strings that contain both substrings ‘101’ and ‘000’. Σ = {0,1}

    3. The set of strings having 0 at every 3rd position from the beginning. Σ = {0,1}. For example- 000, 010, 0100100, 110110,etc.

    4. The set of strings that do not contain substring ‘10’. Σ = {0,1}

    5. The set of strings that do not end with ‘01’. Σ = {0,1}






  •  Following is an example of different ways one can declare variables in some programming language.
    Write down the regular expression that can generate such variable declarations.
    Assume that-






    1. All variable names areat most five (previously written asexactly five; both will be considered correct) characters long.

    2. Variable names can contain only small letters [a-z], digits [0-9], and two special characters $ (dollar) and _ (underscore).

    3. $ sign can only be used at the beginning.

    4. No names can start with digits.

    5. The variable types areinteger, real, char, andBoolean only.

    6. The word ‘var’ which denotes variable is optional.

    7. Ignore any whitespace (space, tab, newline, etc.)

    8. Infer the rest of the rules from the code snippets below-

      var int1 : integer;




      var foo_1 : boolean;




      var f2 : real;




      _ind: char;




      x, y, z: integer;




Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here