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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    stack=[]
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='push': stack.append(set(cmd[1]) & full)
        elif op=='dup': stack.append(set(stack[-1]))
        elif op=='swap': stack[-2],stack[-1]=stack[-2],stack[-1]
        elif op=='not': stack[-1]=full-stack[-1]
        elif op=='clear': stack[-1].clear()
        elif op=='draw': out.append(sorted(stack[-1]))
        else:
            right=stack.pop()
            left=stack.pop()
            if op=='and': result=left & right
            elif op=='or': result=left | right
            elif op=='xor': result=left ^ right
            elif op=='subtract': result=left-right
            elif op=='implies': result=(full-left)|right
            else: result=full-(left^right)
            stack.append(result)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 4), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 4), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 4), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 4), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 4), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 4), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 4), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 4), [[2, 3]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 4), [[1, 3]])
if N == 2:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 5), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 5), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 5), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 5), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 5), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 5), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 5), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 5), [[2, 3, 4]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 5), [[1, 3, 4]])
if N == 3:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 6), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 6), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 6), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 6), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 6), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 6), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 6), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 6), [[2, 3, 4, 5]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 6), [[1, 3, 4, 5]])
if N == 4:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 7), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 7), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 7), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 7), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 7), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 7), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 7), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 7), [[2, 3, 4, 5, 6]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 7), [[1, 3, 4, 5, 6]])
if N == 5:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 8), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 8), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 8), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 8), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 8), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 8), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 8), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 8), [[2, 3, 4, 5, 6, 7]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 8), [[1, 3, 4, 5, 6, 7]])
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(commands, size):
    full=set(range(size))
    stack=[]
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='push': stack.append(set(cmd[1]) & full)
        elif op=='dup': stack.append(set(stack[-1]))
        elif op=='swap': stack[-2],stack[-1]=set(stack[-2]),set(stack[-1])
        elif op=='not': stack[-1]=full-stack[-1]
        elif op=='clear': stack[-1].clear()
        elif op=='draw': out.append(sorted(stack[-1]))
        else:
            right=stack.pop()
            left=stack.pop()
            if op=='and': result=left & right
            elif op=='or': result=left | right
            elif op=='xor': result=left ^ right
            elif op=='subtract': result=left-right
            elif op=='implies': result=(full-left)|right
            else: result=full-(left^right)
            stack.append(result)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 4), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 4), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 4), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 4), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 4), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 4), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 4), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 4), [[2, 3]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 4), [[1, 3]])
if N == 2:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 5), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 5), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 5), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 5), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 5), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 5), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 5), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 5), [[2, 3, 4]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 5), [[1, 3, 4]])
if N == 3:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 6), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 6), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 6), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 6), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 6), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 6), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 6), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 6), [[2, 3, 4, 5]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 6), [[1, 3, 4, 5]])
if N == 4:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 7), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 7), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 7), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 7), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 7), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 7), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 7), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 7), [[2, 3, 4, 5, 6]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 7), [[1, 3, 4, 5, 6]])
if N == 5:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 8), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 8), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 8), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 8), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 8), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 8), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 8), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 8), [[2, 3, 4, 5, 6, 7]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 8), [[1, 3, 4, 5, 6, 7]])
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:
Operand swap is lost before a directional region subtraction.

A postfix region program evaluates finite sample sets. Binary operands preserve left/right order. Complement uses the target universe. Named masks are copied on push; duplicate copies the top value. Subtraction, intersection, union and XOR consume both operands. Draw peeks without consuming. Empty-stack operations are outside this bounded contract.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    stack=[]
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='push': stack.append(set(cmd[1]) & full)
        elif op=='dup': stack.append(set(stack[-1]))
        elif op=='swap': stack[-2],stack[-1]=stack[-1],stack[-2]
        elif op=='not': stack[-1]=set()-stack[-1]
        elif op=='clear': stack[-1].clear()
        elif op=='draw': out.append(sorted(stack[-1]))
        else:
            right=stack.pop()
            left=stack.pop()
            if op=='and': result=left & right
            elif op=='or': result=left | right
            elif op=='xor': result=left ^ right
            elif op=='subtract': result=left-right
            elif op=='implies': result=(full-left)|right
            else: result=full-(left^right)
            stack.append(result)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 4), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 4), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 4), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 4), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 4), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 4), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 4), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 4), [[2, 3]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 4), [[1, 3]])
