Download presentation
Presentation is loading. Please wait.
Published byHugh Davis Modified over 6 years ago
1
CST229 Week 6 Questions or concerns? Homework #4 due
Hand back Homework #3 Reading: Chapters 12&13 Quick note about Lab#1 Lab#1 due tomorrow at midnight via Revised course schedule Quick look at Chapter 12 Test#1
2
Three main topics Languages Machines Grammar
Notations for defining the language Set notation Recursive definitions Regular expressions (for a specific type of language – regular languages) Definitions serve as a recognizer or a generator Machines Recognizer – given a definition and a string, the machine can tell if the string is in the language Finite Automata - Deterministic Finite Automata (ch. 5) Nondeterministic Finite Automata (ch. 7) – optional Grammar Just another notation for defining languages. Unlike regular expressions which only define regular languages, grammar is more flexible and more general.
3
Grammar Language Hierarchy (Noam Chomsky) based on complexity of structure Regular – no nesting Context-Free – handles nesting structures. Syntax only, no meaning Context-Sensitive – adds semantic information Recursive enumerable – more complex, closer to natural languages
4
Recursive Enumerable Context-sensitive Context-Free Regular languages
5
Grammar Two different notations, developed independent of each other, but very similar Chomsky Backus / Naur (John Backus / Peter Naur) Form Notation for defining languages, particularly programming languages. Recursive by nature (similar to recursive definitions) Nondeterministic by nature We use grammar as a recognizer/generator just like other language definitions
6
Grammar Let’s start with a recursive definition
Lp = string over {a,b} where w = wr Base: is in Lp, so is a & b Rec: if x is in Lp, then so is axa and bxb
7
Grammar Another notation S -> S -> a S -> b S -> aSa
S -> bSb
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.