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

N = 1
observations = []
def solve(d):
    errors=[]
    if set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if False: errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    errors=[]
    if set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if not set(d['joined_origins'])<=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A joined reference keeps only one predecessor referent origin.

Check ownership lattice join certificates. Definitely initialized paths intersect predecessor sets; possibly moved paths union; unique capabilities survive only if same owner on all paths; returned paths excluded from continuing join; divergent predecessors contribute bottom; reference alternatives union origins; assignment on every path restores initialization; storage incarnations cannot merge by variable spelling; drop flags reflect possibly initialized fields; conditional ownership is not unconditional ownership. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access


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

N = 1
observations = []
def solve(d):
    errors=[]
    if set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if False: errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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 set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not d['restored'] and bool(d['assigned_everywhere']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A path initialized on every branch remains incorrectly marked moved.

Check ownership lattice join certificates. Definitely initialized paths intersect predecessor sets; possibly moved paths union; unique capabilities survive only if same owner on all paths; returned paths excluded from continuing join; divergent predecessors contribute bottom; reference alternatives union origins; assignment on every path restores initialization; storage incarnations cannot merge by variable spelling; drop flags reflect possibly initialized fields; conditional ownership is not unconditional ownership. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access


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

N = 1
observations = []
def solve(d):
    errors=[]
    if set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if False: errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    errors=[]
    if set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and bool(d['incarnations']) and d['incarnations'][0]!=d['merged_incarnation']: errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Different storage incarnations merge because their source variable spelling matches.

Check ownership lattice join certificates. Definitely initialized paths intersect predecessor sets; possibly moved paths union; unique capabilities survive only if same owner on all paths; returned paths excluded from continuing join; divergent predecessors contribute bottom; reference alternatives union origins; assignment on every path restores initialization; storage incarnations cannot merge by variable spelling; drop flags reflect possibly initialized fields; conditional ownership is not unconditional ownership. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access


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

N = 1
observations = []
def solve(d):
    errors=[]
    if set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if False: errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    errors=[]
    if set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if not set(d['drop_flags'])<=set(d['possibly_initialized']): errors.append('conditional-drop-flags')
    if bool(set(d['conditional'])&set(d['unconditional'])): errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A conditionally initialized field lacks its runtime drop flag obligation.

Check ownership lattice join certificates. Definitely initialized paths intersect predecessor sets; possibly moved paths union; unique capabilities survive only if same owner on all paths; returned paths excluded from continuing join; divergent predecessors contribute bottom; reference alternatives union origins; assignment on every path restores initialization; storage incarnations cannot merge by variable spelling; drop flags reflect possibly initialized fields; conditional ownership is not unconditional ownership. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access


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

N = 1
observations = []
def solve(d):
    errors=[]
    if set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if False: errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    errors=[]
    if set(d['joined_initialized'])!=(set.intersection(*(set(x) for x in d['pred_initialized'])) if d['pred_initialized'] else set()): errors.append('definite-meet')
    if set(d['joined_moved'])!=set(x for xs in d['pred_moved'] for x in xs): errors.append('possible-move-union')
    if d['unique_retained'] and len(set(d['unique_owners']))!=1: errors.append('unique-owner-agreement')
    if bool(set(d['returned'])&set(d['included'])): errors.append('returned-path-exclusion')
    if bool(set(d['diverged'])&set(d['included'])): errors.append('divergent-bottom')
    if set(d['joined_origins'])!=set(x for xs in d['origin_sets'] for x in xs): errors.append('origin-alternative-union')
    if not set(d['assigned_everywhere'])<=set(d['restored']): errors.append('all-path-reinitialization')
    if d['merged_incarnation'] is not None and any(x!=d['merged_incarnation'] for x in d['incarnations']): errors.append('incarnation-separation')
    if set(d['possibly_initialized'])!=set(d['drop_flags']): errors.append('conditional-drop-flags')
    if len(set(d['conditional'])&set(d['unconditional']))>1: errors.append('conditional-capability')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'pred_initialized': [], 'joined_initialized': [], 'pred_moved': [], 'joined_moved': [], 'unique_owners': [], 'unique_retained': False, 'returned': [], 'included': [], 'diverged': [], 'origin_sets': [], 'joined_origins': [], 'assigned_everywhere': [], 'restored': [], 'incarnations': [], 'merged_incarnation': None, 'possibly_initialized': [], 'drop_flags': [], 'conditional': [], 'unconditional': []}
