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

N = 1
observations = []
def solve(d):
    errors=[]
    if len(d['names'])!=len(set(d['names'])): errors.append('binding-uniqueness')
    if any(set(x)!=set(d['names']) for x in d['arm_names']): errors.append('alternative-name-agreement')
    if any(x!=d['arm_modes'][0] for x in d['arm_modes'][1:]): errors.append('alternative-mode-agreement')
    if not set(d['mut_refs'])<=set(d['mutable']): errors.append('mutable-binding')
    if not set(d['deref_moves'])<=set(d['copy']): errors.append('deref-move')
    if bool(set(d['rest'])&set(d['positions'])): errors.append('rest-disjointness')
    if d['union'] and not d['unsafe']: errors.append('union-pattern')
    if bool(set(d['guard_bindings'])&set(d['escaping'])): errors.append('guard-scope')
    if any(a==b or a.startswith(b+'.') or b.startswith(a+'.') for a in d['moves'] for b in d['borrows']): errors.append('move-borrow-overlap')
    if False: errors.append('default-mode-reset')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'names': [], 'arm_names': [], 'arm_modes': [], 'mut_refs': [], 'mutable': [], 'deref_moves': [], 'copy': [], 'rest': [], 'positions': [], 'union': False, 'unsafe': False, 'guard_bindings': [], 'escaping': [], 'moves': [], 'borrows': [], 'default_ref': False, 'implicit_value': []}
