0% found this document useful (0 votes)
65 views3 pages

Lahore Garrison University

The document defines various terms related to formal languages and automata theory including alphabets, strings, words, languages, regular expressions, finite automata, finite state machines, transition diagrams, deterministic and nondeterministic automata, and regular languages. It provides definitions and examples for each term to describe the basic concepts of formal languages and automata theory that are used in compiler construction.

Uploaded by

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

Lahore Garrison University

The document defines various terms related to formal languages and automata theory including alphabets, strings, words, languages, regular expressions, finite automata, finite state machines, transition diagrams, deterministic and nondeterministic automata, and regular languages. It provides definitions and examples for each term to describe the basic concepts of formal languages and automata theory that are used in compiler construction.

Uploaded by

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

11/8/2020

Lahore Garrison University


Name: Muhammad Faisal Bashir
Course: BSCS
Subject: Compiler Construction
Section: K
Roll no: 490
Teacher’s name: Miss Syeda Binish Zahra
Due date: 8th Nov, 2020
Describe the following
Alphabets:
A set of letters denoted by Greek letter sigma Ʃ. Ʃ = {a, b} and Ʃ = {0, 1}. When writing a
language, first we need to define characters or symbols, which will be used in the language.

String:
A string over an alphabet is a finite sequence of symbols from that alphabet. Strings are often
called words or sentences. Example: Strings over {0,1}: ε, 0, 1, 111010.

Word:
String that is permissible in language

Language:
A set of strings with rules. Every language has its own rule.

Terms of strings:
 There are different terms of strings.
 Empty string: String that has no letter, also known as Null string. Its length is zero.
 Length of string: Number of letters in a string.
 Reverse of string: Obtained by writing letters of string in reverse order. Denoted by
Rev(s) or Reverse(s).
 Power of string: Determines the length of string.

Regular expression:
Regular expression is an important notation for specifying patterns. Each pattern matches a set
of strings, so regular expressions serve as names for a set of strings. Programming language
tokens can be described by regular languages.

And also define as Sequence of characters that define a search pattern, mainly for use in pattern
matching with strings, or string matching, i.e. “find and replace” like operations. Regular
expressions are a generalized way to match patterns with sequences of characters.

Notation used in regular expression:


In regular expression, hyphen (-) has special meaning. It indicates a sequential range of possible
characters such as A-Z, a-z or 0-9. The notation [0-9]{3} in the first element of the pattern
matches any string of exactly 3 digits, each of which may range from 0-9.
Finite:
An abstract machine can be in exactly one of a finite number of states at any given time.

Automata:
Automata Theory is a branch of computer science that deals with designing abstract self-
propelled computing devices that follow a predetermined sequence of operations automatically.

Finite automata:
An automaton with a finite number of states is called a Finite Automata.

Finite state machines:


A model of a computational system, consisting of a set of states (including a start state), an
alphabet of symbols that serves as a set of possible inputs to the machine, and a transition
function that maps each state to another state (or to itself) for any given input symbol.

Transition Diagrams:
Transition diagram is a special kind of flowchart for language analysis. In transition diagram, the
boxes of flowchart are drawn as circle and called as states. States are connected by arrows called
as edges connect states. The label or weight on edge indicates the input character that can appear
after that state.

Deterministic:
There is exactly one outgoing transition for every input alphabet from one state. There should not
be more than one transition from one state for one letter.

Nondeterministic:
A Nondeterministic Finite Automata (NFA) is a Transition Graph (TG) with a unique start and a
property of having single letter as label of transitions.

Regular language:
A regular language satisfies the following equivalent properties: it is the language of
a regular expression (by the above definition) it is the language accepted by a nondeterministic
finite automaton (NFA) it is the language accepted by a deterministic finite automaton (DFA) it
can be generated by a regular grammar.

You might also like