FAILURE MAP
← Case archive

FA-43081 / Borrow checking / Open access

Storage-scope rejection requires all inferred points to be forbidden · case 01

Storage-scope rejection requires all inferred points to be forbidden.

Verified by executionVariant 1 · 11 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The static analyzer mishandles forbidden intersection: storage-scope rejection requires all inferred points to be forbidden.

THE FAILURE

The static analyzer mishandles forbidden intersection: storage-scope rejection requires all inferred points to be forbidden.

Unsuccessful approach: The partial repair uses bad=sorted(r for r in names if points[r] and points[r]<=set(forbidden.get(r,[]))), which still violates the stipulated analysis contract.

Case contract

Solve finite outlives constraints a:b meaning a contains b. regions is universe, edges named constraints, equalities are bidirectional, demands maps region to points, universal maps region to required external points, forbidden maps region to points forbidden by storage scope. Compute least fixed point. Unknown edge endpoints produce error unknown; own seeds are retained; report sorted point sets and region names violating forbidden points. The static solution includes disconnected regions and propagates through cycles.

Why this case matters

A finite offline static-analysis model of ownership and borrowing; it does not execute the analyzed program.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(regions, edges, equalities, demands, universal, forbidden):
    names=set(regions)
    if any(a not in names or b not in names for a,b in edges+equalities): return 'unknown'
    links=list(edges)
    for a,b in equalities: links.extend([(a,b),(b,a)])
    points={r:set(demands.get(r,[])) for r in names}
    for r in names: points[r].update(universal.get(r,[]))
    changed=True
    while changed:
        changed=False
        for a,b in links:
            before=set(points[a])
            points[a].update(points[b])
            if points[a]!=before: changed=True
    bad=sorted(r for r in names if points[r]==set(forbidden.get(r,[])))
    return [dict((r,sorted(points[r])) for r in sorted(names)),bad]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty',solve([],[],[],{},{},{}),[{},[]])
