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

N = 1
observations = []
def solve(d):
    errors=[]
    if any(i<0 or i>=d['arity'] for i in d['indices']): errors.append('bound-index-range')
    if d['after']!=[i+d['crossed'] for i in d['before']]: errors.append('capture-avoiding-shift')
    if d['fresh']<=d['caller']: errors.append('fresh-universe')
    if False: errors.append('universe-leak')
    if not set(d['placeholders'])<=set(d['checked']): errors.append('universal-coverage')
    if any(d['renaming'][a]!=d['renaming'][b] for a,b in d['equal_pairs']): errors.append('alpha-equality')
    if any(d['renaming'][a]==d['renaming'][b] for a,b in d['distinct_pairs']): errors.append('alpha-distinctness')
    if d['outside_after']!=[i-1 for i in d['outside_before']]: errors.append('binder-pop')
    if bool(set(d['static_choices'])&set(d['bound'])): errors.append('static-skolem')
    if d['universal_obligation'] and d['concrete_only']: errors.append('concrete-universal')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'indices': [], 'arity': 0, 'crossed': 0, 'before': [], 'after': [], 'fresh': 1, 'caller': 0, 'solution_universes': [], 'existential_universe': 0, 'placeholders': [], 'checked': [], 'equal_pairs': [], 'renaming': {}, 'distinct_pairs': [], 'outside_before': [], 'outside_after': [], 'static_choices': [], 'bound': [], 'universal_obligation': False, 'concrete_only': False}
