<!-- canonical: efficientnewlanguage.org/ai/examples/910-the-stock-was-counted-and-the-promises-were-not | ai_layer_version: 0.1.0 | updated: 2026-09-18 -->

# Example 910 — The stock was counted and the promises were not

`the_stock_was_counted_and_the_promises_were_not.eml` - The sales screen shows 1400 units of stock, the count behind it is exact, and sales staff sell against it. Which of those units can actually be promised to a new customer is computed below.

## EML

```eml
# Self-authored for the EML case corpus (no external origin). The sales screen
# shows 1400 units of stock, the count behind it is exact, and sales staff sell
# against it. Which of those units can actually be promised to a new customer
# is computed below.
#
# The count is careful. It reads the real on-hand quantity from the warehouse;
# it includes the real units already bought and in transit; every unit is
# counted once; and the intent is exactly 'how much can we sell'.
#
# Four hundred of the units are still on a ship and three hundred are already
# promised to earlier orders, so the units a new customer can actually be
# promised are 700 - half of what the screen shows.

1000 => units_on_hand
400 => units_in_transit
300 => units_promised_to_earlier_orders

units_on_hand + units_in_transit => units_the_screen_shows
units_on_hand - units_promised_to_earlier_orders => units_available_to_promise
units_the_screen_shows - units_available_to_promise => units_that_cannot_be_promised_today
int(units_available_to_promise * 10000 / units_the_screen_shows) => truly_available_share_per_myriad

"units on hand                   : " + str(units_on_hand) ^0
"units in transit                : " + str(units_in_transit) ^0
"units promised to earlier orders : " + str(units_promised_to_earlier_orders) ^0
"" ^0
"the screen shows                : " + str(units_the_screen_shows) ^0
"available to promise            : " + str(units_available_to_promise) ^0
"shown but not promisable        : " + str(units_that_cannot_be_promised_today) ^0
"truly available share           : " + str(truly_available_share_per_myriad) + " per ten thousand" ^0
"" ^0

# ---- what the count verified ----

"the stock figure" ^0
"  reads : the real on-hand quantity" ^0
"  includes : real units bought and in transit" ^0
"  counting : every unit once" ^0
"  intent : how much can we sell" ^0
"  units double-counted : 0" ^0
"  verdict : 1400 UNITS, EXACTLY" ^0
"" ^0
"  counting every real unit exactly once is the part done" ^0
"  right here, and it is why " + str(units_the_screen_shows) + " is a true count of" ^0
"  units the company owns or has paid for" ^0
"" ^0

# ---- which units can be promised ----

"three different questions" ^0
"  units we own : " + str(units_the_screen_shows) ^0
"  units on the shelf today : " + str(units_on_hand) ^0
"  units on the shelf and not yet spoken for : " + str(units_available_to_promise) ^0
"  what the sales screen answers : the first" ^0
"  what a promise to a customer needs : the third" ^0
"  so selling to the screen : oversells by up to " + str(units_that_cannot_be_promised_today) ^0
"" ^0

# ---- what the customers got ----

"the orders" ^0
"  new orders accepted against the screen : up to " + str(units_the_screen_shows) ^0
"  units that can ship today : " + str(units_available_to_promise) ^0
"  is the count wrong : no; it is exact" ^0
"  is a counted unit a promisable unit : no; " + str(units_in_transit) + " are at" ^0
"    sea and " + str(units_promised_to_earlier_orders) + " belong to someone already" ^0
"" ^0

# ---- null control ----

# The same screen showing available-to-promise: on hand, minus already
# allocated, with in-transit shown separately with its arrival date.
1400 => nc_figure_sold_against_before
700 => nc_figure_sold_against_after
700 => nc_overselling_the_change_prevents

"null control - show available-to-promise, not units owned" ^0
"  figure sold against, before : " + str(nc_figure_sold_against_before) ^0
"  figure sold against, after : " + str(nc_figure_sold_against_after) ^0
"  overselling the change prevents : up to " + str(nc_overselling_the_change_prevents) ^0
"  no unit and no order changed; the screen stopped" ^0
"  answering a question nobody at the counter was asking" ^0
"" ^0

# ---- the rule ----

"what an exact stock count guarantees" ^0
"  the number of units the company owns is right : exactly," ^0
"    every real unit, counted once" ^0
"  that many units can be promised : not addressed; " + str(units_in_transit) + " are" ^0
"    in transit and " + str(units_promised_to_earlier_orders) + " are already promised, so " + str(units_available_to_promise) + " can" ^0
"    be, " + str(truly_available_share_per_myriad) + " per ten thousand of the screen" ^0
"" ^0

"a count answers 'how many are there', and a sale needs 'how many are here" ^0
"and free'; the units in the difference are real, owned, and unavailable, and a" ^0
"screen that shows the count is precise about the wrong set" ^0
"" ^0

"The screen counts every unit the company owns exactly once - " + str(units_the_screen_shows) + " is true. But" ^0
"" + str(units_in_transit) + " are still at sea and " + str(units_promised_to_earlier_orders) + " are promised to earlier orders, so only " + str(units_available_to_promise) ^0
"can be promised today, " + str(truly_available_share_per_myriad) + " per ten thousand of what was sold against, until the" ^0
"screen shows available-to-promise." ^0
```

## Python (deterministic transpilation)

