broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if False: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut']!=d['mutable']: errors.append('permission-key')
    if d['reused'] and d['cached_substitution']!=d['substitution']: errors.append('substitution-key')
    if d['reused'] and d['cached_universe']!=d['universe']: errors.append('universe-key')
    if d['reused'] and d['cached_edge']!=d['edge']: errors.append('edge-kind-key')
    if d['reused'] and d['cached_layout']!=d['layout']: errors.append('layout-key')
    if d['reused'] and d['negative'] and set(d['old_facts'])!=set(d['facts']): errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete']: errors.append('provisional-result')
    if d['reused'] and d['cached_spans']!=d['spans']: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if d['reused'] and d['cached_place'][:1]!=d['place'][:1]: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut']!=d['mutable']: errors.append('permission-key')
    if d['reused'] and d['cached_substitution']!=d['substitution']: errors.append('substitution-key')
    if d['reused'] and d['cached_universe']!=d['universe']: errors.append('universe-key')
    if d['reused'] and d['cached_edge']!=d['edge']: errors.append('edge-kind-key')
    if d['reused'] and d['cached_layout']!=d['layout']: errors.append('layout-key')
    if d['reused'] and d['negative'] and set(d['old_facts'])!=set(d['facts']): errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete']: errors.append('provisional-result')
    if d['reused'] and d['cached_spans']!=d['spans']: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

prompt:
Borrow proof cache keys only the owner root and confuses sibling projections.

Validate reuse of static borrow proof certificates. Cache entry belongs to same IR revision, same normalized place, same mutability, same lifetime substitution, same solver universe, same CFG edge kind and same target layout; negative results are invalidated when new outlives facts arrive; incomplete fixed-point results are never reusable; diagnostic reuse rebinds source spans to current lifetime occurrence mapping. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if d['reused'] and d['cached_place']!=d['place']: errors.append('normalized-place-key')
    if False: errors.append('permission-key')
    if d['reused'] and d['cached_substitution']!=d['substitution']: errors.append('substitution-key')
    if d['reused'] and d['cached_universe']!=d['universe']: errors.append('universe-key')
    if d['reused'] and d['cached_edge']!=d['edge']: errors.append('edge-kind-key')
    if d['reused'] and d['cached_layout']!=d['layout']: errors.append('layout-key')
    if d['reused'] and d['negative'] and set(d['old_facts'])!=set(d['facts']): errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete']: errors.append('provisional-result')
    if d['reused'] and d['cached_spans']!=d['spans']: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if d['reused'] and d['cached_place']!=d['place']: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut'] and not d['mutable']: errors.append('permission-key')
    if d['reused'] and d['cached_substitution']!=d['substitution']: errors.append('substitution-key')
    if d['reused'] and d['cached_universe']!=d['universe']: errors.append('universe-key')
    if d['reused'] and d['cached_edge']!=d['edge']: errors.append('edge-kind-key')
    if d['reused'] and d['cached_layout']!=d['layout']: errors.append('layout-key')
    if d['reused'] and d['negative'] and set(d['old_facts'])!=set(d['facts']): errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete']: errors.append('provisional-result')
    if d['reused'] and d['cached_spans']!=d['spans']: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

prompt:
Shared-borrow proof is reused to authorize an exclusive borrow.

