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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if False: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound'] is None: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A borrowed trait object defaults to a lifetime unrelated to its outer reference.

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

split: open-access


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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if False: errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if not d['vtable_aliases'] and bool(d['method_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Dynamic method return provenance is missing from the erased dispatch summary.

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

split: open-access


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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if False: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access'] and d['object_unique']: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A mutable dynamic method is callable through a shared object borrow.

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

split: open-access


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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if False: errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if len(d['upcast_after'])>len(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Trait upcasting changes valid borrow points instead of only reducing interface.

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

split: open-access


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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if False: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address'] is not None and d['upcast_address'] is None: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Trait upcasting substitutes vtable identity for referent allocation identity.

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

split: open-access


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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if False: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata'] and d['object_unique']: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Thin object lowering drops the borrowed lifetime witness.

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

split: open-access


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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if False: errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if len(set(d['local_quantified'])&set(d['output_free']))>1: errors.append('associated-owner')
    if not set(d['drop_observes'])<=set(d['drop_summary']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A method-local lifetime binder escapes through an associated borrowed output.

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

split: open-access


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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if False: errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_bound']!=d['erased_bound']: errors.append('erasure-bound')
    if d['object_unique'] and not d['source_unique']: errors.append('erasure-capability')
    if d['reference_bound'] is not None and d['default_bound']!=d['reference_bound']: errors.append('reference-default-bound')
    if not set(d['method_aliases'])<=set(d['vtable_aliases']): errors.append('vtable-alias')
    if d['mut_method'] and not d['exclusive_access']: errors.append('mutable-dispatch')
    if not set(d['upcast_after'])<=set(d['upcast_before']): errors.append('upcast-lifetime')
    if d['source_address']!=d['upcast_address']: errors.append('upcast-provenance')
    if d['thin'] and not d['lifetime_metadata']: errors.append('thin-metadata')
    if bool(set(d['local_quantified'])&set(d['output_free'])): errors.append('associated-owner')
    if not d['drop_summary'] and bool(d['drop_observes']): errors.append('dynamic-drop-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_bound': [], 'erased_bound': [], 'source_unique': False, 'object_unique': False, 'reference_bound': None, 'default_bound': None, 'method_aliases': [], 'vtable_aliases': [], 'mut_method': False, 'exclusive_access': True, 'upcast_before': [], 'upcast_after': [], 'source_address': None, 'upcast_address': None, 'thin': False, 'lifetime_metadata': True, 'assoc_owner': [], 'assoc_output': [], 'local_quantified': [], 'output_free': [], 'drop_observes': [], 'drop_summary': []}
check('well formed empty obligations',solve(base),[])
check('erasure-bound regression 0', solve(dict(base, **({'source_bound':[N],'erased_bound':[N+1]}))), ['erasure-bound'])
check('erasure-bound regression 1', solve(dict(base, **({'source_bound':[N,N+1],'erased_bound':[N+1,N+2]}))), ['erasure-bound'])
check('erasure-capability regression 0', solve(dict(base, **({'object_unique':True}))), ['erasure-capability'])
check('erasure-capability regression 1', solve(dict(base, **({'object_unique':True,'source_bound':[N],'erased_bound':[N]}))), ['erasure-capability'])
check('reference-default-bound regression 0', solve(dict(base, **({'reference_bound':'a','default_bound':'static'}))), ['reference-default-bound'])
check('reference-default-bound regression 1', solve(dict(base, **({'reference_bound':N,'default_bound':N+1}))), ['reference-default-bound'])
check('vtable-alias regression 0', solve(dict(base, **({'method_aliases':['a','b'],'vtable_aliases':['a']}))), ['vtable-alias'])
check('vtable-alias regression 1', solve(dict(base, **({'method_aliases':[N,N+1],'vtable_aliases':[N]}))), ['vtable-alias'])
check('mutable-dispatch regression 0', solve(dict(base, **({'mut_method':True,'exclusive_access':False}))), ['mutable-dispatch'])
check('mutable-dispatch regression 1', solve(dict(base, **({'mut_method':True,'exclusive_access':False,'source_bound':[N],'erased_bound':[N]}))), ['mutable-dispatch'])
check('upcast-lifetime regression 0', solve(dict(base, **({'upcast_before':[N],'upcast_after':[N+1]}))), ['upcast-lifetime'])
check('upcast-lifetime regression 1', solve(dict(base, **({'upcast_before':[N,N+1],'upcast_after':[N+1,N+2]}))), ['upcast-lifetime'])
check('upcast-provenance regression 0', solve(dict(base, **({'source_address':N,'upcast_address':N+1}))), ['upcast-provenance'])
check('upcast-provenance regression 1', solve(dict(base, **({'source_address':'owner','upcast_address':'vtable'}))), ['upcast-provenance'])
check('thin-metadata regression 0', solve(dict(base, **({'thin':True,'lifetime_metadata':False}))), ['thin-metadata'])
check('thin-metadata regression 1', solve(dict(base, **({'thin':True,'lifetime_metadata':False,'source_bound':[N],'erased_bound':[N]}))), ['thin-metadata'])
check('associated-owner regression 0', solve(dict(base, **({'local_quantified':['a'],'output_free':['a']}))), ['associated-owner'])
check('associated-owner regression 1', solve(dict(base, **({'local_quantified':[N],'output_free':[N]}))), ['associated-owner'])
check('dynamic-drop-summary regression 0', solve(dict(base, **({'drop_observes':['a','b'],'drop_summary':['a']}))), ['dynamic-drop-summary'])
check('dynamic-drop-summary regression 1', solve(dict(base, **({'drop_observes':[N,N+1],'drop_summary':[N]}))), ['dynamic-drop-summary'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Erased destructor summaries omit an observed borrowed field.

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

split: open-access


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

N = 1
observations = []
def solve(d):
    errors=[]
    if False: errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p+1<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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 destructor observes a referent one step after its storage expires.

Check destructor-specific lifetime obligations. Destructor-read referents live at drop point; field destruction follows declaration order; explicit manual drop removes only its own drop obligation; may_dangle relaxation excludes observed parameters; owning phantom markers restore transitive drop obligations; arrays repeat element obligations even at nonzero symbolic lengths; partial move prohibited for custom-drop values; recursive drop dependencies need a visited set but may not skip distinct substitutions; unwinding runs initialized-field drops; destructor receiver borrow stays live through the whole body. 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