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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_shared'] and d['target_unique']: errors.append('freeze-direction')
    if d['source_owner']!=d['target_owner']: errors.append('unsize-owner')
    if d['unsized'] and not d['metadata']: errors.append('unsize-metadata')
    if d['array_coerce'] and d['array_size']!=d['slice_size']: errors.append('array-slice-extent')
    if d['nested_mut'] and d['inner_before']!=d['inner_after']: errors.append('nested-mut-invariance')
    if d['shared_outer'] and d['outer_after']>d['outer_before']: errors.append('outer-shared-shortening')
    if False: errors.append('deref-intermediates')
    if d['implicit'] and d['moving_deref']: errors.append('implicit-moving-deref')
    if not set(d['captured'])<=set(d['reified']): errors.append('function-reification-capture')
    if d['never_branch'] and bool(d['invented']): errors.append('never-no-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_shared': False, 'target_unique': False, 'source_owner': None, 'target_owner': None, 'unsized': False, 'metadata': True, 'array_size': 0, 'slice_size': 0, 'array_coerce': False, 'nested_mut': False, 'inner_before': 0, 'inner_after': 0, 'shared_outer': False, 'outer_before': 0, 'outer_after': 0, 'intermediate': [], 'recorded': [], 'moving_deref': False, 'implicit': False, 'captured': [], 'reified': [], 'never_branch': False, 'invented': []}
check('well formed empty obligations',solve(base),[])
check('freeze-direction regression 0', solve(dict(base, **({'source_shared':True,'target_unique':True}))), ['freeze-direction'])
check('freeze-direction regression 1', solve(dict(base, **({'source_shared':True,'target_unique':True,'outer_before':N,'outer_after':N}))), ['freeze-direction'])
check('unsize-owner regression 0', solve(dict(base, **({'source_owner':'a','target_owner':'b'}))), ['unsize-owner'])
check('unsize-owner regression 1', solve(dict(base, **({'source_owner':N,'target_owner':N+1}))), ['unsize-owner'])
check('unsize-metadata regression 0', solve(dict(base, **({'unsized':True,'metadata':False}))), ['unsize-metadata'])
check('unsize-metadata regression 1', solve(dict(base, **({'unsized':True,'metadata':False,'outer_before':N,'outer_after':N}))), ['unsize-metadata'])
check('array-slice-extent regression 0', solve(dict(base, **({'array_coerce':True,'array_size':N+1,'slice_size':N}))), ['array-slice-extent'])
check('array-slice-extent regression 1', solve(dict(base, **({'array_coerce':True,'array_size':N+2,'slice_size':N+1}))), ['array-slice-extent'])
check('nested-mut-invariance regression 0', solve(dict(base, **({'nested_mut':True,'inner_before':N+1,'inner_after':N}))), ['nested-mut-invariance'])
check('nested-mut-invariance regression 1', solve(dict(base, **({'nested_mut':True,'inner_before':N+2,'inner_after':N+1}))), ['nested-mut-invariance'])
check('outer-shared-shortening regression 0', solve(dict(base, **({'shared_outer':True,'outer_before':N,'outer_after':N+1}))), ['outer-shared-shortening'])
check('outer-shared-shortening regression 1', solve(dict(base, **({'shared_outer':True,'outer_before':N+1,'outer_after':N+2}))), ['outer-shared-shortening'])
check('deref-intermediates regression 0', solve(dict(base, **({'intermediate':['a','b'],'recorded':['a']}))), ['deref-intermediates'])
check('deref-intermediates regression 1', solve(dict(base, **({'intermediate':list(range(N+1)),'recorded':[0]}))), ['deref-intermediates'])
check('implicit-moving-deref regression 0', solve(dict(base, **({'implicit':True,'moving_deref':True}))), ['implicit-moving-deref'])
check('implicit-moving-deref regression 1', solve(dict(base, **({'implicit':True,'moving_deref':True,'outer_before':N,'outer_after':N}))), ['implicit-moving-deref'])
check('function-reification-capture regression 0', solve(dict(base, **({'captured':['a','b'],'reified':['a']}))), ['function-reification-capture'])
check('function-reification-capture regression 1', solve(dict(base, **({'captured':[N,N+1],'reified':[N]}))), ['function-reification-capture'])
check('never-no-origin regression 0', solve(dict(base, **({'never_branch':True,'invented':['r']}))), ['never-no-origin'])
check('never-no-origin regression 1', solve(dict(base, **({'never_branch':True,'invented':[N]}))), ['never-no-origin'])
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_shared'] and d['target_unique']: errors.append('freeze-direction')
    if d['source_owner']!=d['target_owner']: errors.append('unsize-owner')
    if d['unsized'] and not d['metadata']: errors.append('unsize-metadata')
    if d['array_coerce'] and d['array_size']!=d['slice_size']: errors.append('array-slice-extent')
    if d['nested_mut'] and d['inner_before']!=d['inner_after']: errors.append('nested-mut-invariance')
    if d['shared_outer'] and d['outer_after']>d['outer_before']: errors.append('outer-shared-shortening')
    if not d['recorded'] and bool(d['intermediate']): errors.append('deref-intermediates')
    if d['implicit'] and d['moving_deref']: errors.append('implicit-moving-deref')
    if not set(d['captured'])<=set(d['reified']): errors.append('function-reification-capture')
    if d['never_branch'] and bool(d['invented']): errors.append('never-no-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_shared': False, 'target_unique': False, 'source_owner': None, 'target_owner': None, 'unsized': False, 'metadata': True, 'array_size': 0, 'slice_size': 0, 'array_coerce': False, 'nested_mut': False, 'inner_before': 0, 'inner_after': 0, 'shared_outer': False, 'outer_before': 0, 'outer_after': 0, 'intermediate': [], 'recorded': [], 'moving_deref': False, 'implicit': False, 'captured': [], 'reified': [], 'never_branch': False, 'invented': []}