Validate reuse of static borrow proof certificates. Cache entry belongs to same IR revision, same normalized place, same mutability, same lifetime substitution, same solver universe, same CFG edge kind and same target layout; negative results are invalidated when new outlives facts arrive; incomplete fixed-point results are never reusable; diagnostic reuse rebinds source spans to current lifetime occurrence mapping. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if d['reused'] and d['cached_place']!=d['place']: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut']!=d['mutable']: errors.append('permission-key')
    if False: errors.append('substitution-key')
    if d['reused'] and d['cached_universe']!=d['universe']: errors.append('universe-key')
    if d['reused'] and d['cached_edge']!=d['edge']: errors.append('edge-kind-key')
    if d['reused'] and d['cached_layout']!=d['layout']: errors.append('layout-key')
    if d['reused'] and d['negative'] and set(d['old_facts'])!=set(d['facts']): errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete']: errors.append('provisional-result')
    if d['reused'] and d['cached_spans']!=d['spans']: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if d['reused'] and d['cached_place']!=d['place']: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut']!=d['mutable']: errors.append('permission-key')
    if d['reused'] and set(d['cached_substitution'])!=set(d['substitution']): errors.append('substitution-key')
    if d['reused'] and d['cached_universe']!=d['universe']: errors.append('universe-key')
    if d['reused'] and d['cached_edge']!=d['edge']: errors.append('edge-kind-key')
    if d['reused'] and d['cached_layout']!=d['layout']: errors.append('layout-key')
    if d['reused'] and d['negative'] and set(d['old_facts'])!=set(d['facts']): errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete']: errors.append('provisional-result')
    if d['reused'] and d['cached_spans']!=d['spans']: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

prompt:
Borrow proof reuse compares generic names but ignores actual lifetime substitution.

Validate reuse of static borrow proof certificates. Cache entry belongs to same IR revision, same normalized place, same mutability, same lifetime substitution, same solver universe, same CFG edge kind and same target layout; negative results are invalidated when new outlives facts arrive; incomplete fixed-point results are never reusable; diagnostic reuse rebinds source spans to current lifetime occurrence mapping. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if d['reused'] and d['cached_place']!=d['place']: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut']!=d['mutable']: errors.append('permission-key')
    if d['reused'] and d['cached_substitution']!=d['substitution']: errors.append('substitution-key')
    if False: errors.append('universe-key')
    if d['reused'] and d['cached_edge']!=d['edge']: errors.append('edge-kind-key')
    if d['reused'] and d['cached_layout']!=d['layout']: errors.append('layout-key')
    if d['reused'] and d['negative'] and set(d['old_facts'])!=set(d['facts']): errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete']: errors.append('provisional-result')
    if d['reused'] and d['cached_spans']!=d['spans']: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if d['reused'] and d['cached_place']!=d['place']: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut']!=d['mutable']: errors.append('permission-key')
    if d['reused'] and d['cached_substitution']!=d['substitution']: errors.append('substitution-key')
    if d['reused'] and d['cached_universe']>d['universe']: errors.append('universe-key')
    if d['reused'] and d['cached_edge']!=d['edge']: errors.append('edge-kind-key')
    if d['reused'] and d['cached_layout']!=d['layout']: errors.append('layout-key')
    if d['reused'] and d['negative'] and set(d['old_facts'])!=set(d['facts']): errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete']: errors.append('provisional-result')
    if d['reused'] and d['cached_spans']!=d['spans']: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

prompt:
A lifetime proof leaks from an earlier solver universe into a fresh placeholder universe.

Validate reuse of static borrow proof certificates. Cache entry belongs to same IR revision, same normalized place, same mutability, same lifetime substitution, same solver universe, same CFG edge kind and same target layout; negative results are invalidated when new outlives facts arrive; incomplete fixed-point results are never reusable; diagnostic reuse rebinds source spans to current lifetime occurrence mapping. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if d['reused'] and d['cached_place']!=d['place']: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut']!=d['mutable']: errors.append('permission-key')
    if d['reused'] and d['cached_substitution']!=d['substitution']: errors.append('substitution-key')
    if d['reused'] and d['cached_universe']!=d['universe']: errors.append('universe-key')
    if False: errors.append('edge-kind-key')
    if d['reused'] and d['cached_layout']!=d['layout']: errors.append('layout-key')
    if d['reused'] and d['negative'] and set(d['old_facts'])!=set(d['facts']): errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete']: errors.append('provisional-result')
    if d['reused'] and d['cached_spans']!=d['spans']: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if d['reused'] and d['cached_place']!=d['place']: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut']!=d['mutable']: errors.append('permission-key')
    if d['reused'] and d['cached_substitution']!=d['substitution']: errors.append('substitution-key')
    if d['reused'] and d['cached_universe']!=d['universe']: errors.append('universe-key')
    if d['reused'] and d['edge']=='normal' and d['cached_edge']!='normal': errors.append('edge-kind-key')
    if d['reused'] and d['cached_layout']!=d['layout']: errors.append('layout-key')
    if d['reused'] and d['negative'] and set(d['old_facts'])!=set(d['facts']): errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete']: errors.append('provisional-result')
    if d['reused'] and d['cached_spans']!=d['spans']: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

