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

N = 1
observations = []
def solve(d):
    errors=[]
    if len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if False: errors.append('repeated-substitution')
    if d['recursive_expected']!=d['recursive_actual']: errors.append('recursive-actual-map')
    if d['static_before']!=d['static_after']: errors.append('static-preservation')
    if len(d['anonymous_calls'])==len(d['anonymous_ids']) and len(set(d['anonymous_ids']))!=len(d['anonymous_ids']): errors.append('anonymous-freshness')
    if set(map(tuple,d['expected_outlives']))!=set(map(tuple,d['actual_outlives'])): errors.append('where-direction')
    if d['associated_args']!=d['recorded_args']: errors.append('associated-arguments')
    if d['accepted'] and bool(d['pending']): errors.append('summary-fixed-point')
    if not set(d['reference_types'])<=set(d['proof_metadata']): errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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 len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if any(len(set(xs))>2 for xs in d['occurrences'].values()): errors.append('repeated-substitution')
    if d['recursive_expected']!=d['recursive_actual']: errors.append('recursive-actual-map')
    if d['static_before']!=d['static_after']: errors.append('static-preservation')
    if len(d['anonymous_calls'])==len(d['anonymous_ids']) and len(set(d['anonymous_ids']))!=len(d['anonymous_ids']): errors.append('anonymous-freshness')
    if set(map(tuple,d['expected_outlives']))!=set(map(tuple,d['actual_outlives'])): errors.append('where-direction')
    if d['associated_args']!=d['recorded_args']: errors.append('associated-arguments')
    if d['accepted'] and bool(d['pending']): errors.append('summary-fixed-point')
    if not set(d['reference_types'])<=set(d['proof_metadata']): errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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:
Repeated occurrences of one lifetime parameter receive different actual regions.

Check generic borrow-summary instantiation. Generic lifetime arguments match parameter arity; parameter substitution is positional; repeated occurrences substitute consistently; recursive instantiation uses each callee actual mapping; static lifetime is not substituted; inferred anonymous lifetimes are fresh per call; where-outlives obligations instantiated in declared direction; associated lifetime applications include all type arguments; recursive summary fixed point cannot be accepted while new obligations remain; monomorphized reference types retain lifetime proof metadata. 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 len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if any(len(set(xs))>1 for xs in d['occurrences'].values()): errors.append('repeated-substitution')
    if False: errors.append('recursive-actual-map')
    if d['static_before']!=d['static_after']: errors.append('static-preservation')
    if len(d['anonymous_calls'])==len(d['anonymous_ids']) and len(set(d['anonymous_ids']))!=len(d['anonymous_ids']): errors.append('anonymous-freshness')
    if set(map(tuple,d['expected_outlives']))!=set(map(tuple,d['actual_outlives'])): errors.append('where-direction')
    if d['associated_args']!=d['recorded_args']: errors.append('associated-arguments')
    if d['accepted'] and bool(d['pending']): errors.append('summary-fixed-point')
    if not set(d['reference_types'])<=set(d['proof_metadata']): errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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 len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if any(len(set(xs))>1 for xs in d['occurrences'].values()): errors.append('repeated-substitution')
    if set(d['recursive_expected'])!=set(d['recursive_actual']): errors.append('recursive-actual-map')
    if d['static_before']!=d['static_after']: errors.append('static-preservation')
    if len(d['anonymous_calls'])==len(d['anonymous_ids']) and len(set(d['anonymous_ids']))!=len(d['anonymous_ids']): errors.append('anonymous-freshness')
    if set(map(tuple,d['expected_outlives']))!=set(map(tuple,d['actual_outlives'])): errors.append('where-direction')
    if d['associated_args']!=d['recorded_args']: errors.append('associated-arguments')
    if d['accepted'] and bool(d['pending']): errors.append('summary-fixed-point')
    if not set(d['reference_types'])<=set(d['proof_metadata']): errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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:
Recursive borrow summary uses the caller substitution at a different callee instantiation.