check('well formed empty obligations',solve(base),[])
check('binding-uniqueness regression 0', solve(dict(base, **({'names':['x','x']}))), ['binding-uniqueness'])
check('binding-uniqueness regression 1', solve(dict(base, **({'names':[N,N]}))), ['binding-uniqueness'])
check('alternative-name-agreement regression 0', solve(dict(base, **({'names':['x'],'arm_names':[['x'],['y']]}))), ['alternative-name-agreement'])
check('alternative-name-agreement regression 1', solve(dict(base, **({'names':[N],'arm_names':[[N],[N+1]]}))), ['alternative-name-agreement'])
check('alternative-mode-agreement regression 0', solve(dict(base, **({'arm_modes':['ref','move']}))), ['alternative-mode-agreement'])
check('alternative-mode-agreement regression 1', solve(dict(base, **({'arm_modes':['ref','mut']}))), ['alternative-mode-agreement'])
check('mutable-binding regression 0', solve(dict(base, **({'mut_refs':['a','b'],'mutable':['a']}))), ['mutable-binding'])
check('mutable-binding regression 1', solve(dict(base, **({'mut_refs':[N],'mutable':[N+1]}))), ['mutable-binding'])
check('deref-move regression 0', solve(dict(base, **({'deref_moves':['a','b'],'copy':['a']}))), ['deref-move'])
check('deref-move regression 1', solve(dict(base, **({'deref_moves':[N,N+1],'copy':[N]}))), ['deref-move'])
check('rest-disjointness regression 0', solve(dict(base, **({'rest':[N,N+1],'positions':[N+1]}))), ['rest-disjointness'])
check('rest-disjointness regression 1', solve(dict(base, **({'rest':[N,N+1,N+2],'positions':[N]}))), ['rest-disjointness'])
check('union-pattern regression 0', solve(dict(base, **({'union':True}))), ['union-pattern'])
check('union-pattern regression 1', solve(dict(base, **({'union':True,'positions':list(range(N))}))), ['union-pattern'])
check('guard-scope regression 0', solve(dict(base, **({'guard_bindings':['r'],'escaping':['r']}))), ['guard-scope'])
check('guard-scope regression 1', solve(dict(base, **({'guard_bindings':[N],'escaping':[N]}))), ['guard-scope'])
check('move-borrow-overlap regression 0', solve(dict(base, **({'moves':['r'],'borrows':['r.f']}))), ['move-borrow-overlap'])
check('move-borrow-overlap regression 1', solve(dict(base, **({'moves':['r.f.g'],'borrows':['r.f']}))), ['move-borrow-overlap'])
check('default-mode-reset regression 0', solve(dict(base, **({'default_ref':True,'implicit_value':['x']}))), ['default-mode-reset'])
check('default-mode-reset regression 1', solve(dict(base, **({'default_ref':True,'implicit_value':[N]}))), ['default-mode-reset'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    errors=[]
    if len(d['names'])!=len(set(d['names'])): errors.append('binding-uniqueness')
    if any(set(x)!=set(d['names']) for x in d['arm_names']): errors.append('alternative-name-agreement')
    if any(x!=d['arm_modes'][0] for x in d['arm_modes'][1:]): errors.append('alternative-mode-agreement')
    if not set(d['mut_refs'])<=set(d['mutable']): errors.append('mutable-binding')
    if not set(d['deref_moves'])<=set(d['copy']): errors.append('deref-move')
    if bool(set(d['rest'])&set(d['positions'])): errors.append('rest-disjointness')
    if d['union'] and not d['unsafe']: errors.append('union-pattern')
    if bool(set(d['guard_bindings'])&set(d['escaping'])): errors.append('guard-scope')
    if any(a==b or a.startswith(b+'.') or b.startswith(a+'.') for a in d['moves'] for b in d['borrows']): errors.append('move-borrow-overlap')
    if d['default_ref'] and len(d['implicit_value'])>1: errors.append('default-mode-reset')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'names': [], 'arm_names': [], 'arm_modes': [], 'mut_refs': [], 'mutable': [], 'deref_moves': [], 'copy': [], 'rest': [], 'positions': [], 'union': False, 'unsafe': False, 'guard_bindings': [], 'escaping': [], 'moves': [], 'borrows': [], 'default_ref': False, 'implicit_value': []}
check('well formed empty obligations',solve(base),[])
check('binding-uniqueness regression 0', solve(dict(base, **({'names':['x','x']}))), ['binding-uniqueness'])
check('binding-uniqueness regression 1', solve(dict(base, **({'names':[N,N]}))), ['binding-uniqueness'])
check('alternative-name-agreement regression 0', solve(dict(base, **({'names':['x'],'arm_names':[['x'],['y']]}))), ['alternative-name-agreement'])
check('alternative-name-agreement regression 1', solve(dict(base, **({'names':[N],'arm_names':[[N],[N+1]]}))), ['alternative-name-agreement'])
check('alternative-mode-agreement regression 0', solve(dict(base, **({'arm_modes':['ref','move']}))), ['alternative-mode-agreement'])
check('alternative-mode-agreement regression 1', solve(dict(base, **({'arm_modes':['ref','mut']}))), ['alternative-mode-agreement'])
check('mutable-binding regression 0', solve(dict(base, **({'mut_refs':['a','b'],'mutable':['a']}))), ['mutable-binding'])
check('mutable-binding regression 1', solve(dict(base, **({'mut_refs':[N],'mutable':[N+1]}))), ['mutable-binding'])
check('deref-move regression 0', solve(dict(base, **({'deref_moves':['a','b'],'copy':['a']}))), ['deref-move'])
check('deref-move regression 1', solve(dict(base, **({'deref_moves':[N,N+1],'copy':[N]}))), ['deref-move'])
check('rest-disjointness regression 0', solve(dict(base, **({'rest':[N,N+1],'positions':[N+1]}))), ['rest-disjointness'])
check('rest-disjointness regression 1', solve(dict(base, **({'rest':[N,N+1,N+2],'positions':[N]}))), ['rest-disjointness'])
check('union-pattern regression 0', solve(dict(base, **({'union':True}))), ['union-pattern'])
check('union-pattern regression 1', solve(dict(base, **({'union':True,'positions':list(range(N))}))), ['union-pattern'])
check('guard-scope regression 0', solve(dict(base, **({'guard_bindings':['r'],'escaping':['r']}))), ['guard-scope'])
check('guard-scope regression 1', solve(dict(base, **({'guard_bindings':[N],'escaping':[N]}))), ['guard-scope'])
check('move-borrow-overlap regression 0', solve(dict(base, **({'moves':['r'],'borrows':['r.f']}))), ['move-borrow-overlap'])
check('move-borrow-overlap regression 1', solve(dict(base, **({'moves':['r.f.g'],'borrows':['r.f']}))), ['move-borrow-overlap'])
check('default-mode-reset regression 0', solve(dict(base, **({'default_ref':True,'implicit_value':['x']}))), ['default-mode-reset'])
check('default-mode-reset regression 1', solve(dict(base, **({'default_ref':True,'implicit_value':[N]}))), ['default-mode-reset'])
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 plain identifier silently changes inherited reference binding into a move.

Check a toy destructuring pattern after type resolution. Binding names unique; alternatives bind identical name sets and modes; mutable reference binding needs mutable access; an explicit dereference pattern cannot move a noncopy referent; rest binding cannot overlap explicitly bound array positions; union fields require an explicit unsafe pattern; bindings introduced in a guard cannot escape guard region; simultaneous move and borrow of overlapping prefix places forbidden; a reference default binding mode cannot be reset implicitly by a plain identifier. 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('temporary-use')
    if d['arg_end']>d['call_end']: errors.append('argument-scope')
    if d['let_extended'] and d['temp_end']!=d['block_end']: errors.append('let-extension')
    if d['assignment_extended']: errors.append('assignment-no-extension')
    if d['operand_end']<d['expr_end']: errors.append('operand-expression')
    if d['condition'] and bool(d['then_uses']): errors.append('condition-escape')
    if d['rhs_created'] and not d['rhs_executed']: errors.append('short-circuit-creation')
    if not set(d['drop_uses'])<=set(d['alive']): errors.append('destructor-use')
    if d['promoted'] and not d['static_storage']: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(d):
    errors=[]
    if len(d['uses'])>len(d['alive']): errors.append('temporary-use')
    if d['arg_end']>d['call_end']: errors.append('argument-scope')
    if d['let_extended'] and d['temp_end']!=d['block_end']: errors.append('let-extension')
    if d['assignment_extended']: errors.append('assignment-no-extension')
    if d['operand_end']<d['expr_end']: errors.append('operand-expression')
    if d['condition'] and bool(d['then_uses']): errors.append('condition-escape')
    if d['rhs_created'] and not d['rhs_executed']: errors.append('short-circuit-creation')
    if not set(d['drop_uses'])<=set(d['alive']): errors.append('destructor-use')
    if d['promoted'] and not d['static_storage']: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
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:
Temporary borrow validity compares counts instead of actual use locations.

Check temporary storage scopes using statement, block and full-expression integer boundaries. A borrowed temporary must cover use points; ordinary call arguments end at call boundary; let reference initializers may extend to block end but assignment RHS may not; operand temporaries end after enclosing expression; condition temporaries cannot leak into the then block; short-circuit RHS temporaries exist only on executed branch; a destructor observation is a use point; a reference to a promoted constant uses static storage; explicit owner binding prevents premature temporary destruction. 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 not set(d['uses'])<=set(d['alive']): errors.append('temporary-use')
    if False: errors.append('argument-scope')
    if d['let_extended'] and d['temp_end']!=d['block_end']: errors.append('let-extension')
    if d['assignment_extended']: errors.append('assignment-no-extension')
    if d['operand_end']<d['expr_end']: errors.append('operand-expression')
    if d['condition'] and bool(d['then_uses']): errors.append('condition-escape')
    if d['rhs_created'] and not d['rhs_executed']: errors.append('short-circuit-creation')
    if not set(d['drop_uses'])<=set(d['alive']): errors.append('destructor-use')
    if d['promoted'] and not d['static_storage']: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
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['uses'])<=set(d['alive']): errors.append('temporary-use')
    if d['arg_end']>d['call_end']+1: errors.append('argument-scope')
    if d['let_extended'] and d['temp_end']!=d['block_end']: errors.append('let-extension')
    if d['assignment_extended']: errors.append('assignment-no-extension')
    if d['operand_end']<d['expr_end']: errors.append('operand-expression')
    if d['condition'] and bool(d['then_uses']): errors.append('condition-escape')
    if d['rhs_created'] and not d['rhs_executed']: errors.append('short-circuit-creation')
    if not set(d['drop_uses'])<=set(d['alive']): errors.append('destructor-use')
    if d['promoted'] and not d['static_storage']: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
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 call argument temporary is inferred to survive into the next statement.

