8

I read a lot about Linear Logic recently but I failed to find any real use to the logic.

I'd like to know how and where Linear Logic could be applied. Something like lambda calculus can be clearly used as a programming language (scheme, lisp). But I don't see how Linear Logic could be used in the real world...

Shaun
  • 47,747
  • 3
    Aw come on, after searching a bit more, I found that there is an actual programming language built on top of linear logic... something similar to prolog. – Loïc Faure-Lacroix Apr 28 '15 at 20:27
  • 2
    How is it opinion based, if the logic as a concrete use and a direct application in real world it is hardly an opinion. – Loïc Faure-Lacroix Apr 29 '15 at 11:04
  • 1
    To me the question is very good. What are the applications (in computer science, among them) of linear logic? Apparently, there have been some attempts to use this theory in the creation of some programming languages based on "linear types" (Clean being such an example; possibly Mercury?) - I myself would be happy to be explained more on this issue. It is sad that the question has been put on hold, becasue, as my comment shows, there can be given some very informative answers. – Alex M. Apr 29 '15 at 17:39
  • @AlexM. Yes that could make a good answer. I didn't find that Mercury language, it sounds a lot like "Lolli" but it is much more documented. – Loïc Faure-Lacroix Apr 30 '15 at 14:39
  • Mercury is much more recent and still maintained. It is not just an academic experiment, one could use it for some "serious" programming. (Plus, I think it is really a conceptually beautiful language.) Mind you, I do not know whether it is conceptually based upon linear logic, but I think it does. Check for yourself: http://mercurylang.org/ – Alex M. Apr 30 '15 at 18:10
  • @AlexM. reopened, you can add your answer. – Loïc Faure-Lacroix May 07 '15 at 18:24
  • Sorry, but my comments were all that I could add concerning this matter. I was frustrated by the closing of your question because I myself was hoping to get an answer to it (mostly in the context of programming languages). – Alex M. May 07 '15 at 18:47
  • Concerning how one could use LL in programming languages, it is important to understand that many bugs come from holding too many references to the same object. LL seems to add a framework in which some objects are guaranteed to only have a single reference pointing to them, that makes managing them very easy (and formally verifiable). A hint for you might be the interpretation of LL as a formalism for managing resources. – Alex M. May 07 '15 at 18:50

3 Answers3

4

Session types in type theory can be defined in terms of (intuitionistic) linear logic. See e.g. Caires and Pfenning. Whether or not you think session types (or even type theory) is a "real use" is up to you.

However, it is also used in practice as a language for for specifying properties which can then be verified to hold or not for a given model using model checking algorithms. See e.g. Faymonville and Zimmermann.

mrp
  • 5,226
3

It matches Quantum Mechanics quite well, because the built-in conservation rules for propositions match the QM prohibitions on copying and deleting information:

"Physics, Topology, Logic and Computation: A Rosetta Stone"
John Baez, Mike Stay
http://math.ucr.edu/home/baez/rosetta.pdf

"Linear Logic for Generalized Quantum Mechanics"
Vaughn Pratt
http://boole.stanford.edu/pub/ql.pdf

These efforts are undertaken in a framework of Category Theory. The insight is that where intuitionist logics (Heyting algebras) correspond to cartesian closed categories (actually posets whose duals are also cartesian closed), linear logic corresponds to symmetric monoidal categories.

The fact that linear logic is resource-based, where propositions are supplied and consumed in inference rules, has the corollary that monoidal categories can be represented as 2D pictures with lines and boxes, where only free inputs and outputs can be left dangling (a la Feynman). Expressions are composed by connecting the wires on sub-expressions. The non-commutative aspects mean that spatial position and ordering of the wires is significant. If we introduce a 'crossing' operator, we have 'braided' monoidal categories, which are closely related to knot theory.

For much more on these diagrams, look at the beautifully illustrated papers from Bob Coecke et al. at Oxford.

Kat

2

In the context of programming language, there is the programming language that has multiple implementations. The syntax and the way it works is quite close to prolog. As it is pretty much a prototype, it lacks basic things such as sockets, reading file, debugger ...

This might be useful to anyone looking for code: http://www.lix.polytechnique.fr/~dale/lolli/

Secondly, in the "Related systems", there is the "Lolli for Alice" project that is quite interesting. It adds communication channels to Lolli. Using communication channels, it is possible to have 2 different process working altogether cooperatively.

There is an implementation of a planning system that makes it possible for 2 process to communicate with each others. Both process don't have to know the internals of the other to reach there goals and a predefined protocol of communication isn't necessary.

Using the resource semantic, it tries to find which action will make each agent reach there goal in parallel.

There for more information on the subject: http://dream.inf.ed.ac.uk/projects/dialoguell/