check('disconnected',solve(['a'],[],[],{},{},{}),[{'a':[]},[]])
check('unknown edge',solve(['a'],[('a','z')],[],{},{},{}),'unknown')
check('unknown equality',solve(['a'],[],[('a','z')],{},{},{}),'unknown')
check('seed both',solve(['a'],[],[],{'a':[N,N+1]},{'a':[N+2]},{}),[{'a':[N,N+1,N+2]},[]])
check('equality',solve(['a','b'],[],[('a','b')],{'a':[N],'b':[N+1]},{},{}),[{'a':[N,N+1],'b':[N,N+1]},[]])
check('transitive reversed order',solve(['a','b','c'],[('a','b'),('b','c')],[],{'c':[N]},{},{}),[{'a':[N],'b':[N],'c':[N]},[]])
check('one-way',solve(['a','b'],[('a','b')],[],{'a':[N],'b':[N+1]},{},{}),[{'a':[N,N+1],'b':[N+1]},[]])
check('forbidden partial',solve(['a'],[],[],{'a':[N,N+1]},{},{'a':[N]}),[{'a':[N,N+1]},['a']])
check('empty not forbidden',solve(['a'],[],[],{},{},{'a':[N]}),[{'a':[]},[]])
check('cycle',solve(['a','b'],[('a','b'),('b','a')],[],{'a':[N]},{},{}),[{'a':[N],'b':[N]},[]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
empty[{}, []][{}, []]Passed
disconnected[{'a': []}, ['a']][{'a': []}, []]Failed
unknown edgeunknownunknownPassed
unknown equalityunknownunknownPassed
seed both[{'a': [1, 2, 3]}, []][{'a': [1, 2, 3]}, []]Passed
equality[{'a': [1, 2], 'b': [1, 2]}, []][{'a': [1, 2], 'b': [1, 2]}, []]Passed
transitive reversed order[{'a': [1], 'b': [1], 'c': [1]}, []][{'a': [1], 'b': [1], 'c': [1]}, []]Passed
one-way[{'a': [1, 2], 'b': [2]}, []][{'a': [1, 2], 'b': [2]}, []]Passed
forbidden partial[{'a': [1, 2]}, []][{'a': [1, 2]}, ['a']]Failed
empty not forbidden[{'a': []}, []][{'a': []}, []]Passed
cycle[{'a': [1], 'b': [1]}, []][{'a': [1], 'b': [1]}, []]Passed

SHA-256 / 0542769ef481966f30544493e9c5292656b72951eb4dc15ed07abd1498ea3c7a

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(regions, edges, equalities, demands, universal, forbidden):
    names=set(regions)
    if any(a not in names or b not in names for a,b in edges+equalities): return 'unknown'
    links=list(edges)
    for a,b in equalities: links.extend([(a,b),(b,a)])
    points={r:set(demands.get(r,[])) for r in names}
    for r in names: points[r].update(universal.get(r,[]))
    changed=True
    while changed:
        changed=False
        for a,b in links:
            before=set(points[a])
            points[a].update(points[b])
            if points[a]!=before: changed=True
    bad=sorted(r for r in names if points[r] and points[r]<=set(forbidden.get(r,[])))
    return [dict((r,sorted(points[r])) for r in sorted(names)),bad]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty',solve([],[],[],{},{},{}),[{},[]])
check('disconnected',solve(['a'],[],[],{},{},{}),[{'a':[]},[]])
check('unknown edge',solve(['a'],[('a','z')],[],{},{},{}),'unknown')
check('unknown equality',solve(['a'],[],[('a','z')],{},{},{}),'unknown')
check('seed both',solve(['a'],[],[],{'a':[N,N+1]},{'a':[N+2]},{}),[{'a':[N,N+1,N+2]},[]])
check('equality',solve(['a','b'],[],[('a','b')],{'a':[N],'b':[N+1]},{},{}),[{'a':[N,N+1],'b':[N,N+1]},[]])
check('transitive reversed order',solve(['a','b','c'],[('a','b'),('b','c')],[],{'c':[N]},{},{}),[{'a':[N],'b':[N],'c':[N]},[]])
check('one-way',solve(['a','b'],[('a','b')],[],{'a':[N],'b':[N+1]},{},{}),[{'a':[N,N+1],'b':[N+1]},[]])
check('forbidden partial',solve(['a'],[],[],{'a':[N,N+1]},{},{'a':[N]}),[{'a':[N,N+1]},['a']])
check('empty not forbidden',solve(['a'],[],[],{},{},{'a':[N]}),[{'a':[]},[]])
check('cycle',solve(['a','b'],[('a','b'),('b','a')],[],{'a':[N]},{},{}),[{'a':[N],'b':[N]},[]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
empty[{}, []][{}, []]Passed
disconnected[{'a': []}, []][{'a': []}, []]Passed
unknown edgeunknownunknownPassed
unknown equalityunknownunknownPassed
seed both[{'a': [1, 2, 3]}, []][{'a': [1, 2, 3]}, []]Passed
equality[{'a': [1, 2], 'b': [1, 2]}, []][{'a': [1, 2], 'b': [1, 2]}, []]Passed
transitive reversed order[{'a': [1], 'b': [1], 'c': [1]}, []][{'a': [1], 'b': [1], 'c': [1]}, []]Passed
one-way[{'a': [1, 2], 'b': [2]}, []][{'a': [1, 2], 'b': [2]}, []]Passed
forbidden partial[{'a': [1, 2]}, []][{'a': [1, 2]}, ['a']]Failed
empty not forbidden[{'a': []}, []][{'a': []}, []]Passed
cycle[{'a': [1], 'b': [1]}, []][{'a': [1], 'b': [1]}, []]Passed

SHA-256 / a8c7a31a7f936019ff7be9c81b4a197d4c8d4f2cced0d8a72845167c4851944f

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 11 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

The explicitly stated toy language is the complete scope; this is not a production compiler or a claim about Rust semantics. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:43:58.180376+00:00.

Case digest / 6c8293d940c2414a0dc9efb220351048e617db0fe1bdc25b858b16ec9b2f1bf8