L ANGUAGE C ONCEPTS : F ORMAL M ODEL FOR L ANGUAGES Theory of Computer Akram Salah.

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

YES-NO machines Finite State Automata as language recognizers.
1 CSCI-2400 Models of Computation. 2 Computation CPU memory.
Fall 2005 CSE 467/567 1 Formal languages regular expressions regular languages finite state machines.
CS 3240 – Chuck Allison.  A model of computation  A very simple, manual computer (we draw pictures!)  Our machines: automata  1) Finite automata (“finite-state.
Topics Automata Theory Grammars and Languages Complexities
Fall 2006Costas Busch - RPI1 Languages. Fall 2006Costas Busch - RPI2 Language: a set of strings String: a sequence of symbols from some alphabet Example:
Fall 2004COMP 3351 Languages. Fall 2004COMP 3352 A language is a set of strings String: A sequence of letters/symbols Examples: “cat”, “dog”, “house”,
Theory Of Automata By Dr. MM Alam
Regular Language & Expressions. Regular Language A regular language is one that a finite state machine (fsm) will accept. ‘Alphabet’: {a, b} ‘Rules’:
Chapter 2 Languages.
Lexical Analysis CSE 340 – Principles of Programming Languages Fall 2015 Adam Doupé Arizona State University
Theory Of Automata By Dr. MM Alam
Lecture # 1 (Automata Theory)
Theory of Automata.
1 Welcome to ! Theory Of Automata. 2 Text and Reference Material 1.Introduction to Computer Theory, by Daniel I. Cohen, John Wiley and Sons, Inc., 1991,
Module 2 How to design Computer Language Huma Ayub Software Construction Lecture 7 1.
CSC312 Automata Theory Lecture # 2 Languages.
CSC312 Automata Theory Lecture # 2 Languages.
Costas Busch - LSU1 Languages. Costas Busch - LSU2 Language: a set of strings String: a sequence of symbols from some alphabet Example: Strings: cat,
L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS  Pre-Requisites  No Pre-Requisite  Text book  Introduction to Computer Theory by Daniel I.A. Cohen 
Lecture Two: Formal Languages Formal Languages, Lecture 2, slide 1 Amjad Ali.
Introduction to Theory of Automata
Two examples English-Words English-Sentences alphabet S ={a,b,c,d,…}
1 Chapter 1 Introduction to the Theory of Computation.
Lecture # 3 Regular Expressions 1. Introduction In computing, a regular expression provides a concise and flexible means to "match" (specify and recognize)
Introduction to Language Theory
Module 2 How to design Computer Language Huma Ayub Software Construction Lecture 8.
Lecture-2 Recap Lecture-1
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet:
L ECTURE 3 Chapter 4 Regular Expressions. I MPORTANT T ERMS Regular Expressions Regular Languages Finite Representations.
Introduction to Theory of Automata By: Wasim Ahmad Khan.
Regular Grammars Chapter 7. Regular Grammars A regular grammar G is a quadruple (V, , R, S), where: ● V is the rule alphabet, which contains nonterminals.
Strings and Languages CS 130: Theory of Computation HMU textbook, Chapter 1 (Sec 1.5)
Cardinality with Applications to Computability Lecture 33 Section 7.5 Wed, Apr 12, 2006.
CSC312 Automata Theory Lecture # 3 Languages-II. Formal Language A formal language is a set of words—that is, strings of symbols drawn from a common alphabet.
Recursive Definations Regular Expressions Ch # 4 by Cohen
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني Theory of Automata We will arrive at what we may believe to be the most powerful machine possible. When.
Three Basic Concepts Languages Grammars Automata.
Lecture # Book Introduction to Theory of Computation by Anil Maheshwari Michiel Smid, 2014 “Introduction to computer theory” by Daniel I.A. Cohen.
Strings and Languages Denning, Section 2.7. Alphabet An alphabet V is a finite nonempty set of symbols. Each symbol is a non- divisible or atomic object.
Theory of computation Introduction theory of computation: It comprises the fundamental mathematical properties of computer hardware, software,
Lecture # 4.
Lecture 2 Theory of AUTOMATA
1 Strings and Languages Lecture 2-3 Ref. Handout p12-17.
Lecture 02: Theory of Automata:2014 Asif Nawaz Theory of Automata.
Set, Alphabets, Strings, and Languages. The regular languages. Clouser properties of regular sets. Finite State Automata. Types of Finite State Automata.
CHAPTER TWO LANGUAGES By Dr Zalmiyah Zakaria.
By Dr.Hamed Alrjoub. 1. Introduction to Computer Theory, by Daniel I. Cohen, John Wiley and Sons, Inc., 1991, Second Edition 2. Introduction to Languages.
Lecture 01: Theory of Automata:2013 Asif Nawaz Theory of Automata.
Languages and Strings Chapter 2. (1) Lexical analysis: Scan the program and break it up into variable names, numbers, etc. (2) Parsing: Create a tree.
Chapter 2. Formal Languages Dept. of Computer Engineering, Hansung University, Sung-Dong Kim.
Cardinality with Applications to Computability
Theory of Computation Lecture #
Lecture # 2.
Language Theory Module 03.1 COP4020 – Programming Language Concepts Dr. Manuel E. Bermudez.
Lexical Analysis CSE 340 – Principles of Programming Languages
Lecture 1 Theory of Automata
Languages Prof. Busch - LSU.
Languages Costas Busch - LSU.
Mathematical Notions and Terminology
COP4620 – Programming Language Translators Dr. Manuel E. Bermudez
Chapter 7 Regular Grammars
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.
Specification of tokens using regular expressions
Introduction Reading: Sections 1.5 – 1.7.
CSC312 Automata Theory Lecture # 2 Languages.
Welcome to ! Theory Of Automata Irum Feroz
LECTURE # 07.
Languages Fall 2018.
Presentation transcript:

L ANGUAGE C ONCEPTS : F ORMAL M ODEL FOR L ANGUAGES Theory of Computer Akram Salah

L ANGUAGE C ONCEPTS Language is a set of words, each word is a string of characters, each character is an element in the language alphabet. A language is defined over an alphabet, a set of elementary units. The most basic units of a language is its alphabet. 2

L ANGUAGE C ONCEPTS  : a set of primitives, called alphabet Fundamental components Fundamental units L : a set of strings, called words L = {w | w is a string from  } 3

L ANGUAGE C ONCEPTS  is called null, it is an empty string A string that has no characters An alphabet cannot be empty A language, L, set of words, may have as an element . A language, a set of words, is finite. A language can not be infinite. 4

L ANGUAGE C ONCEPTS If  ={x}, we can define Closure of  is a language contains all possible strings (whether they are meaningful or not) L = {x, xx, xxx, xxxx, ….} If we want to include the null  to the closure of  we denote it as  * 5

L ANGUAGE C ONCEPTS  = {a, b, c}  * = { , a, b, c, aa, ab, ac, ba, bb, ca, cb, cc, aaa, …..} If S = {aa, b} S* = {  plus any word composed of factors of aa and b} = { , b, aa, bb, aab, baa, aaa, aaaa, aabb, …} S + = closure without  = {b, aa, bb, aab, baa, aaa, aaaa, aabb, …} 6

L ANGUAGE C ONCEPTS The English alphabet,  = {a, b, c, …, z} English, L = {cat, dog, book, boy, computer, program, …} Those are the words in English dictionary. The dictionary must be finite The عربي alphabet  = { ا, ب, ت,..., ي } L = { قط, كلب, كتاب, ولد, حاسب, برنامج,.... } 7

L ANGUAGE C ONCEPTS  = { English words (in the dictionary) plus all punctuation marks}  = {L U {“ “, :, ;, (, ), -,,,, …}} We can construct I ate one apple. I went to school. He called Aly, his uncle. Sentences are series (concatenation) of elements of  8

L ANGUAGE C ONCEPTS  = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} A finite set of digits L = {23, 180, 4427,..} A set of numbers Think (assignment) Define a language of phone numbers. Define a language of car license numbers. 9

L ANGUAGE C ONCEPTS Word functions Concatenate: w 1 w 2 w 1 = boat, w 2 = house w 3 = w 1 w 2 = boathouse w 4 = w 2 w 1 = houseboat 10

L ANGUAGE C ONCEPTS Length, returns the number of characters in a word w 1 = cat w 2 = computer length(w 1 ) = 3 length(w 2 ) = 7 11

L ANGUAGE C ONCEPTS reverse: returns a string contains the same letters in w in a reversed order. w 1 = cat w 2 = computer w 3 = 7641 reverse(w 1 ) = tac reverse(w 2 ) = retupmoc reverse(w 3 ) =

L ANGUAGE C ONCEPTS Length(w 1 w 2 ) = length(w 1 ) + length(w 2 ) Length(w 1 ) = length(reverse(w 1 )) Reverse(w 1 w 2 ) =/= w 2 w 1 13