Q1: Defination Of: - Regular Language

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Q1: Defination of :

. Regular Language.

A regular language is a language that can be expressed with a regular expression


or a deterministic or non-deterministic finite automata or state machine.

Regular languages are a subset of the set of all strings.

. Context Free.

A context-free language is a language generated by a context-free grammar.


They are more general (and include) regular languages.

The same context-free language might be generated by multiple context-free


grammars.

An example context-free language is , the language of all non-empty even-


length strings, the entire first halves of which are a's, and the entire second halves of which are b's.

L is generated by the grammar .

This language is not regular.

. Context Sensitive.

A context-sensitive grammar is a formal grammar in which the left-hand sides


and right-hand sides of any production rules may be surrounded by a context of terminal and
nonterminal symbols

A formal grammar G = (N, Σ, P, S), with N a set of nonterminal symbols, Σ a set of


terminal symbols, P a set of production rules, and S the start symbol, is context-sensitive if all rules in P
are of the form

αAβ → αγβ

. Recursively Enumerable Language.

A recursively enumerable language is a formal language for which there exists a


Turing machine (or other computable function) that will halt and accept when presented with any string
in the language as input but may either halt and reject or loop forever when presented with a string not
in the language

A language is recursively enumerable if there exists a Turing machine that


accepts every string of the language, and does not accept strings that are not in the language. (Strings
that are not in the language may be rejected or may cause the Turing machine to go into an infinite
loop.)
. Non-Recursively Enumerable Language.

An example of a language which is not recursively enumerable is the language L


