[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-682507-105":3,"detail-sidebar-cat-0-en-105":80,"doc-detail-682507-en":130,"doc-similar-682507":152},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":73,"head_meta":75,"extra_data":77,"updated_unix":79},105,"en","formal-models-of-language-grammars","Formal Models of Language - Grammars","","Handout explains formal language theory using inductive definitions, alphabets, strings, and languages as subsets of Σ*. Covers how axioms and induction rules generate strings via derivations represented as finite rooted trees, illustrating an example for abb. Introduces phrase structure (generative) grammars, defining the tuple G = (N, Σ, S, P), describing non-terminals, terminals, start symbol, and rewrite rules, then shows how rewrite expansions construct the smallest strings of L(G).",{"@graph":14,"@context":72},[15,34,55],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/research-report/","Research & Report",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/formal-models-of-language-grammars/682507/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/formal-models-of-language-grammars/682507.png","ImageObject",300,407,{"name":42,"@type":43},"Logic","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-11","2026-11-06",true,{"@type":52,"interactionType":53,"userInteractionCount":33},"InteractionCounter",{"@type":54},"ViewAction",{"@type":56,"mainEntity":57},"FAQPage",[58,64,68],{"name":59,"@type":60,"acceptedAnswer":61},"How is a formal language defined over an alphabet Σ?","Question",{"text":62,"@type":63},"A formal language over Σ is any subset of Σ* (the set of all finite strings over Σ).","Answer",{"name":65,"@type":60,"acceptedAnswer":66},"What is a derivation in the inductive approach to defining languages?",{"text":67,"@type":63},"A derivation of a string u in L is a finite rooted tree whose root is u, whose internal nodes are rule conclusions supported by their children as hypotheses, and whose leaves are axioms.",{"name":69,"@type":60,"acceptedAnswer":70},"What defines a phrase structure (generative) grammar G?",{"text":71,"@type":63},"A phrase structure grammar is given by G = (N, Σ, S, P), where N are non-terminals, Σ are terminals, S is the start non-terminal, and P is the set of rewrite (production) rules.","https://schema.org",{"og:url":32,"og:type":74,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":76,"canonical":32},"index,follow",{"doc_id":78,"site_id":7},682507,1793974312,{"code":4,"msg":81,"data":82},"success",[83,87,91,95,100,105,110,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":84,"show_sort_weight":85,"slug":86},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":88,"show_sort_weight":89,"slug":90},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":92,"show_sort_weight":93,"slug":94},"Exam",70,"exam",{"id":96,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},5,"Comic",60,"comic",{"id":101,"doc_module":4,"doc_module_name":25,"category_name":102,"show_sort_weight":103,"slug":104},6,"Technology",50,"technology",{"id":106,"doc_module":4,"doc_module_name":25,"category_name":107,"show_sort_weight":108,"slug":109},7,"Healthcare",40,"healthcare",{"id":111,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":112,"slug":113},8,30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":96,"slug":129},19,"General","general",{"code":4,"msg":81,"data":131},{"doc_id":78,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":111,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":33,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":117,"language":139,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":12,"update_tm":79,"read_time":103,"preview_page_count":26,"preview_urls":143},1099513958762,"https://ap-avatar.wpscdn.com/avatar/1000023916a998db790?x-image-process=image/resize,m_fixed,w_180,h_180&k=1784791008015729253","Formal Models of Language: Grammars Paula Buttery  \nThis handout provides details of the grammars used throughout the course and associated methods for parsing.  \n0. Refresher of Discrete Maths  \nIn the Formal Languages and Automata section of the Discrete Maths course we defined a formal language as a set of strings over an alphabet.  \nAlphabets An alphabet is specified by a finite set, Σ, whose ele  \nments are called symbols. Some examples are shown below:1 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} the 10-element set of decimal digits.  \n{a, b, c, ..., x, y, z} the 26-element set of lower case characters of written English.  \n{aardvark, ..., zebra} the 250,000-element set of words in the Oxford English Dictionary.2  \nStrings A string of length n over an alphabet Σ is an ordered ntuple of elements of Σ . And Σ∗ denotes the set of all strings over Σ of finite length.  \nIf Σ = {a, b} then ϵ, ba, bab, aab are examples of strings over Σ . If Σ = {a} then Σ∗ = {ϵ, a, aa, aaa, ... }  \nIf Σ = {cats, dogs, eat} then Σ∗ = {ϵ, cats, cats eat, cats eat dogs, ... }3  \nLanguages Given an alphabet Σ any subset of Σ∗ is a formal language over alphabet Σ .  \nIn Discrete Maths you inductively defined subsets of Σ∗ (languages) using axioms and rules. Below are some example axioms and rules for generating a language, L, over the alphabet Σ = {a, b}, that contains strings of an a followed by zero or more b’s, i.e.  \nL = {a, ab, abb, abbb, ... } .  \ndefinition of a formal language  \n1 Note that e.g. the set of natural numbers N = {0, 1, 2, 3, ...} cannot bean alphabet because it is infinite.  \n2 Note that the term alphabet is overloaded: in formal language theory it refers to the set of elements that can combine to form strings: these symbols can be numbers, characters, English words or anything else as long as they are all of the same type! When discussing natural languages, alphabet refers exclusively to the set of characters used for orthographic representations (i.e. writing down the language’s words); the term lexicon is then used to refer to the set that contains the language’s words as elements.  \n3 The spaces here are for readable delimitation of the symbols of the alphabet.  \ninductively defined languages  \nAxioms Axioms specify elements of Σ∗ that exist in L.  \n a  (a1)  \nInduction Rules Rules show hypotheses above the line and conclusions below the line (also referred to as children and parents respectively) . The following is a unary rule where u indicates some string in Σ∗:  \n u  (r1)  \nub  \nformal models of language: grammars 2  \nDerivations Given a set of axioms and rules for inductively defining a subset, L, of Σ∗, a derivation of a string u in L is: a finite rooted tree with vertexes that are elements of L such that: the root of the tree (towards the bottom of the page) is u itself; each vertex of the tree is the conclusion of a rule whose hypotheses are its children; each leaf of the tree is an axiom. Using our axiom and rule, the derivation for the string abb is shown below:  \n~~ ~~ (a1)  \n a  (r1)  \n ab  (r1)  \nabb  \nformal models of language: grammars 3  \n1. Phrase Structure Grammars  \nAnother way of generating a language is using a Phrase Structure grammar. Also referred to as a generative grammar, this formalism uses a set of rewrite rules or production rules to generate strings in the language.4 A phrase structure grammar over an alphabet Σ is defined by a tuple G = (N, Σ, S, P) . We refer to the language generated by grammar G as L(G) .  \n4 This is opposed to constraint-based grammars which allow all strings in Σ∗ that have not otherwise been constrained.  \nNon-terminals N: Non-terminal symbols may be rewritten using the rules of the grammar. We will denote the set of nonterminal symbols as Nwhere N ∩ Σ = ∅ . We generally use capital letters as non-terminals symbols.  \nTerminals Σ: Terminal symbols are elements of Σ and cannot be rewritten. We generally use lower case symbols to refer to terminals.  \nStart Symbol S: A distinguished ","cbCair6G3jgpGb3m","https://ap.wps.com/l/cbCair6G3jgpGb3m","pdf",325761,"English","# Refresher of Discrete Maths\n# Formal Languages and Automata\n## Alphabets\n## Strings\n## Languages\n# Inductively Defined Languages\n## Axioms and Induction Rules\n## Derivations\n# Phrase Structure Grammars\n## Non-terminals, Terminals, Start Symbol\n## Phrase Structure Rules\n## Generating Strings and Derivation Trees","[{\"question\":\"How is a formal language defined over an alphabet Σ?\",\"answer\":\"A formal language over Σ is any subset of Σ* (the set of all finite strings over Σ).\"},{\"question\":\"What is a derivation in the inductive approach to defining languages?\",\"answer\":\"A derivation of a string u in L is a finite rooted tree whose root is u, whose internal nodes are rule conclusions supported by their children as hypotheses, and whose leaves are axioms.\"},{\"question\":\"What defines a phrase structure (generative) grammar G?\",\"answer\":\"A phrase structure grammar is given by G = (N, Σ, S, P), where N are non-terminals, Σ are terminals, S is the start non-terminal, and P is the set of rewrite (production) rules.\"}]","Formal Models of Language - Grammars | PDF",[144,148],{"page_no":22,"url":145,"width":146,"height":147},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-08/bfa2a331e661e863d7b8498f035c9cdb.webp",983,1390,{"page_no":26,"url":149,"width":150,"height":151},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-08/617bee90d7c02626d557a3629d4c798c.webp",982,1388,{"list":153,"token":11},[154,161,168,175,182,189,196,203,210,217],{"doc_id":155,"doc_title":156,"file_type":137,"home_preview_img_url":157,"slug":158,"view_count":159,"category_name":29,"create_tm":160},234,"XNX Gas Detector Calibration Guide 2023","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229693727733/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=z9O%2BEG1IOLR1lXhvuvg%2B1UDRipc%3D","xnx-gas-detector-calibration-2023",7895,1776136863,{"doc_id":162,"doc_title":163,"file_type":137,"home_preview_img_url":164,"slug":165,"view_count":166,"category_name":29,"create_tm":167},227,"Sridevi Matka Chart Full Guide to Panel, Jodi & Pana Records","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229693727553/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=0Vx6ec8E0l05nkT%2BJR1B%2BYUDBQA%3D","sridevi-matka-chart-full-guide-to-panel-jodi-pana-records",6925,1776136851,{"doc_id":169,"doc_title":170,"file_type":137,"home_preview_img_url":171,"slug":172,"view_count":173,"category_name":29,"create_tm":174},167314,"Linear Algebra and Its Applications 6th edition Textbook by david c. lay","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229876163444/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=mWXonEi%2FbsR4XZckR1L19qKqaCM%3D","linear-algebra-and-its-applications-sixth-edition-david-c-lay-steven-r-lay-judi-j-mcdonald",5865,1788211707,{"doc_id":176,"doc_title":177,"file_type":137,"home_preview_img_url":178,"slug":179,"view_count":180,"category_name":29,"create_tm":181},32070,"Blueprint Pengelolaan Sumber Daya Manusia Kesehatan (SDMK) Tahun 2025–2029","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229758685683/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=JHJ3XO6E3N%2FGXpzNGvndrhBrPf4%3D","healthcare-human-resources-management-blueprint-sdmk-20252029",1292,1780779716,{"doc_id":183,"doc_title":184,"file_type":137,"home_preview_img_url":185,"slug":186,"view_count":187,"category_name":29,"create_tm":188},148514,"Developmental Biology - Twelfth Edition","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229868853261/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=FDFXFF5%2FIFdWicFKwylhAcTjO%2Fg%3D","developmental-biology-twelfth-edition",1250,1787780705,{"doc_id":190,"doc_title":191,"file_type":137,"home_preview_img_url":192,"slug":193,"view_count":194,"category_name":29,"create_tm":195},121,"Letter of Intent Sample for School","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229693418846/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=dB3rgdor3wdmbdTWejiowOgMwKg%3D","letter-of-intent-sample-for-school",1059,1776135210,{"doc_id":197,"doc_title":198,"file_type":137,"home_preview_img_url":199,"slug":200,"view_count":201,"category_name":29,"create_tm":202},129209,"Laboratory Manual for Principles of General Chemistry - J. A. Beran - 11th Edition","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229840760175/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=2925KB9WDjABstSb%2FSU1o2Q46IM%3D","laboratory-manual-for-principles-of-general-chemistry-j-a-beran-11th-edition",885,1786011673,{"doc_id":204,"doc_title":205,"file_type":137,"home_preview_img_url":206,"slug":207,"view_count":208,"category_name":29,"create_tm":209},117724,"The Trading Edge - Vivek Bajaj","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229834707110/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=iA0sA2E4qS%2BMY%2FjFgYD3wa8WqtI%3D","the-trading-edge-vivek-bajaj",874,1785678693,{"doc_id":211,"doc_title":212,"file_type":137,"home_preview_img_url":213,"slug":214,"view_count":215,"category_name":29,"create_tm":216},47709,"Stress, Appraisal, and Coping","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229799364477/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=NaZfWv5LsIxihfoeDCnOdjM3c9U%3D","stress-appraisal-and-coping",818,1783565401,{"doc_id":218,"doc_title":219,"file_type":137,"home_preview_img_url":220,"slug":221,"view_count":222,"category_name":29,"create_tm":223},23244,"The World Ahead 2026","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229716297903/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108159&Signature=LgcORSkXx19T%2FiT9RMMssau6V6Y%3D","the-world-ahead-2026",668,1777643490]