Check generic borrow-summary instantiation. Generic lifetime arguments match parameter arity; parameter substitution is positional; repeated occurrences substitute consistently; recursive instantiation uses each callee actual mapping; static lifetime is not substituted; inferred anonymous lifetimes are fresh per call; where-outlives obligations instantiated in declared direction; associated lifetime applications include all type arguments; recursive summary fixed point cannot be accepted while new obligations remain; monomorphized reference types retain lifetime proof metadata. 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 len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if any(len(set(xs))>1 for xs in d['occurrences'].values()): errors.append('repeated-substitution')
    if d['recursive_expected']!=d['recursive_actual']: errors.append('recursive-actual-map')
    if False: errors.append('static-preservation')
    if len(d['anonymous_calls'])==len(d['anonymous_ids']) and len(set(d['anonymous_ids']))!=len(d['anonymous_ids']): errors.append('anonymous-freshness')
    if set(map(tuple,d['expected_outlives']))!=set(map(tuple,d['actual_outlives'])): errors.append('where-direction')
    if d['associated_args']!=d['recorded_args']: errors.append('associated-arguments')
    if d['accepted'] and bool(d['pending']): errors.append('summary-fixed-point')
    if not set(d['reference_types'])<=set(d['proof_metadata']): errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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 len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if any(len(set(xs))>1 for xs in d['occurrences'].values()): errors.append('repeated-substitution')
    if d['recursive_expected']!=d['recursive_actual']: errors.append('recursive-actual-map')
    if d['static_before'] is not None and d['static_after'] is None: errors.append('static-preservation')
    if len(d['anonymous_calls'])==len(d['anonymous_ids']) and len(set(d['anonymous_ids']))!=len(d['anonymous_ids']): errors.append('anonymous-freshness')
    if set(map(tuple,d['expected_outlives']))!=set(map(tuple,d['actual_outlives'])): errors.append('where-direction')
    if d['associated_args']!=d['recorded_args']: errors.append('associated-arguments')
    if d['accepted'] and bool(d['pending']): errors.append('summary-fixed-point')
    if not set(d['reference_types'])<=set(d['proof_metadata']): errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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:
Lifetime substitution rewrites the distinguished static lifetime.

Check generic borrow-summary instantiation. Generic lifetime arguments match parameter arity; parameter substitution is positional; repeated occurrences substitute consistently; recursive instantiation uses each callee actual mapping; static lifetime is not substituted; inferred anonymous lifetimes are fresh per call; where-outlives obligations instantiated in declared direction; associated lifetime applications include all type arguments; recursive summary fixed point cannot be accepted while new obligations remain; monomorphized reference types retain lifetime proof metadata. 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 len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if any(len(set(xs))>1 for xs in d['occurrences'].values()): errors.append('repeated-substitution')
    if d['recursive_expected']!=d['recursive_actual']: errors.append('recursive-actual-map')
    if d['static_before']!=d['static_after']: errors.append('static-preservation')
    if False: errors.append('anonymous-freshness')
    if set(map(tuple,d['expected_outlives']))!=set(map(tuple,d['actual_outlives'])): errors.append('where-direction')
    if d['associated_args']!=d['recorded_args']: errors.append('associated-arguments')
    if d['accepted'] and bool(d['pending']): errors.append('summary-fixed-point')
    if not set(d['reference_types'])<=set(d['proof_metadata']): errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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 len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if any(len(set(xs))>1 for xs in d['occurrences'].values()): errors.append('repeated-substitution')
    if d['recursive_expected']!=d['recursive_actual']: errors.append('recursive-actual-map')
    if d['static_before']!=d['static_after']: errors.append('static-preservation')
    if len(d['anonymous_ids'])>2 and len(set(d['anonymous_ids']))!=len(d['anonymous_ids']): errors.append('anonymous-freshness')
    if set(map(tuple,d['expected_outlives']))!=set(map(tuple,d['actual_outlives'])): errors.append('where-direction')
    if d['associated_args']!=d['recorded_args']: errors.append('associated-arguments')
    if d['accepted'] and bool(d['pending']): errors.append('summary-fixed-point')
    if not set(d['reference_types'])<=set(d['proof_metadata']): errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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:
Different calls share one inferred anonymous lifetime variable.

