Regular Grammar and Regular Expressions are different.
We have discussed Regular expressions. Let’s see Regular Grammar.
Formal Definition of Regular Grammar:
In Computer Science, a right regular grammar is a formal grammar (N, Σ, P, S) such that all the production rules in P are of one of the following forms:
1. A → a - where A is a non-terminal in N and a is a terminal in Σ
2. A → aB - where A and B are in N and a is in Σ
3. A → ε - where A is in N and ε denotes the empty string, i.e. the string of length 0.
Showing posts with label formal definitions. Show all posts
Showing posts with label formal definitions. Show all posts
Thursday, May 17, 2007
Monday, May 14, 2007
Formal Definition of Non-Deterministic Finite State Machine (NFA)
A nondeterministic finite state automaton (NFA) is a 5-tuple, (S, Σ, T, s0, A), consisting of
a finite set of states (S)
a finite set of input symbols (Σ)
a transition function (T : S × (Σ ∪{ε}) → P(S)).
an initial (or start) state s0 such that s0 ∈ S
a set of states A distinguished as accepting (or final) states (A ⊆ S)
where P(S) is the power set of S, ε is the empty string, and Σ is the input symbol alphabet.
Given an NFA M.
Given a string w.
There is any number of computation paths of M with input w.
M accepts w if some computation path ends in a final state.
a finite set of states (S)
a finite set of input symbols (Σ)
a transition function (T : S × (Σ ∪{ε}) → P(S)).
an initial (or start) state s0 such that s0 ∈ S
a set of states A distinguished as accepting (or final) states (A ⊆ S)
where P(S) is the power set of S, ε is the empty string, and Σ is the input symbol alphabet.
Given an NFA M.
Given a string w.
There is any number of computation paths of M with input w.
M accepts w if some computation path ends in a final state.
Sunday, May 13, 2007
Formal Definition of Deterministic Finite State Machine (DFA):
Formal Definition of Deterministic Finite State Machine (DFA):
A DFA is a 5-tuple, (S, Σ, T, s, A), consisting of
a finite set of states (S)
a finite set called the alphabet (Σ)
a transition function (T : S × Σ → S)
a start state (s ∈ S)
a set of accept states (A ⊆ S)
Given an DFA M.
Given a string w.
There is at most one computation path of M with input w.
M accepts w if that computation path ends in a final state.
A DFA is a 5-tuple, (S, Σ, T, s, A), consisting of
a finite set of states (S)
a finite set called the alphabet (Σ)
a transition function (T : S × Σ → S)
a start state (s ∈ S)
a set of accept states (A ⊆ S)
Given an DFA M.
Given a string w.
There is at most one computation path of M with input w.
M accepts w if that computation path ends in a final state.
Saturday, May 12, 2007
regular language-formal defnition continued
A regular language is a formal language (i.e., a possibly infinite set of finite sequences of symbols from a finite alphabet) that satisfies the following equivalent properties:
it can be accepted by a deterministic finite state machine
it can be accepted by a nondeterministic finite state machine
it can be accepted by an alternating finite automaton
it can be described by a regular expression
it can be generated by a regular grammar
it can be accepted by a read-only Turing machine
In next post, I will discuss formal definition of deterministic finite state machine (DFA). DFA is my Favorite topic.
I am sure you will also like it when we will discuss it in detail after completing all formal definitions.
it can be accepted by a deterministic finite state machine
it can be accepted by a nondeterministic finite state machine
it can be accepted by an alternating finite automaton
it can be described by a regular expression
it can be generated by a regular grammar
it can be accepted by a read-only Turing machine
In next post, I will discuss formal definition of deterministic finite state machine (DFA). DFA is my Favorite topic.
I am sure you will also like it when we will discuss it in detail after completing all formal definitions.
Subscribe to:
Posts (Atom)