Jump to content

Formal language: Difference between revisions

From Simple English Wikipedia, the free encyclopedia
Content deleted Content added
Definition
New intro, revision and references.
Line 1: Line 1:
In mathematics, a '''formal language''' is one that has a particular set of symbols that are made according to a particular kind of rule.
In [[mathematics]], [[computer science]] and [[linguistics]], a '''formal language''' is one that has a particular set of symbols, and whose expressions are made according to a particular set of rules. The symbol <math>\mathcal{L}</math> is often used as a [[variable]] for formal languages in [[logic]].<ref>{{Cite web|date=2020-04-06|title=Comprehensive List of Logic Symbols|url=https://mathvault.ca/hub/higher-math/math-symbols/logic-symbols/|access-date=2020-10-09|website=Math Vault|language=en-US}}</ref>

Unlike [[Natural language|natural languages]], the symbols and formulas in formal languages are syntactically and semantically related to one another in a precise way.<ref>{{Cite web|title=Definition of formal language {{!}} Dictionary.com|url=https://www.dictionary.com/browse/formal-language|access-date=2020-10-09|website=www.dictionary.com|language=en}}</ref> As a result, formal languages are completely (or almost completely) void of [[ambiguity]].<ref>{{Cite web|title=1.11. Formal and Natural Languages — How to Think like a Computer Scientist: Interactive Edition|url=https://runestone.academy/runestone/books/published/thinkcspy/GeneralIntro/FormalandNaturalLanguages.html|access-date=2020-10-09|website=runestone.academy}}</ref>


== Examples ==
== Examples ==
Some examples of formal languages:
Some examples of formal languages include:


* the set of all words over <math>{a, b}\,</math>
* The set of all words over <math>{a, b}\,</math>
* the set <math>\left \{ a^{n}\right\}</math>, where <math>n\,</math> is a [[natural number]] and <math>a^n\,</math> means <math>a\,</math> repeated <math>n\,</math> times
* The set <math>\left \{ a^{n}\right\}</math>, where <math>n\,</math> is a [[natural number]] and <math>a^n\,</math> means <math>a\,</math> repeated <math>n</math> times
* finite languages, such as <math>\{\{a,b\},\{a, aa, bba\}\}\,</math>
* Finite languages, such as <math>\{\{a,b\},\{a, aa, bba\}\}\,</math>
* the set of syntactically correct programs in a given programming language; or
* The set of syntactically correct programs in a given programming language
* the set of inputs upon which a certain [[Turing machine]] halts.
* The set of inputs upon which a certain [[Turing machine]] halts


== Specification ==
== Specification ==
A formal language can be specified in a great variety of ways, such as:
A formal language can be specified in a great variety of ways, such as:


* Strings produced by some [[formal grammar]] (see [[Chomsky hierarchy]]);
* Strings produced by some [[formal grammar]] (see [[Chomsky hierarchy]])
* Strings described or matched by a [[regular expression]];
* Strings described or matched by a [[regular expression]]
* Strings accepted by some [[automaton]], such as a [[Turing machine]] or [[Finite state machine|finite state automaton]];
* Strings accepted by some [[automaton]], such as a [[Turing machine]] or [[Finite state machine|finite state automaton]]
* Strings indicated by a [[decision problem|decision procedure]] (a set of related YES/NO questions) where the answer is YES.
* Strings indicated by a [[decision problem|decision procedure]] (a set of related yes/no questions) where the answer is 'yes'


==Related pages==
==Related pages==
Line 25: Line 27:
* [[Computer language]] for application of formal languages in computing
* [[Computer language]] for application of formal languages in computing
* [[Programming language]] for the application of formal languages to program computers
* [[Programming language]] for the application of formal languages to program computers

== References ==
<references />


== Further reading ==
== Further reading ==

Revision as of 19:43, 9 October 2020

In mathematics, computer science and linguistics, a formal language is one that has a particular set of symbols, and whose expressions are made according to a particular set of rules. The symbol is often used as a variable for formal languages in logic.[1]

Unlike natural languages, the symbols and formulas in formal languages are syntactically and semantically related to one another in a precise way.[2] As a result, formal languages are completely (or almost completely) void of ambiguity.[3]

Examples

Some examples of formal languages include:

  • The set of all words over
  • The set , where is a natural number and means repeated times
  • Finite languages, such as
  • The set of syntactically correct programs in a given programming language
  • The set of inputs upon which a certain Turing machine halts

Specification

A formal language can be specified in a great variety of ways, such as:

References

  1. "Comprehensive List of Logic Symbols". Math Vault. 2020-04-06. Retrieved 2020-10-09.
  2. "Definition of formal language | Dictionary.com". www.dictionary.com. Retrieved 2020-10-09.
  3. "1.11. Formal and Natural Languages — How to Think like a Computer Scientist: Interactive Edition". runestone.academy. Retrieved 2020-10-09.

Further reading

  • Hopcroft, J. & Ullman, J. (1979). Introduction to Automata Theory, Languages, and Computation. Addison-Wesley. ISBN 0-201-02988-X.{{cite book}}: CS1 maint: multiple names: authors list (link)
  • Helena Rasiowa and Roman Sikorski (1970). The Mathematics of Metamathematics (3rd ed. ed.). PWN. {{cite book}}: |edition= has extra text (help), chapter 6 Algebra of formalized languages.
  • Rozemberg, G. & Salomaa, A. (eds.) (1979). Introduction to Automata Theory, Languages, and Computation. Addison-Wesley. ISBN 978-3-540-61486-9. {{cite book}}: |author= has generic name (help)CS1 maint: multiple names: authors list (link)

Other websites