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

N = 1
observations = []
def solve(d):
    errors=[]
    if False: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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['entry'] is not None and not d['reachable']: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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:
The analysis starts from a nonentry block and omits entry loan facts.

Check dataflow certificates for loan analysis. Reachability starts at entry and ignores dead blocks; all normal and exceptional successors participate; loop header solution includes backedge loans; kill transfer is edge-specific; phi origins correspond to predecessor edge; dominator proof must cover every incoming edge; a loan definition cannot be live before its definition except on a proven loop backedge; unreachable kills do not invalidate reachable loans; terminal return kills only function-local loans. 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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if False: errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if set(d['dead'])==set(d['reachable']) and bool(d['dead']): errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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:
Unreachable blocks contribute borrow conflicts to reachable code.

Check dataflow certificates for loan analysis. Reachability starts at entry and ignores dead blocks; all normal and exceptional successors participate; loop header solution includes backedge loans; kill transfer is edge-specific; phi origins correspond to predecessor edge; dominator proof must cover every incoming edge; a loan definition cannot be live before its definition except on a proven loop backedge; unreachable kills do not invalidate reachable loans; terminal return kills only function-local loans. 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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if False: errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if not d['processed'] and bool(d['normal']): errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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:
Loan flow drops the second normal branch successor.

Check dataflow certificates for loan analysis. Reachability starts at entry and ignores dead blocks; all normal and exceptional successors participate; loop header solution includes backedge loans; kill transfer is edge-specific; phi origins correspond to predecessor edge; dominator proof must cover every incoming edge; a loan definition cannot be live before its definition except on a proven loop backedge; unreachable kills do not invalidate reachable loans; terminal return kills only function-local loans. 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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if False: errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if not d['processed'] and bool(d['exceptional']): errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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:
Unwind successor receives no live-loan state.

Check dataflow certificates for loan analysis. Reachability starts at entry and ignores dead blocks; all normal and exceptional successors participate; loop header solution includes backedge loans; kill transfer is edge-specific; phi origins correspond to predecessor edge; dominator proof must cover every incoming edge; a loan definition cannot be live before its definition except on a proven loop backedge; unreachable kills do not invalidate reachable loans; terminal return kills only function-local loans. 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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if False: errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if not d['header'] and bool(d['backedge']): errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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:
Loop analysis accepts the preheader state without backedge loan facts.

Check dataflow certificates for loan analysis. Reachability starts at entry and ignores dead blocks; all normal and exceptional successors participate; loop header solution includes backedge loans; kill transfer is edge-specific; phi origins correspond to predecessor edge; dominator proof must cover every incoming edge; a loan definition cannot be live before its definition except on a proven loop backedge; unreachable kills do not invalidate reachable loans; terminal return kills only function-local loans. 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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if False: errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if set(d['edge_kills'])!=set(d['applied_kills']): errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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 loan killed on one branch is killed on every outgoing edge.

Check dataflow certificates for loan analysis. Reachability starts at entry and ignores dead blocks; all normal and exceptional successors participate; loop header solution includes backedge loans; kill transfer is edge-specific; phi origins correspond to predecessor edge; dominator proof must cover every incoming edge; a loan definition cannot be live before its definition except on a proven loop backedge; unreachable kills do not invalidate reachable loans; terminal return kills only function-local loans. 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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if False: errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if set(d['phi_edges'])!=set(d['expected_phi_edges']): errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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:
Phi borrow origins are assigned to the wrong predecessor edge.

Check dataflow certificates for loan analysis. Reachability starts at entry and ignores dead blocks; all normal and exceptional successors participate; loop header solution includes backedge loans; kill transfer is edge-specific; phi origins correspond to predecessor edge; dominator proof must cover every incoming edge; a loan definition cannot be live before its definition except on a proven loop backedge; unreachable kills do not invalidate reachable loans; terminal return kills only function-local loans. 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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if False: errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if not d['dominated'] and bool(d['incoming']): errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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 loan-defining block is assumed to dominate a join after covering one predecessor.

