בנייה ופישוט דקדוקים הפקולטה למדעי המחשב אוטומטים ושפות פורמליות ( 236353) תרגיל מספר 9.

Slides:



Advertisements
Similar presentations
L ECTURE 3 T HEORY OF AUTOMATA. E QUIVALENT R EGULAR E XPRESSIONS Definition Two regular expressions are said to be equivalent if they generate the same.
Advertisements

AB 11 22 33 44 55 66 77 88 99 10  20  19  18  17  16  15  14  13  12  11  21  22  23  24  25  26  27  28.
Dept. of Computer Science & IT, FUUAST Automata Theory 2 Automata Theory VII.
Regular Grammars Formal definition of a regular expression.
צורה נורמלית של גרייבך הפקולטה למדעי המחשב אוטומטים ושפות פורמליות ( ) תרגיל מספר 11.
Strings and Languages Operations
אוטומט מחסנית הפקולטה למדעי המחשב אוטומטים ושפות פורמליות ( ) תרגיל מספר 11.
פישוט דקדוקים הפקולטה למדעי המחשב אוטומטים ושפות פורמליות ( ) תרגיל מספר 10.
א " ב, מילים, ושפות הפקולטה למדעי המחשב אוטומטים ושפות פורמליות ( ) תרגיל מספר 1.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
צורות נורמליות הפקולטה למדעי המחשב אוטומטים ושפות פורמליות ( ) תרגיל מספר 10.
א " ב, מילים, ושפות הפקולטה למדעי המחשב אוטומטים ושפות פורמליות ( ) תרגיל מספר 1.
הפקולטה למדעי המחשב אוטומטים ושפות פורמליות (236353)
Case-Level Research Designs
Algebraic Properties: The Rules of Algebra Be Cool - Follow The Rules!
Blood Type Booklet.
Second lecture REGULAR EXPRESSION. Regular Expression.
CSCI3130: Formal Languages and Automata Theory Tutorial 4 Tutor: William Chow.
Lexical Analysis CSE 340 – Principles of Programming Languages Fall 2015 Adam Doupé Arizona State University
Whole numbers and numeration Math 123 September 17-19, 2008.
1 Language Definitions Lecture # 2. Defining Languages The languages can be defined in different ways, such as Descriptive definition, Recursive definition,
תרגול 13 חזרה 1. Exam example 8 public class Stam { private char x; public Stam() { this.x = '*'; } public Stam (char c) { this.x = c; } public Stam getStam()
Drill #2 Evaluate each expression if a = 6, b = ½, and c =
Module 2 How to design Computer Language Huma Ayub Software Construction Lecture 8.
L ECTURE 3 Chapter 4 Regular Expressions. I MPORTANT T ERMS Regular Expressions Regular Languages Finite Representations.
Properties of Addition and Multiplication. Commutative Property In the sum you can add the numbers in any order. a+b = b+a In the product you can multiply.
Warm ups. Return Quizzes Let’s go over them!! 9-8 Special Products Objective: To identify and expand the three special products.
Introduction to Theory of Automata By: Wasim Ahmad Khan.
Grammar G = (V N, V T, P, S) –V N : Nonterminal symbols –V T : Terminal symbols V N  V T = , V N ∪ V T = V – P : a finite set of production rules α 
Properties and Mental Computation p. 80. Math talk What are some math properties that we use? Why do you think we have them? Do you ever use them?
1 Simplification of Context-Free Grammars Some useful substitution rules. Removing useless productions. Removing -productions. Removing unit-productions.
1.3 – Properties of Real Numbers. Real Numbers 1.3 – Properties of Real Numbers.
1 Chapter 6 Simplification of CFGs and Normal Forms.
Figure **: Adjusted average student learning score against unit cost Unit Cost (fcfa) Average adjusted student learning score.
Lecture # 4.
Lecture 2 Theory of AUTOMATA
1 Chapter 3 Regular Languages.  2 3.1: Regular Expressions (1)   Regular Expression (RE):   E is a regular expression over  if E is one of:
1 Strings and Languages Lecture 2-3 Ref. Handout p12-17.
Warm ups. Return Quizzes Let’s go over them!! 9-8 Special Products Objective: To identify and expand the three special products.
Lecture 03: Theory of Automata:2014 Asif Nawaz Theory of Automata.
Recap Lecture 3 RE, Recursive definition of RE, defining languages by RE, { x}*, { x}+, {a+b}*, Language of strings having exactly one aa, Language of.
CSE 589 Applied Algorithms Spring 1999
COP4620 – Programming Language Translators Dr. Manuel E. Bermudez
Theory of Computation Lecture #
Lecture # 2.
Implementation of Haskell Modules for Automata and Sticker Systems
Revision for year 7.
Regular Languages, Regular Operations, Closure
Lexical Analysis CSE 340 – Principles of Programming Languages
Grammars Module 03.2 COP4020 – Programming Language Concepts Dr. Manuel E. Bermudez.
Regular Expressions (Examples)
PROGRAMMING LANGUAGES
Algebra substitution.
تصنيف التفاعلات الكيميائية
Boolean Algebra.
Introduction to Programming in C
Recap lecture 29 Example of prefixes of a language, Theorem: pref(Q in R) is regular, proof, example, Decidablity, deciding whether two languages are equivalent.
Algebra 1 Section 13.4.
Jeopardy Slopes and Lines Exponents Radicals $100 $ $100 $100
Objective Multiply two binomials..
Математици-юбиляри.
MA/CSSE 474 Theory of Computation Minimizing DFSMs.
Permutations and Combinations
Properties of Numbers Lesson 1-3.
Practice makes perfect!
Turing -Recognizable vs. -Decidable
BETONLINEBETONLINE A·+A·+
CSC312 Automata Theory Lecture # 3 Languages-II.
Recap Lecture 3 RE, Recursive definition of RE, defining languages by RE, { x}*, { x}+, {a+b}*, Language of strings having exactly one aa, Language of.
Properties of Numbers Review Problems.
Presentation transcript:

בנייה ופישוט דקדוקים הפקולטה למדעי המחשב אוטומטים ושפות פורמליות ( ) תרגיל מספר 9

2 בניית דקדוקים – דוגמא 1 בנו דקדוק לשפה : L = {(ab) n c 3n |n  0 } פתרון : הדקדוק : G = S  abSccc | 

3 בניית דקדוקים – דוגמא 2 בנו דקדוק לשפה : L = {a n ba m ba n+m |n,m  0 } פתרון : הדקדוק : G = A  aAa | bB B  aBa | b

4 שלבי הפישוט 1. זריקת משתנים מיותרים 2. ביטול חוקי -  3. זריקת משתנים מיותרים 4. ביטול חוקי יחידה 5. זריקת משתנים מיותרים 1. זריקת משתנים שאינם ניתנים לגזירה טרמינלית 2. זריקה משתנים שאינם ניתנים להשגה ממשתנה התחלתי

5 דוגמא 9.E  CaD 10.E  FDaJ 11.F  D 12.F  C 13.H  aBC 14.H  bH 15.I  aab 16.E  a 1. S  Aa 2. A  Ab 3. A  BC 4. B  ε 5. B  BBAa 6. B  I 7. C  ε 8. A  EaD פשטו את הדקדוק הבא :

6 שלב 1 : זריקת משתנים מיותרים 9.E  CaD 10.E  FDaJ 11.F  D 12.F  C 13.H  aBC 14.H  bH 15.I  aab 16.E  a 1. S  Aa 2. A  Ab 3. A  BC 4. B  ε 5. B  BBAa 6. B  I 7. C  ε 8. A  EaD a. זריקת משתנים שאינם ניתנים לגזירה טרמינלית :

7 שלב 1 : זריקת משתנים מיותרים 7.C  ε 8.F  C 9.H  aBC 10.H  bH 11.I  aab 12.E  a 1. S  Aa 2. A  Ab 3. A  BC 4. B  ε 5. B  BBAa 6. B  I b. זריקת משתנים שאינם ניתנים להשגה מ - S: המשתנים הניתנים להשגה : SAB CI

8 שלב 2 : ביטול חוקי -  2. ביטול חוקי -  : 1.S  Aa 2.A  Ab 3.A  BC 4.B  ε 5.B  BBAa 6.B  I 7.C  ε 8.I  aab משתנים אפיסים : B C A | a | b | B | C | BAa | Aa | a | BBa | Ba

9 שלב 3 : זריקת משתנים מיותרים 1. S  Aa | a 2. A  Ab | b | BC | B | C 3. B  BBAa | BAa | Aa | a | BBa | Ba | I 4. I  aab a. זריקת משתנים שאינם ניתנים לגזירה טרמינלית :

10 שלב 3 : זריקת משתנים מיותרים 1. S  Aa | a 2. A  Ab | b | B 3. B  BBAa | BAa | Aa | a | BBa | Ba | I 4. I  aab b. זריקת משתנים שאינם ניתנים להשגה מ - S: אין כאלה

11 שלב 4 : ביטול חוקי יחידה 1. S  Aa | a 2. A  Ab | b | B 3. B  BBAa | BAa | Aa | a | BBa | Ba | I 4. I  aab BBAa | BAa | Aa | a | BBa | Ba | I aab

12 שלב 5 : זריקת משתנים מיותרים 1. S  Aa | a 2. A  Ab | b | BBAa | BAa | Aa | a | BBa | Ba | aab 3. B  BBAa | BAa | Aa | a | BBa | Ba | aab 4. I  aab a. זריקת משתנים שאינם ניתנים לגזירה טרמינלית : אין כאלה

13 שלב 5 : זריקת משתנים מיותרים 1. S  Aa | a 2. A  Ab | b | BBAa | BAa | Aa | a | BBa | Ba | aab 3. B  BBAa | BAa | Aa | a | BBa | Ba | aab 4. I  aab b. זריקת משתנים שאינם ניתנים להשגה מ - S: וקיבלנו את הדקדוק המפושט !