Definition:Formal Grammar

From ProofWiki
(Redirected from Definition:Top-Down)
Jump to: navigation, search

Contents

Definition

Let $\mathcal L$ be a formal language whose alphabet is $\mathcal A$.

The formal grammar (or syntax) of $\mathcal L$ is the set of rules of formation which determine whether words in $\mathcal A$ belong to $\mathcal L$ or not.


Rules of Formation

The rules of formation of $\mathcal L$ are the rules which define how to construct words in $\mathcal L$ which are well-formed.


That is, the rules of formation tell you how to build strings consisting of symbols from the alphabet $\mathcal A$ which are part of the formal language $\mathcal L$.


The rules of formation of a formal language constitute its syntax.


Top-Down

A top-down grammar is one whose rules of formation allow the user to build well-formed words from a single metasymbol, in the following way:

From the words thus generated, those not containing any metasymbols are the well-formed words.


Bottom-Up

A bottom-up grammar is one whose rules of formation allow the user to build well-formed words from primitive symbols, in the following way:

Personal tools
Namespaces
Variants
Actions
Navigation
ProofWiki.org
ToDo
Toolbox
Google AdSense