0% found this document useful (0 votes)
15 views

Recursive Definition of A Language

Uploaded by

Shamsul Bashar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Recursive Definition of A Language

Uploaded by

Shamsul Bashar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Recursive definition of a language

It is one of the language defining methods. In this method, we simply describe the language with
three steps/rules.

The following three steps are used in recursive definition.

1. Some basic words are specified in the language.


2. Rules for constructing more words are defined in the language.
3. No strings except those constructed in above, are allowed to be in the language.

Example:

Defining language of INTEGER

Step 1: 1 is in INTEGER.

Step 2: If x is in INTEGER then x+1 and x-1 are also in INTEGER.

Step 3: No strings except those constructed in above, are allowed to be in INTEGER.

Example:

Defining language of EVEN

Step 1: 2 is in EVEN.

Step 2: If x is in EVEN then x+2 and x-2 are also in EVEN.

Step 3: No strings except those constructed in above, are allowed to be in EVEN.

Example:

Defining the language factorial

Step 1: As 0!=1, so 1 is in factorial.

Step 2: n!=n*(n-1)! is in factorial.

Step 3: No strings except those constructed in above, are allowed to be in factorial.


Example: Defining the language PALINDROME

Step 1: a and b are in PALINDROME

Step 2: if x is palindrome, then s(x) Rev(s) and xx will also be palindrome, where s belongs to Σ*

Step 3: No strings except those constructed in above, are allowed to be in palindrome

You might also like