check('well formed empty obligations',solve(base),[])
check('freeze-direction regression 0', solve(dict(base, **({'source_shared':True,'target_unique':True}))), ['freeze-direction'])
check('freeze-direction regression 1', solve(dict(base, **({'source_shared':True,'target_unique':True,'outer_before':N,'outer_after':N}))), ['freeze-direction'])
check('unsize-owner regression 0', solve(dict(base, **({'source_owner':'a','target_owner':'b'}))), ['unsize-owner'])
check('unsize-owner regression 1', solve(dict(base, **({'source_owner':N,'target_owner':N+1}))), ['unsize-owner'])
check('unsize-metadata regression 0', solve(dict(base, **({'unsized':True,'metadata':False}))), ['unsize-metadata'])
check('unsize-metadata regression 1', solve(dict(base, **({'unsized':True,'metadata':False,'outer_before':N,'outer_after':N}))), ['unsize-metadata'])
check('array-slice-extent regression 0', solve(dict(base, **({'array_coerce':True,'array_size':N+1,'slice_size':N}))), ['array-slice-extent'])
check('array-slice-extent regression 1', solve(dict(base, **({'array_coerce':True,'array_size':N+2,'slice_size':N+1}))), ['array-slice-extent'])
check('nested-mut-invariance regression 0', solve(dict(base, **({'nested_mut':True,'inner_before':N+1,'inner_after':N}))), ['nested-mut-invariance'])
check('nested-mut-invariance regression 1', solve(dict(base, **({'nested_mut':True,'inner_before':N+2,'inner_after':N+1}))), ['nested-mut-invariance'])
check('outer-shared-shortening regression 0', solve(dict(base, **({'shared_outer':True,'outer_before':N,'outer_after':N+1}))), ['outer-shared-shortening'])
check('outer-shared-shortening regression 1', solve(dict(base, **({'shared_outer':True,'outer_before':N+1,'outer_after':N+2}))), ['outer-shared-shortening'])
check('deref-intermediates regression 0', solve(dict(base, **({'intermediate':['a','b'],'recorded':['a']}))), ['deref-intermediates'])
check('deref-intermediates regression 1', solve(dict(base, **({'intermediate':list(range(N+1)),'recorded':[0]}))), ['deref-intermediates'])
check('implicit-moving-deref regression 0', solve(dict(base, **({'implicit':True,'moving_deref':True}))), ['implicit-moving-deref'])
check('implicit-moving-deref regression 1', solve(dict(base, **({'implicit':True,'moving_deref':True,'outer_before':N,'outer_after':N}))), ['implicit-moving-deref'])
check('function-reification-capture regression 0', solve(dict(base, **({'captured':['a','b'],'reified':['a']}))), ['function-reification-capture'])
check('function-reification-capture regression 1', solve(dict(base, **({'captured':[N,N+1],'reified':[N]}))), ['function-reification-capture'])
check('never-no-origin regression 0', solve(dict(base, **({'never_branch':True,'invented':['r']}))), ['never-no-origin'])
check('never-no-origin regression 1', solve(dict(base, **({'never_branch':True,'invented':[N]}))), ['never-no-origin'])
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 multi-step deref coercion loses an intermediate borrow dependency.

Check reference coercion proof steps. Unique-to-shared freeze is one-way; unsizing preserves owner; trait unsizing retains metadata; array-to-slice length equals array extent; nested mutable references cannot shorten inner lifetime; shared outer references may shorten; deref coercion records every intermediate loan; implicit coercion cannot execute a moving deref; reification of a borrowed function pointer preserves captured lifetimes; never-type branch coercion contributes no invented loan. 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_shared'] and d['target_unique']: errors.append('freeze-direction')
    if d['source_owner']!=d['target_owner']: errors.append('unsize-owner')
    if d['unsized'] and not d['metadata']: errors.append('unsize-metadata')
    if d['array_coerce'] and d['array_size']!=d['slice_size']: errors.append('array-slice-extent')
    if d['nested_mut'] and d['inner_before']!=d['inner_after']: errors.append('nested-mut-invariance')
    if d['shared_outer'] and d['outer_after']>d['outer_before']: errors.append('outer-shared-shortening')
    if not set(d['intermediate'])<=set(d['recorded']): errors.append('deref-intermediates')
    if False: errors.append('implicit-moving-deref')
    if not set(d['captured'])<=set(d['reified']): errors.append('function-reification-capture')
    if d['never_branch'] and bool(d['invented']): errors.append('never-no-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_shared': False, 'target_unique': False, 'source_owner': None, 'target_owner': None, 'unsized': False, 'metadata': True, 'array_size': 0, 'slice_size': 0, 'array_coerce': False, 'nested_mut': False, 'inner_before': 0, 'inner_after': 0, 'shared_outer': False, 'outer_before': 0, 'outer_after': 0, 'intermediate': [], 'recorded': [], 'moving_deref': False, 'implicit': False, 'captured': [], 'reified': [], 'never_branch': False, 'invented': []}