Check generic borrow-summary instantiation. Generic lifetime arguments match parameter arity; parameter substitution is positional; repeated occurrences substitute consistently; recursive instantiation uses each callee actual mapping; static lifetime is not substituted; inferred anonymous lifetimes are fresh per call; where-outlives obligations instantiated in declared direction; associated lifetime applications include all type arguments; recursive summary fixed point cannot be accepted while new obligations remain; monomorphized reference types retain lifetime proof metadata. 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 len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if any(len(set(xs))>1 for xs in d['occurrences'].values()): errors.append('repeated-substitution')
    if d['recursive_expected']!=d['recursive_actual']: errors.append('recursive-actual-map')
    if d['static_before']!=d['static_after']: errors.append('static-preservation')
    if len(d['anonymous_calls'])==len(d['anonymous_ids']) and len(set(d['anonymous_ids']))!=len(d['anonymous_ids']): errors.append('anonymous-freshness')
    if False: errors.append('where-direction')
    if d['associated_args']!=d['recorded_args']: errors.append('associated-arguments')
    if d['accepted'] and bool(d['pending']): errors.append('summary-fixed-point')
    if not set(d['reference_types'])<=set(d['proof_metadata']): errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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 len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if any(len(set(xs))>1 for xs in d['occurrences'].values()): errors.append('repeated-substitution')
    if d['recursive_expected']!=d['recursive_actual']: errors.append('recursive-actual-map')
    if d['static_before']!=d['static_after']: errors.append('static-preservation')
    if len(d['anonymous_calls'])==len(d['anonymous_ids']) and len(set(d['anonymous_ids']))!=len(d['anonymous_ids']): errors.append('anonymous-freshness')
    if set(x for pair in d['expected_outlives'] for x in pair)!=set(x for pair in d['actual_outlives'] for x in pair): errors.append('where-direction')
    if d['associated_args']!=d['recorded_args']: errors.append('associated-arguments')
    if d['accepted'] and bool(d['pending']): errors.append('summary-fixed-point')
    if not set(d['reference_types'])<=set(d['proof_metadata']): errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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:
Instantiation reverses the direction of a declared outlives bound.

Check generic borrow-summary instantiation. Generic lifetime arguments match parameter arity; parameter substitution is positional; repeated occurrences substitute consistently; recursive instantiation uses each callee actual mapping; static lifetime is not substituted; inferred anonymous lifetimes are fresh per call; where-outlives obligations instantiated in declared direction; associated lifetime applications include all type arguments; recursive summary fixed point cannot be accepted while new obligations remain; monomorphized reference types retain lifetime proof metadata. 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 len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if any(len(set(xs))>1 for xs in d['occurrences'].values()): errors.append('repeated-substitution')
    if d['recursive_expected']!=d['recursive_actual']: errors.append('recursive-actual-map')
    if d['static_before']!=d['static_after']: errors.append('static-preservation')
    if len(d['anonymous_calls'])==len(d['anonymous_ids']) and len(set(d['anonymous_ids']))!=len(d['anonymous_ids']): errors.append('anonymous-freshness')
    if set(map(tuple,d['expected_outlives']))!=set(map(tuple,d['actual_outlives'])): errors.append('where-direction')
    if False: errors.append('associated-arguments')
    if d['accepted'] and bool(d['pending']): errors.append('summary-fixed-point')
    if not set(d['reference_types'])<=set(d['proof_metadata']): errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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 len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if any(len(set(xs))>1 for xs in d['occurrences'].values()): errors.append('repeated-substitution')
    if d['recursive_expected']!=d['recursive_actual']: errors.append('recursive-actual-map')
    if d['static_before']!=d['static_after']: errors.append('static-preservation')
    if len(d['anonymous_calls'])==len(d['anonymous_ids']) and len(set(d['anonymous_ids']))!=len(d['anonymous_ids']): errors.append('anonymous-freshness')
    if set(map(tuple,d['expected_outlives']))!=set(map(tuple,d['actual_outlives'])): errors.append('where-direction')
    if set(d['associated_args'])!=set(d['recorded_args']): errors.append('associated-arguments')
    if d['accepted'] and bool(d['pending']): errors.append('summary-fixed-point')
    if not set(d['reference_types'])<=set(d['proof_metadata']): errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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:
Associated lifetime application loses type-argument order in its proof key.

