ArticleslgStudy

mathematics

Monadic second-order logic

Monadic second-order logic is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Monadic second-order logic rather than just read about it. In short: In mathematical logic, monadic second-order logic (MSO) is the fragment of second-order logic where the second-order quantification is limited to quantification over sets. It is particularly important in the logic of graphs, because of Courcelle's theorem, which provides algorithms for evaluating monadic second-order formulas over graphs of bounded treewidth.

Key takeaways

  • Monadic second-order logic belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Monadic second-order logic to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Monadic second-order logic from memory before moving on to harder problems.

Reference excerpt

In mathematical logic, monadic second-order logic (MSO) is the fragment of second-order logic where the second-order quantification is limited to quantification over sets. It is particularly important in the logic of graphs, because of Courcelle's theorem, which provides algorithms for evaluating monadic second-order formulas over graphs of bounded treewidth. It is also of fundamental importance in automata theory, where the Büchi–Elgot–Trakhtenbrot theorem gives a logical characterization of the regular languages. Second-order logic allows quantification over predicates. However, MSO is the fragment in which second-order quantification is limited to monadic predicates (predicates having a single argument). This is often described as quantification over "sets" because monadic predicates are equivalent in expressive power to sets (the set of elements for which the predicate is true). Monadic second-order logic is expressively equivalent to plural logic.

Variants Monadic second-order logic comes in two variants. In the variant considered over structures such as graphs and in Courcelle's theorem, the formula may involve non-monadic predicate constants (in this case the binary edge predicate E ( x , y ) {\displaystyle E(x,y)} ), but quantification is restricted to be over monadic predicate variables only. In the variant considered in automata theory and the Büchi–Elgot–Trakhtenbrot theorem, all predicates, constant or variable, must be monadic, with the exceptions of equality ( = {\displaystyle =} ) and ordering ( < {\displaystyle <} ) relations.

Computational complexity of evaluation Existential monadic second-order logic (EMSO) is the fragment of MSO in which all quantifiers over sets must be existential quantifiers, outside of any other part of the formula. The first-order quantifiers are not restricted. That is, one can speak of "there exists some x, such that..." and "for all x, we have..." where x is a term, but one can only speak of "there exists some monadic predicate P, such that..." not "for all monadic predicate P, we have...". Fagin's theorem states that existential second-order logic (ESO) captures precisely the descriptive complexity of the complexity class NP. By analogy, the class of problems that may be expressed in existential monadic second-order logic has been called monadic NP. In other words, EMSO captures precisely the descriptive complexity of monadic NP (MNP). In the logic of graphs, testing whether a graph is disconnected is in MNP, as the test can be represented by a formula that describes the existence of a proper subset of vertices with no edges connecting them to the rest of the graph. The complementary problem, testing whether a graph is connected, does not belong to monadic NP. That is, it is a problem in co-MNP \ MNP. By symmetry, graph disconnection testing is in MNP \ co-MNP, showing that neither complexity class contains the other. The addition of "monadic" makes the question easier. The analogous question, of whether NP = co-NP, is an open question in computational complexity. By contrast, when we wish to check whether a Boolean MSO formula is satisfied by an input finite tree, this problem can be solved in linear time in the tree, by translating the Boolean MSO formula to a tree automaton and evaluating the automaton on the tree. In terms of the query, however, the complexity of this process is generally nonelementary. Thanks to Courcelle's theorem, we can also evaluate a Boolean MSO formula in linear time on an input graph if the treewidth of the graph is bounded by a constant. For MSO formulas that have free variables, when the input data is a tree or has bounded treewidth, there are efficient enumeration algorithms to produce the set of all solutions, ensuring that the input data is preprocessed in linear time and that each solution is then produced in a delay linear in the size of each solution, i.e., constant-delay in the common case where all free variables of the query are first-order variables (i.e., they do not represent sets). There are also efficient algorithms for counting the number of solutions of the MSO formula in that case.

Decidability and complexity of satisfiability The satisfiability problem for monadic second-order logic is undecidable in general because this logic subsumes first-order logic. The monadic second-order theory of the infinite complete binary tree, called S2S, is decidable. As a consequence of this result, the following theories are decidable:

The monadic second-order theory of trees. S1S, The monadic second-order theory with one successor (that is, of N {\displaystyle \mathbb {N} } ) WS2S and WS1S, which restrict quantification to finite subsets (weak monadic second-order logic). By binary-coding natural numbers as finite subsets, addition is definable even in WS1S. For each of these theories (S2S, S1S, WS2S, WS1S), the complexity of the decision problem is nonelementary. They could be obtained by performing a reduction of the emptiness problem of the star-free languages to WS1S. The WS1S is specifically known to be TOWER-complete.

Use of satisfiability of MSO on trees in verification Monadic second-order logic of trees has applications in formal verification. Decision procedures for MSO satisfiability have been used to prove properties of programs manipulating linked data structures, as a form of shape analysis, and for symbolic reasoning in hardware verification.

See also Descriptive complexity theory Monadic predicate calculus Second-order logic

References

Worked examples

Example 1 — a first encounter with Monadic second-order logic

Start with the simplest possible case. Write down what Monadic second-order logic claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Monadic second-order logic before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Monadic second-order logic ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Monadic second-order logic

In research
Monadic second-order logic appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Monadic second-order logic in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Monadic second-order logic is common in secondary-school and first-year university syllabi. It links to neighbouring topics Mathematical logic, so understanding it makes those chapters shorter.
In everyday life
Look for Monadic second-order logic outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Monadic second-order logic in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Monadic second-order logic means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Monadic second-order logic out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Monadic second-order logic in simple terms?

In mathematical logic, monadic second-order logic (MSO) is the fragment of second-order logic where the second-order quantification is limited to quantification over sets. It is particularly important in the logic of graphs, because of Courcelle's theorem, which provides algorithms for evaluating m…

Why does Monadic second-order logic matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Monadic second-order logic?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Monadic second-order logic.

Tags

  • Mathematical logic

Keep exploring