if N == 2:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 5), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 5), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 5), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 5), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 5), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 5), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 5), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 5), [[2, 3, 4]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 5), [[1, 3, 4]])
if N == 3:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 6), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 6), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 6), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 6), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 6), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 6), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 6), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 6), [[2, 3, 4, 5]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 6), [[1, 3, 4, 5]])
if N == 4:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 7), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 7), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 7), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 7), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 7), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 7), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 7), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 7), [[2, 3, 4, 5, 6]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 7), [[1, 3, 4, 5, 6]])
if N == 5:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 8), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 8), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 8), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 8), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 8), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 8), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 8), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 8), [[2, 3, 4, 5, 6, 7]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 8), [[1, 3, 4, 5, 6, 7]])
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(commands, size):
    full=set(range(size))
    stack=[]
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='push': stack.append(set(cmd[1]) & full)
        elif op=='dup': stack.append(set(stack[-1]))
        elif op=='swap': stack[-2],stack[-1]=stack[-1],stack[-2]
        elif op=='not': stack[-1]=full if not stack[-1] else set()
        elif op=='clear': stack[-1].clear()
        elif op=='draw': out.append(sorted(stack[-1]))
        else:
            right=stack.pop()
            left=stack.pop()
            if op=='and': result=left & right
            elif op=='or': result=left | right
            elif op=='xor': result=left ^ right
            elif op=='subtract': result=left-right
            elif op=='implies': result=(full-left)|right
            else: result=full-(left^right)
            stack.append(result)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 4), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 4), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 4), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 4), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 4), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 4), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 4), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 4), [[2, 3]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 4), [[1, 3]])
if N == 2:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 5), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 5), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 5), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 5), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 5), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 5), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 5), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 5), [[2, 3, 4]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 5), [[1, 3, 4]])
if N == 3:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 6), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 6), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 6), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 6), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 6), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 6), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 6), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 6), [[2, 3, 4, 5]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 6), [[1, 3, 4, 5]])
if N == 4:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 7), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 7), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 7), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 7), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 7), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 7), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 7), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 7), [[2, 3, 4, 5, 6]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 7), [[1, 3, 4, 5, 6]])
if N == 5:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 8), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 8), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 8), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 8), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 8), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 8), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 8), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 8), [[2, 3, 4, 5, 6, 7]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 8), [[1, 3, 4, 5, 6, 7]])
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:
Complement uses an empty universe and rejects all samples.

A postfix region program evaluates finite sample sets. Binary operands preserve left/right order. Complement uses the target universe. Named masks are copied on push; duplicate copies the top value. Subtraction, intersection, union and XOR consume both operands. Draw peeks without consuming. Empty-stack operations are outside this bounded contract.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    stack=[]
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='push': stack.append(set(cmd[1]) & full)
        elif op=='dup': stack.append(set(stack[-1]))
        elif op=='swap': stack[-2],stack[-1]=stack[-1],stack[-2]
        elif op=='not': stack[-1]=full-stack[-1]
        elif op=='clear': stack[-1].clear()
        elif op=='draw': out.append(sorted(stack[-1]))
        else:
            right=stack.pop()
            left=stack.pop()
            if op=='and': result=left | right
            elif op=='or': result=left | right
            elif op=='xor': result=left ^ right
            elif op=='subtract': result=left-right
            elif op=='implies': result=(full-left)|right
            else: result=full-(left^right)
            stack.append(result)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 4), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 4), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 4), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 4), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 4), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 4), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 4), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 4), [[2, 3]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 4), [[1, 3]])
if N == 2:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 5), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 5), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 5), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 5), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 5), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 5), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 5), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 5), [[2, 3, 4]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 5), [[1, 3, 4]])
if N == 3:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 6), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 6), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 6), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 6), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 6), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 6), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 6), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 6), [[2, 3, 4, 5]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 6), [[1, 3, 4, 5]])
if N == 4:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 7), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 7), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 7), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 7), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 7), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 7), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 7), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 7), [[2, 3, 4, 5, 6]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 7), [[1, 3, 4, 5, 6]])
if N == 5:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 8), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 8), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 8), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 8), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 8), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 8), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 8), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 8), [[2, 3, 4, 5, 6, 7]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 8), [[1, 3, 4, 5, 6, 7]])
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(commands, size):
    full=set(range(size))
    stack=[]
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='push': stack.append(set(cmd[1]) & full)
        elif op=='dup': stack.append(set(stack[-1]))
        elif op=='swap': stack[-2],stack[-1]=stack[-1],stack[-2]
        elif op=='not': stack[-1]=full-stack[-1]
        elif op=='clear': stack[-1].clear()
        elif op=='draw': out.append(sorted(stack[-1]))
        else:
            right=stack.pop()
            left=stack.pop()
            if op=='and': result=left if right else set()
            elif op=='or': result=left | right
            elif op=='xor': result=left ^ right
            elif op=='subtract': result=left-right
            elif op=='implies': result=(full-left)|right
            else: result=full-(left^right)
            stack.append(result)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 4), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 4), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 4), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 4), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 4), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 4), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 4), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 4), [[2, 3]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 4), [[1, 3]])
