0% found this document useful (0 votes)
26 views18 pages

Theory of Automata: Lecture - 03 Spring 2021 Waqas Tariq Dar UOL

This document provides an overview of formal languages and how they are defined for communication with machines. It discusses that natural languages are informal while machines require formally defined languages. A formal language is defined by specifying its alphabet, words through rules of composition, and semantics. It also distinguishes between finite and infinite languages, with finite languages having a countable set of words that can be listed, while infinite languages have an uncountable set defined through rules. The empty string is also introduced as a valid string of length 0.

Uploaded by

ali yousaf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views18 pages

Theory of Automata: Lecture - 03 Spring 2021 Waqas Tariq Dar UOL

This document provides an overview of formal languages and how they are defined for communication with machines. It discusses that natural languages are informal while machines require formally defined languages. A formal language is defined by specifying its alphabet, words through rules of composition, and semantics. It also distinguishes between finite and infinite languages, with finite languages having a countable set of words that can be listed, while infinite languages have an uncountable set defined through rules. The empty string is also introduced as a valid string of length 0.

Uploaded by

ali yousaf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Theory of Automata

Lecture – 03
Spring 2021
Waqas Tariq Dar
UOL
Language


In English, there are at least three different
types of entities: letters, words, sentences.

Letters are from a finite alphabet set { a, b,
c, . . . , z }

Words are made up of certain combinations
of letters from the alphabet.

Not all combinations of letters lead to a valid
English word.
...Language


Sentences are made up of certain
combinations of words.

Not all combinations of words lead to a valid
English sentence.

So we see that some basic units are
combined to make bigger units.
...Language


How can you tell whether a given sentence
belongs to a particular languages

Black is cat the

The tea is hot

I like chocolates two much

Rules give a clue to form as well as validate
the sentences.
Formal Vs Informal Language

Informal language

Incoherent (confusing, ambiguous, etc.) strings are
also understandable. Like idioms e.g.,

We should let sleeping dogs lie.

It means, to avoid restarting a conflict.

Raise ambiguity

Interpretation varies with region

Same words have multiple meanings.

Like, light, base, etc.
… Informal language

Natural languages are generally defined informally

Human brain

Capable to understand incoherent even invalid sentences.

E.g., You mangoes like

Rectify grammatical errors etc.

Resolve ambiguity

Interpret according to context

Supporting aids such as Facial expressions and body
language etc.
How to communicate with Machines ?


Need a language: what sort?

Machines don’t have human mind though
may have its partial imitation.

Would fail on incorrect or ambiguous input.

Some recovery or input corrections may be
proposed but again very limited.

Thus need a precise, explicit and universal
definition of communication language.
Summary of Languages

Three aspects/specifications:

Lexical

Defines valid words/units of a language

Syntactic

Defines rules for combining the units to form valid
sentences (computer programs in context of machines)

Semantic

Concerned with the interpretation or meaning of a sentence
(what output to produce in context of machines)

Affected by ambiguity the most.
Formal Languages


Rules defined explicitly and clearly.

No ambiguities.

Universally uniform understanding.

Lets the machine:

Interpret an input uniformly every time. i.e.,
always produces same output for a particular
input.

Explicitly reject invalid input
...Formal Languages


Need uniformly understandable notation

Representations

Alphabet

Represents a finite set of fundamental units
of lanauges, e.g., for English ∑ ={a,b,….z.A,
…Z,}

∑ = {0,1}

∑ = {0,1,2,3,4,5,6,7,8,9}
...Formal Languages

List of words:

Set of all valid words of a given language, e.g., a
language English-Words that contains all valid
words of English would have a  = {all entries of
the dictionary + punctuation marks and blank
space….}

Denoted by 

Strings: A string is a finite sequence of symbols
chosen from alphabets. For example

0111100 , 123045, abbbcdeg etc.
...Formal Languages


String Variable: A letter used for denoting a
string. The author uses w, x, y and z as string
variable. For example

w = 0111100 , x = 123045, z = abbbcdeg

Length of String: The number of symbols in
the string. For example

|w| = 7 , |x| = ? , |z| = ?
...Finite Vs Infinite Languages

Finite Languages

Countable set of words

Can be defined by rigorously listing the words.

E.g., English-Words

Infinite Languages

Infinite set of valid words

Can’t be listed completely

E.g. English-Sentences
...Finite Vs Infinite Languages


Most of the languages are infinite

How can u check whether a word belongs to
a language if it is

Finite

Checking its entry in the language set.

Infinite

Validating against rules
...Defining Languages


Define alphabet set

Define rules for forming valid words and
sequences of words from ∑

Called grammar

Can be descriptive

Can be mathematical

Can also define supporting functions e.g.,
length(x), reverse(x)
...Defining Languages


Example ∑ ={a,b,…z}

L = {all words formed only of odd number of
alphabets}

L = {an | n is odd}

L = {all words of length less than or equal to
4}

PALINDROME ={x, all strings x such that
reverse (x) = x}
...Defining Languages

We shall wish to allow a string to have no letters.

This we call the empty string or null string, and
we shall denote it by the symbol Λ.

For clarity, we do not allow the symbol Λ to be
part of the alphabet for any language.

Let, L = { an for n = 0, 1, 2, 3……}

Remember that a0 = Λ, not a0 = 1 as in algebra.

In this way an is always the string of n number of
a's.
References


T1 : Chapter 2

R1 : Chapter 1

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy