> For the complete documentation index, see [llms.txt](https://mandober.gitbook.io/math-debrief/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mandober.gitbook.io/math-debrief/300-logic/terms/linear-logic.md).

# Linear logic

Traditional logic encourages reckless use of resources. Weakening discards assumptions, Contraction duplicates assumptions. This makes sense for logic where truth is free, and hence for for some PLs where copying a value is as cheap as copying a pointer. But it is not always sensible. Linear logic encourages more careful use of resources.

In PL terms, this corresponds to a language that allows control over duplication and discarding for some variables, but is still powerful enough that all traditional programs may be expressed within it.

So rather than getting rid of Contraction and Weakening entirely, if they are used in a proof that will be explicitly visible in the proposition proved.

The restriction of Contraction and Weakening profoundly changes the nature of the logical connectives:

* implication is now written `A −◦ B` *consume A yielding B* (the symbol `−◦` on its own is called lollipop)
* there are two distinct ways to formulate conjunction, corresponding to two distinct connectives in linear logic. These are written `A ⊗ B` "both A and B" and `A & B` "choose from A and B" (`⊗` is called "tensor", `&` is "with")
* Disjunction is written `A ⊕ B` "either A or B"
* Finally, a new form of proposition is introduced to indicate where Contraction or Weakening may be used. It is written `!A` and pronounced "of course A" (`!` is "bang")

Let A,B,C range over propositions, and X range over propositional constants. The grammar of linear propositions is as follows:

> A,B,C := X | A −◦ B | A ⊗ B | A & B | A ⊕ B | !A


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://mandober.gitbook.io/math-debrief/300-logic/terms/linear-logic.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
