.

Grammars and Automata

What is grammar?

Grammar when used in terms of linguistics, is often understood as a set of structural rules which determine the formation of clauses, phrases, sentences and words in any language. Grammar also includes the study of fields like Morphology, syntax, and phonology which are often clinched with phonetics, semantics, and pragmatics.

Grammars are set internationalized rules of a particular which is used whenever and by whosoever the particular language is spoken. It is a fact that a person does not need to refer to grammar or set rules to speak or use their native language or mother tongue. It comes from a tender age wand is adopted by the person from others surrounding him/ her. It Is easier to learn a language in early ages as in the older ages people need more explicit instructions.

What is Automata Theory?

Automata theory in general sense is the study of abstract machines and automata. Not only has this it also included the computational problems that can be solved by using these abstract machines and automata.

Grammars and Automata

In linguistic sense we closely relate the Automata theory formal language theory. This theory shows the finite representation of a formal language which can possibly be an infinite set. Most often the classification of automata is based on the className of formal language which they can recognize. This is by the Chomsky hierarchy where in it describes the relations between various languages and kinds of formalized logic.

The major role of Automata is as follows:

  • Theory of computation
  • compiler construction
  • artificial intelligence
  • parsing
  • Formal verification

The most prominent theory in grammars is the theory of CHORMSKY. The hierarchy of classes of formal languages goes as follows:

hierarchy of classes of formal languages
ChomskyGrammarsAutomatalanguages
Type 4RegularFiniteL3: regulare (anbm)
Type 3Context freePushdownL2: context-freed (anbn)
Type 2Content sensitiveLinear boundedL1: context-sensitivec (anbncn)
Type 1Reclusively enumerableTurning machineL0: recursively enumerablea

Languages:

Language is denoted by the letter ‘L’ over alphabet Σ, only if L C Σ*.
The reason behind this is that Σ* is the set of all strings (of all possible length including 0) over the given alphabet Σ

Language Operations

Concatenation

{`
  • L1 = {a , b}
  • L2 = {c , d}
  • L = L1 L2
  • ={xy | x ∈ L1, y ∈L2}
  • = {ac, ad, bc, bd}
`}

Grammars

A formal grammar G can be defined as any compact, precise mathematical definition of a language L contrary to simple raw listing of language’s legal sentences, or just examples of them.

A grammar can be said to be an algorithm which generate all legal sentences of the language they often take the form of a set of recursive definitions. The most popular way to specify a grammar recursively can be to specify it as a phrase-structure grammar.

Phrase-Structure Grammars

A phrase-structure grammar (abbr. PSG) G = (V,T,S,P) is a 4-tuple, in which: V is a set of special “words” called non terminals. (Representing concepts like “noun”).

T is a set of words called terminals or the actual words of a formal language. S ∈ V is a special non terminal which is normally the start symbol.

P is a set of Productions that are to defined which deals with rules for substituting fragment of sentence to another.

A production p ∈ P is a pair p=(β , α) of sentence fragments (not necessarily in L), which may generally contain a mix of both terminals and non terminals that is, α , β ∈ (V ∪ T)*

A phrase-structure grammar imposes the constraint that each Language Template must contain a non terminal symbol.

Fragmentation of English

{`
We have G = (V, T, S, P), where:
V = {(sentence), (noun phrase), (verb phrase), (article), (adjective), (noun), (verb), (adverb)}
T = {a, the, large, hungry, rabbit, mathematician, eats, hops, quickly, wildly}
S = ( sentence)
P = { (sentence) → (noun phrase) (verb phrase),
(noun phrase) → (article) (adjective) (noun),
(noun phrase) → (article) (noun), (verb phrase) → (verb) (adverb),
(verb phrase) → (verb), (article) → a,
(article) → the, (adjective) → large,
(adjective) → hungry, (noun) → rabbit,
(noun) → mathematician, (verb) → eats,
(verb) → hops, (adverb) → quickly,
 adverb) → wildly }
 `}

A Sample Sentence Derivation

To understand the above concept better, let’s look at an example:

{`
(Sentence)
(Noun phrase) (Verb phrase)
(Article) (Adj.) (Noun) (Verb phrase)
The (adj.) (noun) (verb phrase)
The (adj.) (noun) (verb) (adverb)
The huge (noun) (verb) (adverb)
The huge dog (verb) (adverb)
The huge dog runs (adverb)
The huge dog runs fast.
`}

Finite State Automata

Finite Automata has three states, stage1, stage 2, stage3 along with having an input alphabet consisting of two symbols, {a,b}. the starting point is from stage 1 and reads a string of as and bs, meanwhile making its transitions from one state to another. It is deterministic as it has only one and only one choice that is to move forward because at each stage regardless of its current state and the symbol. It always reads the next.

To say it, The DFA is a kind of a tiny computer. Its job is to say “yes” or “no” to input strings—to “accept” or “reject” them.

Now this is done by reading the string from left to right, then arriving in a certain final state. To determine results, If the final state is in the dashed rectangle, in state 1 or 2, it accepts the string or else it is rejected. Thus any DFA answers a simple yes-or-no

Nondeterministic Finite-State Automata (NFA)

Nondeterministic Finite-State Automata can be described as a function into the power set P (S) that is the set of all subsets of S: δ :S ×A →P (S).

To explain the above equation, Nondeterministic Finite-State Automata starts in an initial state of s 0 and makes a series of transitions as it reads a string w. But the difference now is that the set of possible computations branch out, in turn allowing the automaton to follow as many possible paths as it can. This may either lead with Some of these to end up accepting the state S as ‘yes’ while others don’t. to determine circumstances where M accepts w and the situation where it recognizes language L(M) we think that M accepts w if and only if there exists a computation path ending in an accepting state. Contrary to this if M rejects w it will be if and only if all computation paths end in a rejecting state.

It should be kept in mind that the notion of “non determinism” has nothing at all to do with probability. Therefore the acceptance is judged not on the probability of an accepting path, but simply on its existence.

The above article relays the information about grammars and automata this topic is very vast ad consists of a lot of theory as well as mathematical numerical connected with language which makes it all the more difficult to understand. Understanding and writing assignments on such topics is very hard provided you are fully aware of all concepts and have thorough knowledge of it. In case you do not then it is becomes a very tedious and super hard task to complete it. This topic is sure going to give you a huge amount of stress. So to release some stress from your shoulders assignmenthippo.com is here to help through it. we areone of the most student friendly Assignment Help providers in Australia and are very popular for the quality of our assignments. we specialize in making assignments but along with that we providing extra but relevant information on any topic which relates to academics as a helping aid to students. You name it and we know that subject. We have a 24/7 helpline for late bloomers seeking help, where you can contact us anytime and we’ll help you. If you have doubts handing over your assignments to us, then we assure you that we have an expert team of tutors and professional writers who are experienced in their respective fields. Therefore you can rely on us that your assignments will be in safe hands. Our tutors and professional writers take each assignment with full seriousness and dedication to complete them without any errors. Also our assignments will be plagiarism free and totally original. If you don’t believe us you can check!

.