prompt:
Normal-edge loan proof is reused on an unwind or cancellation edge.

Validate reuse of static borrow proof certificates. Cache entry belongs to same IR revision, same normalized place, same mutability, same lifetime substitution, same solver universe, same CFG edge kind and same target layout; negative results are invalidated when new outlives facts arrive; incomplete fixed-point results are never reusable; diagnostic reuse rebinds source spans to current lifetime occurrence mapping. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if d['reused'] and d['cached_place']!=d['place']: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut']!=d['mutable']: errors.append('permission-key')
    if d['reused'] and d['cached_substitution']!=d['substitution']: errors.append('substitution-key')
    if d['reused'] and d['cached_universe']!=d['universe']: errors.append('universe-key')
    if d['reused'] and d['cached_edge']!=d['edge']: errors.append('edge-kind-key')
    if False: errors.append('layout-key')
    if d['reused'] and d['negative'] and set(d['old_facts'])!=set(d['facts']): errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete']: errors.append('provisional-result')
    if d['reused'] and d['cached_spans']!=d['spans']: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if d['reused'] and d['cached_place']!=d['place']: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut']!=d['mutable']: errors.append('permission-key')
    if d['reused'] and d['cached_substitution']!=d['substitution']: errors.append('substitution-key')
    if d['reused'] and d['cached_universe']!=d['universe']: errors.append('universe-key')
    if d['reused'] and d['cached_edge']!=d['edge']: errors.append('edge-kind-key')
    if d['reused'] and len(d['cached_layout'])!=len(d['layout']): errors.append('layout-key')
    if d['reused'] and d['negative'] and set(d['old_facts'])!=set(d['facts']): errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete']: errors.append('provisional-result')
    if d['reused'] and d['cached_spans']!=d['spans']: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

prompt:
Projection-disjointness proof is reused after field offsets change.

Validate reuse of static borrow proof certificates. Cache entry belongs to same IR revision, same normalized place, same mutability, same lifetime substitution, same solver universe, same CFG edge kind and same target layout; negative results are invalidated when new outlives facts arrive; incomplete fixed-point results are never reusable; diagnostic reuse rebinds source spans to current lifetime occurrence mapping. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if d['reused'] and d['cached_place']!=d['place']: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut']!=d['mutable']: errors.append('permission-key')
    if d['reused'] and d['cached_substitution']!=d['substitution']: errors.append('substitution-key')
    if d['reused'] and d['cached_universe']!=d['universe']: errors.append('universe-key')
    if d['reused'] and d['cached_edge']!=d['edge']: errors.append('edge-kind-key')
    if d['reused'] and d['cached_layout']!=d['layout']: errors.append('layout-key')
    if False: errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete']: errors.append('provisional-result')
    if d['reused'] and d['cached_spans']!=d['spans']: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if d['reused'] and d['cached_place']!=d['place']: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut']!=d['mutable']: errors.append('permission-key')
    if d['reused'] and d['cached_substitution']!=d['substitution']: errors.append('substitution-key')
    if d['reused'] and d['cached_universe']!=d['universe']: errors.append('universe-key')
    if d['reused'] and d['cached_edge']!=d['edge']: errors.append('edge-kind-key')
    if d['reused'] and d['cached_layout']!=d['layout']: errors.append('layout-key')
    if d['reused'] and d['negative'] and not set(d['facts'])>=set(d['old_facts']): errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete']: errors.append('provisional-result')
    if d['reused'] and d['cached_spans']!=d['spans']: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

prompt:
A cached failed lifetime proof is retained after new outlives facts could satisfy it.

