← Latest papers
💻 computer science

Access Hoare Logic

This paper introduces Access Hoare Logic, a novel formalism for reasoning about access control and security in computer programs, and establishes its soundness, completeness, and fundamental distinctions from both standard Hoare logic and incorrectness logic.

Original authors: Arnold Beckmann, Anton Setzer

Published 2026-04-01
📖 5 min read🧠 Deep dive

Original authors: Arnold Beckmann, Anton Setzer

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 security guard at a high-tech hotel. Your job is to make sure that only the right people get into the right rooms.

For decades, computer scientists have used a famous method called Hoare Logic to check if computer programs work correctly. Think of Hoare Logic as a forward-looking detective. It asks: "If I start with this specific key (the pre-condition), will the door definitely open (the post-condition) when I run the program?"

If the answer is yes, the program is "correct." This works great for most software. But, the authors of this paper argue that for Access Control (security), this forward-looking approach misses the most important question.

The Problem: The "False Alarm" Trap

Let's say you have a program that opens a door.

  • Hoare Logic (Forward): "If the guest has a valid key, the door opens." (This is true).
  • The Security Flaw: What if the program is broken and opens the door regardless of whether the guest has a key?
    • Hoare Logic might still say, "Well, if they did have a key, the door opened. So it's correct!"
    • But as a security guard, you know that's a disaster. You need to know: "If the door opened, was it necessary that the guest had a valid key?"

This is the gap the paper fills. They introduce Access Hoare Logic (aHL).

The Solution: The "Backward Detective"

Access Hoare Logic is like a backward-looking detective. Instead of asking "What happens if I start here?", it asks: "If the door is open, what must have happened before?"

  • Standard Hoare Logic: "If I have a key, the door opens." (Sufficiency).
  • Access Hoare Logic: "If the door is open, I must have had a key." (Necessity).

In the world of security, we don't just want to know that a key can open the door; we need to guarantee that nothing else can open it. Access Hoare Logic forces the computer to prove that the "Open Door" state is impossible without the "Valid Key" state.

Real-World Analogies from the Paper

The authors use three examples to show why this backward thinking is crucial:

1. The Hotel Key Card (The "Ambiguous Code" Trap)

Imagine a hotel where your key card has two chips: an old one and a new one.

  • The Goal: When you swipe, the door opens, and the old chip is deactivated so the previous guest can't use it.
  • The Bug: The programmer wrote the code in a way that is ambiguous. One version of the code checks the key and then always opens the door, even if the key is wrong.
  • The Result:
    • Hoare Logic says: "If the guest has the right key, the door opens." (True, so it passes).
    • Access Hoare Logic says: "If the door opened, did the guest necessarily have the right key?" (No! The door opened even with a wrong key). FAIL.
    • Analogy: It's like a bouncer who lets anyone in if they have a VIP pass, but also lets everyone in anyway. Hoare Logic checks if VIPs get in; Access Logic checks if only VIPs get in.

2. Bitcoin (The Digital Vault)

Bitcoin uses "scripts" to move money. To send money, you need a digital signature (a key) that matches a specific address.

  • The Goal: Ensure that money only moves if the correct signature is provided.
  • The Logic: Access Hoare Logic verifies that if the transaction succeeds (money moves), it is impossible that the wrong signature was used. It proves that the "Success" state requires the "Correct Signature" state.

3. The Master Key List (The Loop)

Imagine a program that checks a list of 1,000 keys to see if yours is on it.

  • The Goal: Grant access only if your key is in the list.
  • The Logic: Access Hoare Logic traces the program backward from the moment access is granted. It proves that for the program to reach the "Access Granted" state, it must have found your key in the list during the loop. If the loop had a bug that granted access by accident, Access Hoare Logic would catch it because the "Access Granted" state wouldn't be necessary for finding the key.

Why Not Just Use "Negation"?

You might think, "Can't we just flip the logic? Instead of 'If Key then Open', say 'If No Key then No Open'?"

The authors say: Yes, you can, but it's a nightmare.

  • The "Negation" Approach: It turns simple, clear math into confusing, double-negative riddles (like "It is not the case that the door is not open").
  • The "Direct" Approach: Access Hoare Logic gives us a new, clean set of rules specifically designed for security. It's like having a specialized screwdriver for security screws, rather than trying to use a hammer and twisting it until it breaks.

The Big Picture

This paper is essentially saying: "We have a great tool for building things (Hoare Logic), but we need a different tool for locking them up (Access Hoare Logic)."

  • Hoare Logic ensures your program does what you intend it to do.
  • Access Hoare Logic ensures your program does nothing you didn't intend it to do (specifically, it ensures no unauthorized access).

By using this "backward detective" approach, we can build more secure systems, from hotel doors to the billions of dollars in Bitcoin, ensuring that the only way to get in is to have the right key.

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 →