Check temporary storage scopes using statement, block and full-expression integer boundaries. A borrowed temporary must cover use points; ordinary call arguments end at call boundary; let reference initializers may extend to block end but assignment RHS may not; operand temporaries end after enclosing expression; condition temporaries cannot leak into the then block; short-circuit RHS temporaries exist only on executed branch; a destructor observation is a use point; a reference to a promoted constant uses static storage; explicit owner binding prevents premature temporary destruction. 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 not set(d['uses'])<=set(d['alive']): errors.append('temporary-use')
    if d['arg_end']>d['call_end']: errors.append('argument-scope')
    if False: errors.append('let-extension')
    if d['assignment_extended']: errors.append('assignment-no-extension')
    if d['operand_end']<d['expr_end']: errors.append('operand-expression')
    if d['condition'] and bool(d['then_uses']): errors.append('condition-escape')
    if d['rhs_created'] and not d['rhs_executed']: errors.append('short-circuit-creation')
    if not set(d['drop_uses'])<=set(d['alive']): errors.append('destructor-use')
    if d['promoted'] and not d['static_storage']: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
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['uses'])<=set(d['alive']): errors.append('temporary-use')
    if d['arg_end']>d['call_end']: errors.append('argument-scope')
    if d['let_extended'] and d['temp_end']>d['block_end']: errors.append('let-extension')
    if d['assignment_extended']: errors.append('assignment-no-extension')
    if d['operand_end']<d['expr_end']: errors.append('operand-expression')
    if d['condition'] and bool(d['then_uses']): errors.append('condition-escape')
    if d['rhs_created'] and not d['rhs_executed']: errors.append('short-circuit-creation')
    if not set(d['drop_uses'])<=set(d['alive']): errors.append('destructor-use')
    if d['promoted'] and not d['static_storage']: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
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 reference-pattern let initializer loses its permitted block lifetime extension.