check('well formed empty obligations',solve(base),[])
check('bound-index-range regression 0', solve(dict(base, **({'indices':[N],'arity':N}))), ['bound-index-range'])
check('bound-index-range regression 1', solve(dict(base, **({'indices':[N+1],'arity':N+1}))), ['bound-index-range'])
check('capture-avoiding-shift regression 0', solve(dict(base, **({'before':[N],'after':[N],'crossed':1}))), ['capture-avoiding-shift'])
check('capture-avoiding-shift regression 1', solve(dict(base, **({'before':[N,N+1],'after':[N,N+1],'crossed':2}))), ['capture-avoiding-shift'])
check('fresh-universe regression 0', solve(dict(base, **({'fresh':N,'caller':N}))), ['fresh-universe'])
check('fresh-universe regression 1', solve(dict(base, **({'fresh':N+1,'caller':N+1}))), ['fresh-universe'])
check('universe-leak regression 0', solve(dict(base, **({'solution_universes':[N+1],'existential_universe':N}))), ['universe-leak'])
check('universe-leak regression 1', solve(dict(base, **({'solution_universes':[N+2],'existential_universe':N+1}))), ['universe-leak'])
check('universal-coverage regression 0', solve(dict(base, **({'placeholders':['a','b'],'checked':['a']}))), ['universal-coverage'])
check('universal-coverage regression 1', solve(dict(base, **({'placeholders':list(range(N+1)),'checked':[0]}))), ['universal-coverage'])
check('alpha-equality regression 0', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':0,'b':1}}))), ['alpha-equality'])
check('alpha-equality regression 1', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':N,'b':N+1}}))), ['alpha-equality'])
check('alpha-distinctness regression 0', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':0,'b':1,'c':1}}))), ['alpha-distinctness'])
check('alpha-distinctness regression 1', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':N,'b':N+1,'c':N+1}}))), ['alpha-distinctness'])
check('binder-pop regression 0', solve(dict(base, **({'outside_before':[N],'outside_after':[N]}))), ['binder-pop'])
check('binder-pop regression 1', solve(dict(base, **({'outside_before':[N+1],'outside_after':[N+1]}))), ['binder-pop'])
check('static-skolem regression 0', solve(dict(base, **({'static_choices':['a'],'bound':['a']}))), ['static-skolem'])
check('static-skolem regression 1', solve(dict(base, **({'static_choices':[N],'bound':[N]}))), ['static-skolem'])
check('concrete-universal regression 0', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':['a']}))), ['concrete-universal'])
check('concrete-universal regression 1', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':[N]}))), ['concrete-universal'])
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 any(i<0 or i>=d['arity'] for i in d['indices']): errors.append('bound-index-range')
    if d['after']!=[i+d['crossed'] for i in d['before']]: errors.append('capture-avoiding-shift')
    if d['fresh']<=d['caller']: errors.append('fresh-universe')
    if any(u>d['existential_universe']+1 for u in d['solution_universes']): errors.append('universe-leak')
    if not set(d['placeholders'])<=set(d['checked']): errors.append('universal-coverage')
    if any(d['renaming'][a]!=d['renaming'][b] for a,b in d['equal_pairs']): errors.append('alpha-equality')
    if any(d['renaming'][a]==d['renaming'][b] for a,b in d['distinct_pairs']): errors.append('alpha-distinctness')
    if d['outside_after']!=[i-1 for i in d['outside_before']]: errors.append('binder-pop')
    if bool(set(d['static_choices'])&set(d['bound'])): errors.append('static-skolem')
    if d['universal_obligation'] and d['concrete_only']: errors.append('concrete-universal')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'indices': [], 'arity': 0, 'crossed': 0, 'before': [], 'after': [], 'fresh': 1, 'caller': 0, 'solution_universes': [], 'existential_universe': 0, 'placeholders': [], 'checked': [], 'equal_pairs': [], 'renaming': {}, 'distinct_pairs': [], 'outside_before': [], 'outside_after': [], 'static_choices': [], 'bound': [], 'universal_obligation': False, 'concrete_only': False}
check('well formed empty obligations',solve(base),[])
check('bound-index-range regression 0', solve(dict(base, **({'indices':[N],'arity':N}))), ['bound-index-range'])
check('bound-index-range regression 1', solve(dict(base, **({'indices':[N+1],'arity':N+1}))), ['bound-index-range'])
check('capture-avoiding-shift regression 0', solve(dict(base, **({'before':[N],'after':[N],'crossed':1}))), ['capture-avoiding-shift'])
check('capture-avoiding-shift regression 1', solve(dict(base, **({'before':[N,N+1],'after':[N,N+1],'crossed':2}))), ['capture-avoiding-shift'])
check('fresh-universe regression 0', solve(dict(base, **({'fresh':N,'caller':N}))), ['fresh-universe'])
check('fresh-universe regression 1', solve(dict(base, **({'fresh':N+1,'caller':N+1}))), ['fresh-universe'])
check('universe-leak regression 0', solve(dict(base, **({'solution_universes':[N+1],'existential_universe':N}))), ['universe-leak'])
check('universe-leak regression 1', solve(dict(base, **({'solution_universes':[N+2],'existential_universe':N+1}))), ['universe-leak'])
check('universal-coverage regression 0', solve(dict(base, **({'placeholders':['a','b'],'checked':['a']}))), ['universal-coverage'])
check('universal-coverage regression 1', solve(dict(base, **({'placeholders':list(range(N+1)),'checked':[0]}))), ['universal-coverage'])
check('alpha-equality regression 0', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':0,'b':1}}))), ['alpha-equality'])
check('alpha-equality regression 1', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':N,'b':N+1}}))), ['alpha-equality'])
check('alpha-distinctness regression 0', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':0,'b':1,'c':1}}))), ['alpha-distinctness'])
check('alpha-distinctness regression 1', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':N,'b':N+1,'c':N+1}}))), ['alpha-distinctness'])
check('binder-pop regression 0', solve(dict(base, **({'outside_before':[N],'outside_after':[N]}))), ['binder-pop'])
check('binder-pop regression 1', solve(dict(base, **({'outside_before':[N+1],'outside_after':[N+1]}))), ['binder-pop'])
check('static-skolem regression 0', solve(dict(base, **({'static_choices':['a'],'bound':['a']}))), ['static-skolem'])
check('static-skolem regression 1', solve(dict(base, **({'static_choices':[N],'bound':[N]}))), ['static-skolem'])
check('concrete-universal regression 0', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':['a']}))), ['concrete-universal'])
check('concrete-universal regression 1', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':[N]}))), ['concrete-universal'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
An existential lifetime captures a placeholder from the next universe.

Check higher-ranked borrow instantiation using de Bruijn binder depths and universes. Bound occurrence index less than binder arity; substitutions shift free lifetimes when crossing binders; fresh universes strictly exceed caller universe; existential solutions cannot mention newer universes; universally quantified input must be checked for every listed placeholder; alpha renaming preserves equal occurrences; distinct bound parameters remain distinct; dropping a binder decrements outside indices; bound lifetimes cannot be selected as static; placeholder obligations cannot be discharged by one concrete lifetime. 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 any(i<0 or i>=d['arity'] for i in d['indices']): errors.append('bound-index-range')
    if d['after']!=[i+d['crossed'] for i in d['before']]: errors.append('capture-avoiding-shift')
    if d['fresh']<=d['caller']: errors.append('fresh-universe')
    if any(u>d['existential_universe'] for u in d['solution_universes']): errors.append('universe-leak')
    if False: errors.append('universal-coverage')
    if any(d['renaming'][a]!=d['renaming'][b] for a,b in d['equal_pairs']): errors.append('alpha-equality')
    if any(d['renaming'][a]==d['renaming'][b] for a,b in d['distinct_pairs']): errors.append('alpha-distinctness')
    if d['outside_after']!=[i-1 for i in d['outside_before']]: errors.append('binder-pop')
    if bool(set(d['static_choices'])&set(d['bound'])): errors.append('static-skolem')
    if d['universal_obligation'] and d['concrete_only']: errors.append('concrete-universal')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'indices': [], 'arity': 0, 'crossed': 0, 'before': [], 'after': [], 'fresh': 1, 'caller': 0, 'solution_universes': [], 'existential_universe': 0, 'placeholders': [], 'checked': [], 'equal_pairs': [], 'renaming': {}, 'distinct_pairs': [], 'outside_before': [], 'outside_after': [], 'static_choices': [], 'bound': [], 'universal_obligation': False, 'concrete_only': False}
check('well formed empty obligations',solve(base),[])
check('bound-index-range regression 0', solve(dict(base, **({'indices':[N],'arity':N}))), ['bound-index-range'])
check('bound-index-range regression 1', solve(dict(base, **({'indices':[N+1],'arity':N+1}))), ['bound-index-range'])
check('capture-avoiding-shift regression 0', solve(dict(base, **({'before':[N],'after':[N],'crossed':1}))), ['capture-avoiding-shift'])
check('capture-avoiding-shift regression 1', solve(dict(base, **({'before':[N,N+1],'after':[N,N+1],'crossed':2}))), ['capture-avoiding-shift'])
check('fresh-universe regression 0', solve(dict(base, **({'fresh':N,'caller':N}))), ['fresh-universe'])
check('fresh-universe regression 1', solve(dict(base, **({'fresh':N+1,'caller':N+1}))), ['fresh-universe'])
check('universe-leak regression 0', solve(dict(base, **({'solution_universes':[N+1],'existential_universe':N}))), ['universe-leak'])
check('universe-leak regression 1', solve(dict(base, **({'solution_universes':[N+2],'existential_universe':N+1}))), ['universe-leak'])
check('universal-coverage regression 0', solve(dict(base, **({'placeholders':['a','b'],'checked':['a']}))), ['universal-coverage'])
check('universal-coverage regression 1', solve(dict(base, **({'placeholders':list(range(N+1)),'checked':[0]}))), ['universal-coverage'])
check('alpha-equality regression 0', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':0,'b':1}}))), ['alpha-equality'])
check('alpha-equality regression 1', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':N,'b':N+1}}))), ['alpha-equality'])
check('alpha-distinctness regression 0', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':0,'b':1,'c':1}}))), ['alpha-distinctness'])
check('alpha-distinctness regression 1', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':N,'b':N+1,'c':N+1}}))), ['alpha-distinctness'])
check('binder-pop regression 0', solve(dict(base, **({'outside_before':[N],'outside_after':[N]}))), ['binder-pop'])
check('binder-pop regression 1', solve(dict(base, **({'outside_before':[N+1],'outside_after':[N+1]}))), ['binder-pop'])
check('static-skolem regression 0', solve(dict(base, **({'static_choices':['a'],'bound':['a']}))), ['static-skolem'])
check('static-skolem regression 1', solve(dict(base, **({'static_choices':[N],'bound':[N]}))), ['static-skolem'])
check('concrete-universal regression 0', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':['a']}))), ['concrete-universal'])
check('concrete-universal regression 1', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':[N]}))), ['concrete-universal'])
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 any(i<0 or i>=d['arity'] for i in d['indices']): errors.append('bound-index-range')
    if d['after']!=[i+d['crossed'] for i in d['before']]: errors.append('capture-avoiding-shift')
    if d['fresh']<=d['caller']: errors.append('fresh-universe')
    if any(u>d['existential_universe'] for u in d['solution_universes']): errors.append('universe-leak')
    if not d['checked'] and bool(d['placeholders']): errors.append('universal-coverage')
    if any(d['renaming'][a]!=d['renaming'][b] for a,b in d['equal_pairs']): errors.append('alpha-equality')
    if any(d['renaming'][a]==d['renaming'][b] for a,b in d['distinct_pairs']): errors.append('alpha-distinctness')
    if d['outside_after']!=[i-1 for i in d['outside_before']]: errors.append('binder-pop')
    if bool(set(d['static_choices'])&set(d['bound'])): errors.append('static-skolem')
    if d['universal_obligation'] and d['concrete_only']: errors.append('concrete-universal')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'indices': [], 'arity': 0, 'crossed': 0, 'before': [], 'after': [], 'fresh': 1, 'caller': 0, 'solution_universes': [], 'existential_universe': 0, 'placeholders': [], 'checked': [], 'equal_pairs': [], 'renaming': {}, 'distinct_pairs': [], 'outside_before': [], 'outside_after': [], 'static_choices': [], 'bound': [], 'universal_obligation': False, 'concrete_only': False}
check('well formed empty obligations',solve(base),[])
check('bound-index-range regression 0', solve(dict(base, **({'indices':[N],'arity':N}))), ['bound-index-range'])
check('bound-index-range regression 1', solve(dict(base, **({'indices':[N+1],'arity':N+1}))), ['bound-index-range'])
check('capture-avoiding-shift regression 0', solve(dict(base, **({'before':[N],'after':[N],'crossed':1}))), ['capture-avoiding-shift'])
check('capture-avoiding-shift regression 1', solve(dict(base, **({'before':[N,N+1],'after':[N,N+1],'crossed':2}))), ['capture-avoiding-shift'])
check('fresh-universe regression 0', solve(dict(base, **({'fresh':N,'caller':N}))), ['fresh-universe'])
check('fresh-universe regression 1', solve(dict(base, **({'fresh':N+1,'caller':N+1}))), ['fresh-universe'])
check('universe-leak regression 0', solve(dict(base, **({'solution_universes':[N+1],'existential_universe':N}))), ['universe-leak'])
check('universe-leak regression 1', solve(dict(base, **({'solution_universes':[N+2],'existential_universe':N+1}))), ['universe-leak'])
check('universal-coverage regression 0', solve(dict(base, **({'placeholders':['a','b'],'checked':['a']}))), ['universal-coverage'])
check('universal-coverage regression 1', solve(dict(base, **({'placeholders':list(range(N+1)),'checked':[0]}))), ['universal-coverage'])
check('alpha-equality regression 0', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':0,'b':1}}))), ['alpha-equality'])
check('alpha-equality regression 1', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':N,'b':N+1}}))), ['alpha-equality'])
check('alpha-distinctness regression 0', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':0,'b':1,'c':1}}))), ['alpha-distinctness'])
check('alpha-distinctness regression 1', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':N,'b':N+1,'c':N+1}}))), ['alpha-distinctness'])
check('binder-pop regression 0', solve(dict(base, **({'outside_before':[N],'outside_after':[N]}))), ['binder-pop'])
check('binder-pop regression 1', solve(dict(base, **({'outside_before':[N+1],'outside_after':[N+1]}))), ['binder-pop'])
check('static-skolem regression 0', solve(dict(base, **({'static_choices':['a'],'bound':['a']}))), ['static-skolem'])
check('static-skolem regression 1', solve(dict(base, **({'static_choices':[N],'bound':[N]}))), ['static-skolem'])
check('concrete-universal regression 0', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':['a']}))), ['concrete-universal'])
check('concrete-universal regression 1', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':[N]}))), ['concrete-universal'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A higher-ranked obligation is checked for only one bound parameter.

Check higher-ranked borrow instantiation using de Bruijn binder depths and universes. Bound occurrence index less than binder arity; substitutions shift free lifetimes when crossing binders; fresh universes strictly exceed caller universe; existential solutions cannot mention newer universes; universally quantified input must be checked for every listed placeholder; alpha renaming preserves equal occurrences; distinct bound parameters remain distinct; dropping a binder decrements outside indices; bound lifetimes cannot be selected as static; placeholder obligations cannot be discharged by one concrete lifetime. 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 any(i<0 or i>=d['arity'] for i in d['indices']): errors.append('bound-index-range')
    if d['after']!=[i+d['crossed'] for i in d['before']]: errors.append('capture-avoiding-shift')
    if d['fresh']<=d['caller']: errors.append('fresh-universe')
    if any(u>d['existential_universe'] for u in d['solution_universes']): errors.append('universe-leak')
    if not set(d['placeholders'])<=set(d['checked']): errors.append('universal-coverage')
    if False: errors.append('alpha-equality')
    if any(d['renaming'][a]==d['renaming'][b] for a,b in d['distinct_pairs']): errors.append('alpha-distinctness')
    if d['outside_after']!=[i-1 for i in d['outside_before']]: errors.append('binder-pop')
    if bool(set(d['static_choices'])&set(d['bound'])): errors.append('static-skolem')
    if d['universal_obligation'] and d['concrete_only']: errors.append('concrete-universal')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'indices': [], 'arity': 0, 'crossed': 0, 'before': [], 'after': [], 'fresh': 1, 'caller': 0, 'solution_universes': [], 'existential_universe': 0, 'placeholders': [], 'checked': [], 'equal_pairs': [], 'renaming': {}, 'distinct_pairs': [], 'outside_before': [], 'outside_after': [], 'static_choices': [], 'bound': [], 'universal_obligation': False, 'concrete_only': False}
check('well formed empty obligations',solve(base),[])
check('bound-index-range regression 0', solve(dict(base, **({'indices':[N],'arity':N}))), ['bound-index-range'])
check('bound-index-range regression 1', solve(dict(base, **({'indices':[N+1],'arity':N+1}))), ['bound-index-range'])
check('capture-avoiding-shift regression 0', solve(dict(base, **({'before':[N],'after':[N],'crossed':1}))), ['capture-avoiding-shift'])
check('capture-avoiding-shift regression 1', solve(dict(base, **({'before':[N,N+1],'after':[N,N+1],'crossed':2}))), ['capture-avoiding-shift'])
check('fresh-universe regression 0', solve(dict(base, **({'fresh':N,'caller':N}))), ['fresh-universe'])
check('fresh-universe regression 1', solve(dict(base, **({'fresh':N+1,'caller':N+1}))), ['fresh-universe'])
check('universe-leak regression 0', solve(dict(base, **({'solution_universes':[N+1],'existential_universe':N}))), ['universe-leak'])
check('universe-leak regression 1', solve(dict(base, **({'solution_universes':[N+2],'existential_universe':N+1}))), ['universe-leak'])
check('universal-coverage regression 0', solve(dict(base, **({'placeholders':['a','b'],'checked':['a']}))), ['universal-coverage'])
check('universal-coverage regression 1', solve(dict(base, **({'placeholders':list(range(N+1)),'checked':[0]}))), ['universal-coverage'])
check('alpha-equality regression 0', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':0,'b':1}}))), ['alpha-equality'])
check('alpha-equality regression 1', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':N,'b':N+1}}))), ['alpha-equality'])
check('alpha-distinctness regression 0', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':0,'b':1,'c':1}}))), ['alpha-distinctness'])
check('alpha-distinctness regression 1', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':N,'b':N+1,'c':N+1}}))), ['alpha-distinctness'])
check('binder-pop regression 0', solve(dict(base, **({'outside_before':[N],'outside_after':[N]}))), ['binder-pop'])
check('binder-pop regression 1', solve(dict(base, **({'outside_before':[N+1],'outside_after':[N+1]}))), ['binder-pop'])
check('static-skolem regression 0', solve(dict(base, **({'static_choices':['a'],'bound':['a']}))), ['static-skolem'])
check('static-skolem regression 1', solve(dict(base, **({'static_choices':[N],'bound':[N]}))), ['static-skolem'])
check('concrete-universal regression 0', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':['a']}))), ['concrete-universal'])
check('concrete-universal regression 1', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':[N]}))), ['concrete-universal'])
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 any(i<0 or i>=d['arity'] for i in d['indices']): errors.append('bound-index-range')
    if d['after']!=[i+d['crossed'] for i in d['before']]: errors.append('capture-avoiding-shift')
    if d['fresh']<=d['caller']: errors.append('fresh-universe')
    if any(u>d['existential_universe'] for u in d['solution_universes']): errors.append('universe-leak')
    if not set(d['placeholders'])<=set(d['checked']): errors.append('universal-coverage')
    if any(a!=b and d['renaming'][a]!=d['renaming'][b] for a,b in d['equal_pairs'][:1]): errors.append('alpha-equality')
    if any(d['renaming'][a]==d['renaming'][b] for a,b in d['distinct_pairs']): errors.append('alpha-distinctness')
    if d['outside_after']!=[i-1 for i in d['outside_before']]: errors.append('binder-pop')
    if bool(set(d['static_choices'])&set(d['bound'])): errors.append('static-skolem')
    if d['universal_obligation'] and d['concrete_only']: errors.append('concrete-universal')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'indices': [], 'arity': 0, 'crossed': 0, 'before': [], 'after': [], 'fresh': 1, 'caller': 0, 'solution_universes': [], 'existential_universe': 0, 'placeholders': [], 'checked': [], 'equal_pairs': [], 'renaming': {}, 'distinct_pairs': [], 'outside_before': [], 'outside_after': [], 'static_choices': [], 'bound': [], 'universal_obligation': False, 'concrete_only': False}
check('well formed empty obligations',solve(base),[])
check('bound-index-range regression 0', solve(dict(base, **({'indices':[N],'arity':N}))), ['bound-index-range'])
check('bound-index-range regression 1', solve(dict(base, **({'indices':[N+1],'arity':N+1}))), ['bound-index-range'])
check('capture-avoiding-shift regression 0', solve(dict(base, **({'before':[N],'after':[N],'crossed':1}))), ['capture-avoiding-shift'])
check('capture-avoiding-shift regression 1', solve(dict(base, **({'before':[N,N+1],'after':[N,N+1],'crossed':2}))), ['capture-avoiding-shift'])
check('fresh-universe regression 0', solve(dict(base, **({'fresh':N,'caller':N}))), ['fresh-universe'])
check('fresh-universe regression 1', solve(dict(base, **({'fresh':N+1,'caller':N+1}))), ['fresh-universe'])
check('universe-leak regression 0', solve(dict(base, **({'solution_universes':[N+1],'existential_universe':N}))), ['universe-leak'])
check('universe-leak regression 1', solve(dict(base, **({'solution_universes':[N+2],'existential_universe':N+1}))), ['universe-leak'])
check('universal-coverage regression 0', solve(dict(base, **({'placeholders':['a','b'],'checked':['a']}))), ['universal-coverage'])
check('universal-coverage regression 1', solve(dict(base, **({'placeholders':list(range(N+1)),'checked':[0]}))), ['universal-coverage'])
check('alpha-equality regression 0', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':0,'b':1}}))), ['alpha-equality'])
check('alpha-equality regression 1', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':N,'b':N+1}}))), ['alpha-equality'])
check('alpha-distinctness regression 0', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':0,'b':1,'c':1}}))), ['alpha-distinctness'])
check('alpha-distinctness regression 1', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':N,'b':N+1,'c':N+1}}))), ['alpha-distinctness'])
check('binder-pop regression 0', solve(dict(base, **({'outside_before':[N],'outside_after':[N]}))), ['binder-pop'])
check('binder-pop regression 1', solve(dict(base, **({'outside_before':[N+1],'outside_after':[N+1]}))), ['binder-pop'])
check('static-skolem regression 0', solve(dict(base, **({'static_choices':['a'],'bound':['a']}))), ['static-skolem'])
check('static-skolem regression 1', solve(dict(base, **({'static_choices':[N],'bound':[N]}))), ['static-skolem'])
check('concrete-universal regression 0', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':['a']}))), ['concrete-universal'])
check('concrete-universal regression 1', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':[N]}))), ['concrete-universal'])
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:
Alpha-renaming splits equal bound lifetime occurrences.

Check higher-ranked borrow instantiation using de Bruijn binder depths and universes. Bound occurrence index less than binder arity; substitutions shift free lifetimes when crossing binders; fresh universes strictly exceed caller universe; existential solutions cannot mention newer universes; universally quantified input must be checked for every listed placeholder; alpha renaming preserves equal occurrences; distinct bound parameters remain distinct; dropping a binder decrements outside indices; bound lifetimes cannot be selected as static; placeholder obligations cannot be discharged by one concrete lifetime. 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 any(i<0 or i>=d['arity'] for i in d['indices']): errors.append('bound-index-range')
    if d['after']!=[i+d['crossed'] for i in d['before']]: errors.append('capture-avoiding-shift')
    if d['fresh']<=d['caller']: errors.append('fresh-universe')
    if any(u>d['existential_universe'] for u in d['solution_universes']): errors.append('universe-leak')
    if not set(d['placeholders'])<=set(d['checked']): errors.append('universal-coverage')
    if any(d['renaming'][a]!=d['renaming'][b] for a,b in d['equal_pairs']): errors.append('alpha-equality')
    if False: errors.append('alpha-distinctness')
    if d['outside_after']!=[i-1 for i in d['outside_before']]: errors.append('binder-pop')
    if bool(set(d['static_choices'])&set(d['bound'])): errors.append('static-skolem')
    if d['universal_obligation'] and d['concrete_only']: errors.append('concrete-universal')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'indices': [], 'arity': 0, 'crossed': 0, 'before': [], 'after': [], 'fresh': 1, 'caller': 0, 'solution_universes': [], 'existential_universe': 0, 'placeholders': [], 'checked': [], 'equal_pairs': [], 'renaming': {}, 'distinct_pairs': [], 'outside_before': [], 'outside_after': [], 'static_choices': [], 'bound': [], 'universal_obligation': False, 'concrete_only': False}
check('well formed empty obligations',solve(base),[])
check('bound-index-range regression 0', solve(dict(base, **({'indices':[N],'arity':N}))), ['bound-index-range'])
check('bound-index-range regression 1', solve(dict(base, **({'indices':[N+1],'arity':N+1}))), ['bound-index-range'])
check('capture-avoiding-shift regression 0', solve(dict(base, **({'before':[N],'after':[N],'crossed':1}))), ['capture-avoiding-shift'])
check('capture-avoiding-shift regression 1', solve(dict(base, **({'before':[N,N+1],'after':[N,N+1],'crossed':2}))), ['capture-avoiding-shift'])
check('fresh-universe regression 0', solve(dict(base, **({'fresh':N,'caller':N}))), ['fresh-universe'])
check('fresh-universe regression 1', solve(dict(base, **({'fresh':N+1,'caller':N+1}))), ['fresh-universe'])
check('universe-leak regression 0', solve(dict(base, **({'solution_universes':[N+1],'existential_universe':N}))), ['universe-leak'])
check('universe-leak regression 1', solve(dict(base, **({'solution_universes':[N+2],'existential_universe':N+1}))), ['universe-leak'])
check('universal-coverage regression 0', solve(dict(base, **({'placeholders':['a','b'],'checked':['a']}))), ['universal-coverage'])
check('universal-coverage regression 1', solve(dict(base, **({'placeholders':list(range(N+1)),'checked':[0]}))), ['universal-coverage'])
check('alpha-equality regression 0', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':0,'b':1}}))), ['alpha-equality'])
check('alpha-equality regression 1', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':N,'b':N+1}}))), ['alpha-equality'])
check('alpha-distinctness regression 0', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':0,'b':1,'c':1}}))), ['alpha-distinctness'])
check('alpha-distinctness regression 1', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':N,'b':N+1,'c':N+1}}))), ['alpha-distinctness'])
check('binder-pop regression 0', solve(dict(base, **({'outside_before':[N],'outside_after':[N]}))), ['binder-pop'])
check('binder-pop regression 1', solve(dict(base, **({'outside_before':[N+1],'outside_after':[N+1]}))), ['binder-pop'])
check('static-skolem regression 0', solve(dict(base, **({'static_choices':['a'],'bound':['a']}))), ['static-skolem'])
check('static-skolem regression 1', solve(dict(base, **({'static_choices':[N],'bound':[N]}))), ['static-skolem'])
check('concrete-universal regression 0', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':['a']}))), ['concrete-universal'])
check('concrete-universal regression 1', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':[N]}))), ['concrete-universal'])
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 any(i<0 or i>=d['arity'] for i in d['indices']): errors.append('bound-index-range')
    if d['after']!=[i+d['crossed'] for i in d['before']]: errors.append('capture-avoiding-shift')
    if d['fresh']<=d['caller']: errors.append('fresh-universe')
    if any(u>d['existential_universe'] for u in d['solution_universes']): errors.append('universe-leak')
    if not set(d['placeholders'])<=set(d['checked']): errors.append('universal-coverage')
    if any(d['renaming'][a]!=d['renaming'][b] for a,b in d['equal_pairs']): errors.append('alpha-equality')
    if any(d['renaming'][a]==d['renaming'][b] for a,b in d['distinct_pairs'][:1]): errors.append('alpha-distinctness')
    if d['outside_after']!=[i-1 for i in d['outside_before']]: errors.append('binder-pop')
    if bool(set(d['static_choices'])&set(d['bound'])): errors.append('static-skolem')
    if d['universal_obligation'] and d['concrete_only']: errors.append('concrete-universal')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'indices': [], 'arity': 0, 'crossed': 0, 'before': [], 'after': [], 'fresh': 1, 'caller': 0, 'solution_universes': [], 'existential_universe': 0, 'placeholders': [], 'checked': [], 'equal_pairs': [], 'renaming': {}, 'distinct_pairs': [], 'outside_before': [], 'outside_after': [], 'static_choices': [], 'bound': [], 'universal_obligation': False, 'concrete_only': False}
check('well formed empty obligations',solve(base),[])
check('bound-index-range regression 0', solve(dict(base, **({'indices':[N],'arity':N}))), ['bound-index-range'])
check('bound-index-range regression 1', solve(dict(base, **({'indices':[N+1],'arity':N+1}))), ['bound-index-range'])
check('capture-avoiding-shift regression 0', solve(dict(base, **({'before':[N],'after':[N],'crossed':1}))), ['capture-avoiding-shift'])
check('capture-avoiding-shift regression 1', solve(dict(base, **({'before':[N,N+1],'after':[N,N+1],'crossed':2}))), ['capture-avoiding-shift'])
check('fresh-universe regression 0', solve(dict(base, **({'fresh':N,'caller':N}))), ['fresh-universe'])
check('fresh-universe regression 1', solve(dict(base, **({'fresh':N+1,'caller':N+1}))), ['fresh-universe'])
check('universe-leak regression 0', solve(dict(base, **({'solution_universes':[N+1],'existential_universe':N}))), ['universe-leak'])
check('universe-leak regression 1', solve(dict(base, **({'solution_universes':[N+2],'existential_universe':N+1}))), ['universe-leak'])
check('universal-coverage regression 0', solve(dict(base, **({'placeholders':['a','b'],'checked':['a']}))), ['universal-coverage'])
check('universal-coverage regression 1', solve(dict(base, **({'placeholders':list(range(N+1)),'checked':[0]}))), ['universal-coverage'])
check('alpha-equality regression 0', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':0,'b':1}}))), ['alpha-equality'])
check('alpha-equality regression 1', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':N,'b':N+1}}))), ['alpha-equality'])
check('alpha-distinctness regression 0', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':0,'b':1,'c':1}}))), ['alpha-distinctness'])
check('alpha-distinctness regression 1', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':N,'b':N+1,'c':N+1}}))), ['alpha-distinctness'])
check('binder-pop regression 0', solve(dict(base, **({'outside_before':[N],'outside_after':[N]}))), ['binder-pop'])
check('binder-pop regression 1', solve(dict(base, **({'outside_before':[N+1],'outside_after':[N+1]}))), ['binder-pop'])
check('static-skolem regression 0', solve(dict(base, **({'static_choices':['a'],'bound':['a']}))), ['static-skolem'])
check('static-skolem regression 1', solve(dict(base, **({'static_choices':[N],'bound':[N]}))), ['static-skolem'])
check('concrete-universal regression 0', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':['a']}))), ['concrete-universal'])
check('concrete-universal regression 1', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':[N]}))), ['concrete-universal'])
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:
Alpha-renaming merges distinct bound lifetime parameters.

Check higher-ranked borrow instantiation using de Bruijn binder depths and universes. Bound occurrence index less than binder arity; substitutions shift free lifetimes when crossing binders; fresh universes strictly exceed caller universe; existential solutions cannot mention newer universes; universally quantified input must be checked for every listed placeholder; alpha renaming preserves equal occurrences; distinct bound parameters remain distinct; dropping a binder decrements outside indices; bound lifetimes cannot be selected as static; placeholder obligations cannot be discharged by one concrete lifetime. 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 any(i<0 or i>=d['arity'] for i in d['indices']): errors.append('bound-index-range')
    if d['after']!=[i+d['crossed'] for i in d['before']]: errors.append('capture-avoiding-shift')
    if d['fresh']<=d['caller']: errors.append('fresh-universe')
    if any(u>d['existential_universe'] for u in d['solution_universes']): errors.append('universe-leak')
    if not set(d['placeholders'])<=set(d['checked']): errors.append('universal-coverage')
    if any(d['renaming'][a]!=d['renaming'][b] for a,b in d['equal_pairs']): errors.append('alpha-equality')
    if any(d['renaming'][a]==d['renaming'][b] for a,b in d['distinct_pairs']): errors.append('alpha-distinctness')
    if False: errors.append('binder-pop')
    if bool(set(d['static_choices'])&set(d['bound'])): errors.append('static-skolem')
    if d['universal_obligation'] and d['concrete_only']: errors.append('concrete-universal')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'indices': [], 'arity': 0, 'crossed': 0, 'before': [], 'after': [], 'fresh': 1, 'caller': 0, 'solution_universes': [], 'existential_universe': 0, 'placeholders': [], 'checked': [], 'equal_pairs': [], 'renaming': {}, 'distinct_pairs': [], 'outside_before': [], 'outside_after': [], 'static_choices': [], 'bound': [], 'universal_obligation': False, 'concrete_only': False}
check('well formed empty obligations',solve(base),[])
check('bound-index-range regression 0', solve(dict(base, **({'indices':[N],'arity':N}))), ['bound-index-range'])
check('bound-index-range regression 1', solve(dict(base, **({'indices':[N+1],'arity':N+1}))), ['bound-index-range'])
check('capture-avoiding-shift regression 0', solve(dict(base, **({'before':[N],'after':[N],'crossed':1}))), ['capture-avoiding-shift'])
check('capture-avoiding-shift regression 1', solve(dict(base, **({'before':[N,N+1],'after':[N,N+1],'crossed':2}))), ['capture-avoiding-shift'])
check('fresh-universe regression 0', solve(dict(base, **({'fresh':N,'caller':N}))), ['fresh-universe'])
check('fresh-universe regression 1', solve(dict(base, **({'fresh':N+1,'caller':N+1}))), ['fresh-universe'])
check('universe-leak regression 0', solve(dict(base, **({'solution_universes':[N+1],'existential_universe':N}))), ['universe-leak'])
check('universe-leak regression 1', solve(dict(base, **({'solution_universes':[N+2],'existential_universe':N+1}))), ['universe-leak'])
check('universal-coverage regression 0', solve(dict(base, **({'placeholders':['a','b'],'checked':['a']}))), ['universal-coverage'])
check('universal-coverage regression 1', solve(dict(base, **({'placeholders':list(range(N+1)),'checked':[0]}))), ['universal-coverage'])
check('alpha-equality regression 0', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':0,'b':1}}))), ['alpha-equality'])
check('alpha-equality regression 1', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':N,'b':N+1}}))), ['alpha-equality'])
check('alpha-distinctness regression 0', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':0,'b':1,'c':1}}))), ['alpha-distinctness'])
check('alpha-distinctness regression 1', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':N,'b':N+1,'c':N+1}}))), ['alpha-distinctness'])
check('binder-pop regression 0', solve(dict(base, **({'outside_before':[N],'outside_after':[N]}))), ['binder-pop'])
check('binder-pop regression 1', solve(dict(base, **({'outside_before':[N+1],'outside_after':[N+1]}))), ['binder-pop'])
check('static-skolem regression 0', solve(dict(base, **({'static_choices':['a'],'bound':['a']}))), ['static-skolem'])
check('static-skolem regression 1', solve(dict(base, **({'static_choices':[N],'bound':[N]}))), ['static-skolem'])
check('concrete-universal regression 0', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':['a']}))), ['concrete-universal'])
check('concrete-universal regression 1', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':[N]}))), ['concrete-universal'])
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 any(i<0 or i>=d['arity'] for i in d['indices']): errors.append('bound-index-range')
    if d['after']!=[i+d['crossed'] for i in d['before']]: errors.append('capture-avoiding-shift')
    if d['fresh']<=d['caller']: errors.append('fresh-universe')
    if any(u>d['existential_universe'] for u in d['solution_universes']): errors.append('universe-leak')
    if not set(d['placeholders'])<=set(d['checked']): errors.append('universal-coverage')
    if any(d['renaming'][a]!=d['renaming'][b] for a,b in d['equal_pairs']): errors.append('alpha-equality')
    if any(d['renaming'][a]==d['renaming'][b] for a,b in d['distinct_pairs']): errors.append('alpha-distinctness')
    if len(d['outside_after'])!=len(d['outside_before']): errors.append('binder-pop')
    if bool(set(d['static_choices'])&set(d['bound'])): errors.append('static-skolem')
    if d['universal_obligation'] and d['concrete_only']: errors.append('concrete-universal')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'indices': [], 'arity': 0, 'crossed': 0, 'before': [], 'after': [], 'fresh': 1, 'caller': 0, 'solution_universes': [], 'existential_universe': 0, 'placeholders': [], 'checked': [], 'equal_pairs': [], 'renaming': {}, 'distinct_pairs': [], 'outside_before': [], 'outside_after': [], 'static_choices': [], 'bound': [], 'universal_obligation': False, 'concrete_only': False}
check('well formed empty obligations',solve(base),[])
check('bound-index-range regression 0', solve(dict(base, **({'indices':[N],'arity':N}))), ['bound-index-range'])
check('bound-index-range regression 1', solve(dict(base, **({'indices':[N+1],'arity':N+1}))), ['bound-index-range'])
check('capture-avoiding-shift regression 0', solve(dict(base, **({'before':[N],'after':[N],'crossed':1}))), ['capture-avoiding-shift'])
check('capture-avoiding-shift regression 1', solve(dict(base, **({'before':[N,N+1],'after':[N,N+1],'crossed':2}))), ['capture-avoiding-shift'])
check('fresh-universe regression 0', solve(dict(base, **({'fresh':N,'caller':N}))), ['fresh-universe'])
check('fresh-universe regression 1', solve(dict(base, **({'fresh':N+1,'caller':N+1}))), ['fresh-universe'])
check('universe-leak regression 0', solve(dict(base, **({'solution_universes':[N+1],'existential_universe':N}))), ['universe-leak'])
check('universe-leak regression 1', solve(dict(base, **({'solution_universes':[N+2],'existential_universe':N+1}))), ['universe-leak'])
check('universal-coverage regression 0', solve(dict(base, **({'placeholders':['a','b'],'checked':['a']}))), ['universal-coverage'])
check('universal-coverage regression 1', solve(dict(base, **({'placeholders':list(range(N+1)),'checked':[0]}))), ['universal-coverage'])
check('alpha-equality regression 0', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':0,'b':1}}))), ['alpha-equality'])
check('alpha-equality regression 1', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':N,'b':N+1}}))), ['alpha-equality'])
check('alpha-distinctness regression 0', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':0,'b':1,'c':1}}))), ['alpha-distinctness'])
check('alpha-distinctness regression 1', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':N,'b':N+1,'c':N+1}}))), ['alpha-distinctness'])
check('binder-pop regression 0', solve(dict(base, **({'outside_before':[N],'outside_after':[N]}))), ['binder-pop'])
check('binder-pop regression 1', solve(dict(base, **({'outside_before':[N+1],'outside_after':[N+1]}))), ['binder-pop'])
check('static-skolem regression 0', solve(dict(base, **({'static_choices':['a'],'bound':['a']}))), ['static-skolem'])
check('static-skolem regression 1', solve(dict(base, **({'static_choices':[N],'bound':[N]}))), ['static-skolem'])
check('concrete-universal regression 0', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':['a']}))), ['concrete-universal'])
check('concrete-universal regression 1', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':[N]}))), ['concrete-universal'])
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:
Removing a binder leaves outer lifetime indices off by one.

Check higher-ranked borrow instantiation using de Bruijn binder depths and universes. Bound occurrence index less than binder arity; substitutions shift free lifetimes when crossing binders; fresh universes strictly exceed caller universe; existential solutions cannot mention newer universes; universally quantified input must be checked for every listed placeholder; alpha renaming preserves equal occurrences; distinct bound parameters remain distinct; dropping a binder decrements outside indices; bound lifetimes cannot be selected as static; placeholder obligations cannot be discharged by one concrete lifetime. 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 any(i<0 or i>=d['arity'] for i in d['indices']): errors.append('bound-index-range')
    if d['after']!=[i+d['crossed'] for i in d['before']]: errors.append('capture-avoiding-shift')
    if d['fresh']<=d['caller']: errors.append('fresh-universe')
    if any(u>d['existential_universe'] for u in d['solution_universes']): errors.append('universe-leak')
    if not set(d['placeholders'])<=set(d['checked']): errors.append('universal-coverage')
    if any(d['renaming'][a]!=d['renaming'][b] for a,b in d['equal_pairs']): errors.append('alpha-equality')
    if any(d['renaming'][a]==d['renaming'][b] for a,b in d['distinct_pairs']): errors.append('alpha-distinctness')
    if d['outside_after']!=[i-1 for i in d['outside_before']]: errors.append('binder-pop')
    if False: errors.append('static-skolem')
    if d['universal_obligation'] and d['concrete_only']: errors.append('concrete-universal')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'indices': [], 'arity': 0, 'crossed': 0, 'before': [], 'after': [], 'fresh': 1, 'caller': 0, 'solution_universes': [], 'existential_universe': 0, 'placeholders': [], 'checked': [], 'equal_pairs': [], 'renaming': {}, 'distinct_pairs': [], 'outside_before': [], 'outside_after': [], 'static_choices': [], 'bound': [], 'universal_obligation': False, 'concrete_only': False}
check('well formed empty obligations',solve(base),[])
check('bound-index-range regression 0', solve(dict(base, **({'indices':[N],'arity':N}))), ['bound-index-range'])
check('bound-index-range regression 1', solve(dict(base, **({'indices':[N+1],'arity':N+1}))), ['bound-index-range'])
check('capture-avoiding-shift regression 0', solve(dict(base, **({'before':[N],'after':[N],'crossed':1}))), ['capture-avoiding-shift'])
check('capture-avoiding-shift regression 1', solve(dict(base, **({'before':[N,N+1],'after':[N,N+1],'crossed':2}))), ['capture-avoiding-shift'])
check('fresh-universe regression 0', solve(dict(base, **({'fresh':N,'caller':N}))), ['fresh-universe'])
check('fresh-universe regression 1', solve(dict(base, **({'fresh':N+1,'caller':N+1}))), ['fresh-universe'])
check('universe-leak regression 0', solve(dict(base, **({'solution_universes':[N+1],'existential_universe':N}))), ['universe-leak'])
check('universe-leak regression 1', solve(dict(base, **({'solution_universes':[N+2],'existential_universe':N+1}))), ['universe-leak'])
check('universal-coverage regression 0', solve(dict(base, **({'placeholders':['a','b'],'checked':['a']}))), ['universal-coverage'])
check('universal-coverage regression 1', solve(dict(base, **({'placeholders':list(range(N+1)),'checked':[0]}))), ['universal-coverage'])
check('alpha-equality regression 0', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':0,'b':1}}))), ['alpha-equality'])
check('alpha-equality regression 1', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':N,'b':N+1}}))), ['alpha-equality'])
check('alpha-distinctness regression 0', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':0,'b':1,'c':1}}))), ['alpha-distinctness'])
check('alpha-distinctness regression 1', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':N,'b':N+1,'c':N+1}}))), ['alpha-distinctness'])
check('binder-pop regression 0', solve(dict(base, **({'outside_before':[N],'outside_after':[N]}))), ['binder-pop'])
check('binder-pop regression 1', solve(dict(base, **({'outside_before':[N+1],'outside_after':[N+1]}))), ['binder-pop'])
check('static-skolem regression 0', solve(dict(base, **({'static_choices':['a'],'bound':['a']}))), ['static-skolem'])
check('static-skolem regression 1', solve(dict(base, **({'static_choices':[N],'bound':[N]}))), ['static-skolem'])
check('concrete-universal regression 0', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':['a']}))), ['concrete-universal'])
check('concrete-universal regression 1', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':[N]}))), ['concrete-universal'])
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 any(i<0 or i>=d['arity'] for i in d['indices']): errors.append('bound-index-range')
    if d['after']!=[i+d['crossed'] for i in d['before']]: errors.append('capture-avoiding-shift')
    if d['fresh']<=d['caller']: errors.append('fresh-universe')
    if any(u>d['existential_universe'] for u in d['solution_universes']): errors.append('universe-leak')
    if not set(d['placeholders'])<=set(d['checked']): errors.append('universal-coverage')
    if any(d['renaming'][a]!=d['renaming'][b] for a,b in d['equal_pairs']): errors.append('alpha-equality')
    if any(d['renaming'][a]==d['renaming'][b] for a,b in d['distinct_pairs']): errors.append('alpha-distinctness')
    if d['outside_after']!=[i-1 for i in d['outside_before']]: errors.append('binder-pop')
    if len(set(d['static_choices'])&set(d['bound']))>1: errors.append('static-skolem')
    if d['universal_obligation'] and d['concrete_only']: errors.append('concrete-universal')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'indices': [], 'arity': 0, 'crossed': 0, 'before': [], 'after': [], 'fresh': 1, 'caller': 0, 'solution_universes': [], 'existential_universe': 0, 'placeholders': [], 'checked': [], 'equal_pairs': [], 'renaming': {}, 'distinct_pairs': [], 'outside_before': [], 'outside_after': [], 'static_choices': [], 'bound': [], 'universal_obligation': False, 'concrete_only': False}
check('well formed empty obligations',solve(base),[])
check('bound-index-range regression 0', solve(dict(base, **({'indices':[N],'arity':N}))), ['bound-index-range'])
check('bound-index-range regression 1', solve(dict(base, **({'indices':[N+1],'arity':N+1}))), ['bound-index-range'])
check('capture-avoiding-shift regression 0', solve(dict(base, **({'before':[N],'after':[N],'crossed':1}))), ['capture-avoiding-shift'])
check('capture-avoiding-shift regression 1', solve(dict(base, **({'before':[N,N+1],'after':[N,N+1],'crossed':2}))), ['capture-avoiding-shift'])
check('fresh-universe regression 0', solve(dict(base, **({'fresh':N,'caller':N}))), ['fresh-universe'])
check('fresh-universe regression 1', solve(dict(base, **({'fresh':N+1,'caller':N+1}))), ['fresh-universe'])
check('universe-leak regression 0', solve(dict(base, **({'solution_universes':[N+1],'existential_universe':N}))), ['universe-leak'])
check('universe-leak regression 1', solve(dict(base, **({'solution_universes':[N+2],'existential_universe':N+1}))), ['universe-leak'])
check('universal-coverage regression 0', solve(dict(base, **({'placeholders':['a','b'],'checked':['a']}))), ['universal-coverage'])
check('universal-coverage regression 1', solve(dict(base, **({'placeholders':list(range(N+1)),'checked':[0]}))), ['universal-coverage'])
check('alpha-equality regression 0', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':0,'b':1}}))), ['alpha-equality'])
check('alpha-equality regression 1', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':N,'b':N+1}}))), ['alpha-equality'])
check('alpha-distinctness regression 0', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':0,'b':1,'c':1}}))), ['alpha-distinctness'])
check('alpha-distinctness regression 1', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':N,'b':N+1,'c':N+1}}))), ['alpha-distinctness'])
check('binder-pop regression 0', solve(dict(base, **({'outside_before':[N],'outside_after':[N]}))), ['binder-pop'])
check('binder-pop regression 1', solve(dict(base, **({'outside_before':[N+1],'outside_after':[N+1]}))), ['binder-pop'])
check('static-skolem regression 0', solve(dict(base, **({'static_choices':['a'],'bound':['a']}))), ['static-skolem'])
check('static-skolem regression 1', solve(dict(base, **({'static_choices':[N],'bound':[N]}))), ['static-skolem'])
check('concrete-universal regression 0', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':['a']}))), ['concrete-universal'])
check('concrete-universal regression 1', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':[N]}))), ['concrete-universal'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A universal lifetime placeholder is replaced by static storage.

Check higher-ranked borrow instantiation using de Bruijn binder depths and universes. Bound occurrence index less than binder arity; substitutions shift free lifetimes when crossing binders; fresh universes strictly exceed caller universe; existential solutions cannot mention newer universes; universally quantified input must be checked for every listed placeholder; alpha renaming preserves equal occurrences; distinct bound parameters remain distinct; dropping a binder decrements outside indices; bound lifetimes cannot be selected as static; placeholder obligations cannot be discharged by one concrete lifetime. 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 any(i<0 or i>=d['arity'] for i in d['indices']): errors.append('bound-index-range')
    if d['after']!=[i+d['crossed'] for i in d['before']]: errors.append('capture-avoiding-shift')
    if d['fresh']<=d['caller']: errors.append('fresh-universe')
    if any(u>d['existential_universe'] for u in d['solution_universes']): errors.append('universe-leak')
    if not set(d['placeholders'])<=set(d['checked']): errors.append('universal-coverage')
    if any(d['renaming'][a]!=d['renaming'][b] for a,b in d['equal_pairs']): errors.append('alpha-equality')
    if any(d['renaming'][a]==d['renaming'][b] for a,b in d['distinct_pairs']): errors.append('alpha-distinctness')
    if d['outside_after']!=[i-1 for i in d['outside_before']]: errors.append('binder-pop')
    if bool(set(d['static_choices'])&set(d['bound'])): errors.append('static-skolem')
    if False: errors.append('concrete-universal')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'indices': [], 'arity': 0, 'crossed': 0, 'before': [], 'after': [], 'fresh': 1, 'caller': 0, 'solution_universes': [], 'existential_universe': 0, 'placeholders': [], 'checked': [], 'equal_pairs': [], 'renaming': {}, 'distinct_pairs': [], 'outside_before': [], 'outside_after': [], 'static_choices': [], 'bound': [], 'universal_obligation': False, 'concrete_only': False}
check('well formed empty obligations',solve(base),[])
check('bound-index-range regression 0', solve(dict(base, **({'indices':[N],'arity':N}))), ['bound-index-range'])
check('bound-index-range regression 1', solve(dict(base, **({'indices':[N+1],'arity':N+1}))), ['bound-index-range'])
check('capture-avoiding-shift regression 0', solve(dict(base, **({'before':[N],'after':[N],'crossed':1}))), ['capture-avoiding-shift'])
check('capture-avoiding-shift regression 1', solve(dict(base, **({'before':[N,N+1],'after':[N,N+1],'crossed':2}))), ['capture-avoiding-shift'])
check('fresh-universe regression 0', solve(dict(base, **({'fresh':N,'caller':N}))), ['fresh-universe'])
check('fresh-universe regression 1', solve(dict(base, **({'fresh':N+1,'caller':N+1}))), ['fresh-universe'])
check('universe-leak regression 0', solve(dict(base, **({'solution_universes':[N+1],'existential_universe':N}))), ['universe-leak'])
check('universe-leak regression 1', solve(dict(base, **({'solution_universes':[N+2],'existential_universe':N+1}))), ['universe-leak'])
check('universal-coverage regression 0', solve(dict(base, **({'placeholders':['a','b'],'checked':['a']}))), ['universal-coverage'])
check('universal-coverage regression 1', solve(dict(base, **({'placeholders':list(range(N+1)),'checked':[0]}))), ['universal-coverage'])
check('alpha-equality regression 0', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':0,'b':1}}))), ['alpha-equality'])
check('alpha-equality regression 1', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':N,'b':N+1}}))), ['alpha-equality'])
check('alpha-distinctness regression 0', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':0,'b':1,'c':1}}))), ['alpha-distinctness'])
check('alpha-distinctness regression 1', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':N,'b':N+1,'c':N+1}}))), ['alpha-distinctness'])
check('binder-pop regression 0', solve(dict(base, **({'outside_before':[N],'outside_after':[N]}))), ['binder-pop'])
check('binder-pop regression 1', solve(dict(base, **({'outside_before':[N+1],'outside_after':[N+1]}))), ['binder-pop'])
check('static-skolem regression 0', solve(dict(base, **({'static_choices':['a'],'bound':['a']}))), ['static-skolem'])
check('static-skolem regression 1', solve(dict(base, **({'static_choices':[N],'bound':[N]}))), ['static-skolem'])
check('concrete-universal regression 0', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':['a']}))), ['concrete-universal'])
check('concrete-universal regression 1', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':[N]}))), ['concrete-universal'])
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 any(i<0 or i>=d['arity'] for i in d['indices']): errors.append('bound-index-range')
    if d['after']!=[i+d['crossed'] for i in d['before']]: errors.append('capture-avoiding-shift')
    if d['fresh']<=d['caller']: errors.append('fresh-universe')
    if any(u>d['existential_universe'] for u in d['solution_universes']): errors.append('universe-leak')
    if not set(d['placeholders'])<=set(d['checked']): errors.append('universal-coverage')
    if any(d['renaming'][a]!=d['renaming'][b] for a,b in d['equal_pairs']): errors.append('alpha-equality')
    if any(d['renaming'][a]==d['renaming'][b] for a,b in d['distinct_pairs']): errors.append('alpha-distinctness')
    if d['outside_after']!=[i-1 for i in d['outside_before']]: errors.append('binder-pop')
    if bool(set(d['static_choices'])&set(d['bound'])): errors.append('static-skolem')
    if d['universal_obligation'] and d['concrete_only'] and not d['checked']: errors.append('concrete-universal')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'indices': [], 'arity': 0, 'crossed': 0, 'before': [], 'after': [], 'fresh': 1, 'caller': 0, 'solution_universes': [], 'existential_universe': 0, 'placeholders': [], 'checked': [], 'equal_pairs': [], 'renaming': {}, 'distinct_pairs': [], 'outside_before': [], 'outside_after': [], 'static_choices': [], 'bound': [], 'universal_obligation': False, 'concrete_only': False}
check('well formed empty obligations',solve(base),[])
check('bound-index-range regression 0', solve(dict(base, **({'indices':[N],'arity':N}))), ['bound-index-range'])
check('bound-index-range regression 1', solve(dict(base, **({'indices':[N+1],'arity':N+1}))), ['bound-index-range'])
check('capture-avoiding-shift regression 0', solve(dict(base, **({'before':[N],'after':[N],'crossed':1}))), ['capture-avoiding-shift'])
check('capture-avoiding-shift regression 1', solve(dict(base, **({'before':[N,N+1],'after':[N,N+1],'crossed':2}))), ['capture-avoiding-shift'])
check('fresh-universe regression 0', solve(dict(base, **({'fresh':N,'caller':N}))), ['fresh-universe'])
check('fresh-universe regression 1', solve(dict(base, **({'fresh':N+1,'caller':N+1}))), ['fresh-universe'])
check('universe-leak regression 0', solve(dict(base, **({'solution_universes':[N+1],'existential_universe':N}))), ['universe-leak'])
check('universe-leak regression 1', solve(dict(base, **({'solution_universes':[N+2],'existential_universe':N+1}))), ['universe-leak'])
check('universal-coverage regression 0', solve(dict(base, **({'placeholders':['a','b'],'checked':['a']}))), ['universal-coverage'])
check('universal-coverage regression 1', solve(dict(base, **({'placeholders':list(range(N+1)),'checked':[0]}))), ['universal-coverage'])
check('alpha-equality regression 0', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':0,'b':1}}))), ['alpha-equality'])
check('alpha-equality regression 1', solve(dict(base, **({'equal_pairs':[('a','a'),('a','b')],'renaming':{'a':N,'b':N+1}}))), ['alpha-equality'])
check('alpha-distinctness regression 0', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':0,'b':1,'c':1}}))), ['alpha-distinctness'])
check('alpha-distinctness regression 1', solve(dict(base, **({'distinct_pairs':[('a','b'),('b','c')],'renaming':{'a':N,'b':N+1,'c':N+1}}))), ['alpha-distinctness'])
check('binder-pop regression 0', solve(dict(base, **({'outside_before':[N],'outside_after':[N]}))), ['binder-pop'])
check('binder-pop regression 1', solve(dict(base, **({'outside_before':[N+1],'outside_after':[N+1]}))), ['binder-pop'])
check('static-skolem regression 0', solve(dict(base, **({'static_choices':['a'],'bound':['a']}))), ['static-skolem'])
check('static-skolem regression 1', solve(dict(base, **({'static_choices':[N],'bound':[N]}))), ['static-skolem'])
check('concrete-universal regression 0', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':['a']}))), ['concrete-universal'])
check('concrete-universal regression 1', solve(dict(base, **({'universal_obligation':True,'concrete_only':True,'checked':[N]}))), ['concrete-universal'])
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:
One concrete lifetime instantiation is mistaken for a universal proof.

Check higher-ranked borrow instantiation using de Bruijn binder depths and universes. Bound occurrence index less than binder arity; substitutions shift free lifetimes when crossing binders; fresh universes strictly exceed caller universe; existential solutions cannot mention newer universes; universally quantified input must be checked for every listed placeholder; alpha renaming preserves equal occurrences; distinct bound parameters remain distinct; dropping a binder decrements outside indices; bound lifetimes cannot be selected as static; placeholder obligations cannot be discharged by one concrete lifetime. 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('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
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['source_bound'])!=len(d['erased_bound']): errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
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:
Trait erasure changes the referent lifetime while preserving its size.

Check erased borrowed trait objects in a stipulated object calculus. Erasure retains referent lifetime and ownership capability; default object bound inside reference inherits reference bound; object method return aliases must be represented in the vtable summary; mutable methods require exclusive object access; upcasting cannot enlarge lifetime or change data-address provenance; thin conversion cannot discard lifetime metadata; associated borrowed output includes owner lifetime; object-safe methods cannot expose a locally quantified lifetime as an unbound output; dynamic destruction observes declared borrowed fields. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access


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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if False: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
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['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique'] and not d['exclusive_access']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
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:
Erasing a shared borrow manufactures exclusive trait-object access.

Check erased borrowed trait objects in a stipulated object calculus. Erasure retains referent lifetime and ownership capability; default object bound inside reference inherits reference bound; object method return aliases must be represented in the vtable summary; mutable methods require exclusive object access; upcasting cannot enlarge lifetime or change data-address provenance; thin conversion cannot discard lifetime metadata; associated borrowed output includes owner lifetime; object-safe methods cannot expose a locally quantified lifetime as an unbound output; dynamic destruction observes declared borrowed fields. 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