Check generic borrow-summary instantiation. Generic lifetime arguments match parameter arity; parameter substitution is positional; repeated occurrences substitute consistently; recursive instantiation uses each callee actual mapping; static lifetime is not substituted; inferred anonymous lifetimes are fresh per call; where-outlives obligations instantiated in declared direction; associated lifetime applications include all type arguments; recursive summary fixed point cannot be accepted while new obligations remain; monomorphized reference types retain lifetime proof metadata. 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 len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if any(len(set(xs))>1 for xs in d['occurrences'].values()): errors.append('repeated-substitution')
    if d['recursive_expected']!=d['recursive_actual']: errors.append('recursive-actual-map')
    if d['static_before']!=d['static_after']: errors.append('static-preservation')
    if len(d['anonymous_calls'])==len(d['anonymous_ids']) and len(set(d['anonymous_ids']))!=len(d['anonymous_ids']): errors.append('anonymous-freshness')
    if set(map(tuple,d['expected_outlives']))!=set(map(tuple,d['actual_outlives'])): errors.append('where-direction')
    if d['associated_args']!=d['recorded_args']: errors.append('associated-arguments')
    if False: errors.append('summary-fixed-point')
    if not set(d['reference_types'])<=set(d['proof_metadata']): errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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 len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if any(len(set(xs))>1 for xs in d['occurrences'].values()): errors.append('repeated-substitution')
    if d['recursive_expected']!=d['recursive_actual']: errors.append('recursive-actual-map')
    if d['static_before']!=d['static_after']: errors.append('static-preservation')
    if len(d['anonymous_calls'])==len(d['anonymous_ids']) and len(set(d['anonymous_ids']))!=len(d['anonymous_ids']): errors.append('anonymous-freshness')
    if set(map(tuple,d['expected_outlives']))!=set(map(tuple,d['actual_outlives'])): errors.append('where-direction')
    if d['associated_args']!=d['recorded_args']: errors.append('associated-arguments')
    if d['accepted'] and len(d['pending'])>1: errors.append('summary-fixed-point')
    if not set(d['reference_types'])<=set(d['proof_metadata']): errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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:
Recursive lifetime inference accepts a summary while one new obligation remains.

Check generic borrow-summary instantiation. Generic lifetime arguments match parameter arity; parameter substitution is positional; repeated occurrences substitute consistently; recursive instantiation uses each callee actual mapping; static lifetime is not substituted; inferred anonymous lifetimes are fresh per call; where-outlives obligations instantiated in declared direction; associated lifetime applications include all type arguments; recursive summary fixed point cannot be accepted while new obligations remain; monomorphized reference types retain lifetime proof metadata. 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 len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if any(len(set(xs))>1 for xs in d['occurrences'].values()): errors.append('repeated-substitution')
    if d['recursive_expected']!=d['recursive_actual']: errors.append('recursive-actual-map')
    if d['static_before']!=d['static_after']: errors.append('static-preservation')
    if len(d['anonymous_calls'])==len(d['anonymous_ids']) and len(set(d['anonymous_ids']))!=len(d['anonymous_ids']): errors.append('anonymous-freshness')
    if set(map(tuple,d['expected_outlives']))!=set(map(tuple,d['actual_outlives'])): errors.append('where-direction')
    if d['associated_args']!=d['recorded_args']: errors.append('associated-arguments')
    if d['accepted'] and bool(d['pending']): errors.append('summary-fixed-point')
    if False: errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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 len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if any(len(set(xs))>1 for xs in d['occurrences'].values()): errors.append('repeated-substitution')
    if d['recursive_expected']!=d['recursive_actual']: errors.append('recursive-actual-map')
    if d['static_before']!=d['static_after']: errors.append('static-preservation')
    if len(d['anonymous_calls'])==len(d['anonymous_ids']) and len(set(d['anonymous_ids']))!=len(d['anonymous_ids']): errors.append('anonymous-freshness')
    if set(map(tuple,d['expected_outlives']))!=set(map(tuple,d['actual_outlives'])): errors.append('where-direction')
    if d['associated_args']!=d['recorded_args']: errors.append('associated-arguments')
    if d['accepted'] and bool(d['pending']): errors.append('summary-fixed-point')
    if not d['proof_metadata'] and bool(d['reference_types']): errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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:
Monomorphization drops a reference type lifetime proof before borrow validation.