Check temporary storage scopes using statement, block and full-expression integer boundaries. A borrowed temporary must cover use points; ordinary call arguments end at call boundary; let reference initializers may extend to block end but assignment RHS may not; operand temporaries end after enclosing expression; condition temporaries cannot leak into the then block; short-circuit RHS temporaries exist only on executed branch; a destructor observation is a use point; a reference to a promoted constant uses static storage; explicit owner binding prevents premature temporary destruction. 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 not set(d['uses'])<=set(d['alive']): errors.append('temporary-use')
    if d['arg_end']>d['call_end']: errors.append('argument-scope')
    if d['let_extended'] and d['temp_end']!=d['block_end']: errors.append('let-extension')
    if False: errors.append('assignment-no-extension')
    if d['operand_end']<d['expr_end']: errors.append('operand-expression')
    if d['condition'] and bool(d['then_uses']): errors.append('condition-escape')
    if d['rhs_created'] and not d['rhs_executed']: errors.append('short-circuit-creation')
    if not set(d['drop_uses'])<=set(d['alive']): errors.append('destructor-use')
    if d['promoted'] and not d['static_storage']: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
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['uses'])<=set(d['alive']): errors.append('temporary-use')
    if d['arg_end']>d['call_end']: errors.append('argument-scope')
    if d['let_extended'] and d['temp_end']!=d['block_end']: errors.append('let-extension')
    if d['assignment_extended'] and d['temp_end']>d['block_end']: errors.append('assignment-no-extension')
    if d['operand_end']<d['expr_end']: errors.append('operand-expression')
    if d['condition'] and bool(d['then_uses']): errors.append('condition-escape')
    if d['rhs_created'] and not d['rhs_executed']: errors.append('short-circuit-creation')
    if not set(d['drop_uses'])<=set(d['alive']): errors.append('destructor-use')
    if d['promoted'] and not d['static_storage']: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
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:
Assignment is incorrectly given the lifetime-extension rule of a let initializer.