Validate reuse of static borrow proof certificates. Cache entry belongs to same IR revision, same normalized place, same mutability, same lifetime substitution, same solver universe, same CFG edge kind and same target layout; negative results are invalidated when new outlives facts arrive; incomplete fixed-point results are never reusable; diagnostic reuse rebinds source spans to current lifetime occurrence mapping. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if d['reused'] and d['cached_place']!=d['place']: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut']!=d['mutable']: errors.append('permission-key')
    if d['reused'] and d['cached_substitution']!=d['substitution']: errors.append('substitution-key')
    if d['reused'] and d['cached_universe']!=d['universe']: errors.append('universe-key')
    if d['reused'] and d['cached_edge']!=d['edge']: errors.append('edge-kind-key')
    if d['reused'] and d['cached_layout']!=d['layout']: errors.append('layout-key')
    if d['reused'] and d['negative'] and set(d['old_facts'])!=set(d['facts']): errors.append('negative-fact-invalidation')
    if False: errors.append('provisional-result')
    if d['reused'] and d['cached_spans']!=d['spans']: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if d['reused'] and d['cached_place']!=d['place']: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut']!=d['mutable']: errors.append('permission-key')
    if d['reused'] and d['cached_substitution']!=d['substitution']: errors.append('substitution-key')
    if d['reused'] and d['cached_universe']!=d['universe']: errors.append('universe-key')
    if d['reused'] and d['cached_edge']!=d['edge']: errors.append('edge-kind-key')
    if d['reused'] and d['cached_layout']!=d['layout']: errors.append('layout-key')
    if d['reused'] and d['negative'] and set(d['old_facts'])!=set(d['facts']): errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete'] and d['negative']: errors.append('provisional-result')
    if d['reused'] and d['cached_spans']!=d['spans']: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

prompt:
An incomplete positive fixed-point borrow result is reused as final.

Validate reuse of static borrow proof certificates. Cache entry belongs to same IR revision, same normalized place, same mutability, same lifetime substitution, same solver universe, same CFG edge kind and same target layout; negative results are invalidated when new outlives facts arrive; incomplete fixed-point results are never reusable; diagnostic reuse rebinds source spans to current lifetime occurrence mapping. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if d['reused'] and d['cached_place']!=d['place']: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut']!=d['mutable']: errors.append('permission-key')
    if d['reused'] and d['cached_substitution']!=d['substitution']: errors.append('substitution-key')
    if d['reused'] and d['cached_universe']!=d['universe']: errors.append('universe-key')
    if d['reused'] and d['cached_edge']!=d['edge']: errors.append('edge-kind-key')
    if d['reused'] and d['cached_layout']!=d['layout']: errors.append('layout-key')
    if d['reused'] and d['negative'] and set(d['old_facts'])!=set(d['facts']): errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete']: errors.append('provisional-result')
    if False: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if d['reused'] and d['cached_revision']!=d['revision']: errors.append('ir-revision')
    if d['reused'] and d['cached_place']!=d['place']: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut']!=d['mutable']: errors.append('permission-key')
    if d['reused'] and d['cached_substitution']!=d['substitution']: errors.append('substitution-key')
    if d['reused'] and d['cached_universe']!=d['universe']: errors.append('universe-key')
    if d['reused'] and d['cached_edge']!=d['edge']: errors.append('edge-kind-key')
    if d['reused'] and d['cached_layout']!=d['layout']: errors.append('layout-key')
    if d['reused'] and d['negative'] and set(d['old_facts'])!=set(d['facts']): errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete']: errors.append('provisional-result')
    if d['reused'] and set(d['cached_spans'])!=set(d['spans']): errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
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)

prompt:
Cached borrow diagnostics retain source spans from a different lifetime occurrence.

Validate reuse of static borrow proof certificates. Cache entry belongs to same IR revision, same normalized place, same mutability, same lifetime substitution, same solver universe, same CFG edge kind and same target layout; negative results are invalidated when new outlives facts arrive; incomplete fixed-point results are never reusable; diagnostic reuse rebinds source spans to current lifetime occurrence mapping. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access