```python
units_on_hand = 1000
units_in_transit = 400
units_promised_to_earlier_orders = 300
units_the_screen_shows = units_on_hand + units_in_transit
units_available_to_promise = units_on_hand - units_promised_to_earlier_orders
units_that_cannot_be_promised_today = units_the_screen_shows - units_available_to_promise
truly_available_share_per_myriad = int(units_available_to_promise * 10000 / units_the_screen_shows)
print("units on hand                   : " + str(units_on_hand))
print("units in transit                : " + str(units_in_transit))
print("units promised to earlier orders : " + str(units_promised_to_earlier_orders))
print("")
print("the screen shows                : " + str(units_the_screen_shows))
print("available to promise            : " + str(units_available_to_promise))
print("shown but not promisable        : " + str(units_that_cannot_be_promised_today))
print("truly available share           : " + str(truly_available_share_per_myriad) + " per ten thousand")
print("")
print("the stock figure")
print("  reads : the real on-hand quantity")
print("  includes : real units bought and in transit")
print("  counting : every unit once")
print("  intent : how much can we sell")
print("  units double-counted : 0")
print("  verdict : 1400 UNITS, EXACTLY")
print("")
print("  counting every real unit exactly once is the part done")
print("  right here, and it is why " + str(units_the_screen_shows) + " is a true count of")
print("  units the company owns or has paid for")
print("")
print("three different questions")
print("  units we own : " + str(units_the_screen_shows))
print("  units on the shelf today : " + str(units_on_hand))
print("  units on the shelf and not yet spoken for : " + str(units_available_to_promise))
print("  what the sales screen answers : the first")
print("  what a promise to a customer needs : the third")
print("  so selling to the screen : oversells by up to " + str(units_that_cannot_be_promised_today))
print("")
print("the orders")
print("  new orders accepted against the screen : up to " + str(units_the_screen_shows))
print("  units that can ship today : " + str(units_available_to_promise))
print("  is the count wrong : no; it is exact")
print("  is a counted unit a promisable unit : no; " + str(units_in_transit) + " are at")
print("    sea and " + str(units_promised_to_earlier_orders) + " belong to someone already")
print("")
nc_figure_sold_against_before = 1400
nc_figure_sold_against_after = 700
nc_overselling_the_change_prevents = 700
print("null control - show available-to-promise, not units owned")
print("  figure sold against, before : " + str(nc_figure_sold_against_before))
print("  figure sold against, after : " + str(nc_figure_sold_against_after))
print("  overselling the change prevents : up to " + str(nc_overselling_the_change_prevents))
print("  no unit and no order changed; the screen stopped")
print("  answering a question nobody at the counter was asking")
print("")
print("what an exact stock count guarantees")
print("  the number of units the company owns is right : exactly,")
print("    every real unit, counted once")
print("  that many units can be promised : not addressed; " + str(units_in_transit) + " are")
print("    in transit and " + str(units_promised_to_earlier_orders) + " are already promised, so " + str(units_available_to_promise) + " can")
print("    be, " + str(truly_available_share_per_myriad) + " per ten thousand of the screen")
print("")
print("a count answers 'how many are there', and a sale needs 'how many are here")
print("and free'; the units in the difference are real, owned, and unavailable, and a")
print("screen that shows the count is precise about the wrong set")
print("")
print("The screen counts every unit the company owns exactly once - " + str(units_the_screen_shows) + " is true. But")
print("" + str(units_in_transit) + " are still at sea and " + str(units_promised_to_earlier_orders) + " are promised to earlier orders, so only " + str(units_available_to_promise))
print("can be promised today, " + str(truly_available_share_per_myriad) + " per ten thousand of what was sold against, until the")
print("screen shows available-to-promise.")
```

## stdout (executed)

```text
units on hand                   : 1000
units in transit                : 400
units promised to earlier orders : 300

the screen shows                : 1400
available to promise            : 700
shown but not promisable        : 700
truly available share           : 5000 per ten thousand

the stock figure
  reads : the real on-hand quantity
  includes : real units bought and in transit
  counting : every unit once
  intent : how much can we sell
  units double-counted : 0
  verdict : 1400 UNITS, EXACTLY

  counting every real unit exactly once is the part done
  right here, and it is why 1400 is a true count of
  units the company owns or has paid for

three different questions
  units we own : 1400
  units on the shelf today : 1000
  units on the shelf and not yet spoken for : 700
  what the sales screen answers : the first
  what a promise to a customer needs : the third
  so selling to the screen : oversells by up to 700

the orders
  new orders accepted against the screen : up to 1400
  units that can ship today : 700
  is the count wrong : no; it is exact
  is a counted unit a promisable unit : no; 400 are at
    sea and 300 belong to someone already

null control - show available-to-promise, not units owned
  figure sold against, before : 1400
  figure sold against, after : 700
  overselling the change prevents : up to 700
  no unit and no order changed; the screen stopped
  answering a question nobody at the counter was asking

what an exact stock count guarantees
  the number of units the company owns is right : exactly,
    every real unit, counted once
  that many units can be promised : not addressed; 400 are
    in transit and 300 are already promised, so 700 can
    be, 5000 per ten thousand of the screen

a count answers 'how many are there', and a sale needs 'how many are here
and free'; the units in the difference are real, owned, and unavailable, and a
screen that shows the count is precise about the wrong set

The screen counts every unit the company owns exactly once - 1400 is true. But
400 are still at sea and 300 are promised to earlier orders, so only 700
can be promised today, 5000 per ten thousand of what was sold against, until the
screen shows available-to-promise.
```

## Round-trip

`ok: true` — round-trip fixpoint reached (python1 == python2)

## Trace event types

eml:run:start · eml:assign · eml:output · eml:run:done