if N == 2:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 5), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 5), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 5), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 5), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 5), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 5), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 5), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 5), [[2, 3, 4]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 5), [[1, 3, 4]])
if N == 3:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 6), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 6), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 6), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 6), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 6), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 6), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 6), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 6), [[2, 3, 4, 5]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 6), [[1, 3, 4, 5]])
if N == 4:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 7), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 7), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 7), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 7), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 7), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 7), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 7), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 7), [[2, 3, 4, 5, 6]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 7), [[1, 3, 4, 5, 6]])
if N == 5:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 8), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 8), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 8), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 8), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 8), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 8), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 8), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 8), [[2, 3, 4, 5, 6, 7]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 8), [[1, 3, 4, 5, 6, 7]])
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:
Intersection evaluates region union and exposes singly covered samples.

A postfix region program evaluates finite sample sets. Binary operands preserve left/right order. Complement uses the target universe. Named masks are copied on push; duplicate copies the top value. Subtraction, intersection, union and XOR consume both operands. Draw peeks without consuming. Empty-stack operations are outside this bounded contract.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    stack=[]
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='push': stack.append(set(cmd[1]) & full)
        elif op=='dup': stack.append(set(stack[-1]))
        elif op=='swap': stack[-2],stack[-1]=stack[-1],stack[-2]
        elif op=='not': stack[-1]=full-stack[-1]
        elif op=='clear': stack[-1].clear()
        elif op=='draw': out.append(sorted(stack[-1]))
        else:
            right=stack.pop()
            left=stack.pop()
            if op=='and': result=left & right
            elif op=='or': result=left ^ right
            elif op=='xor': result=left ^ right
            elif op=='subtract': result=left-right
            elif op=='implies': result=(full-left)|right
            else: result=full-(left^right)
            stack.append(result)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 4), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 4), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 4), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 4), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 4), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 4), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 4), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 4), [[2, 3]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 4), [[1, 3]])
if N == 2:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 5), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 5), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 5), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 5), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 5), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 5), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 5), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 5), [[2, 3, 4]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 5), [[1, 3, 4]])
if N == 3:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 6), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 6), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 6), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 6), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 6), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 6), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 6), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 6), [[2, 3, 4, 5]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 6), [[1, 3, 4, 5]])
if N == 4:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 7), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 7), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 7), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 7), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 7), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 7), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 7), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 7), [[2, 3, 4, 5, 6]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 7), [[1, 3, 4, 5, 6]])
if N == 5:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 8), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 8), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 8), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 8), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 8), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 8), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 8), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 8), [[2, 3, 4, 5, 6, 7]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 8), [[1, 3, 4, 5, 6, 7]])
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(commands, size):
    full=set(range(size))
    stack=[]
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='push': stack.append(set(cmd[1]) & full)
        elif op=='dup': stack.append(set(stack[-1]))
        elif op=='swap': stack[-2],stack[-1]=stack[-1],stack[-2]
        elif op=='not': stack[-1]=full-stack[-1]
        elif op=='clear': stack[-1].clear()
        elif op=='draw': out.append(sorted(stack[-1]))
        else:
            right=stack.pop()
            left=stack.pop()
            if op=='and': result=left & right
            elif op=='or': result=left if left else right
            elif op=='xor': result=left ^ right
            elif op=='subtract': result=left-right
            elif op=='implies': result=(full-left)|right
            else: result=full-(left^right)
            stack.append(result)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 4), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 4), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 4), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 4), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 4), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 4), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 4), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 4), [[2, 3]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 4), [[1, 3]])
if N == 2:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 5), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 5), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 5), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 5), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 5), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 5), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 5), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 5), [[2, 3, 4]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 5), [[1, 3, 4]])
if N == 3:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 6), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 6), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 6), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 6), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 6), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 6), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 6), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 6), [[2, 3, 4, 5]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 6), [[1, 3, 4, 5]])
if N == 4:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 7), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 7), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 7), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 7), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 7), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 7), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 7), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 7), [[2, 3, 4, 5, 6]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 7), [[1, 3, 4, 5, 6]])
if N == 5:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 8), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 8), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 8), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 8), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 8), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 8), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 8), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 8), [[2, 3, 4, 5, 6, 7]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 8), [[1, 3, 4, 5, 6, 7]])
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 union drops samples present in both masks.