Check temporary storage scopes using statement, block and full-expression integer boundaries. A borrowed temporary must cover use points; ordinary call arguments end at call boundary; let reference initializers may extend to block end but assignment RHS may not; operand temporaries end after enclosing expression; condition temporaries cannot leak into the then block; short-circuit RHS temporaries exist only on executed branch; a destructor observation is a use point; a reference to a promoted constant uses static storage; explicit owner binding prevents premature temporary destruction. 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 not set(d['uses'])<=set(d['alive']): errors.append('temporary-use')
    if d['arg_end']>d['call_end']: errors.append('argument-scope')
    if d['let_extended'] and d['temp_end']!=d['block_end']: errors.append('let-extension')
    if d['assignment_extended']: errors.append('assignment-no-extension')
    if False: errors.append('operand-expression')
    if d['condition'] and bool(d['then_uses']): errors.append('condition-escape')
    if d['rhs_created'] and not d['rhs_executed']: errors.append('short-circuit-creation')
    if not set(d['drop_uses'])<=set(d['alive']): errors.append('destructor-use')
    if d['promoted'] and not d['static_storage']: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
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['uses'])<=set(d['alive']): errors.append('temporary-use')
    if d['arg_end']>d['call_end']: errors.append('argument-scope')
    if d['let_extended'] and d['temp_end']!=d['block_end']: errors.append('let-extension')
    if d['assignment_extended']: errors.append('assignment-no-extension')
    if d['operand_end']+1<d['expr_end']: errors.append('operand-expression')
    if d['condition'] and bool(d['then_uses']): errors.append('condition-escape')
    if d['rhs_created'] and not d['rhs_executed']: errors.append('short-circuit-creation')
    if not set(d['drop_uses'])<=set(d['alive']): errors.append('destructor-use')
    if d['promoted'] and not d['static_storage']: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
An operand borrow ends one evaluation step before the full expression.

Check temporary storage scopes using statement, block and full-expression integer boundaries. A borrowed temporary must cover use points; ordinary call arguments end at call boundary; let reference initializers may extend to block end but assignment RHS may not; operand temporaries end after enclosing expression; condition temporaries cannot leak into the then block; short-circuit RHS temporaries exist only on executed branch; a destructor observation is a use point; a reference to a promoted constant uses static storage; explicit owner binding prevents premature temporary destruction. 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 not set(d['uses'])<=set(d['alive']): errors.append('temporary-use')
    if d['arg_end']>d['call_end']: errors.append('argument-scope')
    if d['let_extended'] and d['temp_end']!=d['block_end']: errors.append('let-extension')
    if d['assignment_extended']: errors.append('assignment-no-extension')
    if d['operand_end']<d['expr_end']: errors.append('operand-expression')
    if False: errors.append('condition-escape')
    if d['rhs_created'] and not d['rhs_executed']: errors.append('short-circuit-creation')
    if not set(d['drop_uses'])<=set(d['alive']): errors.append('destructor-use')
    if d['promoted'] and not d['static_storage']: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
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['uses'])<=set(d['alive']): errors.append('temporary-use')
    if d['arg_end']>d['call_end']: errors.append('argument-scope')
    if d['let_extended'] and d['temp_end']!=d['block_end']: errors.append('let-extension')
    if d['assignment_extended']: errors.append('assignment-no-extension')
    if d['operand_end']<d['expr_end']: errors.append('operand-expression')
    if d['condition'] and len(d['then_uses'])>1: errors.append('condition-escape')
    if d['rhs_created'] and not d['rhs_executed']: errors.append('short-circuit-creation')
    if not set(d['drop_uses'])<=set(d['alive']): errors.append('destructor-use')
    if d['promoted'] and not d['static_storage']: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
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 condition temporary is borrowed by the following then block.

Check temporary storage scopes using statement, block and full-expression integer boundaries. A borrowed temporary must cover use points; ordinary call arguments end at call boundary; let reference initializers may extend to block end but assignment RHS may not; operand temporaries end after enclosing expression; condition temporaries cannot leak into the then block; short-circuit RHS temporaries exist only on executed branch; a destructor observation is a use point; a reference to a promoted constant uses static storage; explicit owner binding prevents premature temporary destruction. 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 not set(d['uses'])<=set(d['alive']): errors.append('temporary-use')
    if d['arg_end']>d['call_end']: errors.append('argument-scope')
    if d['let_extended'] and d['temp_end']!=d['block_end']: errors.append('let-extension')
    if d['assignment_extended']: errors.append('assignment-no-extension')
    if d['operand_end']<d['expr_end']: errors.append('operand-expression')
    if d['condition'] and bool(d['then_uses']): errors.append('condition-escape')
    if False: errors.append('short-circuit-creation')
    if not set(d['drop_uses'])<=set(d['alive']): errors.append('destructor-use')
    if d['promoted'] and not d['static_storage']: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
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['uses'])<=set(d['alive']): errors.append('temporary-use')
    if d['arg_end']>d['call_end']: errors.append('argument-scope')
    if d['let_extended'] and d['temp_end']!=d['block_end']: errors.append('let-extension')
    if d['assignment_extended']: errors.append('assignment-no-extension')
    if d['operand_end']<d['expr_end']: errors.append('operand-expression')
    if d['condition'] and bool(d['then_uses']): errors.append('condition-escape')
    if d['rhs_created'] and not d['rhs_executed'] and d['expr_end']==0: errors.append('short-circuit-creation')
    if not set(d['drop_uses'])<=set(d['alive']): errors.append('destructor-use')
    if d['promoted'] and not d['static_storage']: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
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 skipped short-circuit operand creates a phantom borrow origin.