Check dataflow certificates for loan analysis. Reachability starts at entry and ignores dead blocks; all normal and exceptional successors participate; loop header solution includes backedge loans; kill transfer is edge-specific; phi origins correspond to predecessor edge; dominator proof must cover every incoming edge; a loan definition cannot be live before its definition except on a proven loop backedge; unreachable kills do not invalidate reachable loans; terminal return kills only function-local loans. 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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if False: errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if not d['loop_allowed'] and bool(d['predef_live']): errors.append('predefinition-liveness')
    if not set(d['return_killed'])<=set(d['local_loans']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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 loop exemption lets unrelated loans exist before their static definition.

Check dataflow certificates for loan analysis. Reachability starts at entry and ignores dead blocks; all normal and exceptional successors participate; loop header solution includes backedge loans; kill transfer is edge-specific; phi origins correspond to predecessor edge; dominator proof must cover every incoming edge; a loan definition cannot be live before its definition except on a proven loop backedge; unreachable kills do not invalidate reachable loans; terminal return kills only function-local loans. 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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if False: errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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['entry'] is not None and d['entry'] not in d['reachable']: errors.append('entry-reachability')
    if bool(set(d['dead'])&set(d['reachable'])): errors.append('dead-block-exclusion')
    if not set(d['normal'])<=set(d['processed']): errors.append('all-normal-successors')
    if not set(d['exceptional'])<=set(d['processed']): errors.append('exceptional-successors')
    if not set(d['backedge'])<=set(d['header']): errors.append('loop-backedge-join')
    if d['edge_kills']!=d['applied_kills']: errors.append('edge-kill-locality')
    if d['phi_edges']!=d['expected_phi_edges']: errors.append('phi-edge-origin')
    if not set(d['incoming'])<=set(d['dominated']): errors.append('all-path-dominance')
    if not set(d['predef_live'])<=set(d['loop_allowed']): errors.append('predefinition-liveness')
    if not d['local_loans'] and bool(d['return_killed']): errors.append('return-local-kill')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'entry': None, 'reachable': [], 'dead': [], 'normal': [], 'processed': [], 'exceptional': [], 'backedge': [], 'header': [], 'edge_kills': {}, 'applied_kills': {}, 'phi_edges': {}, 'expected_phi_edges': {}, 'incoming': [], 'dominated': [], 'predef_live': [], 'loop_allowed': [], 'dead_killed': [], 'reachable_invalidated': [], 'return_killed': [], 'local_loans': []}
check('well formed empty obligations',solve(base),[])
check('entry-reachability regression 0', solve(dict(base, **({'entry':'e','reachable':['x']}))), ['entry-reachability'])
check('entry-reachability regression 1', solve(dict(base, **({'entry':N,'reachable':[N+1]}))), ['entry-reachability'])
check('dead-block-exclusion regression 0', solve(dict(base, **({'dead':['d'],'reachable':['e','d']}))), ['dead-block-exclusion'])
check('dead-block-exclusion regression 1', solve(dict(base, **({'dead':[N],'reachable':[N,N+1]}))), ['dead-block-exclusion'])
check('all-normal-successors regression 0', solve(dict(base, **({'normal':['a','b'],'processed':['a']}))), ['all-normal-successors'])
check('all-normal-successors regression 1', solve(dict(base, **({'normal':[N,N+1],'processed':[N]}))), ['all-normal-successors'])
check('exceptional-successors regression 0', solve(dict(base, **({'exceptional':['u'],'processed':['n']}))), ['exceptional-successors'])
check('exceptional-successors regression 1', solve(dict(base, **({'exceptional':[N],'processed':[N+1]}))), ['exceptional-successors'])
check('loop-backedge-join regression 0', solve(dict(base, **({'backedge':['a','b'],'header':['a']}))), ['loop-backedge-join'])
check('loop-backedge-join regression 1', solve(dict(base, **({'backedge':[N,N+1],'header':[N]}))), ['loop-backedge-join'])
check('edge-kill-locality regression 0', solve(dict(base, **({'edge_kills':{'a':['r'],'b':[]},'applied_kills':{'a':['r'],'b':['r']}}))), ['edge-kill-locality'])
check('edge-kill-locality regression 1', solve(dict(base, **({'edge_kills':{N:['r'],N+1:[]},'applied_kills':{N:['r'],N+1:['r']}}))), ['edge-kill-locality'])
check('phi-edge-origin regression 0', solve(dict(base, **({'phi_edges':{'a':'y','b':'x'},'expected_phi_edges':{'a':'x','b':'y'}}))), ['phi-edge-origin'])
check('phi-edge-origin regression 1', solve(dict(base, **({'phi_edges':{N:'y',N+1:'x'},'expected_phi_edges':{N:'x',N+1:'y'}}))), ['phi-edge-origin'])
check('all-path-dominance regression 0', solve(dict(base, **({'incoming':['a','b'],'dominated':['a']}))), ['all-path-dominance'])
check('all-path-dominance regression 1', solve(dict(base, **({'incoming':[N,N+1],'dominated':[N]}))), ['all-path-dominance'])
check('predefinition-liveness regression 0', solve(dict(base, **({'predef_live':['a','b'],'loop_allowed':['a']}))), ['predefinition-liveness'])
check('predefinition-liveness regression 1', solve(dict(base, **({'predef_live':[N,N+1],'loop_allowed':[N]}))), ['predefinition-liveness'])
check('return-local-kill regression 0', solve(dict(base, **({'return_killed':['caller'],'local_loans':['callee']}))), ['return-local-kill'])
check('return-local-kill regression 1', solve(dict(base, **({'return_killed':[N],'local_loans':[N+1]}))), ['return-local-kill'])
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 function return invalidates a caller-owned loan.

Check dataflow certificates for loan analysis. Reachability starts at entry and ignores dead blocks; all normal and exceptional successors participate; loop header solution includes backedge loans; kill transfer is edge-specific; phi origins correspond to predecessor edge; dominator proof must cover every incoming edge; a loan definition cannot be live before its definition except on a proven loop backedge; unreachable kills do not invalidate reachable loans; terminal return kills only function-local loans. 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