Check generic borrow-summary instantiation. Generic lifetime arguments match parameter arity; parameter substitution is positional; repeated occurrences substitute consistently; recursive instantiation uses each callee actual mapping; static lifetime is not substituted; inferred anonymous lifetimes are fresh per call; where-outlives obligations instantiated in declared direction; associated lifetime applications include all type arguments; recursive summary fixed point cannot be accepted while new obligations remain; monomorphized reference types retain lifetime proof metadata. 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 False: errors.append('ir-revision')
    if d['reused'] and d['cached_place']!=d['place']: errors.append('normalized-place-key')
    if d['reused'] and d['cached_mut']!=d['mutable']: errors.append('permission-key')
    if d['reused'] and d['cached_substitution']!=d['substitution']: errors.append('substitution-key')
    if d['reused'] and d['cached_universe']!=d['universe']: errors.append('universe-key')
    if d['reused'] and d['cached_edge']!=d['edge']: errors.append('edge-kind-key')
    if d['reused'] and d['cached_layout']!=d['layout']: errors.append('layout-key')
    if d['reused'] and d['negative'] and set(d['old_facts'])!=set(d['facts']): errors.append('negative-fact-invalidation')
    if d['reused'] and not d['complete']: errors.append('provisional-result')
    if d['reused'] and d['cached_spans']!=d['spans']: errors.append('diagnostic-span-rebind')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'cached_revision': 0, 'revision': 0, 'cached_place': [], 'place': [], 'cached_mut': False, 'mutable': False, 'cached_substitution': {}, 'substitution': {}, 'cached_universe': 0, 'universe': 0, 'cached_edge': 'normal', 'edge': 'normal', 'cached_layout': [], 'layout': [], 'negative': False, 'old_facts': [], 'facts': [], 'complete': True, 'reused': False, 'cached_spans': {}, 'spans': {}}
check('well formed empty obligations',solve(base),[])
check('ir-revision regression 0', solve(dict(base, **({'reused':True,'cached_revision':N,'revision':N+1}))), ['ir-revision'])
check('ir-revision regression 1', solve(dict(base, **({'reused':True,'cached_revision':N+1,'revision':N+2}))), ['ir-revision'])
check('normalized-place-key regression 0', solve(dict(base, **({'reused':True,'cached_place':['r','a'],'place':['r','b']}))), ['normalized-place-key'])
check('normalized-place-key regression 1', solve(dict(base, **({'reused':True,'cached_place':['r',N],'place':['r',N+1]}))), ['normalized-place-key'])
check('permission-key regression 0', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True}))), ['permission-key'])
check('permission-key regression 1', solve(dict(base, **({'reused':True,'cached_mut':False,'mutable':True,'revision':N,'cached_revision':N}))), ['permission-key'])
check('substitution-key regression 0', solve(dict(base, **({'reused':True,'cached_substitution':{'a':'x'},'substitution':{'a':'y'}}))), ['substitution-key'])
check('substitution-key regression 1', solve(dict(base, **({'reused':True,'cached_substitution':{'a':N},'substitution':{'a':N+1}}))), ['substitution-key'])
check('universe-key regression 0', solve(dict(base, **({'reused':True,'cached_universe':N,'universe':N+1}))), ['universe-key'])
check('universe-key regression 1', solve(dict(base, **({'reused':True,'cached_universe':N+1,'universe':N+2}))), ['universe-key'])
check('edge-kind-key regression 0', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'unwind'}))), ['edge-kind-key'])
check('edge-kind-key regression 1', solve(dict(base, **({'reused':True,'cached_edge':'normal','edge':'cancel','revision':N,'cached_revision':N}))), ['edge-kind-key'])
check('layout-key regression 0', solve(dict(base, **({'reused':True,'cached_layout':[0,4],'layout':[0,8]}))), ['layout-key'])
check('layout-key regression 1', solve(dict(base, **({'reused':True,'cached_layout':[0,N],'layout':[0,N+1]}))), ['layout-key'])
check('negative-fact-invalidation regression 0', solve(dict(base, **({'reused':True,'negative':True,'old_facts':['a'],'facts':['a','b']}))), ['negative-fact-invalidation'])
check('negative-fact-invalidation regression 1', solve(dict(base, **({'reused':True,'negative':True,'old_facts':[N],'facts':[N,N+1]}))), ['negative-fact-invalidation'])
check('provisional-result regression 0', solve(dict(base, **({'reused':True,'complete':False}))), ['provisional-result'])
check('provisional-result regression 1', solve(dict(base, **({'reused':True,'complete':False,'revision':N,'cached_revision':N}))), ['provisional-result'])
check('diagnostic-span-rebind regression 0', solve(dict(base, **({'reused':True,'cached_spans':{'a':1},'spans':{'a':2}}))), ['diagnostic-span-rebind'])
check('diagnostic-span-rebind regression 1', solve(dict(base, **({'reused':True,'cached_spans':{'a':N},'spans':{'a':N+1}}))), ['diagnostic-span-rebind'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

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

prompt:
Borrow proof is reused after its defining IR revision changes.

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

split: open-access