ArticleslgStudy

mathematics

Bunched logic

Bunched 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 Bunched logic rather than just read about it. In short: Bunched logic is a variety of substructural logic proposed by Peter O'Hearn and David Pym. Bunched logic provides primitives for reasoning about resource composition, which aid in the compositional analysis of computer and other systems.

Key takeaways

  • Bunched 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 Bunched logic to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Bunched logic from memory before moving on to harder problems.

Reference excerpt

Bunched logic is a variety of substructural logic proposed by Peter O'Hearn and David Pym. Bunched logic provides primitives for reasoning about resource composition, which aid in the compositional analysis of computer and other systems. It has category-theoretic and truth-functional semantics, which can be understood in terms of an abstract concept of resource, and a proof theory in which the contexts Γ in an entailment judgement Γ ⊢ A are tree-like structures (bunches) rather than lists or (multi)sets as in most proof calculi. Bunched logic has an associated type theory, and its first application was in providing a way to control the aliasing and other forms of interference in imperative programs. The logic has seen further applications in program verification, where it is the basis of the assertion language of separation logic, and in systems modelling, where it provides a way to decompose the resources used by components of a system.

Foundations The deduction theorem of classical logic relates conjunction and implication:

A∧B⊢CiffA⊢B⇒C Bunched logic has two versions of the deduction theorem:

A∗B⊢CiffA⊢B−∗Cand alsoA∧B⊢CiffA⊢B⇒C A∗B and B−∗C are forms of conjunction and implication that take resources into account (explained below). In addition to these connectives bunched logic has a formula, sometimes written I or emp, which is the unit of *. In the original version of bunched logic ∧ and ⇒ were the connectives from intuitionistic logic, while a boolean variant takes ∧ and ⇒ (and ¬) as from traditional boolean logic. Thus, bunched logic is compatible with constructive principles, but is in no way dependent on them.

Truth-functional semantics (resource semantics) The easiest way to understand these formulae is in terms of its truth-functional semantics. In this semantics a formula is true or false with respect to given resources. A∗B asserts that the resource at hand can be decomposed into resources that satisfy A and B. B−∗C says that if we compose the resource at hand with additional resource that satisfies B, then the combined resource satisfies C. ∧ and ⇒ have their familiar meanings. The foundation for this reading of formulae was provided by a forcing semantics r⊨A advanced by Pym, where the forcing relation means 'A holds of resource r'. The semantics is analogous to Kripke's semantics of intuitionistic or modal logic, but where the elements of the model are regarded as resources that can be composed and decomposed, rather than as possible worlds that are accessible from one another. For example, the forcing semantics for the conjunction is of the form

r⊨A∗Biff∃rArB.rA⊨A,rB⊨B,andrA∙rB≤r where rA∙rB is a way of combining resources and ≤ is a relation of approximation. This semantics of bunched logic draws on prior work in relevance logic (especially the operational semantics of Routley–Meyer), but differs from it by not requiring r∙r≤r and by accepting the semantics of standard intuitionistic or classical versions of ∧ and ⇒. The property r∙r≤r is justified when thinking about relevance but denied by considerations of resource; having two copies of a resource is not the same as having one, and in some models (e.g. heap models) r∙r might not even be defined. The standard semantics of ⇒ (or of negation) is often rejected by relevantists in their bid to escape the `paradoxes of material implication', which are not a problem from the perspective of modelling resources and so not rejected by bunched logic. The semantics is also related to the 'phase semantics' of linear logic, but again is differentiated by accepting the standard (even boolean) semantics of ∧ and ⇒, which in linear logic is rejected in a bid to be constructive. These considerations are discussed in detail in an article on resource semantics by Pym, O'Hearn and Yang.

Categorical semantics (doubly closed categories) The double version of the deduction theorem of bunched logic has a corresponding category-theoretic structure. Proofs in intuitionistic logic can be interpreted in cartesian closed categories, that is, categories with finite products satisfying the (natural in A and C) adjunction correspondence relating hom sets:

Hom(A∧B,C)is isomorphic toHom(A,B⇒C) Bunched logic can be interpreted in categories possessing two such structures

a categorical model of bunched logic is a single category possessing two closed structures, one symmetric monoidal closed the other cartesian closed. A host of categorial models can be given using Day's tensor product construction. Additionally, the implicational fragment of bunched logic has been given a game semantics.

Algebraic semantics The algebraic semantics of bunched logic is a special case of its categorical semantics, but is simple to state and can be more approachable.

An algebraic model of bunched logic is a poset that is a Heyting algebra and that carries an additional commutative residuated lattice structure (for the same lattice as the Heyting algebra): that is, an ordered commutative monoid with an associated implication satisfying A∗B≤CiffA≤B−∗C. The boolean version of bunched logic has models as follows.

An algebraic model of boolean bunched logic is a poset that is a Boolean algebra and that carries an additional residuated commutative monoid structure.

Proof theory and type theory (bunches) The proof calculus of bunched logic differs from usual sequent calculi in having a tree-like context of hypotheses instead of a flat list-like structure. In its sequent-based proof theories, the context Δ in an entailment judgement Δ⊢A is a finite rooted tree whose leaves are propositions and whose internal nodes are labelled with modes of composition corresponding to the two conjunctions. The two combining operators, comma and semicolon, are used (for instance) in the introduction rules for the two implications.

Γ,A⊢BΓ⊢A−∗BΓ;A⊢BΓ⊢A⇒B The difference between the two composition rules comes from additional rules that apply to them.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Bunched logic

Start with the simplest possible case. Write down what Bunched 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 Bunched 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 Bunched 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 Bunched logic

In research
Bunched 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 Bunched 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
Bunched logic is common in secondary-school and first-year university syllabi. It links to neighbouring topics Logic in computer science, Mathematical logic, Substructural logic, so understanding it makes those chapters shorter.
In everyday life
Look for Bunched 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.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Bunched logic” →

How to study Bunched logic in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Bunched 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 Bunched logic out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Bunched logic in simple terms?

Bunched logic is a variety of substructural logic proposed by Peter O'Hearn and David Pym. Bunched logic provides primitives for reasoning about resource composition, which aid in the compositional analysis of computer and other systems.

Why does Bunched 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 Bunched 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 Bunched logic.

Tags

  • Logic in computer science
  • Mathematical logic
  • Substructural logic

Keep exploring