A postfix region program evaluates finite sample sets. Binary operands preserve left/right order. Complement uses the target universe. Named masks are copied on push; duplicate copies the top value. Subtraction, intersection, union and XOR consume both operands. Draw peeks without consuming. Empty-stack operations are outside this bounded contract.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    stack=[]
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='push': stack.append(set(cmd[1]) & full)
        elif op=='dup': stack.append(set(stack[-1]))
        elif op=='swap': stack[-2],stack[-1]=stack[-1],stack[-2]
        elif op=='not': stack[-1]=full-stack[-1]
        elif op=='clear': stack[-1].clear()
        elif op=='draw': out.append(sorted(stack[-1]))
        else:
            right=stack.pop()
            left=stack.pop()
            if op=='and': result=left & right
            elif op=='or': result=left | right
            elif op=='xor': result=left | right
            elif op=='subtract': result=left-right
            elif op=='implies': result=(full-left)|right
            else: result=full-(left^right)
            stack.append(result)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 4), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 4), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 4), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 4), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 4), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 4), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 4), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 4), [[2, 3]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 4), [[1, 3]])
if N == 2:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 5), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 5), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 5), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 5), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 5), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 5), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 5), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 5), [[2, 3, 4]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 5), [[1, 3, 4]])
if N == 3:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 6), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 6), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 6), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 6), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 6), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 6), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 6), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 6), [[2, 3, 4, 5]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 6), [[1, 3, 4, 5]])
if N == 4:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 7), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 7), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 7), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 7), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 7), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 7), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 7), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 7), [[2, 3, 4, 5, 6]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 7), [[1, 3, 4, 5, 6]])
if N == 5:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 8), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 8), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 8), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 8), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 8), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 8), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 8), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 8), [[2, 3, 4, 5, 6, 7]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 8), [[1, 3, 4, 5, 6, 7]])
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(commands, size):
    full=set(range(size))
    stack=[]
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='push': stack.append(set(cmd[1]) & full)
        elif op=='dup': stack.append(set(stack[-1]))
        elif op=='swap': stack[-2],stack[-1]=stack[-1],stack[-2]
        elif op=='not': stack[-1]=full-stack[-1]
        elif op=='clear': stack[-1].clear()
        elif op=='draw': out.append(sorted(stack[-1]))
        else:
            right=stack.pop()
            left=stack.pop()
            if op=='and': result=left & right
            elif op=='or': result=left | right
            elif op=='xor': result=left-right
            elif op=='subtract': result=left-right
            elif op=='implies': result=(full-left)|right
            else: result=full-(left^right)
            stack.append(result)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 4), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 4), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 4), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 4), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 4), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 4), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 4), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 4), [[2, 3]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 4), [[1, 3]])
if N == 2:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 5), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 5), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 5), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 5), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 5), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 5), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 5), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 5), [[2, 3, 4]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 5), [[1, 3, 4]])
if N == 3:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 6), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 6), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 6), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 6), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 6), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 6), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 6), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 6), [[2, 3, 4, 5]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 6), [[1, 3, 4, 5]])
if N == 4:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 7), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 7), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 7), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 7), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 7), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 7), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 7), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 7), [[2, 3, 4, 5, 6]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 7), [[1, 3, 4, 5, 6]])
if N == 5:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 8), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 8), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 8), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 8), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 8), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 8), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 8), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 8), [[2, 3, 4, 5, 6, 7]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 8), [[1, 3, 4, 5, 6, 7]])
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:
Exclusive region composition retains overlapping coverage.

A postfix region program evaluates finite sample sets. Binary operands preserve left/right order. Complement uses the target universe. Named masks are copied on push; duplicate copies the top value. Subtraction, intersection, union and XOR consume both operands. Draw peeks without consuming. Empty-stack operations are outside this bounded contract.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    stack=[]
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='push': stack.append(set(cmd[1]) & full)
        elif op=='dup': stack.append(set(stack[-1]))
        elif op=='swap': stack[-2],stack[-1]=stack[-1],stack[-2]
        elif op=='not': stack[-1]=full-stack[-1]
        elif op=='clear': stack[-1].clear()
        elif op=='draw': out.append(sorted(stack[-1]))
        else:
            right=stack.pop()
            left=stack.pop()
            if op=='and': result=left & right
            elif op=='or': result=left | right
            elif op=='xor': result=left ^ right
            elif op=='subtract': result=right-left
            elif op=='implies': result=(full-left)|right
            else: result=full-(left^right)
            stack.append(result)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 4), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 4), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 4), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 4), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 4), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 4), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 4), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 4), [[2, 3]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 4), [[1, 3]])