Check temporary storage scopes using statement, block and full-expression integer boundaries. A borrowed temporary must cover use points; ordinary call arguments end at call boundary; let reference initializers may extend to block end but assignment RHS may not; operand temporaries end after enclosing expression; condition temporaries cannot leak into the then block; short-circuit RHS temporaries exist only on executed branch; a destructor observation is a use point; a reference to a promoted constant uses static storage; explicit owner binding prevents premature temporary destruction. 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 not set(d['uses'])<=set(d['alive']): errors.append('temporary-use')
    if d['arg_end']>d['call_end']: errors.append('argument-scope')
    if d['let_extended'] and d['temp_end']!=d['block_end']: errors.append('let-extension')
    if d['assignment_extended']: errors.append('assignment-no-extension')
    if d['operand_end']<d['expr_end']: errors.append('operand-expression')
    if d['condition'] and bool(d['then_uses']): errors.append('condition-escape')
    if d['rhs_created'] and not d['rhs_executed']: errors.append('short-circuit-creation')
    if False: errors.append('destructor-use')
    if d['promoted'] and not d['static_storage']: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
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['uses'])<=set(d['alive']): errors.append('temporary-use')
    if d['arg_end']>d['call_end']: errors.append('argument-scope')
    if d['let_extended'] and d['temp_end']!=d['block_end']: errors.append('let-extension')
    if d['assignment_extended']: errors.append('assignment-no-extension')
    if d['operand_end']<d['expr_end']: errors.append('operand-expression')
    if d['condition'] and bool(d['then_uses']): errors.append('condition-escape')
    if d['rhs_created'] and not d['rhs_executed']: errors.append('short-circuit-creation')
    if not d['alive'] and bool(d['drop_uses']): errors.append('destructor-use')
    if d['promoted'] and not d['static_storage']: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
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:
Temporary destruction fails to extend a destructor-observed reference.

Check temporary storage scopes using statement, block and full-expression integer boundaries. A borrowed temporary must cover use points; ordinary call arguments end at call boundary; let reference initializers may extend to block end but assignment RHS may not; operand temporaries end after enclosing expression; condition temporaries cannot leak into the then block; short-circuit RHS temporaries exist only on executed branch; a destructor observation is a use point; a reference to a promoted constant uses static storage; explicit owner binding prevents premature temporary destruction. 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 not set(d['uses'])<=set(d['alive']): errors.append('temporary-use')
    if d['arg_end']>d['call_end']: errors.append('argument-scope')
    if d['let_extended'] and d['temp_end']!=d['block_end']: errors.append('let-extension')
    if d['assignment_extended']: errors.append('assignment-no-extension')
    if d['operand_end']<d['expr_end']: errors.append('operand-expression')
    if d['condition'] and bool(d['then_uses']): errors.append('condition-escape')
    if d['rhs_created'] and not d['rhs_executed']: errors.append('short-circuit-creation')
    if not set(d['drop_uses'])<=set(d['alive']): errors.append('destructor-use')
    if False: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
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['uses'])<=set(d['alive']): errors.append('temporary-use')
    if d['arg_end']>d['call_end']: errors.append('argument-scope')
    if d['let_extended'] and d['temp_end']!=d['block_end']: errors.append('let-extension')
    if d['assignment_extended']: errors.append('assignment-no-extension')
    if d['operand_end']<d['expr_end']: errors.append('operand-expression')
    if d['condition'] and bool(d['then_uses']): errors.append('condition-escape')
    if d['rhs_created'] and not d['rhs_executed']: errors.append('short-circuit-creation')
    if not set(d['drop_uses'])<=set(d['alive']): errors.append('destructor-use')
    if d['promoted'] and not d['static_storage'] and d['block_end']==0: errors.append('promotion-storage')
    if d['bound_temp_end']<d['owner_end']: errors.append('bound-owner-scope')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'uses': [], 'alive': [], 'call_end': 0, 'arg_end': 0, 'let_extended': False, 'temp_end': 0, 'block_end': 0, 'assignment_extended': False, 'expr_end': 0, 'operand_end': 0, 'condition': False, 'then_uses': [], 'rhs_created': False, 'rhs_executed': True, 'drop_uses': [], 'promoted': False, 'static_storage': True, 'owner_end': 0, 'bound_temp_end': 0}
