hedwigaihedwigaihedwigai
Free · no account needed to check

Vending machine business plan: will it work?

A business is a set of processes running at once. The checker tries every order they can happen in and finds where they break. Coins on each step show what it earns.

1. The business

Two customers, one card reader, a dispenser that can jam, a refund timer and a restock route.

the customersawaychargedgot itstuckrefundeddisputedawaychargedgot itstuckrefundeddisputedthe card readerfreebusy with a salefreebusy with asalethe dispenserdrops itjamsdrops itjamsthe refund timeroffjam seentimer runningrefundedoffjam seentimer runningrefundedthe restock routenoneon the waydonenoneon the waydonethe takings0+ a sale- a refund0+ a sale- a refundthe dayopenoveropenovertapping a cardvendthe jam sensora new sale resets the machinemoney backnew stock

Each loop is a process and its states; the dot goes round them. The labels between loops are where processes meet; the red ones are where the picked rule breaks.

2. The rules

206 states reached

Step through: the opening state

Everything as the business opens. Press Next.

cust
customer 1: awaycustomer 2: away
owed
customer 1: nocustomer 2: no
serving
0
jamFor
0
timer
0
stock
2
route
none
cash
0
day
open

3. Fixes

No fixes on: 206 states, 1 rule broken. The fewest fixes that make every rule hold: write each jam on a list.

4. Coins

A night picks a random step at each point, with equal odds, until none can happen; closing steps come last. Change what a step earns or costs and the nights run again.

Press Run to play 100,000 nights.

5. Interpret with AI

A language model reads this spec, the broken rules, the path in steps and the coins, and explains in plain words what goes wrong and what to change. A fix it suggests can be applied here and checked.

Sign in to ask

The checker is free without an account; the explanation needs one.

How the checker works

What does it check?

Each process is simple on its own: guests sit, order, eat and pay; a kitchen cooks. The trouble is that they run at the same time. The checker starts from the opening state and takes every step that can happen next, then every step after that, until it has seen every state the business can reach. In each state it checks every rule. A rule that fails anywhere is shown with the shortest path to the failure.

Why the shortest path?

The search goes breadth first, as TLC does for a TLA+ model, so the first broken state it meets is the nearest one. That path is the simplest story of how the plan goes wrong, and the one worth fixing first.

What is a night of coins?

A night starts at the opening state. At each point one of the steps that can happen is picked at random, with equal odds, until no step can. Closing steps are picked only when nothing else can happen, so a night ends when the work is done. Each step adds its coins. The page runs 100,000 nights and shows how many ended on each total.

Can I check my own business?

Yes. Signed in, describe it in a few sentences: who does what, and what they share. A language model writes it as processes and rules in the same format, and the page checks it like the examples.