if N == 2:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 5), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 5), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 5), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 5), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 5), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 5), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 5), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 5), [[2, 3, 4]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 5), [[1, 3, 4]])
if N == 3:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 6), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 6), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 6), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 6), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 6), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 6), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 6), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 6), [[2, 3, 4, 5]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 6), [[1, 3, 4, 5]])
if N == 4:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 7), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 7), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 7), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 7), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 7), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 7), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 7), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 7), [[2, 3, 4, 5, 6]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 7), [[1, 3, 4, 5, 6]])
if N == 5:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 8), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 8), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 8), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 8), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 8), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 8), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 8), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 8), [[2, 3, 4, 5, 6, 7]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 8), [[1, 3, 4, 5, 6, 7]])
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(commands, size):
    full=set(range(size))
    stack=[]
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='push': stack.append(set(cmd[1]) & full)
        elif op=='dup': stack.append(set(stack[-1]))
        elif op=='swap': stack[-2],stack[-1]=stack[-1],stack[-2]
        elif op=='not': stack[-1]=full-stack[-1]
        elif op=='clear': stack[-1].clear()
        elif op=='draw': out.append(sorted(stack[-1]))
        else:
            right=stack.pop()
            left=stack.pop()
            if op=='and': result=left & right
            elif op=='or': result=left | right
            elif op=='xor': result=left ^ right
            elif op=='subtract': result=left ^ right
            elif op=='implies': result=(full-left)|right
            else: result=full-(left^right)
            stack.append(result)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 4), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 4), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 4), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 4), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 4), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 4), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 4), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 4), [[1, 2, 3]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 4), [[2, 3]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 4), [[1, 3]])
if N == 2:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 5), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 5), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 5), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 5), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 5), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 5), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 5), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 5), [[1, 2, 3, 4]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 5), [[2, 3, 4]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 5), [[1, 3, 4]])
if N == 3:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 6), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 6), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 6), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 6), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 6), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 6), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 6), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 6), [[1, 2, 3, 4, 5]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 6), [[2, 3, 4, 5]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 6), [[1, 3, 4, 5]])
if N == 4:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 7), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 7), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 7), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 7), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 7), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 7), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 7), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 7), [[1, 2, 3, 4, 5, 6]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 7), [[2, 3, 4, 5, 6]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 7), [[1, 3, 4, 5, 6]])
if N == 5:
    check('explicit sequence 0', solve([['push', [0, 99]], ['draw']], 8), [[0]])
    check('explicit sequence 1', solve([['push', [0, 1]], ['dup'], ['clear'], ['swap'], ['draw']], 8), [[0, 1]])
    check('explicit sequence 2', solve([['push', [0, 1]], ['push', [1, 2]], ['swap'], ['subtract'], ['draw']], 8), [[2]])
    check('explicit sequence 3', solve([['push', [0]], ['not'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 4', solve([['push', [0, 1]], ['push', [1, 2]], ['and'], ['draw']], 8), [[1]])
    check('explicit sequence 5', solve([['push', [0, 1]], ['push', [1, 2]], ['or'], ['draw']], 8), [[0, 1, 2]])
    check('explicit sequence 6', solve([['push', [0, 1]], ['push', [1, 2]], ['xor'], ['draw']], 8), [[0, 2]])
    check('explicit sequence 7', solve([['push', [0, 1]], ['push', [1, 2]], ['subtract'], ['draw']], 8), [[0]])
    check('explicit sequence 8', solve([['push', [0]], ['push', [1]], ['implies'], ['draw']], 8), [[1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 9', solve([['push', [0]], ['push', [1]], ['equal'], ['draw']], 8), [[2, 3, 4, 5, 6, 7]])
    check('explicit sequence 10', solve([['push', [0, 1]], ['push', [1, 2]], ['equal'], ['draw']], 8), [[1, 3, 4, 5, 6, 7]])
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:
Directional region subtraction reverses its operands.

A postfix region program evaluates finite sample sets. Binary operands preserve left/right order. Complement uses the target universe. Named masks are copied on push; duplicate copies the top value. Subtraction, intersection, union and XOR consume both operands. Draw peeks without consuming. Empty-stack operations are outside this bounded contract.

split: open-access