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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return False
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if x == '|' or y == '|': return True
        if x == '*' or y == '*': return True
        if x == '?' and isinstance(y, int): continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return True
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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(a, b):
    if not a or not b: return False
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if x == '|' or y == '|': return True
        if x == '*' or y == '*': return True
        if x == '?' and isinstance(y, int): continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return len(x)==len(y)
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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:
Sibling named fields retain a false conflict.

Places are lists of projections: root name, then fields or integer indices. Different roots and unequal fields or known indices are disjoint. A wildcard index ? aliases any index. A union projection | overlaps any sibling. Dereference * conservatively overlaps another projection at that depth. Prefix places overlap; empty denotes no place. Return overlap.

split: open-access


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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return False
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if x == '|' or y == '|': return True
        if x == '*' or y == '*': return True
        if x == '?' and isinstance(y, int): continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return False
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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(a, b):
    if not a or not b: return False
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if x == '|' or y == '|': return True
        if x == '*' or y == '*': return True
        if x == '?' and isinstance(y, int): continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return len(a)==len(b)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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 whole aggregate loses its conflict with a borrowed subplace.

Places are lists of projections: root name, then fields or integer indices. Different roots and unequal fields or known indices are disjoint. A wildcard index ? aliases any index. A union projection | overlaps any sibling. Dereference * conservatively overlaps another projection at that depth. Prefix places overlap; empty denotes no place. Return overlap.

split: open-access


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

