# Confusion related to the type 3 grammar

I have this confusion. Lets say I have language produced by type 3 grammar such that

L(G1) = <Vn1,Vt,P1,S1>


I need to find a type3 grammar G3 such that

L(G3) = [L(G1)]*

I can't use S3→S3S1 and S3→null rule in this new G3, because the production is not type 3 as well. So what should I do?

-
Are Vn1, Vt, P1, S1 just weirdly named terminals or do they stand for something? –  Karolis Juodelė Sep 24 '12 at 19:34
they are the set of non-terminals, the set of terminals, the set of productions, and the initial symbol, respectively. –  Mike Sep 24 '12 at 20:12

You have to arrange things so that whenever $G_1$ would generate a word, $G_3$ will either generate that word, or generate that word and start over. The obvious way to do that is to add to each production $X\to a$ of $G_1$ the production $X\to aS_3$. In addition, you will have to change every instance of $S_1$ to $S_3$ and add the production $S_3\to\lambda$, if $S_1\to\lambda$ wasn’t in the original grammar.

-
Is the null character in type 3 grammar? –  Mike Sep 24 '12 at 20:10
@Mike: Yes: the type $3$ grammars are the regular grammars, which allow null productions. –  Brian M. Scott Sep 24 '12 at 20:16
Thank you for the help –  Mike Sep 24 '12 at 20:19
@Mike: You’re very welcome. –  Brian M. Scott Sep 24 '12 at 20:21
If you have a language $L$ defined by grammar $$S \to a \\ S \to b$$ the language $L^*$ can be defined by $$S \to a \\ S \to b \\ S \to aS \\ S \to bS$$
Almost, but you also need to include a production to generate the empty string (which, of course, will always be in $L^*$). As you, I'm still waiting for definitions of Vn1, Vt, P1, and S1. –  Rick Decker Sep 24 '12 at 19:43
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5579286813735962, "perplexity": 724.4883200505103}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-15/segments/1398223201753.19/warc/CC-MAIN-20140423032001-00601-ip-10-147-4-33.ec2.internal.warc.gz"}