of all descriptions of Turing machines which don't halt on the empty input. We know that L¯¯¯¯ is
recursively enumerable (exercise) while L is not recursive (this is Turing's classical result), so it follows
that L is not recursively enumerable.

. Null Production in CFG.

Null productions are of the form A -> ϵ.

. Unit Production in CFG.

The unit productions are the productions in which one non-terminal gives
another non-terminal

. FA.

A finite automaton (FA) is a simple idealized machine used to recognize patterns


within input taken from some character set (or alphabet) C.

The job of an FA is to accept or reject an input depending on whether the


pattern defined by the FA occurs in the input.

A finite automaton consists of: a finite set S of N states

. NFA.

In NDFA, for a particular input symbol, the machine can move to any
combination of the states in the machine.

In other words, the exact state to which the machine moves cannot be
determined.

Hence, it is called Non-deterministic Automaton.

As it has finite number of states, the machine is called Non-deterministic Finite


Machine or Non-deterministic Finite Automaton.
. PDA.

A pushdown automaton is a way to implement a context-free grammar in a


similar way we design DFA for a regular grammar. A DFA can remember a finite amount of information,
but a PDA can remember an infinite amount of information.

Basically a pushdown automaton is:

"Finite state machine" + "a stack"

Components:

an input tape,

a control unit, and

a stack with infinite size.

. LBA.

A linear bounded automaton is a multi-track non-deterministic Turing machine


with a tape of some bounded finite length.

Length = function (Length of the initial input string, constant c)

Here,

Memory information ≤ c × Input information

. TM.

A Turing Machine (TM) is a mathematical model which consists of an infinite


length tape divided into cells on which input is given.

After reading an input symbol, it is replaced with another symbol, its internal
state is changed, and it moves from one cell to the right or left

. MutliTape TM.

Multi-tape Turing Machines have multiple tapes where each tape is accessed
with a separate head.

Each head can move independently of the other heads.

Initially the input is on tape 1 and others are blank.

At first, the first tape is occupied by the input and the other tapes are kept
blank.

Next, the machine reads consecutive symbols under its heads and the TM prints
a symbol on each tape and moves its heads.
. Ambiguous Grammar.

A CFG is said to ambiguous if there exists more than one derivation tree for the
given input string

i.e., more than one LeftMost Derivation Tree (LMDT) or RightMost Derivation
Tree (RMDT).

. Regular Expression.

The language accepted by finite automata can be easily described by simple


expressions called Regular Expressions.

A regular expression can also be described as a sequence of pattern that defines


a string.

Regular expressions are used to match character combinations in strings.

. Clean Star Closure.

The Kleene star, ∑*, is a unary operator on a set of symbols or strings, ∑, that
gives the infinite set of all possible strings of all possible lengths over ∑ including λ.

. Plus Closure.

The set ∑+ is the infinite set of all possible strings of all possible lengths over ∑
excluding λ.

Q2: Use of:

. Regular Language.

Regular languages are used in parsing and designing programming languages


and are one of the first concepts taught in computability courses.

. Context Free.

It is is a formal grammar which is used to generate all possible patterns of


strings in a given formal language.

Context-free grammar G can be defined by four tuples as: G = (V, T, P, S)


. Context Sensitive.

A context-sensitive grammar (CSG) is a formal grammar in which the left-hand


sides and right-hand sides of any production rules may be surrounded by a context of terminal and
nonterminal symbols.

. Recursively Enumerable Language.

A recursively enumerable language is a formal language for which there exists a


Turing machine (or other computable function) that will halt and accept when presented with any string
in the language as input but may either halt and reject or loop forever when presented with a string not
in the language

. FA.

Finite automata are used in text processing, compilers, and hardware design.

Context-free grammar (CFGs) are used in programming languages and artificial


intelligence.

Originally, CFGs were used in the study of the human languages.

. NFA.

NFA stands for non-deterministic finite automata.

It is easy to construct an NFA than DFA for a given regular language.

The finite automata are called NFA when there exist many paths for specific
input from the current state to the next state.

Every NFA is not DFA, but each NFA can be translated into DFA

. PDA.

A pushdown automaton is a way to implement a context-free grammar in a


similar way we design DFA for a regular grammar.

A DFA can remember a finite amount of information, but a PDA can remember
an infinite amount of information.

a stack with infinite size.


. LBA.

A linear bounded automaton (lba) is, in effect, a Turing machine whose


computations are restricted to the amount of tape on which the input is written.

. TM.

A Turing Machine (TM) is a mathematical model which consists of an infinite


length tape divided into cells on which input is given.

It consists of a head which reads the input tape.

. MutliTape TM.

It covers much of the basics about Turing machines and how their displays are
different from other automata.

Multi-tape Turing machines allow for a number of languages to be implemented


with greater ease.

One such example is the language demonstrated in the one tape tutorial, L =
{anbncn}.

Q3: Difference Between:

. Mealy & Moore Machine.

A mealy machine is defined as a machine in theory of computation whose


output values are determined by both its current state and current inputs.

A moore machine is defined as a machine in theory of computation whose


output values are determined only by its current state.

. Theory of Automata & Theory of Computation.

Depends on the point of view. In many regards, Automata Theory is a sub-field


of Computational Theory.

The latter being (mainly) concerned with the decidability and complexity of
problems, while the former offers one set of tools to approach this issue.

Others would be Formal Languages, general proofs, etc.


On the other hand, Automata Theory (arguably) has uses outside the field of
Theory of Computation.

Be it in simulation, verification and validation of actual algorithms or systems


(without focus on complexity).

. SingleTape & MultiTape.

The single-tape Turing machines adopted for the simulation use a particular kind
of the tape, which is divided into tracks (multi-track tape).

In this way, if the tape has m tracks, the head is able to access (for reading
and/or writing) all the m characters on the tracks during a single operation

Multi-tape Turing Machines have multiple tapes where each tape is accessed
with a separate head.

Each head can move independently of the other heads.

Initially the input is on tape 1 and others are blank.

At first, the first tape is occupied by the input and the other tapes are kept
blank.

. NFA & DFA(FA).

For each symbolic representation of the alphabet, there is only one state
transition in DFA.

No need to specify how does the NFA react according to some symbol.

DFA cannot use Empty String transition.

NFA can use Empty String transition.

. Star Closure(Clean Closure) & Plus Closure.

The Kleene star, ∑*, is a unary operator on a set of symbols or strings, ∑, that
gives the infinite set of all possible strings of all possible lengths over ∑ including λ.

The set ∑+ is the infinite set of all possible strings of all possible lengths over ∑
excluding λ.
Q4: How to Remove Ambiguity from PDA or Automata?

If the grammar has ambiguity, then it is not good for compiler construction.

No method can automatically detect and remove the ambiguity,

but we can remove ambiguity by re-writing the whole grammar without ambiguity.

Q5: What is mean by equivalent of two FA's?

Two automata A and B are said to be equivalent if both accept exactly the same set of input
strings.

Q6: Which is more powerful:

. SingleTape or MultiTape.

. TM or LBA.

. LBA or PDA.

. PDA or FA.

ANS: FA<PDA<LBA<TM & STape == MTape (but Complexity Differnce)

You might also like