check('well formed empty obligations',solve(base),[])
check('freeze-direction regression 0', solve(dict(base, **({'source_shared':True,'target_unique':True}))), ['freeze-direction'])
check('freeze-direction regression 1', solve(dict(base, **({'source_shared':True,'target_unique':True,'outer_before':N,'outer_after':N}))), ['freeze-direction'])
check('unsize-owner regression 0', solve(dict(base, **({'source_owner':'a','target_owner':'b'}))), ['unsize-owner'])
check('unsize-owner regression 1', solve(dict(base, **({'source_owner':N,'target_owner':N+1}))), ['unsize-owner'])
check('unsize-metadata regression 0', solve(dict(base, **({'unsized':True,'metadata':False}))), ['unsize-metadata'])
check('unsize-metadata regression 1', solve(dict(base, **({'unsized':True,'metadata':False,'outer_before':N,'outer_after':N}))), ['unsize-metadata'])
check('array-slice-extent regression 0', solve(dict(base, **({'array_coerce':True,'array_size':N+1,'slice_size':N}))), ['array-slice-extent'])
check('array-slice-extent regression 1', solve(dict(base, **({'array_coerce':True,'array_size':N+2,'slice_size':N+1}))), ['array-slice-extent'])
check('nested-mut-invariance regression 0', solve(dict(base, **({'nested_mut':True,'inner_before':N+1,'inner_after':N}))), ['nested-mut-invariance'])
check('nested-mut-invariance regression 1', solve(dict(base, **({'nested_mut':True,'inner_before':N+2,'inner_after':N+1}))), ['nested-mut-invariance'])
check('outer-shared-shortening regression 0', solve(dict(base, **({'shared_outer':True,'outer_before':N,'outer_after':N+1}))), ['outer-shared-shortening'])
check('outer-shared-shortening regression 1', solve(dict(base, **({'shared_outer':True,'outer_before':N+1,'outer_after':N+2}))), ['outer-shared-shortening'])
check('deref-intermediates regression 0', solve(dict(base, **({'intermediate':['a','b'],'recorded':['a']}))), ['deref-intermediates'])
check('deref-intermediates regression 1', solve(dict(base, **({'intermediate':list(range(N+1)),'recorded':[0]}))), ['deref-intermediates'])
check('implicit-moving-deref regression 0', solve(dict(base, **({'implicit':True,'moving_deref':True}))), ['implicit-moving-deref'])
check('implicit-moving-deref regression 1', solve(dict(base, **({'implicit':True,'moving_deref':True,'outer_before':N,'outer_after':N}))), ['implicit-moving-deref'])
check('function-reification-capture regression 0', solve(dict(base, **({'captured':['a','b'],'reified':['a']}))), ['function-reification-capture'])
check('function-reification-capture regression 1', solve(dict(base, **({'captured':[N,N+1],'reified':[N]}))), ['function-reification-capture'])
check('never-no-origin regression 0', solve(dict(base, **({'never_branch':True,'invented':['r']}))), ['never-no-origin'])
check('never-no-origin regression 1', solve(dict(base, **({'never_branch':True,'invented':[N]}))), ['never-no-origin'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_shared'] and d['target_unique']: errors.append('freeze-direction')
    if d['source_owner']!=d['target_owner']: errors.append('unsize-owner')
    if d['unsized'] and not d['metadata']: errors.append('unsize-metadata')
    if d['array_coerce'] and d['array_size']!=d['slice_size']: errors.append('array-slice-extent')
    if d['nested_mut'] and d['inner_before']!=d['inner_after']: errors.append('nested-mut-invariance')
    if d['shared_outer'] and d['outer_after']>d['outer_before']: errors.append('outer-shared-shortening')
    if not set(d['intermediate'])<=set(d['recorded']): errors.append('deref-intermediates')
    if d['implicit'] and d['moving_deref'] and d['target_unique']: errors.append('implicit-moving-deref')
    if not set(d['captured'])<=set(d['reified']): errors.append('function-reification-capture')
    if d['never_branch'] and bool(d['invented']): errors.append('never-no-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_shared': False, 'target_unique': False, 'source_owner': None, 'target_owner': None, 'unsized': False, 'metadata': True, 'array_size': 0, 'slice_size': 0, 'array_coerce': False, 'nested_mut': False, 'inner_before': 0, 'inner_after': 0, 'shared_outer': False, 'outer_before': 0, 'outer_after': 0, 'intermediate': [], 'recorded': [], 'moving_deref': False, 'implicit': False, 'captured': [], 'reified': [], 'never_branch': False, 'invented': []}
check('well formed empty obligations',solve(base),[])
check('freeze-direction regression 0', solve(dict(base, **({'source_shared':True,'target_unique':True}))), ['freeze-direction'])
check('freeze-direction regression 1', solve(dict(base, **({'source_shared':True,'target_unique':True,'outer_before':N,'outer_after':N}))), ['freeze-direction'])
check('unsize-owner regression 0', solve(dict(base, **({'source_owner':'a','target_owner':'b'}))), ['unsize-owner'])
check('unsize-owner regression 1', solve(dict(base, **({'source_owner':N,'target_owner':N+1}))), ['unsize-owner'])
check('unsize-metadata regression 0', solve(dict(base, **({'unsized':True,'metadata':False}))), ['unsize-metadata'])
check('unsize-metadata regression 1', solve(dict(base, **({'unsized':True,'metadata':False,'outer_before':N,'outer_after':N}))), ['unsize-metadata'])
check('array-slice-extent regression 0', solve(dict(base, **({'array_coerce':True,'array_size':N+1,'slice_size':N}))), ['array-slice-extent'])
check('array-slice-extent regression 1', solve(dict(base, **({'array_coerce':True,'array_size':N+2,'slice_size':N+1}))), ['array-slice-extent'])
check('nested-mut-invariance regression 0', solve(dict(base, **({'nested_mut':True,'inner_before':N+1,'inner_after':N}))), ['nested-mut-invariance'])
check('nested-mut-invariance regression 1', solve(dict(base, **({'nested_mut':True,'inner_before':N+2,'inner_after':N+1}))), ['nested-mut-invariance'])
check('outer-shared-shortening regression 0', solve(dict(base, **({'shared_outer':True,'outer_before':N,'outer_after':N+1}))), ['outer-shared-shortening'])
check('outer-shared-shortening regression 1', solve(dict(base, **({'shared_outer':True,'outer_before':N+1,'outer_after':N+2}))), ['outer-shared-shortening'])
check('deref-intermediates regression 0', solve(dict(base, **({'intermediate':['a','b'],'recorded':['a']}))), ['deref-intermediates'])
check('deref-intermediates regression 1', solve(dict(base, **({'intermediate':list(range(N+1)),'recorded':[0]}))), ['deref-intermediates'])
check('implicit-moving-deref regression 0', solve(dict(base, **({'implicit':True,'moving_deref':True}))), ['implicit-moving-deref'])
check('implicit-moving-deref regression 1', solve(dict(base, **({'implicit':True,'moving_deref':True,'outer_before':N,'outer_after':N}))), ['implicit-moving-deref'])
check('function-reification-capture regression 0', solve(dict(base, **({'captured':['a','b'],'reified':['a']}))), ['function-reification-capture'])
check('function-reification-capture regression 1', solve(dict(base, **({'captured':[N,N+1],'reified':[N]}))), ['function-reification-capture'])
check('never-no-origin regression 0', solve(dict(base, **({'never_branch':True,'invented':['r']}))), ['never-no-origin'])
check('never-no-origin regression 1', solve(dict(base, **({'never_branch':True,'invented':[N]}))), ['never-no-origin'])
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:
Implicit reference coercion invokes a dereference that consumes its owner.

Check reference coercion proof steps. Unique-to-shared freeze is one-way; unsizing preserves owner; trait unsizing retains metadata; array-to-slice length equals array extent; nested mutable references cannot shorten inner lifetime; shared outer references may shorten; deref coercion records every intermediate loan; implicit coercion cannot execute a moving deref; reification of a borrowed function pointer preserves captured lifetimes; never-type branch coercion contributes no invented loan. 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_shared'] and d['target_unique']: errors.append('freeze-direction')
    if d['source_owner']!=d['target_owner']: errors.append('unsize-owner')
    if d['unsized'] and not d['metadata']: errors.append('unsize-metadata')
    if d['array_coerce'] and d['array_size']!=d['slice_size']: errors.append('array-slice-extent')
    if d['nested_mut'] and d['inner_before']!=d['inner_after']: errors.append('nested-mut-invariance')
    if d['shared_outer'] and d['outer_after']>d['outer_before']: errors.append('outer-shared-shortening')
    if not set(d['intermediate'])<=set(d['recorded']): errors.append('deref-intermediates')
    if d['implicit'] and d['moving_deref']: errors.append('implicit-moving-deref')
    if False: errors.append('function-reification-capture')
    if d['never_branch'] and bool(d['invented']): errors.append('never-no-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_shared': False, 'target_unique': False, 'source_owner': None, 'target_owner': None, 'unsized': False, 'metadata': True, 'array_size': 0, 'slice_size': 0, 'array_coerce': False, 'nested_mut': False, 'inner_before': 0, 'inner_after': 0, 'shared_outer': False, 'outer_before': 0, 'outer_after': 0, 'intermediate': [], 'recorded': [], 'moving_deref': False, 'implicit': False, 'captured': [], 'reified': [], 'never_branch': False, 'invented': []}
check('well formed empty obligations',solve(base),[])
check('freeze-direction regression 0', solve(dict(base, **({'source_shared':True,'target_unique':True}))), ['freeze-direction'])
check('freeze-direction regression 1', solve(dict(base, **({'source_shared':True,'target_unique':True,'outer_before':N,'outer_after':N}))), ['freeze-direction'])
check('unsize-owner regression 0', solve(dict(base, **({'source_owner':'a','target_owner':'b'}))), ['unsize-owner'])
check('unsize-owner regression 1', solve(dict(base, **({'source_owner':N,'target_owner':N+1}))), ['unsize-owner'])
check('unsize-metadata regression 0', solve(dict(base, **({'unsized':True,'metadata':False}))), ['unsize-metadata'])
check('unsize-metadata regression 1', solve(dict(base, **({'unsized':True,'metadata':False,'outer_before':N,'outer_after':N}))), ['unsize-metadata'])
check('array-slice-extent regression 0', solve(dict(base, **({'array_coerce':True,'array_size':N+1,'slice_size':N}))), ['array-slice-extent'])
check('array-slice-extent regression 1', solve(dict(base, **({'array_coerce':True,'array_size':N+2,'slice_size':N+1}))), ['array-slice-extent'])
check('nested-mut-invariance regression 0', solve(dict(base, **({'nested_mut':True,'inner_before':N+1,'inner_after':N}))), ['nested-mut-invariance'])
check('nested-mut-invariance regression 1', solve(dict(base, **({'nested_mut':True,'inner_before':N+2,'inner_after':N+1}))), ['nested-mut-invariance'])
check('outer-shared-shortening regression 0', solve(dict(base, **({'shared_outer':True,'outer_before':N,'outer_after':N+1}))), ['outer-shared-shortening'])
check('outer-shared-shortening regression 1', solve(dict(base, **({'shared_outer':True,'outer_before':N+1,'outer_after':N+2}))), ['outer-shared-shortening'])
check('deref-intermediates regression 0', solve(dict(base, **({'intermediate':['a','b'],'recorded':['a']}))), ['deref-intermediates'])
check('deref-intermediates regression 1', solve(dict(base, **({'intermediate':list(range(N+1)),'recorded':[0]}))), ['deref-intermediates'])
check('implicit-moving-deref regression 0', solve(dict(base, **({'implicit':True,'moving_deref':True}))), ['implicit-moving-deref'])
check('implicit-moving-deref regression 1', solve(dict(base, **({'implicit':True,'moving_deref':True,'outer_before':N,'outer_after':N}))), ['implicit-moving-deref'])
check('function-reification-capture regression 0', solve(dict(base, **({'captured':['a','b'],'reified':['a']}))), ['function-reification-capture'])
check('function-reification-capture regression 1', solve(dict(base, **({'captured':[N,N+1],'reified':[N]}))), ['function-reification-capture'])
check('never-no-origin regression 0', solve(dict(base, **({'never_branch':True,'invented':['r']}))), ['never-no-origin'])
check('never-no-origin regression 1', solve(dict(base, **({'never_branch':True,'invented':[N]}))), ['never-no-origin'])
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_shared'] and d['target_unique']: errors.append('freeze-direction')
    if d['source_owner']!=d['target_owner']: errors.append('unsize-owner')
    if d['unsized'] and not d['metadata']: errors.append('unsize-metadata')
    if d['array_coerce'] and d['array_size']!=d['slice_size']: errors.append('array-slice-extent')
    if d['nested_mut'] and d['inner_before']!=d['inner_after']: errors.append('nested-mut-invariance')
    if d['shared_outer'] and d['outer_after']>d['outer_before']: errors.append('outer-shared-shortening')
    if not set(d['intermediate'])<=set(d['recorded']): errors.append('deref-intermediates')
    if d['implicit'] and d['moving_deref']: errors.append('implicit-moving-deref')
    if not d['reified'] and bool(d['captured']): errors.append('function-reification-capture')
    if d['never_branch'] and bool(d['invented']): errors.append('never-no-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_shared': False, 'target_unique': False, 'source_owner': None, 'target_owner': None, 'unsized': False, 'metadata': True, 'array_size': 0, 'slice_size': 0, 'array_coerce': False, 'nested_mut': False, 'inner_before': 0, 'inner_after': 0, 'shared_outer': False, 'outer_before': 0, 'outer_after': 0, 'intermediate': [], 'recorded': [], 'moving_deref': False, 'implicit': False, 'captured': [], 'reified': [], 'never_branch': False, 'invented': []}
check('well formed empty obligations',solve(base),[])
check('freeze-direction regression 0', solve(dict(base, **({'source_shared':True,'target_unique':True}))), ['freeze-direction'])
check('freeze-direction regression 1', solve(dict(base, **({'source_shared':True,'target_unique':True,'outer_before':N,'outer_after':N}))), ['freeze-direction'])
check('unsize-owner regression 0', solve(dict(base, **({'source_owner':'a','target_owner':'b'}))), ['unsize-owner'])
check('unsize-owner regression 1', solve(dict(base, **({'source_owner':N,'target_owner':N+1}))), ['unsize-owner'])
check('unsize-metadata regression 0', solve(dict(base, **({'unsized':True,'metadata':False}))), ['unsize-metadata'])
check('unsize-metadata regression 1', solve(dict(base, **({'unsized':True,'metadata':False,'outer_before':N,'outer_after':N}))), ['unsize-metadata'])
check('array-slice-extent regression 0', solve(dict(base, **({'array_coerce':True,'array_size':N+1,'slice_size':N}))), ['array-slice-extent'])
check('array-slice-extent regression 1', solve(dict(base, **({'array_coerce':True,'array_size':N+2,'slice_size':N+1}))), ['array-slice-extent'])
check('nested-mut-invariance regression 0', solve(dict(base, **({'nested_mut':True,'inner_before':N+1,'inner_after':N}))), ['nested-mut-invariance'])
check('nested-mut-invariance regression 1', solve(dict(base, **({'nested_mut':True,'inner_before':N+2,'inner_after':N+1}))), ['nested-mut-invariance'])
check('outer-shared-shortening regression 0', solve(dict(base, **({'shared_outer':True,'outer_before':N,'outer_after':N+1}))), ['outer-shared-shortening'])
check('outer-shared-shortening regression 1', solve(dict(base, **({'shared_outer':True,'outer_before':N+1,'outer_after':N+2}))), ['outer-shared-shortening'])
check('deref-intermediates regression 0', solve(dict(base, **({'intermediate':['a','b'],'recorded':['a']}))), ['deref-intermediates'])
check('deref-intermediates regression 1', solve(dict(base, **({'intermediate':list(range(N+1)),'recorded':[0]}))), ['deref-intermediates'])
check('implicit-moving-deref regression 0', solve(dict(base, **({'implicit':True,'moving_deref':True}))), ['implicit-moving-deref'])
check('implicit-moving-deref regression 1', solve(dict(base, **({'implicit':True,'moving_deref':True,'outer_before':N,'outer_after':N}))), ['implicit-moving-deref'])
check('function-reification-capture regression 0', solve(dict(base, **({'captured':['a','b'],'reified':['a']}))), ['function-reification-capture'])
check('function-reification-capture regression 1', solve(dict(base, **({'captured':[N,N+1],'reified':[N]}))), ['function-reification-capture'])
check('never-no-origin regression 0', solve(dict(base, **({'never_branch':True,'invented':['r']}))), ['never-no-origin'])
check('never-no-origin regression 1', solve(dict(base, **({'never_branch':True,'invented':[N]}))), ['never-no-origin'])
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:
Function-reference reification drops one captured lifetime dependency.

Check reference coercion proof steps. Unique-to-shared freeze is one-way; unsizing preserves owner; trait unsizing retains metadata; array-to-slice length equals array extent; nested mutable references cannot shorten inner lifetime; shared outer references may shorten; deref coercion records every intermediate loan; implicit coercion cannot execute a moving deref; reification of a borrowed function pointer preserves captured lifetimes; never-type branch coercion contributes no invented loan. 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_shared'] and d['target_unique']: errors.append('freeze-direction')
    if d['source_owner']!=d['target_owner']: errors.append('unsize-owner')
    if d['unsized'] and not d['metadata']: errors.append('unsize-metadata')
    if d['array_coerce'] and d['array_size']!=d['slice_size']: errors.append('array-slice-extent')
    if d['nested_mut'] and d['inner_before']!=d['inner_after']: errors.append('nested-mut-invariance')
    if d['shared_outer'] and d['outer_after']>d['outer_before']: errors.append('outer-shared-shortening')
    if not set(d['intermediate'])<=set(d['recorded']): errors.append('deref-intermediates')
    if d['implicit'] and d['moving_deref']: errors.append('implicit-moving-deref')
    if not set(d['captured'])<=set(d['reified']): errors.append('function-reification-capture')
    if False: errors.append('never-no-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_shared': False, 'target_unique': False, 'source_owner': None, 'target_owner': None, 'unsized': False, 'metadata': True, 'array_size': 0, 'slice_size': 0, 'array_coerce': False, 'nested_mut': False, 'inner_before': 0, 'inner_after': 0, 'shared_outer': False, 'outer_before': 0, 'outer_after': 0, 'intermediate': [], 'recorded': [], 'moving_deref': False, 'implicit': False, 'captured': [], 'reified': [], 'never_branch': False, 'invented': []}
check('well formed empty obligations',solve(base),[])
check('freeze-direction regression 0', solve(dict(base, **({'source_shared':True,'target_unique':True}))), ['freeze-direction'])
check('freeze-direction regression 1', solve(dict(base, **({'source_shared':True,'target_unique':True,'outer_before':N,'outer_after':N}))), ['freeze-direction'])
check('unsize-owner regression 0', solve(dict(base, **({'source_owner':'a','target_owner':'b'}))), ['unsize-owner'])
check('unsize-owner regression 1', solve(dict(base, **({'source_owner':N,'target_owner':N+1}))), ['unsize-owner'])
check('unsize-metadata regression 0', solve(dict(base, **({'unsized':True,'metadata':False}))), ['unsize-metadata'])
check('unsize-metadata regression 1', solve(dict(base, **({'unsized':True,'metadata':False,'outer_before':N,'outer_after':N}))), ['unsize-metadata'])
check('array-slice-extent regression 0', solve(dict(base, **({'array_coerce':True,'array_size':N+1,'slice_size':N}))), ['array-slice-extent'])
check('array-slice-extent regression 1', solve(dict(base, **({'array_coerce':True,'array_size':N+2,'slice_size':N+1}))), ['array-slice-extent'])
check('nested-mut-invariance regression 0', solve(dict(base, **({'nested_mut':True,'inner_before':N+1,'inner_after':N}))), ['nested-mut-invariance'])
check('nested-mut-invariance regression 1', solve(dict(base, **({'nested_mut':True,'inner_before':N+2,'inner_after':N+1}))), ['nested-mut-invariance'])
check('outer-shared-shortening regression 0', solve(dict(base, **({'shared_outer':True,'outer_before':N,'outer_after':N+1}))), ['outer-shared-shortening'])
check('outer-shared-shortening regression 1', solve(dict(base, **({'shared_outer':True,'outer_before':N+1,'outer_after':N+2}))), ['outer-shared-shortening'])
check('deref-intermediates regression 0', solve(dict(base, **({'intermediate':['a','b'],'recorded':['a']}))), ['deref-intermediates'])
check('deref-intermediates regression 1', solve(dict(base, **({'intermediate':list(range(N+1)),'recorded':[0]}))), ['deref-intermediates'])
check('implicit-moving-deref regression 0', solve(dict(base, **({'implicit':True,'moving_deref':True}))), ['implicit-moving-deref'])
check('implicit-moving-deref regression 1', solve(dict(base, **({'implicit':True,'moving_deref':True,'outer_before':N,'outer_after':N}))), ['implicit-moving-deref'])
check('function-reification-capture regression 0', solve(dict(base, **({'captured':['a','b'],'reified':['a']}))), ['function-reification-capture'])
check('function-reification-capture regression 1', solve(dict(base, **({'captured':[N,N+1],'reified':[N]}))), ['function-reification-capture'])
check('never-no-origin regression 0', solve(dict(base, **({'never_branch':True,'invented':['r']}))), ['never-no-origin'])
check('never-no-origin regression 1', solve(dict(base, **({'never_branch':True,'invented':[N]}))), ['never-no-origin'])
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_shared'] and d['target_unique']: errors.append('freeze-direction')
    if d['source_owner']!=d['target_owner']: errors.append('unsize-owner')
    if d['unsized'] and not d['metadata']: errors.append('unsize-metadata')
    if d['array_coerce'] and d['array_size']!=d['slice_size']: errors.append('array-slice-extent')
    if d['nested_mut'] and d['inner_before']!=d['inner_after']: errors.append('nested-mut-invariance')
    if d['shared_outer'] and d['outer_after']>d['outer_before']: errors.append('outer-shared-shortening')
    if not set(d['intermediate'])<=set(d['recorded']): errors.append('deref-intermediates')
    if d['implicit'] and d['moving_deref']: errors.append('implicit-moving-deref')
    if not set(d['captured'])<=set(d['reified']): errors.append('function-reification-capture')
    if d['never_branch'] and len(d['invented'])>1: errors.append('never-no-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_shared': False, 'target_unique': False, 'source_owner': None, 'target_owner': None, 'unsized': False, 'metadata': True, 'array_size': 0, 'slice_size': 0, 'array_coerce': False, 'nested_mut': False, 'inner_before': 0, 'inner_after': 0, 'shared_outer': False, 'outer_before': 0, 'outer_after': 0, 'intermediate': [], 'recorded': [], 'moving_deref': False, 'implicit': False, 'captured': [], 'reified': [], 'never_branch': False, 'invented': []}
check('well formed empty obligations',solve(base),[])
check('freeze-direction regression 0', solve(dict(base, **({'source_shared':True,'target_unique':True}))), ['freeze-direction'])
check('freeze-direction regression 1', solve(dict(base, **({'source_shared':True,'target_unique':True,'outer_before':N,'outer_after':N}))), ['freeze-direction'])
check('unsize-owner regression 0', solve(dict(base, **({'source_owner':'a','target_owner':'b'}))), ['unsize-owner'])
check('unsize-owner regression 1', solve(dict(base, **({'source_owner':N,'target_owner':N+1}))), ['unsize-owner'])
check('unsize-metadata regression 0', solve(dict(base, **({'unsized':True,'metadata':False}))), ['unsize-metadata'])
check('unsize-metadata regression 1', solve(dict(base, **({'unsized':True,'metadata':False,'outer_before':N,'outer_after':N}))), ['unsize-metadata'])
check('array-slice-extent regression 0', solve(dict(base, **({'array_coerce':True,'array_size':N+1,'slice_size':N}))), ['array-slice-extent'])
check('array-slice-extent regression 1', solve(dict(base, **({'array_coerce':True,'array_size':N+2,'slice_size':N+1}))), ['array-slice-extent'])
check('nested-mut-invariance regression 0', solve(dict(base, **({'nested_mut':True,'inner_before':N+1,'inner_after':N}))), ['nested-mut-invariance'])
check('nested-mut-invariance regression 1', solve(dict(base, **({'nested_mut':True,'inner_before':N+2,'inner_after':N+1}))), ['nested-mut-invariance'])
check('outer-shared-shortening regression 0', solve(dict(base, **({'shared_outer':True,'outer_before':N,'outer_after':N+1}))), ['outer-shared-shortening'])
check('outer-shared-shortening regression 1', solve(dict(base, **({'shared_outer':True,'outer_before':N+1,'outer_after':N+2}))), ['outer-shared-shortening'])
check('deref-intermediates regression 0', solve(dict(base, **({'intermediate':['a','b'],'recorded':['a']}))), ['deref-intermediates'])
check('deref-intermediates regression 1', solve(dict(base, **({'intermediate':list(range(N+1)),'recorded':[0]}))), ['deref-intermediates'])
check('implicit-moving-deref regression 0', solve(dict(base, **({'implicit':True,'moving_deref':True}))), ['implicit-moving-deref'])
check('implicit-moving-deref regression 1', solve(dict(base, **({'implicit':True,'moving_deref':True,'outer_before':N,'outer_after':N}))), ['implicit-moving-deref'])
check('function-reification-capture regression 0', solve(dict(base, **({'captured':['a','b'],'reified':['a']}))), ['function-reification-capture'])
check('function-reification-capture regression 1', solve(dict(base, **({'captured':[N,N+1],'reified':[N]}))), ['function-reification-capture'])
check('never-no-origin regression 0', solve(dict(base, **({'never_branch':True,'invented':['r']}))), ['never-no-origin'])
check('never-no-origin regression 1', solve(dict(base, **({'never_branch':True,'invented':[N]}))), ['never-no-origin'])
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:
Diverging branch coercion invents a reference origin at the join.

Check reference coercion proof steps. Unique-to-shared freeze is one-way; unsizing preserves owner; trait unsizing retains metadata; array-to-slice length equals array extent; nested mutable references cannot shorten inner lifetime; shared outer references may shorten; deref coercion records every intermediate loan; implicit coercion cannot execute a moving deref; reification of a borrowed function pointer preserves captured lifetimes; never-type branch coercion contributes no invented loan. 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('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
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 not set(d['joined_initialized'])<=(set.union(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
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:
Branch initialization joins use union rather than definite intersection.

Check ownership lattice join certificates. Definitely initialized paths intersect predecessor sets; possibly moved paths union; unique capabilities survive only if same owner on all paths; returned paths excluded from continuing join; divergent predecessors contribute bottom; reference alternatives union origins; assignment on every path restores initialization; storage incarnations cannot merge by variable spelling; drop flags reflect possibly initialized fields; conditional ownership is not unconditional ownership. 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 set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if False: errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
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 set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if not set(d['joined_moved'])<=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
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 move on one predecessor is absent from the possible-move state.

Check ownership lattice join certificates. Definitely initialized paths intersect predecessor sets; possibly moved paths union; unique capabilities survive only if same owner on all paths; returned paths excluded from continuing join; divergent predecessors contribute bottom; reference alternatives union origins; assignment on every path restores initialization; storage incarnations cannot merge by variable spelling; drop flags reflect possibly initialized fields; conditional ownership is not unconditional ownership. 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 set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if False: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
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 set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and not d['unique_owners']: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
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:
Join retains exclusive capability when predecessor owners differ.

Check ownership lattice join certificates. Definitely initialized paths intersect predecessor sets; possibly moved paths union; unique capabilities survive only if same owner on all paths; returned paths excluded from continuing join; divergent predecessors contribute bottom; reference alternatives union origins; assignment on every path restores initialization; storage incarnations cannot merge by variable spelling; drop flags reflect possibly initialized fields; conditional ownership is not unconditional ownership. 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 set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if False: errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
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 set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if set(d['returned'])==set(d['included']) and bool(d['returned']): errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
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 returned predecessor pollutes continuing ownership state.

Check ownership lattice join certificates. Definitely initialized paths intersect predecessor sets; possibly moved paths union; unique capabilities survive only if same owner on all paths; returned paths excluded from continuing join; divergent predecessors contribute bottom; reference alternatives union origins; assignment on every path restores initialization; storage incarnations cannot merge by variable spelling; drop flags reflect possibly initialized fields; conditional ownership is not unconditional ownership. 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 set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if False: errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
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 set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if set(d['diverged'])==set(d['included']) and bool(d['diverged']): errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
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 diverging branch contributes an ordinary ownership state instead of bottom.

Check ownership lattice join certificates. Definitely initialized paths intersect predecessor sets; possibly moved paths union; unique capabilities survive only if same owner on all paths; returned paths excluded from continuing join; divergent predecessors contribute bottom; reference alternatives union origins; assignment on every path restores initialization; storage incarnations cannot merge by variable spelling; drop flags reflect possibly initialized fields; conditional ownership is not unconditional ownership. 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