:PROPERTIES:
:ID: 7c02edf0-8541-4259-8112-0599ede9c9ba
:mtime: 20230923192037
:ctime: 20230923191921
:END:
#+title: Relationship between Cooking Recipes and Linear Logic
#+filetags: :cooking:linearloigc:project:public:
* Basic Idea
I have noticed a connection between cooking recipes and linear logic.
Just as variables in linear logic cannot be duplicated, so too can
ingredients in recipes not be duplicated.
* Use for Giving Intuition
I think that
perhaps using the example of a recipe could give people
intuition for how linear logic works.
* Example Pseudo-Code
I will use an example recipe
[[https://based.cooking/irish-potato-casserole/]]
to show how this could work
#+BEGIN_SRC haskell
potato_cassarole : Cups 2 Potato -> Cups 1/2 Butter -> Quantity 2 Eggs
-> Tsp 1 Onion -> Tsp 1 Salt -> Tsp 1/4 Paprika -> Cup 1/2 Milk -> Cup 1/2 Cheese
potato_cassarole potato butter egg onion salt paprika milk cheese =
bake (sprinkle (shred cheese) (bake (pour milk (mix [potato , butter , egg , onion , salt , paprika]))))
#+END_SRC
* Use in Verified Cooking site
Someone could perhaps use this idea to
have websites automatically generated by linear code.
The benefits of this approach would be that there would be no ingredient errors in the
recipe: all ingredients would be garuanteed to always be used to the correct amounts.
I don't have the motivation or knowledge to make such a site, but I think it would
be an interesting idea nonetheless.