Recursive definition of languages

The following three steps are used in recursive definition

Some basic words are specified in the language.

Rules for constructing more words are defined in the language.

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.

 

 

 

Previous

 

 

TOC

 

 

Next