N = 1
observations = []
def solve(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issubset(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return x>set(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return len(x)>=len(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return x>set(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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:
Outlives substitutes cardinality for program-point containment.

Finite lexical regions map names to sets of program-point integers. Longer region contains every point of shorter. Queries: outlives(a,b), meet(a,b), join(a,b), missing(a,b), strict(a,b), eq(a,b), disjoint(a,b), covers(a, list-of-regions), gap(a,b,c) requires a cover intersection of b,c, and choose(a,candidates) returns lexically sorted candidate regions containing a with smallest cardinality, ties lexical. Return booleans or sorted lists as appropriate.

split: open-access


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

N = 1
observations = []
def solve(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x.union(regions[b]))
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return x>set(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x)
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return x>set(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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:
Common valid lifetime includes points valid for only one referent.

Finite lexical regions map names to sets of program-point integers. Longer region contains every point of shorter. Queries: outlives(a,b), meet(a,b), join(a,b), missing(a,b), strict(a,b), eq(a,b), disjoint(a,b), covers(a, list-of-regions), gap(a,b,c) requires a cover intersection of b,c, and choose(a,candidates) returns lexically sorted candidate regions containing a with smallest cardinality, ties lexical. Return booleans or sorted lists as appropriate.

split: open-access


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

N = 1
observations = []
def solve(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(x.intersection(regions[b]))
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return x>set(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(regions[b])
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return x>set(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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:
Combined use lifetime drops points from one use region.

Finite lexical regions map names to sets of program-point integers. Longer region contains every point of shorter. Queries: outlives(a,b), meet(a,b), join(a,b), missing(a,b), strict(a,b), eq(a,b), disjoint(a,b), covers(a, list-of-regions), gap(a,b,c) requires a cover intersection of b,c, and choose(a,candidates) returns lexically sorted candidate regions containing a with smallest cardinality, ties lexical. Return booleans or sorted lists as appropriate.

split: open-access


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

N = 1
observations = []
def solve(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(x-set(regions[b]))
    if op=='strict': return x>set(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(x ^ set(regions[b]))
    if op=='strict': return x>set(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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:
Unsatisfied lifetime obligations report extra availability as missing.

Finite lexical regions map names to sets of program-point integers. Longer region contains every point of shorter. Queries: outlives(a,b), meet(a,b), join(a,b), missing(a,b), strict(a,b), eq(a,b), disjoint(a,b), covers(a, list-of-regions), gap(a,b,c) requires a cover intersection of b,c, and choose(a,candidates) returns lexically sorted candidate regions containing a with smallest cardinality, ties lexical. Return booleans or sorted lists as appropriate.

split: open-access


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

N = 1
observations = []
def solve(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return x>=set(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return len(x)>len(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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:
Strict lifetime shortening accepts a same-sized or incomparable region.

Finite lexical regions map names to sets of program-point integers. Longer region contains every point of shorter. Queries: outlives(a,b), meet(a,b), join(a,b), missing(a,b), strict(a,b), eq(a,b), disjoint(a,b), covers(a, list-of-regions), gap(a,b,c) requires a cover intersection of b,c, and choose(a,candidates) returns lexically sorted candidate regions containing a with smallest cardinality, ties lexical. Return booleans or sorted lists as appropriate.

split: open-access


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

N = 1
observations = []
def solve(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return x>set(regions[b])
    if op=='eq': return len(x)==len(regions[b])
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return x>set(regions[b])
    if op=='eq': return sorted(x)==regions[b]
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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:
Region equivalence depends on enumeration order.

Finite lexical regions map names to sets of program-point integers. Longer region contains every point of shorter. Queries: outlives(a,b), meet(a,b), join(a,b), missing(a,b), strict(a,b), eq(a,b), disjoint(a,b), covers(a, list-of-regions), gap(a,b,c) requires a cover intersection of b,c, and choose(a,candidates) returns lexically sorted candidate regions containing a with smallest cardinality, ties lexical. Return booleans or sorted lists as appropriate.

split: open-access


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

N = 1
observations = []
def solve(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return x>set(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return x!=set(regions[b])
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return x>set(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return not x or not regions[b]
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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:
Disjoint live regions are rejected unless one is empty.

Finite lexical regions map names to sets of program-point integers. Longer region contains every point of shorter. Queries: outlives(a,b), meet(a,b), join(a,b), missing(a,b), strict(a,b), eq(a,b), disjoint(a,b), covers(a, list-of-regions), gap(a,b,c) requires a cover intersection of b,c, and choose(a,candidates) returns lexically sorted candidate regions containing a with smallest cardinality, ties lexical. Return booleans or sorted lists as appropriate.

split: open-access


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

N = 1
observations = []
def solve(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return x>set(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return any(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return x>set(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return bool(b) and all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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:
Lifetime obligation fold loses the empty conjunction.

Finite lexical regions map names to sets of program-point integers. Longer region contains every point of shorter. Queries: outlives(a,b), meet(a,b), join(a,b), missing(a,b), strict(a,b), eq(a,b), disjoint(a,b), covers(a, list-of-regions), gap(a,b,c) requires a cover intersection of b,c, and choose(a,candidates) returns lexically sorted candidate regions containing a with smallest cardinality, ties lexical. Return booleans or sorted lists as appropriate.

split: open-access


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

N = 1
observations = []
def solve(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return x>set(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) | set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return x>set(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted(set(regions[b])-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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:
Joint-use lifetime diagnostic reports points outside simultaneous demand.

Finite lexical regions map names to sets of program-point integers. Longer region contains every point of shorter. Queries: outlives(a,b), meet(a,b), join(a,b), missing(a,b), strict(a,b), eq(a,b), disjoint(a,b), covers(a, list-of-regions), gap(a,b,c) requires a cover intersection of b,c, and choose(a,candidates) returns lexically sorted candidate regions containing a with smallest cardinality, ties lexical. Return booleans or sorted lists as appropriate.

split: open-access


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

N = 1
observations = []
def solve(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return x>set(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return max(candidates,key=lambda k:(len(set(regions[k])),k)) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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(regions, op, a, b, c=None):
    x=set(regions[a])
    if op=='outlives': return x.issuperset(regions[b])
    if op=='meet': return sorted(x.intersection(regions[b]))
    if op=='join': return sorted(x.union(regions[b]))
    if op=='missing': return sorted(set(regions[b])-x)
    if op=='strict': return x>set(regions[b])
    if op=='eq': return x==set(regions[b])
    if op=='disjoint': return x.isdisjoint(regions[b])
    if op=='covers': return all(x.issuperset(regions[k]) for k in b)
    if op=='gap': return sorted((set(regions[b]) & set(regions[c]))-x)
    if op=='choose':
        candidates=[k for k in b if set(regions[k]).issuperset(x)]
        return min(candidates) if candidates else None
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r={'a':[N,N+1],'b':[N+1,N+2],'s':[N+1],'e':[],'z':[N+1,N],'aa':[N,N+1,N+2]}
check('outlives',solve(r,'outlives','a','s'),True)
check('incomparable',solve(r,'outlives','a','b'),False)
check('meet',solve(r,'meet','a','b'),[N+1])
check('join',solve(r,'join','a','b'),[N,N+1,N+2])
check('missing',solve(r,'missing','a','b'),[N+2])
check('strict equal',solve(r,'strict','a','a'),False)
check('strict incomparable',solve(r,'strict','aa','b'),True)
check('strict size insufficient',solve({'a':[N,N+1],'b':[N+2]},'strict','a','b'),False)
check('equivalent unordered',solve(r,'eq','a','z'),True)
check('equivalent distinct',solve(r,'eq','a','b'),False)
check('nonempty disjoint',solve({'a':[N],'b':[N+1]},'disjoint','a','b'),True)
check('overlap disjoint',solve(r,'disjoint','a','b'),False)
check('mixed obligations',solve(r,'covers','a',['s','b']),False)
check('no obligations',solve(r,'covers','a',[]),True)
check('joint demand',solve(r,'gap','e','a','b'),[N+1])
check('choose shortest',solve(r,'choose','s',['aa','a','s']), 's')
check('no candidate',solve(r,'choose','aa',['a','s']),None)
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:
Inferred enclosing lifetime follows its name instead of minimal extent.

Finite lexical regions map names to sets of program-point integers. Longer region contains every point of shorter. Queries: outlives(a,b), meet(a,b), join(a,b), missing(a,b), strict(a,b), eq(a,b), disjoint(a,b), covers(a, list-of-regions), gap(a,b,c) requires a cover intersection of b,c, and choose(a,candidates) returns lexically sorted candidate regions containing a with smallest cardinality, ties lexical. Return booleans or sorted lists as appropriate.

split: open-access


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

N = 1
observations = []
def solve(leaves, ops):
    allowed=set(leaves); live=set(); out=[]
    for op,arg in ops:
        if op=='init':
            live.update(arg); out.append(sorted(live))
        elif op=='move':
            ok=arg in live
            if ok: live.remove(arg)
            out.append(ok)
        elif op=='read': out.append(arg in live)
        elif op=='whole': out.append(live==allowed)
        elif op=='assign':
            if arg in allowed: live.add(arg)
            out.append(sorted(live))
        elif op=='drop':
            out.append(sorted(live)); live.clear()
        elif op=='reset':
            live.clear(); out.append([])
        elif op=='copy': out.append(arg in live)
        elif op=='merge':
            live.intersection_update(arg); out.append(sorted(live))
        elif op=='available': out.append(sorted(live))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
x='v'+str(N)
check('unknown init',solve(['a'],[('init',['a',x])]),[['a']])
check('last move',solve(['a'],[('init',['a']),('move','a'),('read','a')]),[['a'],True,False])
check('uninitialized sibling',solve(['a','b'],[('init',['a']),('read','b')]),[['a'],False])
check('empty whole',solve([], [('whole',None)]),[True])
check('partial whole',solve(['a','b'],[('init',['a']),('whole',None)]),[['a'],False])
check('reassign empty',solve(['a'],[('assign','a'),('read','a')]),[['a'],True])
check('drop clears',solve(['a'],[('init',['a']),('drop',None),('read','a')]),[['a'],['a'],False])
check('storage reset',solve(['a'],[('init',['a']),('reset',None),('read','a')]),[['a'],[],False])
check('copy preserves',solve(['a'],[('init',['a']),('copy','a'),('read','a')]),[['a'],True,True])
check('join intersection',solve(['a','b'],[('init',['a']),('merge',['b']),('available',None)]),[['a'],[],[]])
check('available subset',solve(['a','b'],[('init',['a']),('available',None)]),[['a'],['a']])
check('variant leaf',solve([x],[('init',[x]),('move',x),('available',None)]),[[x],True,[]])
check('record arity',solve(list(range(N+1)),[('init',list(range(N+1))),('move',N),('available',None)]),[list(range(N+1)),True,list(range(N))])
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(leaves, ops):
    allowed=set(leaves); live=set(); out=[]
    for op,arg in ops:
        if op=='init':
            live.update(set(arg) if arg else allowed); out.append(sorted(live))
        elif op=='move':
            ok=arg in live
            if ok: live.remove(arg)
            out.append(ok)
        elif op=='read': out.append(arg in live)
        elif op=='whole': out.append(live==allowed)
        elif op=='assign':
            if arg in allowed: live.add(arg)
            out.append(sorted(live))
        elif op=='drop':
            out.append(sorted(live)); live.clear()
        elif op=='reset':
            live.clear(); out.append([])
        elif op=='copy': out.append(arg in live)
        elif op=='merge':
            live.intersection_update(arg); out.append(sorted(live))
        elif op=='available': out.append(sorted(live))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
x='v'+str(N)
check('unknown init',solve(['a'],[('init',['a',x])]),[['a']])
check('last move',solve(['a'],[('init',['a']),('move','a'),('read','a')]),[['a'],True,False])
check('uninitialized sibling',solve(['a','b'],[('init',['a']),('read','b')]),[['a'],False])
check('empty whole',solve([], [('whole',None)]),[True])
check('partial whole',solve(['a','b'],[('init',['a']),('whole',None)]),[['a'],False])
check('reassign empty',solve(['a'],[('assign','a'),('read','a')]),[['a'],True])
check('drop clears',solve(['a'],[('init',['a']),('drop',None),('read','a')]),[['a'],['a'],False])
check('storage reset',solve(['a'],[('init',['a']),('reset',None),('read','a')]),[['a'],[],False])
check('copy preserves',solve(['a'],[('init',['a']),('copy','a'),('read','a')]),[['a'],True,True])
check('join intersection',solve(['a','b'],[('init',['a']),('merge',['b']),('available',None)]),[['a'],[],[]])
check('available subset',solve(['a','b'],[('init',['a']),('available',None)]),[['a'],['a']])
check('variant leaf',solve([x],[('init',[x]),('move',x),('available',None)]),[[x],True,[]])
check('record arity',solve(list(range(N+1)),[('init',list(range(N+1))),('move',N),('available',None)]),[list(range(N+1)),True,list(range(N))])
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:
Initialization invents paths absent from the declared record.

Static path initialization lattice for a record with declared leaf names. Commands init/move/read/whole/assign/drop/reset/copy/merge/available. init and assign initialize one leaf. move consumes only initialized named leaf and reports success; read tests one; whole tests all. drop consumes all and reports previously initialized names. reset clears; copy tests without consumption. merge intersects current initialized leaves with supplied branch leaves. available returns sorted initialized names. Unknown leaves never initialize. Return one result per command. This is definite-initialization analysis, not runtime borrowing.

split: open-access


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

N = 1
observations = []
def solve(leaves, ops):
    allowed=set(leaves); live=set(); out=[]
    for op,arg in ops:
        if op=='init':
            live.update(set(arg)&allowed); out.append(sorted(live))
        elif op=='move':
            ok=arg in live
            if False: live.remove(arg)
            out.append(ok)
        elif op=='read': out.append(arg in live)
        elif op=='whole': out.append(live==allowed)
        elif op=='assign':
            if arg in allowed: live.add(arg)
            out.append(sorted(live))
        elif op=='drop':
            out.append(sorted(live)); live.clear()
        elif op=='reset':
            live.clear(); out.append([])
        elif op=='copy': out.append(arg in live)
        elif op=='merge':
            live.intersection_update(arg); out.append(sorted(live))
        elif op=='available': out.append(sorted(live))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
x='v'+str(N)
check('unknown init',solve(['a'],[('init',['a',x])]),[['a']])
check('last move',solve(['a'],[('init',['a']),('move','a'),('read','a')]),[['a'],True,False])
check('uninitialized sibling',solve(['a','b'],[('init',['a']),('read','b')]),[['a'],False])
check('empty whole',solve([], [('whole',None)]),[True])
check('partial whole',solve(['a','b'],[('init',['a']),('whole',None)]),[['a'],False])
check('reassign empty',solve(['a'],[('assign','a'),('read','a')]),[['a'],True])
check('drop clears',solve(['a'],[('init',['a']),('drop',None),('read','a')]),[['a'],['a'],False])
check('storage reset',solve(['a'],[('init',['a']),('reset',None),('read','a')]),[['a'],[],False])
check('copy preserves',solve(['a'],[('init',['a']),('copy','a'),('read','a')]),[['a'],True,True])
check('join intersection',solve(['a','b'],[('init',['a']),('merge',['b']),('available',None)]),[['a'],[],[]])
check('available subset',solve(['a','b'],[('init',['a']),('available',None)]),[['a'],['a']])
check('variant leaf',solve([x],[('init',[x]),('move',x),('available',None)]),[[x],True,[]])
check('record arity',solve(list(range(N+1)),[('init',list(range(N+1))),('move',N),('available',None)]),[list(range(N+1)),True,list(range(N))])
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(leaves, ops):
    allowed=set(leaves); live=set(); out=[]
    for op,arg in ops:
        if op=='init':
            live.update(set(arg)&allowed); out.append(sorted(live))
        elif op=='move':
            ok=arg in live
            if ok and len(live)>1: live.remove(arg)
            out.append(ok)
        elif op=='read': out.append(arg in live)
        elif op=='whole': out.append(live==allowed)
        elif op=='assign':
            if arg in allowed: live.add(arg)
            out.append(sorted(live))
        elif op=='drop':
            out.append(sorted(live)); live.clear()
        elif op=='reset':
            live.clear(); out.append([])
        elif op=='copy': out.append(arg in live)
        elif op=='merge':
            live.intersection_update(arg); out.append(sorted(live))
        elif op=='available': out.append(sorted(live))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
x='v'+str(N)
check('unknown init',solve(['a'],[('init',['a',x])]),[['a']])
check('last move',solve(['a'],[('init',['a']),('move','a'),('read','a')]),[['a'],True,False])
check('uninitialized sibling',solve(['a','b'],[('init',['a']),('read','b')]),[['a'],False])
check('empty whole',solve([], [('whole',None)]),[True])
check('partial whole',solve(['a','b'],[('init',['a']),('whole',None)]),[['a'],False])
check('reassign empty',solve(['a'],[('assign','a'),('read','a')]),[['a'],True])
check('drop clears',solve(['a'],[('init',['a']),('drop',None),('read','a')]),[['a'],['a'],False])
check('storage reset',solve(['a'],[('init',['a']),('reset',None),('read','a')]),[['a'],[],False])
check('copy preserves',solve(['a'],[('init',['a']),('copy','a'),('read','a')]),[['a'],True,True])
check('join intersection',solve(['a','b'],[('init',['a']),('merge',['b']),('available',None)]),[['a'],[],[]])
check('available subset',solve(['a','b'],[('init',['a']),('available',None)]),[['a'],['a']])
check('variant leaf',solve([x],[('init',[x]),('move',x),('available',None)]),[[x],True,[]])
check('record arity',solve(list(range(N+1)),[('init',list(range(N+1))),('move',N),('available',None)]),[list(range(N+1)),True,list(range(N))])
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:
Moving the last initialized leaf leaves a stale initialization fact.

Static path initialization lattice for a record with declared leaf names. Commands init/move/read/whole/assign/drop/reset/copy/merge/available. init and assign initialize one leaf. move consumes only initialized named leaf and reports success; read tests one; whole tests all. drop consumes all and reports previously initialized names. reset clears; copy tests without consumption. merge intersects current initialized leaves with supplied branch leaves. available returns sorted initialized names. Unknown leaves never initialize. Return one result per command. This is definite-initialization analysis, not runtime borrowing.

split: open-access


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

N = 1
observations = []
def solve(leaves, ops):
    allowed=set(leaves); live=set(); out=[]
    for op,arg in ops:
        if op=='init':
            live.update(set(arg)&allowed); out.append(sorted(live))
        elif op=='move':
            ok=arg in live
            if ok: live.remove(arg)
            out.append(ok)
        elif op=='read': out.append(arg in allowed)
        elif op=='whole': out.append(live==allowed)
        elif op=='assign':
            if arg in allowed: live.add(arg)
            out.append(sorted(live))
        elif op=='drop':
            out.append(sorted(live)); live.clear()
        elif op=='reset':
            live.clear(); out.append([])
        elif op=='copy': out.append(arg in live)
        elif op=='merge':
            live.intersection_update(arg); out.append(sorted(live))
        elif op=='available': out.append(sorted(live))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
x='v'+str(N)
check('unknown init',solve(['a'],[('init',['a',x])]),[['a']])
check('last move',solve(['a'],[('init',['a']),('move','a'),('read','a')]),[['a'],True,False])
check('uninitialized sibling',solve(['a','b'],[('init',['a']),('read','b')]),[['a'],False])
check('empty whole',solve([], [('whole',None)]),[True])
check('partial whole',solve(['a','b'],[('init',['a']),('whole',None)]),[['a'],False])
check('reassign empty',solve(['a'],[('assign','a'),('read','a')]),[['a'],True])
check('drop clears',solve(['a'],[('init',['a']),('drop',None),('read','a')]),[['a'],['a'],False])
check('storage reset',solve(['a'],[('init',['a']),('reset',None),('read','a')]),[['a'],[],False])
check('copy preserves',solve(['a'],[('init',['a']),('copy','a'),('read','a')]),[['a'],True,True])
check('join intersection',solve(['a','b'],[('init',['a']),('merge',['b']),('available',None)]),[['a'],[],[]])
check('available subset',solve(['a','b'],[('init',['a']),('available',None)]),[['a'],['a']])
check('variant leaf',solve([x],[('init',[x]),('move',x),('available',None)]),[[x],True,[]])
check('record arity',solve(list(range(N+1)),[('init',list(range(N+1))),('move',N),('available',None)]),[list(range(N+1)),True,list(range(N))])
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(leaves, ops):
    allowed=set(leaves); live=set(); out=[]
    for op,arg in ops:
        if op=='init':
            live.update(set(arg)&allowed); out.append(sorted(live))
        elif op=='move':
            ok=arg in live
            if ok: live.remove(arg)
            out.append(ok)
        elif op=='read': out.append(bool(live))
        elif op=='whole': out.append(live==allowed)
        elif op=='assign':
            if arg in allowed: live.add(arg)
            out.append(sorted(live))
        elif op=='drop':
            out.append(sorted(live)); live.clear()
        elif op=='reset':
            live.clear(); out.append([])
        elif op=='copy': out.append(arg in live)
        elif op=='merge':
            live.intersection_update(arg); out.append(sorted(live))
        elif op=='available': out.append(sorted(live))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
x='v'+str(N)
check('unknown init',solve(['a'],[('init',['a',x])]),[['a']])
check('last move',solve(['a'],[('init',['a']),('move','a'),('read','a')]),[['a'],True,False])
check('uninitialized sibling',solve(['a','b'],[('init',['a']),('read','b')]),[['a'],False])
check('empty whole',solve([], [('whole',None)]),[True])
check('partial whole',solve(['a','b'],[('init',['a']),('whole',None)]),[['a'],False])
check('reassign empty',solve(['a'],[('assign','a'),('read','a')]),[['a'],True])
check('drop clears',solve(['a'],[('init',['a']),('drop',None),('read','a')]),[['a'],['a'],False])
check('storage reset',solve(['a'],[('init',['a']),('reset',None),('read','a')]),[['a'],[],False])
check('copy preserves',solve(['a'],[('init',['a']),('copy','a'),('read','a')]),[['a'],True,True])
check('join intersection',solve(['a','b'],[('init',['a']),('merge',['b']),('available',None)]),[['a'],[],[]])
check('available subset',solve(['a','b'],[('init',['a']),('available',None)]),[['a'],['a']])
check('variant leaf',solve([x],[('init',[x]),('move',x),('available',None)]),[[x],True,[]])
check('record arity',solve(list(range(N+1)),[('init',list(range(N+1))),('move',N),('available',None)]),[list(range(N+1)),True,list(range(N))])
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 read inherits initialization from a different field.

Static path initialization lattice for a record with declared leaf names. Commands init/move/read/whole/assign/drop/reset/copy/merge/available. init and assign initialize one leaf. move consumes only initialized named leaf and reports success; read tests one; whole tests all. drop consumes all and reports previously initialized names. reset clears; copy tests without consumption. merge intersects current initialized leaves with supplied branch leaves. available returns sorted initialized names. Unknown leaves never initialize. Return one result per command. This is definite-initialization analysis, not runtime borrowing.

split: open-access


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

N = 1
observations = []
def solve(leaves, ops):
    allowed=set(leaves); live=set(); out=[]
    for op,arg in ops:
        if op=='init':
            live.update(set(arg)&allowed); out.append(sorted(live))
        elif op=='move':
            ok=arg in live
            if ok: live.remove(arg)
            out.append(ok)
        elif op=='read': out.append(arg in live)
        elif op=='whole': out.append(bool(live))
        elif op=='assign':
            if arg in allowed: live.add(arg)
            out.append(sorted(live))
        elif op=='drop':
            out.append(sorted(live)); live.clear()
        elif op=='reset':
            live.clear(); out.append([])
        elif op=='copy': out.append(arg in live)
        elif op=='merge':
            live.intersection_update(arg); out.append(sorted(live))
        elif op=='available': out.append(sorted(live))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
x='v'+str(N)
check('unknown init',solve(['a'],[('init',['a',x])]),[['a']])
check('last move',solve(['a'],[('init',['a']),('move','a'),('read','a')]),[['a'],True,False])
check('uninitialized sibling',solve(['a','b'],[('init',['a']),('read','b')]),[['a'],False])
check('empty whole',solve([], [('whole',None)]),[True])
check('partial whole',solve(['a','b'],[('init',['a']),('whole',None)]),[['a'],False])
check('reassign empty',solve(['a'],[('assign','a'),('read','a')]),[['a'],True])
check('drop clears',solve(['a'],[('init',['a']),('drop',None),('read','a')]),[['a'],['a'],False])
check('storage reset',solve(['a'],[('init',['a']),('reset',None),('read','a')]),[['a'],[],False])
check('copy preserves',solve(['a'],[('init',['a']),('copy','a'),('read','a')]),[['a'],True,True])
check('join intersection',solve(['a','b'],[('init',['a']),('merge',['b']),('available',None)]),[['a'],[],[]])
check('available subset',solve(['a','b'],[('init',['a']),('available',None)]),[['a'],['a']])
check('variant leaf',solve([x],[('init',[x]),('move',x),('available',None)]),[[x],True,[]])
check('record arity',solve(list(range(N+1)),[('init',list(range(N+1))),('move',N),('available',None)]),[list(range(N+1)),True,list(range(N))])
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(leaves, ops):
    allowed=set(leaves); live=set(); out=[]
    for op,arg in ops:
        if op=='init':
            live.update(set(arg)&allowed); out.append(sorted(live))
        elif op=='move':
            ok=arg in live
            if ok: live.remove(arg)
            out.append(ok)
        elif op=='read': out.append(arg in live)
        elif op=='whole': out.append(bool(allowed) and live==allowed)
        elif op=='assign':
            if arg in allowed: live.add(arg)
            out.append(sorted(live))
        elif op=='drop':
            out.append(sorted(live)); live.clear()
        elif op=='reset':
            live.clear(); out.append([])
        elif op=='copy': out.append(arg in live)
        elif op=='merge':
            live.intersection_update(arg); out.append(sorted(live))
        elif op=='available': out.append(sorted(live))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
x='v'+str(N)
check('unknown init',solve(['a'],[('init',['a',x])]),[['a']])
check('last move',solve(['a'],[('init',['a']),('move','a'),('read','a')]),[['a'],True,False])
check('uninitialized sibling',solve(['a','b'],[('init',['a']),('read','b')]),[['a'],False])
check('empty whole',solve([], [('whole',None)]),[True])
check('partial whole',solve(['a','b'],[('init',['a']),('whole',None)]),[['a'],False])
check('reassign empty',solve(['a'],[('assign','a'),('read','a')]),[['a'],True])
check('drop clears',solve(['a'],[('init',['a']),('drop',None),('read','a')]),[['a'],['a'],False])
check('storage reset',solve(['a'],[('init',['a']),('reset',None),('read','a')]),[['a'],[],False])
check('copy preserves',solve(['a'],[('init',['a']),('copy','a'),('read','a')]),[['a'],True,True])
check('join intersection',solve(['a','b'],[('init',['a']),('merge',['b']),('available',None)]),[['a'],[],[]])
check('available subset',solve(['a','b'],[('init',['a']),('available',None)]),[['a'],['a']])
check('variant leaf',solve([x],[('init',[x]),('move',x),('available',None)]),[[x],True,[]])
check('record arity',solve(list(range(N+1)),[('init',list(range(N+1))),('move',N),('available',None)]),[list(range(N+1)),True,list(range(N))])
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:
Whole-value initialization mishandles empty records.

Static path initialization lattice for a record with declared leaf names. Commands init/move/read/whole/assign/drop/reset/copy/merge/available. init and assign initialize one leaf. move consumes only initialized named leaf and reports success; read tests one; whole tests all. drop consumes all and reports previously initialized names. reset clears; copy tests without consumption. merge intersects current initialized leaves with supplied branch leaves. available returns sorted initialized names. Unknown leaves never initialize. Return one result per command. This is definite-initialization analysis, not runtime borrowing.

split: open-access


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

N = 1
observations = []
def solve(leaves, ops):
    allowed=set(leaves); live=set(); out=[]
    for op,arg in ops:
        if op=='init':
            live.update(set(arg)&allowed); out.append(sorted(live))
        elif op=='move':
            ok=arg in live
            if ok: live.remove(arg)
            out.append(ok)
        elif op=='read': out.append(arg in live)
        elif op=='whole': out.append(live==allowed)
        elif op=='assign':
            if False: live.add(arg)
            out.append(sorted(live))
        elif op=='drop':
            out.append(sorted(live)); live.clear()
        elif op=='reset':
            live.clear(); out.append([])
        elif op=='copy': out.append(arg in live)
        elif op=='merge':
            live.intersection_update(arg); out.append(sorted(live))
        elif op=='available': out.append(sorted(live))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
x='v'+str(N)
check('unknown init',solve(['a'],[('init',['a',x])]),[['a']])
check('last move',solve(['a'],[('init',['a']),('move','a'),('read','a')]),[['a'],True,False])
check('uninitialized sibling',solve(['a','b'],[('init',['a']),('read','b')]),[['a'],False])
check('empty whole',solve([], [('whole',None)]),[True])
check('partial whole',solve(['a','b'],[('init',['a']),('whole',None)]),[['a'],False])
check('reassign empty',solve(['a'],[('assign','a'),('read','a')]),[['a'],True])
check('drop clears',solve(['a'],[('init',['a']),('drop',None),('read','a')]),[['a'],['a'],False])
check('storage reset',solve(['a'],[('init',['a']),('reset',None),('read','a')]),[['a'],[],False])
check('copy preserves',solve(['a'],[('init',['a']),('copy','a'),('read','a')]),[['a'],True,True])
check('join intersection',solve(['a','b'],[('init',['a']),('merge',['b']),('available',None)]),[['a'],[],[]])
check('available subset',solve(['a','b'],[('init',['a']),('available',None)]),[['a'],['a']])
check('variant leaf',solve([x],[('init',[x]),('move',x),('available',None)]),[[x],True,[]])
check('record arity',solve(list(range(N+1)),[('init',list(range(N+1))),('move',N),('available',None)]),[list(range(N+1)),True,list(range(N))])
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(leaves, ops):
    allowed=set(leaves); live=set(); out=[]
    for op,arg in ops:
        if op=='init':
            live.update(set(arg)&allowed); out.append(sorted(live))
        elif op=='move':
            ok=arg in live
            if ok: live.remove(arg)
            out.append(ok)
        elif op=='read': out.append(arg in live)
        elif op=='whole': out.append(live==allowed)
        elif op=='assign':
            if arg in allowed and live: live.add(arg)
            out.append(sorted(live))
        elif op=='drop':
            out.append(sorted(live)); live.clear()
        elif op=='reset':
            live.clear(); out.append([])
        elif op=='copy': out.append(arg in live)
        elif op=='merge':
            live.intersection_update(arg); out.append(sorted(live))
        elif op=='available': out.append(sorted(live))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
x='v'+str(N)
check('unknown init',solve(['a'],[('init',['a',x])]),[['a']])
check('last move',solve(['a'],[('init',['a']),('move','a'),('read','a')]),[['a'],True,False])
check('uninitialized sibling',solve(['a','b'],[('init',['a']),('read','b')]),[['a'],False])
check('empty whole',solve([], [('whole',None)]),[True])
check('partial whole',solve(['a','b'],[('init',['a']),('whole',None)]),[['a'],False])
check('reassign empty',solve(['a'],[('assign','a'),('read','a')]),[['a'],True])
check('drop clears',solve(['a'],[('init',['a']),('drop',None),('read','a')]),[['a'],['a'],False])
check('storage reset',solve(['a'],[('init',['a']),('reset',None),('read','a')]),[['a'],[],False])
check('copy preserves',solve(['a'],[('init',['a']),('copy','a'),('read','a')]),[['a'],True,True])
check('join intersection',solve(['a','b'],[('init',['a']),('merge',['b']),('available',None)]),[['a'],[],[]])
check('available subset',solve(['a','b'],[('init',['a']),('available',None)]),[['a'],['a']])
check('variant leaf',solve([x],[('init',[x]),('move',x),('available',None)]),[[x],True,[]])
check('record arity',solve(list(range(N+1)),[('init',list(range(N+1))),('move',N),('available',None)]),[list(range(N+1)),True,list(range(N))])
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:
Reinitializing a completely moved record fails to restore its leaf.

Static path initialization lattice for a record with declared leaf names. Commands init/move/read/whole/assign/drop/reset/copy/merge/available. init and assign initialize one leaf. move consumes only initialized named leaf and reports success; read tests one; whole tests all. drop consumes all and reports previously initialized names. reset clears; copy tests without consumption. merge intersects current initialized leaves with supplied branch leaves. available returns sorted initialized names. Unknown leaves never initialize. Return one result per command. This is definite-initialization analysis, not runtime borrowing.

split: open-access


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

N = 1
observations = []
def solve(leaves, ops):
    allowed=set(leaves); live=set(); out=[]
    for op,arg in ops:
        if op=='init':
            live.update(set(arg)&allowed); out.append(sorted(live))
        elif op=='move':
            ok=arg in live
            if ok: live.remove(arg)
            out.append(ok)
        elif op=='read': out.append(arg in live)
        elif op=='whole': out.append(live==allowed)
        elif op=='assign':
            if arg in allowed: live.add(arg)
            out.append(sorted(live))
        elif op=='drop':
            out.append(sorted(live))
        elif op=='reset':
            live.clear(); out.append([])
        elif op=='copy': out.append(arg in live)
        elif op=='merge':
            live.intersection_update(arg); out.append(sorted(live))
        elif op=='available': out.append(sorted(live))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
x='v'+str(N)
check('unknown init',solve(['a'],[('init',['a',x])]),[['a']])
check('last move',solve(['a'],[('init',['a']),('move','a'),('read','a')]),[['a'],True,False])
check('uninitialized sibling',solve(['a','b'],[('init',['a']),('read','b')]),[['a'],False])
check('empty whole',solve([], [('whole',None)]),[True])
check('partial whole',solve(['a','b'],[('init',['a']),('whole',None)]),[['a'],False])
check('reassign empty',solve(['a'],[('assign','a'),('read','a')]),[['a'],True])
check('drop clears',solve(['a'],[('init',['a']),('drop',None),('read','a')]),[['a'],['a'],False])
check('storage reset',solve(['a'],[('init',['a']),('reset',None),('read','a')]),[['a'],[],False])
check('copy preserves',solve(['a'],[('init',['a']),('copy','a'),('read','a')]),[['a'],True,True])
check('join intersection',solve(['a','b'],[('init',['a']),('merge',['b']),('available',None)]),[['a'],[],[]])
check('available subset',solve(['a','b'],[('init',['a']),('available',None)]),[['a'],['a']])
check('variant leaf',solve([x],[('init',[x]),('move',x),('available',None)]),[[x],True,[]])
check('record arity',solve(list(range(N+1)),[('init',list(range(N+1))),('move',N),('available',None)]),[list(range(N+1)),True,list(range(N))])
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(leaves, ops):
    allowed=set(leaves); live=set(); out=[]
    for op,arg in ops:
        if op=='init':
            live.update(set(arg)&allowed); out.append(sorted(live))
        elif op=='move':
            ok=arg in live
            if ok: live.remove(arg)
            out.append(ok)
        elif op=='read': out.append(arg in live)
        elif op=='whole': out.append(live==allowed)
        elif op=='assign':
            if arg in allowed: live.add(arg)
            out.append(sorted(live))
        elif op=='drop':
            out.append(sorted(live)); live.intersection_update(allowed)
        elif op=='reset':
            live.clear(); out.append([])
        elif op=='copy': out.append(arg in live)
        elif op=='merge':
            live.intersection_update(arg); out.append(sorted(live))
        elif op=='available': out.append(sorted(live))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
x='v'+str(N)
check('unknown init',solve(['a'],[('init',['a',x])]),[['a']])
check('last move',solve(['a'],[('init',['a']),('move','a'),('read','a')]),[['a'],True,False])
check('uninitialized sibling',solve(['a','b'],[('init',['a']),('read','b')]),[['a'],False])
check('empty whole',solve([], [('whole',None)]),[True])
check('partial whole',solve(['a','b'],[('init',['a']),('whole',None)]),[['a'],False])
check('reassign empty',solve(['a'],[('assign','a'),('read','a')]),[['a'],True])
check('drop clears',solve(['a'],[('init',['a']),('drop',None),('read','a')]),[['a'],['a'],False])
check('storage reset',solve(['a'],[('init',['a']),('reset',None),('read','a')]),[['a'],[],False])
check('copy preserves',solve(['a'],[('init',['a']),('copy','a'),('read','a')]),[['a'],True,True])
check('join intersection',solve(['a','b'],[('init',['a']),('merge',['b']),('available',None)]),[['a'],[],[]])
check('available subset',solve(['a','b'],[('init',['a']),('available',None)]),[['a'],['a']])
check('variant leaf',solve([x],[('init',[x]),('move',x),('available',None)]),[[x],True,[]])
check('record arity',solve(list(range(N+1)),[('init',list(range(N+1))),('move',N),('available',None)]),[list(range(N+1)),True,list(range(N))])
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:
Static drop transfer preserves initialized descendants.

Static path initialization lattice for a record with declared leaf names. Commands init/move/read/whole/assign/drop/reset/copy/merge/available. init and assign initialize one leaf. move consumes only initialized named leaf and reports success; read tests one; whole tests all. drop consumes all and reports previously initialized names. reset clears; copy tests without consumption. merge intersects current initialized leaves with supplied branch leaves. available returns sorted initialized names. Unknown leaves never initialize. Return one result per command. This is definite-initialization analysis, not runtime borrowing.

split: open-access


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

N = 1
observations = []
def solve(leaves, ops):
    allowed=set(leaves); live=set(); out=[]
    for op,arg in ops:
        if op=='init':
            live.update(set(arg)&allowed); out.append(sorted(live))
        elif op=='move':
            ok=arg in live
            if ok: live.remove(arg)
            out.append(ok)
        elif op=='read': out.append(arg in live)
        elif op=='whole': out.append(live==allowed)
        elif op=='assign':
            if arg in allowed: live.add(arg)
            out.append(sorted(live))
        elif op=='drop':
            out.append(sorted(live)); live.clear()
        elif op=='reset':
            out.append([])
        elif op=='copy': out.append(arg in live)
        elif op=='merge':
            live.intersection_update(arg); out.append(sorted(live))
        elif op=='available': out.append(sorted(live))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
x='v'+str(N)
check('unknown init',solve(['a'],[('init',['a',x])]),[['a']])
check('last move',solve(['a'],[('init',['a']),('move','a'),('read','a')]),[['a'],True,False])
check('uninitialized sibling',solve(['a','b'],[('init',['a']),('read','b')]),[['a'],False])
check('empty whole',solve([], [('whole',None)]),[True])
check('partial whole',solve(['a','b'],[('init',['a']),('whole',None)]),[['a'],False])
check('reassign empty',solve(['a'],[('assign','a'),('read','a')]),[['a'],True])
check('drop clears',solve(['a'],[('init',['a']),('drop',None),('read','a')]),[['a'],['a'],False])
check('storage reset',solve(['a'],[('init',['a']),('reset',None),('read','a')]),[['a'],[],False])
check('copy preserves',solve(['a'],[('init',['a']),('copy','a'),('read','a')]),[['a'],True,True])
check('join intersection',solve(['a','b'],[('init',['a']),('merge',['b']),('available',None)]),[['a'],[],[]])
check('available subset',solve(['a','b'],[('init',['a']),('available',None)]),[['a'],['a']])
check('variant leaf',solve([x],[('init',[x]),('move',x),('available',None)]),[[x],True,[]])
check('record arity',solve(list(range(N+1)),[('init',list(range(N+1))),('move',N),('available',None)]),[list(range(N+1)),True,list(range(N))])
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(leaves, ops):
    allowed=set(leaves); live=set(); out=[]
    for op,arg in ops:
        if op=='init':
            live.update(set(arg)&allowed); out.append(sorted(live))
        elif op=='move':
            ok=arg in live
            if ok: live.remove(arg)
            out.append(ok)
        elif op=='read': out.append(arg in live)
        elif op=='whole': out.append(live==allowed)
        elif op=='assign':
            if arg in allowed: live.add(arg)
            out.append(sorted(live))
        elif op=='drop':
            out.append(sorted(live)); live.clear()
        elif op=='reset':
            live.intersection_update(allowed); out.append([])
        elif op=='copy': out.append(arg in live)
        elif op=='merge':
            live.intersection_update(arg); out.append(sorted(live))
        elif op=='available': out.append(sorted(live))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
x='v'+str(N)
check('unknown init',solve(['a'],[('init',['a',x])]),[['a']])
check('last move',solve(['a'],[('init',['a']),('move','a'),('read','a')]),[['a'],True,False])
check('uninitialized sibling',solve(['a','b'],[('init',['a']),('read','b')]),[['a'],False])
check('empty whole',solve([], [('whole',None)]),[True])
check('partial whole',solve(['a','b'],[('init',['a']),('whole',None)]),[['a'],False])
check('reassign empty',solve(['a'],[('assign','a'),('read','a')]),[['a'],True])
check('drop clears',solve(['a'],[('init',['a']),('drop',None),('read','a')]),[['a'],['a'],False])
check('storage reset',solve(['a'],[('init',['a']),('reset',None),('read','a')]),[['a'],[],False])
check('copy preserves',solve(['a'],[('init',['a']),('copy','a'),('read','a')]),[['a'],True,True])
check('join intersection',solve(['a','b'],[('init',['a']),('merge',['b']),('available',None)]),[['a'],[],[]])
check('available subset',solve(['a','b'],[('init',['a']),('available',None)]),[['a'],['a']])
check('variant leaf',solve([x],[('init',[x]),('move',x),('available',None)]),[[x],True,[]])
check('record arity',solve(list(range(N+1)),[('init',list(range(N+1))),('move',N),('available',None)]),[list(range(N+1)),True,list(range(N))])
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:
Storage death preserves leaf facts into a reused slot.

Static path initialization lattice for a record with declared leaf names. Commands init/move/read/whole/assign/drop/reset/copy/merge/available. init and assign initialize one leaf. move consumes only initialized named leaf and reports success; read tests one; whole tests all. drop consumes all and reports previously initialized names. reset clears; copy tests without consumption. merge intersects current initialized leaves with supplied branch leaves. available returns sorted initialized names. Unknown leaves never initialize. Return one result per command. This is definite-initialization analysis, not runtime borrowing.

split: open-access