Theory of computation ic-2k20-13 Anushka joshi viii semester

Published on Slideshow
Static slideshow
Download PDF version
Download PDF version
Embed video
Share video
Ask about this video

Scene 1 (0s)

[Audio] Hello and welcome to this presentation on formal languages and grammars..

Scene 2 (10s)

[Audio] Today we will explore various aspects of language structure, including a subset of English grammar, postfix notation, grammar, extended Backus-naur form, BNF, and examples with derivations..

Scene 3 (24s)

[Audio] Let's start with the rules for constructing valid sentences. Sentences must have a subject and a predicate, both agreeing in number and tense. Proper punctuation, including capitalization at the beginning and appropriate punctuation the at the end, is crucial. Additionally sentences should be grammatically correct and coherent. We then delve into a subset of English grammar covering noun phrases, NP verb phrases, VP, and prepositional phrases p p. For instance a sentence consists of a noun phrase followed by an intransitive verb phrase and another noun phrase. Valid sentences. Examples. We illustrate these rules with examples of valid sentences like John runs, the cat jumps, and the book is on the table.

Scene 4 (1m 13s)

[Audio] Question one validation of sentences. We proceed to validate sentences using a set of productions. For example, the happy hare runs is broken down into a noun phrase, intransitive verb phrase, and another noun phrase each following specific grammar rules..

Scene 5 (1m 54s)

[Audio] In postfix notation, also known as reverse Polish notation (RPN), operators are placed after their operands. To evaluate expressions, you can use a stack to keep track of the operands. Here are some examples:1. *Addition*: - Expression: 45+ - Derivation: - Push 4 onto the stack: 4 - Push 5 onto the stack: 4, 5 - Pop 5 and 4, add them, and push the result (9) onto the stack: 9 - Result: 92. *Subtraction*: - Expression: 83- - Derivation: - Push 8 onto the stack: 8 - Push 3 onto the stack: 8, 3 - Pop 3 and 8, subtract 3 from 8, and push the result (5) onto the stack: 5 - Result: 53. *Multiplication*: - Expression: 26* - Derivation: - Push 2 onto the stack: 2 - Push 6 onto the stack: 2, 6 - Pop 6 and 2, multiply them, and push the result (12) onto the stack: 12 - Result: 124. *Division*: - Expression: 102/ - Derivation: - Push 1 onto the stack: 1 - Push 0 onto the stack: 1, 0 - Push 2 onto the stack: 1, 0, 2 - Pop 2 and 0, divide 2 by 0, and push the result (infinity or an error) onto the stack: ∞ or error - Result: ∞ or errorIn these examples, the stack is used to hold operands until an operator is encountered. The operator then operates on the top operands on the stack, and the result is pushed back onto the stack for further operations..

Scene 6 (3m 47s)

[Audio] Question two derivation trees. To visually represent the process of generating sentences, we construct derivation trees. These trees show step by step production rules for sentences. Let's.

Scene 7 (4m 19s)

[Audio] create derivation trees for sentences like the tortoise passes the hare..

Scene 8 (4m 37s)

[Audio] This EBNF grammar defines a signed decimal number as an optional sign followed by one or more digits. The sign can be either '+' or '-', and a digit is any decimal digit from 0 to 9.Valid examples of signed decimal numbers:- +123- -456- 789Invalid examples:- 12.34 (contains a decimal point)- audio script for PPT slide (contains non-digit characters).

Scene 9 (5m 15s)

[Audio] Question three phrase structure grammar. Moving on we introduce phrase structure grammar, a formal grammar describing language structure. We implement a phrase structure grammar for signed decimal numbers using code, segments and parser. Question three constructing a phrase structure grammar.

Scene 10 (5m 38s)

[Audio] More on phrase structure grammar examples. Expanding our exploration,.

Scene 11 (5m 50s)

[Audio] Question four extended Backus-naur form BNF. Next we introduce extended Backus-naur form BNF, a notation allowing optional elements, repetitions, and more. We present production rules for decimal numerals in BNF.

Scene 12 (6m 27s)

[Audio] We define the grammar rules for signed decimal numbers in backus-naur form BNF and illustrate it. The rules cover signs, non-negative integers, decimal fractions, and positive integers..

Scene 13 (6m 45s)

[Audio] we provide production rules in BNF for different identifier scenarios, including lowercase letters, uppercase letters, and combinations with digits and underscores..

Scene 14 (7m 22s)

[Audio] e BNF. For C programming language identifiers, we extend our e BNF exploration to cover identifiers in the C programming language, incorporating variations like starting with a letter or an underscore, and including alphanumeric characters. Postfix notation..

Scene 15 (8m 3s)

[Audio] extended Backus-naur form BNF. Next we introduce extended Backus-naur form BNF, a notation allowing optional elements, repetitions, and more. We present production rules for decimal numerals in BNF specifying optional sign, non-negative integer, and decimal fraction..

Scene 16 (8m 26s)

[Audio] postfix notation, an alternative to infix notation in postfix notation, operators.

Scene 17 (8m 58s)

[Audio] come after operands, contrasting with traditional infix notation used in mathematics and programming languages. Question six postfix notation. Examples. We then analyze strings in postfix notation, determining if they are generated by the provided grammar..

Scene 18 (9m 29s)

[Audio] We illustrate steps used to generate or not generate strings like ABC plus and XYZ. Question seven infix notation with BNF. Exploring infix notation, we describe its syntax using backus-naur form. BNF..

Scene 19 (9m 48s)

e) ⟨expression⟩ ⟨term⟩ ⟨factor⟩⟨factor⟩⟨muloperator⟩ ⟨factor⟩⟨expression⟩⟨muloperator⟩ ⟨factor⟩⟨term⟩⟨term⟩⟨addoperator⟩⟨muloperator⟩ ⟨factor⟩⟨factor⟩⟨factor⟩⟨addoperator⟩⟨muloperator⟩ ⟨identifier⟩⟨identifier⟩⟨identifier⟩⟨addoperator⟩⟨muloperator⟩ a d e − ∗ b) not generated.

Scene 20 (9m 56s)

[Audio] contrasting with traditional infix notation used in mathematics and programming languages..

Scene 21 (10m 21s)

[Audio] We illustrate steps used to generate or not generate strings like ABC plus and XYZ. Question seven infix notation with BNF. Exploring infix.

Scene 22 (10m 36s)

[Audio] automata construction In transitioning to automata, we construct a finite automaton for a pushdown automaton,.

Scene 23 (11m 7s)

[Audio] PDA and a Turing machine TM to accept specific language sets. We also verify strings against these automata..

Scene 24 (11m 58s)

[Audio] Turing machine. For language O one plus ten. We design a Turing machine to accept strings in the language O1C plus ten,.

Scene 25 (12m 38s)

[Audio] showcasing the steps taken by the machine in processing an input.

Scene 26 (12m 58s)

[Audio] PDA for CFG. Finally, we build a pushdown automaton PDA equivalent to a given context free grammar cfg..

Scene 27 (13m 38s)

[Audio] We test the PDA against a specific string to determine its acceptance..

Scene 28 (14m 11s)

[Audio] Conclusion and thank you. Thank you for joining us on this journey through formal languages and grammars. If you have any questions or would like further clarification, please feel free to reach out. We appreciate your time and attention..