Log in Sign up
Back to Discover
🔢

Formal language

math Maturity 11-13

We use signs to make words.

Formal languages.svg
Formal languages.svg
These signs follow rules. The rules help us build strings. Rules help computers talk too. It is like a game with patterns. Can you find a pattern?
Syntax tree.svg
Syntax tree.svg

37 words

Imagine a box of letter blocks.

Formal languages.svg
Formal languages.svg
You can pick letters to make words. These letters come from a set called an alphabet.
Syntax tree.svg
Syntax tree.svg
Rules tell us how to build words. Some words are made the right way. Other words do not follow the rules. Computers use these rules to talk. People use them to study math too. We can even use them to describe machines. These rules help us find patterns in many things.

77 words

Think about a box of letter blocks.

Formal languages.svg
Formal languages.svg
You can pick any block to make a word. These blocks come from a set called an alphabet. In a formal language, we use these letters to make strings. A string is just a sequence of letters. Some strings are called well-formed. This means they follow specific rules.
Syntax tree.svg
Syntax tree.svg
These rules are often called a grammar. A grammar tells us how to build words the right way.

People use these ideas in many ways. Computer scientists use them to make programming languages. These languages help computers follow instructions. Mathematicians use them to study the patterns in math. In the 17th century, Leibniz imagined a universal language. He wanted to use symbols to represent ideas. Later, Noam Chomsky created a way to group these languages. He called this the Chomsky hierarchy. This helps us see how complex a language is. We can also use these rules to describe machines. Even simple math rules are a type of formal language. They show us how symbols can fit together.

176 words

Imagine you have a box of letter blocks. Each block is a symbol from a set called an alphabet.

Formal languages.svg
Formal languages.svg
You can snap these blocks together to make a string. A string is just a sequence of letters. In a formal language, we only care about certain strings. We call these strings well-formed if they follow specific rules. These rules are known as a grammar. A grammar tells you how to build words the right way. Some strings might look right but fail the rules. A formal language is simply the set of all those correct strings.
Syntax tree.svg
Syntax tree.svg

How do these rules actually work? They focus on the shape and order of symbols. This is called syntax. Syntax is different from semantics, which is the meaning of the words. For example, a rule might say a plus sign must sit between two numbers. The string "23+4=555" follows this rule. However, the rule does not care if the math is true. It only cares if the symbols are in the right spots. This way of working lets us study the structure of language itself. We can use these rules to group different types of languages together.

Many thinkers have worked on these ideas over hundreds of years. In the 17th century, Gottfried Leibniz imagined a universal language. He wanted to use pictographs to represent all ideas. Later, Gottlob Frege tried to make this real. He wrote about a formal language of pure language in 1879 and 1893. In 1907, Leonardo Torres Quevedo used a formal language for mechanical drawings in Vienna. Between 1906 and 1914, Axel Thue published papers about words and language. He helped create what we now call Thue Systems. These thinkers helped us move from simple symbols to complex systems.

In the 20th century, these ideas became very important for computers. Noam Chomsky created the Chomsky hierarchy to group languages. This helps us see how complex a language is. In 1959, John Backus developed a way to describe programming languages. He worked on a language called FORTRAN. Peter Naur later used this method for a language called ALGOL60. Today, we use these rules to define how computers read code. We also use them to study how hard it is for machines to solve problems. This field is part of a bigger study called complexity theory.

Formal languages connect to many things you already know. You use rules every time you write a sentence in school. Computer scientists use these same ideas to build software. Even math uses them to show how symbols can be moved around. You can think of an alphabet like the letters in your ABCs. A word is just a way to put those letters in order. By using these strict rules, we can make sure machines understand us perfectly. It turns the messy way humans speak into a clear system of patterns.

480 words

A formal language is a specific set of strings made from a set of symbols. These symbols are taken from a collection called an alphabet. In logic, mathematics, and computer science, these languages provide a way to study structure. While humans use natural languages like English, formal languages focus on the rules of arrangement. They are defined by a set of strings that are considered well-formed. A string is simply a finite sequence of letters from the alphabet.

Formal languages.svg
Formal languages.svg

The mechanism of a formal language relies on syntax. Syntax refers to the internal structural patterns of the symbols. This is different from semantics, which is the actual meaning of the words. For example, a rule might require a plus sign to sit between two numbers. The string "23+4=555" follows the syntax of a specific math language. However, the rule does not care if the math is actually true. It only cares that the symbols are in the correct order. This distinction allows scientists to study the shape of language without needing to understand its meaning.

Formal languages are often categorized by their complexity. One way to do this is through a formal grammar. A grammar is a set of rules that defines how to create well-formed words. There are different types of grammars, such as regular grammars and context-free grammars. Regular grammars are simpler, while context-free grammars are more expressive. These different levels of complexity are organized into the Chomsky hierarchy. This hierarchy helps researchers understand the expressive power of a language. It also helps them understand how difficult it is for a machine to parse the language.

Syntax tree.svg
Syntax tree.svg

The history of these ideas spans several centuries. In the 17th century, Gottfried Leibniz imagined a universal language. He called it the characteristica universalis and wanted to use pictographs. Later, Gottlob Frege worked to realize these ideas. He outlined a notational system in his 1879 work, Begriffsschrift. He also developed the Grundgesetze der Arithmetik between 1893 and 1903. These works described a formal language of pure language. In 1907, Leonardo Torres Quevedo introduced a formal language for mechanical drawings in Vienna. His system was meant to help describe machines.

Formal languages.svg
Formal languages.svg

Other important developments occurred in the early 20th century. Axel Thue published papers on words and language between 1906 and 1914. His work led to what Emil Post called Thue Systems. These systems provided early examples of undecidable problems. In 1959, John Backus developed the Backus-Naur form. He used this to describe the syntax of the programming language FORTRAN. Peter Naur later used this form to describe the formal part of ALGOL60. Noam Chomsky also made massive contributions by creating his namesake hierarchy. These researchers moved the field from abstract philosophy to precise mathematical science.

Formal languages are vital to modern computer science. They serve as the basis for defining programming languages. A computer needs strict rules to understand code. If the syntax is wrong, the machine cannot process the instructions. In computational complexity theory, decision problems are often defined as formal languages. Complexity classes are sets of formal languages that machines can parse. These machines have limited computational power. Researchers use these tools to study how hard it is to solve certain problems. Sometimes, the answer to a problem is that it is impossible to solve.

Syntax tree.svg
Syntax tree.svg

There are many ways to manipulate these languages through mathematical operations. One common operation is concatenation. This is when you combine two words to form a new word. The length of the new word is the sum of the original lengths. Another operation is the Kleene star. This represents a language consisting of zero or more concatenations of words. You can also use intersection, which finds strings that belong to two different languages. Scientists also study closure properties. A class of languages is closed if applying an operation always produces a language in that same class. For example, context-free languages are closed under union and concatenation.

Formal languages.svg
Formal languages.svg

Formal language theory connects many different fields of study. It links linguistics to the foundations of mathematics. In mathematics, formalism is the idea that all math can be reduced to syntactic manipulation. This means math can be seen as a system of moving symbols according to rules. The field also connects to automata theory. This involves studying machines that can recognize or accept certain languages. By studying these patterns, we can build better computers and understand the limits of logic. The study of formal languages turns the complexity of communication into a measurable science.

753 words
🖼️ Images & Media (2)
File:Syntax tree.svg
Syntax tree.svg
File:Formal languages.svg
Formal languages.svg
Up Next
🔢
Formal grammar
Math
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.