check('well formed empty obligations',solve(base),[])
check('temporary-use regression 0', solve(dict(base, **({'uses':[N],'alive':[N+1]}))), ['temporary-use'])
check('temporary-use regression 1', solve(dict(base, **({'uses':[N,N+1],'alive':[N+1,N+2]}))), ['temporary-use'])
check('argument-scope regression 0', solve(dict(base, **({'arg_end':N+1,'call_end':N}))), ['argument-scope'])
check('argument-scope regression 1', solve(dict(base, **({'arg_end':N+2,'call_end':N+1}))), ['argument-scope'])
check('let-extension regression 0', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+1}))), ['let-extension'])
check('let-extension regression 1', solve(dict(base, **({'let_extended':True,'temp_end':N,'block_end':N+2}))), ['let-extension'])
check('assignment-no-extension regression 0', solve(dict(base, **({'assignment_extended':True}))), ['assignment-no-extension'])
check('assignment-no-extension regression 1', solve(dict(base, **({'assignment_extended':True,'block_end':N}))), ['assignment-no-extension'])
check('operand-expression regression 0', solve(dict(base, **({'operand_end':N,'expr_end':N+1}))), ['operand-expression'])
check('operand-expression regression 1', solve(dict(base, **({'operand_end':N+1,'expr_end':N+2}))), ['operand-expression'])
check('condition-escape regression 0', solve(dict(base, **({'condition':True,'then_uses':[N]}))), ['condition-escape'])
check('condition-escape regression 1', solve(dict(base, **({'condition':True,'then_uses':[N+1]}))), ['condition-escape'])
check('short-circuit-creation regression 0', solve(dict(base, **({'rhs_created':True,'rhs_executed':False}))), ['short-circuit-creation'])
check('short-circuit-creation regression 1', solve(dict(base, **({'rhs_created':True,'rhs_executed':False,'expr_end':N,'operand_end':N}))), ['short-circuit-creation'])
check('destructor-use regression 0', solve(dict(base, **({'drop_uses':[N+1],'alive':[N]}))), ['destructor-use'])
check('destructor-use regression 1', solve(dict(base, **({'drop_uses':[N,N+1],'alive':[N]}))), ['destructor-use'])
check('promotion-storage regression 0', solve(dict(base, **({'promoted':True,'static_storage':False}))), ['promotion-storage'])
check('promotion-storage regression 1', solve(dict(base, **({'promoted':True,'static_storage':False,'block_end':N}))), ['promotion-storage'])
check('bound-owner-scope regression 0', solve(dict(base, **({'bound_temp_end':N,'owner_end':N+1}))), ['bound-owner-scope'])
check('bound-owner-scope regression 1', solve(dict(base, **({'bound_temp_end':N+1,'owner_end':N+2}))), ['bound-owner-scope'])
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:
Constant promotion retains a stack lifetime in its reference provenance.

Check temporary storage scopes using statement, block and full-expression integer boundaries. A borrowed temporary must cover use points; ordinary call arguments end at call boundary; let reference initializers may extend to block end but assignment RHS may not; operand temporaries end after enclosing expression; condition temporaries cannot leak into the then block; short-circuit RHS temporaries exist only on executed branch; a destructor observation is a use point; a reference to a promoted constant uses static storage; explicit owner binding prevents premature temporary destruction. 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