check('well formed empty obligations',solve(base),[])
check('definite-meet regression 0', solve(dict(base, **({'pred_initialized':[['a'],[]],'joined_initialized':['a']}))), ['definite-meet'])
check('definite-meet regression 1', solve(dict(base, **({'pred_initialized':[[N,N+1],[N]],'joined_initialized':[N,N+1]}))), ['definite-meet'])
check('possible-move-union regression 0', solve(dict(base, **({'pred_moved':[['a'],[]]}))), ['possible-move-union'])
check('possible-move-union regression 1', solve(dict(base, **({'pred_moved':[[N],[N+1]],'joined_moved':[N]}))), ['possible-move-union'])
check('unique-owner-agreement regression 0', solve(dict(base, **({'unique_retained':True,'unique_owners':['a','b']}))), ['unique-owner-agreement'])
check('unique-owner-agreement regression 1', solve(dict(base, **({'unique_retained':True,'unique_owners':[N,N+1]}))), ['unique-owner-agreement'])
check('returned-path-exclusion regression 0', solve(dict(base, **({'returned':['a'],'included':['a','b']}))), ['returned-path-exclusion'])
check('returned-path-exclusion regression 1', solve(dict(base, **({'returned':[N],'included':[N,N+1]}))), ['returned-path-exclusion'])
check('divergent-bottom regression 0', solve(dict(base, **({'diverged':['a'],'included':['a','b']}))), ['divergent-bottom'])
check('divergent-bottom regression 1', solve(dict(base, **({'diverged':[N],'included':[N,N+1]}))), ['divergent-bottom'])
check('origin-alternative-union regression 0', solve(dict(base, **({'origin_sets':[['a'],['b']],'joined_origins':['a']}))), ['origin-alternative-union'])
check('origin-alternative-union regression 1', solve(dict(base, **({'origin_sets':[[N],[N+1]],'joined_origins':[N]}))), ['origin-alternative-union'])
check('all-path-reinitialization regression 0', solve(dict(base, **({'assigned_everywhere':['a','b'],'restored':['a']}))), ['all-path-reinitialization'])
check('all-path-reinitialization regression 1', solve(dict(base, **({'assigned_everywhere':[N,N+1],'restored':[N]}))), ['all-path-reinitialization'])
check('incarnation-separation regression 0', solve(dict(base, **({'merged_incarnation':N,'incarnations':[N,N+1]}))), ['incarnation-separation'])
check('incarnation-separation regression 1', solve(dict(base, **({'merged_incarnation':'x1','incarnations':['x1','x2']}))), ['incarnation-separation'])
check('conditional-drop-flags regression 0', solve(dict(base, **({'possibly_initialized':['a']}))), ['conditional-drop-flags'])
check('conditional-drop-flags regression 1', solve(dict(base, **({'possibly_initialized':[N,N+1],'drop_flags':[N]}))), ['conditional-drop-flags'])
check('conditional-capability regression 0', solve(dict(base, **({'conditional':['r'],'unconditional':['r']}))), ['conditional-capability'])
check('conditional-capability regression 1', solve(dict(base, **({'conditional':[N],'unconditional':[N]}))), ['conditional-capability'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A path-dependent borrow capability becomes unconditional at the join.

Check ownership lattice join certificates. Definitely initialized paths intersect predecessor sets; possibly moved paths union; unique capabilities survive only if same owner on all paths; returned paths excluded from continuing join; divergent predecessors contribute bottom; reference alternatives union origins; assignment on every path restores initialization; storage incarnations cannot merge by variable spelling; drop flags reflect possibly initialized fields; conditional ownership is not unconditional ownership. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access


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

N = 1
observations = []
def solve(d):
    errors=[]
    if False: errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    errors=[]
    if set(d['source_order'])!=set(d['eval_order']): errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Aggregate lowering reorders a borrow before its owner-producing field expression.

Validate lowering of aggregate expressions containing owned and borrowed fields. Evaluation order follows source field order; struct update moves only omitted fields; explicit fields override update sources; failed construction drops initialized fields in reverse initialization order; borrowed fields preserve their source origin; spread cannot duplicate exclusive fields; tuple projection indices remain positional; enum payload loans require matching discriminant; moving an aggregate remaps every contained reference owner slot; zero-field aggregates create no synthetic borrowed field. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access


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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if False: errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if not set(d['omitted'])<=set(d['update_moved']): errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Struct update moves a field explicitly replaced by the constructor.

Validate lowering of aggregate expressions containing owned and borrowed fields. Evaluation order follows source field order; struct update moves only omitted fields; explicit fields override update sources; failed construction drops initialized fields in reverse initialization order; borrowed fields preserve their source origin; spread cannot duplicate exclusive fields; tuple projection indices remain positional; enum payload loans require matching discriminant; moving an aggregate remaps every contained reference owner slot; zero-field aggregates create no synthetic borrowed field. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access


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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if False: errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if set(d['explicit'])==set(d['update_written']) and bool(d['explicit']): errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Struct spread overwrites an explicit borrowed field origin.

Validate lowering of aggregate expressions containing owned and borrowed fields. Evaluation order follows source field order; struct update moves only omitted fields; explicit fields override update sources; failed construction drops initialized fields in reverse initialization order; borrowed fields preserve their source origin; spread cannot duplicate exclusive fields; tuple projection indices remain positional; enum payload loans require matching discriminant; moving an aggregate remaps every contained reference owner slot; zero-field aggregates create no synthetic borrowed field. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

split: open-access


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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if False: errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if set(d['cleanup_order'])!=set(d['initialized_order']): errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Partial aggregate cleanup destroys owners before later initialized borrowers.

Validate lowering of aggregate expressions containing owned and borrowed fields. Evaluation order follows source field order; struct update moves only omitted fields; explicit fields override update sources; failed construction drops initialized fields in reverse initialization order; borrowed fields preserve their source origin; spread cannot duplicate exclusive fields; tuple projection indices remain positional; enum payload loans require matching discriminant; moving an aggregate remaps every contained reference owner slot; zero-field aggregates create no synthetic borrowed field. 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