← Latest papers
💻 computer science

A unification of graded and substructural logics

This paper introduces GRASS, a unified type system that integrates the resource restriction mechanisms of substructural logics with the quantitative tracking of graded systems, enabling flexible, heterogeneous control over variable usage within a single framework and subsuming established models like LNL, Adjoint Logic, and mGL through its categorical semantics.

Original authors: Peter Hanukaev, Harley Eades III

Published 2026-05-19
📖 5 min read🧠 Deep dive

Original authors: Peter Hanukaev, Harley Eades III

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are a chef running a busy kitchen. In a traditional kitchen (standard programming), if you need an egg, you can grab one, use it, and then grab another one from the same carton without worrying about how many are left. You can also throw an egg away if you don't need it. This is like treating variables as "propositions" that can be reused or discarded freely.

But in a high-stakes kitchen (resource-sensitive computing), ingredients are precious. You can't use the same egg twice in two different ovens at once, and you can't throw away a rare spice you might need later. This is the world of Grass, a new system created by Peter Hanukaev and Harley Eades III to help programmers manage these "ingredients" (variables) perfectly.

Here is how the paper breaks it down, using simple analogies:

1. The Two Old Ways of Managing Ingredients

Before Grass, there were two main ways chefs tried to manage their resources:

  • The "Strict Rules" Approach (Substructural Logics): Imagine a kitchen where the rules are rigid. You are forbidden from using an ingredient twice or throwing it away unless you have a special "magic pass" (a modality). This is great for preventing waste, but it's hard to use for things that should be reusable, like a salt shaker.
  • The "Scorecard" Approach (Graded Systems): Imagine a kitchen where you can use ingredients freely, but every time you grab one, you have to write down a number on a scorecard. If you grab a "1," you used it once. If you grab a "2," you used it twice. This is flexible, but it treats everything as a number, which can be too rigid for things that need strict "no reuse" rules.

2. The New Solution: Grass

The authors created Grass (Graded and Substructural). Think of Grass as a universal kitchen manager that combines the best of both worlds.

  • It's a Hybrid: Grass allows you to have some ingredients that follow strict "no reuse" rules (like a linear logic) and others that follow flexible "scorecard" rules (like a graded system), all in the same recipe.

  • The "Modes" Concept: This is the paper's big innovation. Imagine the kitchen has different "zones" or Modes.

    • Zone A (Strict): In this zone, you can't reuse ingredients.
    • Zone B (Flexible): In this zone, you can reuse ingredients, but you must track how many times.
    • Zone C (Secure): In this zone, you might track security clearance levels.

    Grass lets you move ingredients between these zones. You can take a "secure key" from the Secure Zone and use it to unlock a file in the Flexible Zone, but the system ensures the key is handled correctly according to the rules of both zones.

3. How It Controls Usage (The "Ideal" Concept)

The paper introduces a mathematical concept called an "Ideal" to control how ingredients can be combined.

  • The Analogy: Imagine you have a bucket of "contractible" items (things you can merge). If you have two "1s" (one use each), can you merge them into a "2" (two uses)?

    • In some zones, Yes: You can merge two single-use items into a double-use item.
    • In other zones, No: You cannot merge two single-use items. If you try to use a file handle twice, the system stops you because two "1s" cannot become a "2" in that specific zone.

    This prevents dangerous errors, like trying to use two separate file handles as if they were one giant handle that can be used twice.

4. The "Translation" System

The paper also describes how to move between these different zones using morphisms (translation functions).

  • The Analogy: Imagine a translator who speaks "Strict Zone" and "Flexible Zone." If you have a rule in the Strict Zone that says "Do not reuse," the translator knows how to convert that into the Flexible Zone's language (perhaps by saying "Reuse is allowed, but only if you mark it with a high score").
  • The authors prove that this translation is safe. If a recipe works in the Strict Zone, the translated version will work correctly in the Flexible Zone without breaking the rules.

5. The Mathematical "Blueprint" (Categorical Semantics)

Finally, the authors built a mathematical "blueprint" (categorical semantics) to prove their system works.

  • The Analogy: They didn't just build the kitchen; they drew up the architectural plans using advanced geometry (category theory). They showed that their new system (Grass) is actually a "super-system" that contains all the old systems (Linear Logic, Adjoint Logic, etc.) as special cases.
  • They proved that if you take their complex blueprint and simplify it, you get the exact same results as the older, simpler blueprints. This means Grass is a true unification, not just a patchwork.

Summary

In short, this paper presents Grass, a new way to write computer code that treats variables like physical resources. It allows programmers to mix different rules for different variables within the same program.

  • It uses Modes to define different rule sets (strict vs. flexible).
  • It uses Ideals to decide when resources can be merged or split.
  • It uses Mathematical Proofs to ensure that moving between these different rule sets never causes the program to crash or behave incorrectly.

The result is a system that gives programmers the maximum possible control over how their code uses memory, files, and data, preventing leaks and errors while remaining flexible enough for complex tasks.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →