{"abstract":"A latched mode or fault memory is lost after a controller power cycle.","category":"PLC ladder logic scan cycles","checks":8,"contract":"Latch (OTL), unlatch (OTU) and non-retentive output (OTE) rungs executed in program order each scan. rungs is a list of [instr, bit, condition_tag]; the rung is true when the condition input is true, or, for condition S:FS, on the first scan after power-up. A scan item {\"power_cycle\": true} models a power cycle: prescan clears only OTE destination bits, OTL/OTU bits are retentive, and the next scan is a first scan; it also reports the post-prescan state. OTL sets and OTU clears its bit only when its rung is true; the later rung wins. Return the sorted true bits after each item.","contract_signature":"rungs, scans","evaluation_group":"w2-plc-ladder-logic-scan-cycles-otl-otu-retentive","failed_approach":"Excluding only bits written by OTL still clears latched bits that also have an OTU rung.","family":"w2-plc-ladder-logic-scan-cycles-otl-otu-retentive-latch-retention","id":"FA-92031","implementations":{"attempt":{"sha256":"c87aa601ce53161746217213b32013b6e908ad3cc37911e26a7823c332b29588","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rungs, scans):\n    bits = {}\n    first = True\n    out = []\n    for scan in scans:\n        if scan.get('power_cycle'):\n            for instr, bit, cond in rungs:\n                if instr != 'OTL':\n                    bits[bit] = False\n            first = True\n            out.append(sorted(b for b, v in bits.items() if v))\n            continue\n        for instr, bit, cond in rungs:\n            rung = first if cond == 'S:FS' else bool(scan.get(cond, False))\n            if instr == 'OTE':\n                bits[bit] = rung\n            elif rung and instr == 'OTL':\n                bits[bit] = True\n            elif rung and instr == 'OTU':\n                bits[bit] = False\n        first = False\n        out.append(sorted(b for b, v in bits.items() if v))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: latched through power cycle',\n   [[['OTL', 'B:0', 'I:0'], ['OTU', 'B:0', 'I:1'], ['OTE', 'B:1', 'I:0'], ['OTE', 'B:2', 'S:FS']],\n    [{'I:0': True}, {}, {'power_cycle': True}, {}, {'I:1': True}]],\n   [['B:0', 'B:1', 'B:2'], ['B:0'], ['B:0'], ['B:0', 'B:2'], []]],\n  ['regression: scenario 6',\n   [[['OTU', 'B:2', 'I:0'],\n     ['OTU', 'B:0', 'I:1'],\n     ['OTL', 'B:2', 'I:2'],\n     ['OTL', 'B:0', 'I:0'],\n     ['OTL', 'B:2', 'I:1'],\n     ['OTL', 'B:2', 'I:2']],\n    [{'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'power_cycle': True},\n     {'I:0': True, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': False}]],\n   [[], ['B:2'], ['B:2'], ['B:2'], ['B:0', 'B:2'], ['B:0', 'B:2']]],\n  ['control: unlatch listed before latch',\n   [[['OTU', 'B:3', 'I:1'], ['OTL', 'B:3', 'I:0']], [{'I:0': True, 'I:1': True}, {}, {'I:1': True}]],\n   [['B:3'], ['B:3'], []]],\n  ['regression: first-scan output then power cycle',\n   [[['OTE', 'B:2', 'S:FS'], ['OTL', 'B:0', 'S:FS']], [{}, {'power_cycle': True}, {}, {}]],\n   [['B:0', 'B:2'], ['B:0'], ['B:0', 'B:2'], ['B:0']]],\n  ['regression: latch then idle',\n   [[['OTL', 'B:1', 'I:2'], ['OTE', 'B:0', 'I:2']], [{'I:2': True}, {}, {'power_cycle': True}, {}]],\n   [['B:0', 'B:1'], ['B:1'], ['B:1'], ['B:1']]],\n  ['control: scenario 1',\n   [[['OTL', 'B:3', 'I:2'],\n     ['OTL', 'B:0', 'I:0'],\n     ['OTE', 'B:0', 'S:FS'],\n     ['OTL', 'B:1', 'S:FS'],\n     ['OTU', 'B:1', 'S:FS'],\n     ['OTE', 'B:2', 'I:1']],\n    [{'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': True}]],\n   [['B:0'], [], ['B:2', 'B:3'], ['B:3'], ['B:3'], ['B:3'], ['B:2', 'B:3'], ['B:2', 'B:3'], ['B:3']]],\n  ['regression: scenario 2',\n   [[['OTU', 'B:2', 'I:1'], ['OTL', 'B:1', 'I:1'], ['OTL', 'B:1', 'I:2'], ['OTL', 'B:0', 'I:0']],\n    [{'I:0': True, 'I:1': False, 'I:2': False},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': True, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': True, 'I:2': True}]],\n   [['B:0'],\n    ['B:0'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1']]],\n  ['regression: scenario 3',\n   [[['OTE', 'B:3', 'I:2'],\n     ['OTE', 'B:1', 'I:1'],\n     ['OTL', 'B:2', 'I:0'],\n     ['OTL', 'B:2', 'I:2'],\n     ['OTL', 'B:2', 'I:0']],\n    [{'I:0': True, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'power_cycle': True}]],\n   [['B:1', 'B:2', 'B:3'], ['B:2', 'B:3'], ['B:1', 'B:2'], ['B:2'], ['B:2']]]],\n [['regression: first-scan output then power cycle',\n   [[['OTE', 'B:2', 'S:FS'], ['OTL', 'B:0', 'S:FS']], [{}, {'power_cycle': True}, {}, {}]],\n   [['B:0', 'B:2'], ['B:0'], ['B:0', 'B:2'], ['B:0']]],\n  ['regression: scenario 37',\n   [[['OTU', 'B:0', 'S:FS'], ['OTL', 'B:3', 'I:0'], ['OTL', 'B:1', 'I:0'], ['OTL', 'B:0', 'I:1']],\n    [{'I:0': False, 'I:1': False, 'I:2': False},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'power_cycle': True},\n     {'I:0': True, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'power_cycle': True}]],\n   [[], [], [], [], ['B:1', 'B:3'], ['B:0', 'B:1', 'B:3'], ['B:0', 'B:1', 'B:3']]],\n  ['regression: latched through power cycle',\n   [[['OTL', 'B:0', 'I:0'], ['OTU', 'B:0', 'I:1'], ['OTE', 'B:1', 'I:0'], ['OTE', 'B:2', 'S:FS']],\n    [{'I:0': True}, {}, {'power_cycle': True}, {}, {'I:1': True}]],\n   [['B:0', 'B:1', 'B:2'], ['B:0'], ['B:0'], ['B:0', 'B:2'], []]],\n  ['control: unlatch listed before latch',\n   [[['OTU', 'B:3', 'I:1'], ['OTL', 'B:3', 'I:0']], [{'I:0': True, 'I:1': True}, {}, {'I:1': True}]],\n   [['B:3'], ['B:3'], []]],\n  ['regression: latch then idle',\n   [[['OTL', 'B:1', 'I:2'], ['OTE', 'B:0', 'I:2']], [{'I:2': True}, {}, {'power_cycle': True}, {}]],\n   [['B:0', 'B:1'], ['B:1'], ['B:1'], ['B:1']]],\n  ['control: scenario 1',\n   [[['OTE', 'B:3', 'S:FS'], ['OTL', 'B:0', 'S:FS'], ['OTL', 'B:0', 'I:0'], ['OTE', 'B:0', 'S:FS']],\n    [{'I:0': True, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False}]],\n   [['B:0', 'B:3'], [], [], [], [], []]],\n  ['regression: scenario 2',\n   [[['OTL', 'B:2', 'I:1'], ['OTL', 'B:3', 'I:2'], ['OTU', 'B:0', 'I:0'], ['OTL', 'B:0', 'S:FS']],\n    [{'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': True, 'I:2': False}]],\n   [['B:0', 'B:3'],\n    ['B:2', 'B:3'],\n    ['B:2', 'B:3'],\n    ['B:2', 'B:3'],\n    ['B:2', 'B:3'],\n    ['B:0', 'B:2', 'B:3'],\n    ['B:0', 'B:2', 'B:3']]],\n  ['control: scenario 3',\n   [[['OTL', 'B:2', 'I:0'],\n     ['OTL', 'B:3', 'S:FS'],\n     ['OTL', 'B:2', 'I:2'],\n     ['OTL', 'B:1', 'S:FS'],\n     ['OTL', 'B:3', 'I:2']],\n    [{'power_cycle': True},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': False}]],\n   [[],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3']]]],\n [['regression: latch then idle',\n   [[['OTL', 'B:1', 'I:2'], ['OTE', 'B:0', 'I:2']], [{'I:2': True}, {}, {'power_cycle': True}, {}]],\n   [['B:0', 'B:1'], ['B:1'], ['B:1'], ['B:1']]],\n  ['regression: scenario 7',\n   [[['OTU', 'B:3', 'I:2'],\n     ['OTU', 'B:0', 'I:1'],\n     ['OTL', 'B:0', 'I:2'],\n     ['OTU', 'B:2', 'I:0'],\n     ['OTL', 'B:0', 'S:FS'],\n     ['OTL', 'B:1', 'S:FS']],\n    [{'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'power_cycle': True}]],\n   [['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1']]],\n  ['regression: latched through power cycle',\n   [[['OTL', 'B:0', 'I:0'], ['OTU', 'B:0', 'I:1'], ['OTE', 'B:1', 'I:0'], ['OTE', 'B:2', 'S:FS']],\n    [{'I:0': True}, {}, {'power_cycle': True}, {}, {'I:1': True}]],\n   [['B:0', 'B:1', 'B:2'], ['B:0'], ['B:0'], ['B:0', 'B:2'], []]],\n  ['control: unlatch listed before latch',\n   [[['OTU', 'B:3', 'I:1'], ['OTL', 'B:3', 'I:0']], [{'I:0': True, 'I:1': True}, {}, {'I:1': True}]],\n   [['B:3'], ['B:3'], []]],\n  ['regression: first-scan output then power cycle',\n   [[['OTE', 'B:2', 'S:FS'], ['OTL', 'B:0', 'S:FS']], [{}, {'power_cycle': True}, {}, {}]],\n   [['B:0', 'B:2'], ['B:0'], ['B:0', 'B:2'], ['B:0']]],\n  ['regression: scenario 1',\n   [[['OTL', 'B:3', 'I:2'], ['OTE', 'B:1', 'I:0'], ['OTL', 'B:1', 'I:0']],\n    [{'power_cycle': True},\n     {'power_cycle': True},\n     {'I:0': True, 'I:1': True, 'I:2': True},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': True}]],\n   [[], [], ['B:1', 'B:3'], ['B:1', 'B:3'], ['B:3'], ['B:3']]],\n  ['regression: scenario 2',\n   [[['OTL', 'B:0', 'I:2'], ['OTL', 'B:2', 'S:FS'], ['OTU', 'B:0', 'I:2'], ['OTU', 'B:3', 'I:2']],\n    [{'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': True},\n     {'power_cycle': True},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': True}]],\n   [['B:2'], ['B:2'], ['B:2'], ['B:2'], ['B:2']]],\n  ['regression: scenario 3',\n   [[['OTU', 'B:0', 'I:0'], ['OTL', 'B:0', 'I:0'], ['OTE', 'B:3', 'I:0']],\n    [{'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'power_cycle': True},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'power_cycle': True}]],\n   [[], [], [], [], ['B:0', 'B:3'], ['B:0']]]],\n [['regression: scenario 1',\n   [[['OTL', 'B:3', 'I:1'],\n     ['OTL', 'B:1', 'S:FS'],\n     ['OTU', 'B:1', 'S:FS'],\n     ['OTL', 'B:0', 'S:FS'],\n     ['OTE', 'B:2', 'I:0']],\n    [{'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'power_cycle': True},\n     {'power_cycle': True}]],\n   [['B:0', 'B:2'], ['B:0', 'B:3'], ['B:0', 'B:2', 'B:3'], ['B:0', 'B:3'], ['B:0', 'B:3']]],\n  ['regression: scenario 17',\n   [[['OTU', 'B:2', 'I:2'],\n     ['OTL', 'B:2', 'I:1'],\n     ['OTU', 'B:1', 'I:0'],\n     ['OTU', 'B:2', 'I:2'],\n     ['OTL', 'B:1', 'I:2']],\n    [{'I:0': True, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'power_cycle': True},\n     {'I:0': True, 'I:1': True, 'I:2': True},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': True}]],\n   [['B:2'], ['B:2'], ['B:2'], ['B:2'], ['B:2'], ['B:1'], ['B:2'], ['B:1']]],\n  ['regression: latched through power cycle',\n   [[['OTL', 'B:0', 'I:0'], ['OTU', 'B:0', 'I:1'], ['OTE', 'B:1', 'I:0'], ['OTE', 'B:2', 'S:FS']],\n    [{'I:0': True}, {}, {'power_cycle': True}, {}, {'I:1': True}]],\n   [['B:0', 'B:1', 'B:2'], ['B:0'], ['B:0'], ['B:0', 'B:2'], []]],\n  ['control: unlatch listed before latch',\n   [[['OTU', 'B:3', 'I:1'], ['OTL', 'B:3', 'I:0']], [{'I:0': True, 'I:1': True}, {}, {'I:1': True}]],\n   [['B:3'], ['B:3'], []]],\n  ['regression: first-scan output then power cycle',\n   [[['OTE', 'B:2', 'S:FS'], ['OTL', 'B:0', 'S:FS']], [{}, {'power_cycle': True}, {}, {}]],\n   [['B:0', 'B:2'], ['B:0'], ['B:0', 'B:2'], ['B:0']]],\n  ['regression: latch then idle',\n   [[['OTL', 'B:1', 'I:2'], ['OTE', 'B:0', 'I:2']], [{'I:2': True}, {}, {'power_cycle': True}, {}]],\n   [['B:0', 'B:1'], ['B:1'], ['B:1'], ['B:1']]],\n  ['control: scenario 2',\n   [[['OTE', 'B:1', 'I:1'],\n     ['OTU', 'B:3', 'I:2'],\n     ['OTL', 'B:1', 'I:0'],\n     ['OTL', 'B:1', 'I:0'],\n     ['OTL', 'B:3', 'I:2'],\n     ['OTL', 'B:3', 'I:1']],\n    [{'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'I:0': True, 'I:1': True, 'I:2': True},\n     {'I:0': True, 'I:1': False, 'I:2': False}]],\n   [['B:1', 'B:3'], ['B:3'], ['B:1', 'B:3'], ['B:1', 'B:3'], ['B:1', 'B:3'], ['B:1', 'B:3']]],\n  ['regression: scenario 3',\n   [[['OTU', 'B:3', 'I:0'],\n     ['OTL', 'B:1', 'I:0'],\n     ['OTE', 'B:1', 'S:FS'],\n     ['OTU', 'B:2', 'S:FS'],\n     ['OTL', 'B:2', 'I:1'],\n     ['OTU', 'B:1', 'S:FS']],\n    [{'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': True},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False}]],\n   [[], [], ['B:2'], ['B:2'], ['B:2'], ['B:2'], [], []]]],\n [['regression: scenario 3',\n   [[['OTU', 'B:0', 'S:FS'],\n     ['OTU', 'B:1', 'S:FS'],\n     ['OTU', 'B:3', 'I:0'],\n     ['OTL', 'B:2', 'I:1'],\n     ['OTL', 'B:1', 'I:2'],\n     ['OTU', 'B:0', 'S:FS']],\n    [{'power_cycle': True},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': True}]],\n   [[],\n    ['B:2'],\n    ['B:2'],\n    ['B:2'],\n    ['B:2'],\n    ['B:1', 'B:2'],\n    ['B:1', 'B:2'],\n    ['B:1', 'B:2'],\n    ['B:1', 'B:2'],\n    ['B:1', 'B:2']]],\n  ['regression: scenario 25',\n   [[['OTE', 'B:0', 'S:FS'],\n     ['OTL', 'B:3', 'I:2'],\n     ['OTU', 'B:1', 'I:0'],\n     ['OTU', 'B:3', 'S:FS'],\n     ['OTL', 'B:0', 'S:FS']],\n    [{'power_cycle': True},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': True, 'I:1': False, 'I:2': True},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'power_cycle': True}]],\n   [[], ['B:0'], ['B:3'], ['B:3'], ['B:3'], ['B:3'], ['B:3']]],\n  ['regression: latched through power cycle',\n   [[['OTL', 'B:0', 'I:0'], ['OTU', 'B:0', 'I:1'], ['OTE', 'B:1', 'I:0'], ['OTE', 'B:2', 'S:FS']],\n    [{'I:0': True}, {}, {'power_cycle': True}, {}, {'I:1': True}]],\n   [['B:0', 'B:1', 'B:2'], ['B:0'], ['B:0'], ['B:0', 'B:2'], []]],\n  ['control: unlatch listed before latch',\n   [[['OTU', 'B:3', 'I:1'], ['OTL', 'B:3', 'I:0']], [{'I:0': True, 'I:1': True}, {}, {'I:1': True}]],\n   [['B:3'], ['B:3'], []]],\n  ['regression: first-scan output then power cycle',\n   [[['OTE', 'B:2', 'S:FS'], ['OTL', 'B:0', 'S:FS']], [{}, {'power_cycle': True}, {}, {}]],\n   [['B:0', 'B:2'], ['B:0'], ['B:0', 'B:2'], ['B:0']]],\n  ['regression: latch then idle',\n   [[['OTL', 'B:1', 'I:2'], ['OTE', 'B:0', 'I:2']], [{'I:2': True}, {}, {'power_cycle': True}, {}]],\n   [['B:0', 'B:1'], ['B:1'], ['B:1'], ['B:1']]],\n  ['control: scenario 1',\n   [[['OTL', 'B:3', 'S:FS'],\n     ['OTL', 'B:1', 'I:1'],\n     ['OTL', 'B:2', 'S:FS'],\n     ['OTL', 'B:1', 'I:0'],\n     ['OTL', 'B:1', 'I:1']],\n    [{'power_cycle': True},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': False}]],\n   [[],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3']]],\n  ['regression: scenario 2',\n   [[['OTU', 'B:0', 'I:2'], ['OTE', 'B:2', 'I:0'], ['OTL', 'B:1', 'I:2']],\n    [{'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': True},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': True, 'I:2': False}]],\n   [[], [], ['B:2'], ['B:2'], ['B:2'], ['B:1', 'B:2'], ['B:1', 'B:2'], ['B:1'], ['B:1']]]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"740f84fda34b963c630e2c2522b8681824960e422aaa2b159de7c58f653dd496","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rungs, scans):\n    bits = {}\n    first = True\n    out = []\n    for scan in scans:\n        if scan.get('power_cycle'):\n            for instr, bit, cond in rungs:\n                bits[bit] = False\n            first = True\n            out.append(sorted(b for b, v in bits.items() if v))\n            continue\n        for instr, bit, cond in rungs:\n            rung = first if cond == 'S:FS' else bool(scan.get(cond, False))\n            if instr == 'OTE':\n                bits[bit] = rung\n            elif rung and instr == 'OTL':\n                bits[bit] = True\n            elif rung and instr == 'OTU':\n                bits[bit] = False\n        first = False\n        out.append(sorted(b for b, v in bits.items() if v))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: latched through power cycle',\n   [[['OTL', 'B:0', 'I:0'], ['OTU', 'B:0', 'I:1'], ['OTE', 'B:1', 'I:0'], ['OTE', 'B:2', 'S:FS']],\n    [{'I:0': True}, {}, {'power_cycle': True}, {}, {'I:1': True}]],\n   [['B:0', 'B:1', 'B:2'], ['B:0'], ['B:0'], ['B:0', 'B:2'], []]],\n  ['regression: scenario 6',\n   [[['OTU', 'B:2', 'I:0'],\n     ['OTU', 'B:0', 'I:1'],\n     ['OTL', 'B:2', 'I:2'],\n     ['OTL', 'B:0', 'I:0'],\n     ['OTL', 'B:2', 'I:1'],\n     ['OTL', 'B:2', 'I:2']],\n    [{'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'power_cycle': True},\n     {'I:0': True, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': False}]],\n   [[], ['B:2'], ['B:2'], ['B:2'], ['B:0', 'B:2'], ['B:0', 'B:2']]],\n  ['control: unlatch listed before latch',\n   [[['OTU', 'B:3', 'I:1'], ['OTL', 'B:3', 'I:0']], [{'I:0': True, 'I:1': True}, {}, {'I:1': True}]],\n   [['B:3'], ['B:3'], []]],\n  ['regression: first-scan output then power cycle',\n   [[['OTE', 'B:2', 'S:FS'], ['OTL', 'B:0', 'S:FS']], [{}, {'power_cycle': True}, {}, {}]],\n   [['B:0', 'B:2'], ['B:0'], ['B:0', 'B:2'], ['B:0']]],\n  ['regression: latch then idle',\n   [[['OTL', 'B:1', 'I:2'], ['OTE', 'B:0', 'I:2']], [{'I:2': True}, {}, {'power_cycle': True}, {}]],\n   [['B:0', 'B:1'], ['B:1'], ['B:1'], ['B:1']]],\n  ['control: scenario 1',\n   [[['OTL', 'B:3', 'I:2'],\n     ['OTL', 'B:0', 'I:0'],\n     ['OTE', 'B:0', 'S:FS'],\n     ['OTL', 'B:1', 'S:FS'],\n     ['OTU', 'B:1', 'S:FS'],\n     ['OTE', 'B:2', 'I:1']],\n    [{'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': True}]],\n   [['B:0'], [], ['B:2', 'B:3'], ['B:3'], ['B:3'], ['B:3'], ['B:2', 'B:3'], ['B:2', 'B:3'], ['B:3']]],\n  ['regression: scenario 2',\n   [[['OTU', 'B:2', 'I:1'], ['OTL', 'B:1', 'I:1'], ['OTL', 'B:1', 'I:2'], ['OTL', 'B:0', 'I:0']],\n    [{'I:0': True, 'I:1': False, 'I:2': False},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': True, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': True, 'I:2': True}]],\n   [['B:0'],\n    ['B:0'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1']]],\n  ['regression: scenario 3',\n   [[['OTE', 'B:3', 'I:2'],\n     ['OTE', 'B:1', 'I:1'],\n     ['OTL', 'B:2', 'I:0'],\n     ['OTL', 'B:2', 'I:2'],\n     ['OTL', 'B:2', 'I:0']],\n    [{'I:0': True, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'power_cycle': True}]],\n   [['B:1', 'B:2', 'B:3'], ['B:2', 'B:3'], ['B:1', 'B:2'], ['B:2'], ['B:2']]]],\n [['regression: first-scan output then power cycle',\n   [[['OTE', 'B:2', 'S:FS'], ['OTL', 'B:0', 'S:FS']], [{}, {'power_cycle': True}, {}, {}]],\n   [['B:0', 'B:2'], ['B:0'], ['B:0', 'B:2'], ['B:0']]],\n  ['regression: scenario 37',\n   [[['OTU', 'B:0', 'S:FS'], ['OTL', 'B:3', 'I:0'], ['OTL', 'B:1', 'I:0'], ['OTL', 'B:0', 'I:1']],\n    [{'I:0': False, 'I:1': False, 'I:2': False},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'power_cycle': True},\n     {'I:0': True, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'power_cycle': True}]],\n   [[], [], [], [], ['B:1', 'B:3'], ['B:0', 'B:1', 'B:3'], ['B:0', 'B:1', 'B:3']]],\n  ['regression: latched through power cycle',\n   [[['OTL', 'B:0', 'I:0'], ['OTU', 'B:0', 'I:1'], ['OTE', 'B:1', 'I:0'], ['OTE', 'B:2', 'S:FS']],\n    [{'I:0': True}, {}, {'power_cycle': True}, {}, {'I:1': True}]],\n   [['B:0', 'B:1', 'B:2'], ['B:0'], ['B:0'], ['B:0', 'B:2'], []]],\n  ['control: unlatch listed before latch',\n   [[['OTU', 'B:3', 'I:1'], ['OTL', 'B:3', 'I:0']], [{'I:0': True, 'I:1': True}, {}, {'I:1': True}]],\n   [['B:3'], ['B:3'], []]],\n  ['regression: latch then idle',\n   [[['OTL', 'B:1', 'I:2'], ['OTE', 'B:0', 'I:2']], [{'I:2': True}, {}, {'power_cycle': True}, {}]],\n   [['B:0', 'B:1'], ['B:1'], ['B:1'], ['B:1']]],\n  ['control: scenario 1',\n   [[['OTE', 'B:3', 'S:FS'], ['OTL', 'B:0', 'S:FS'], ['OTL', 'B:0', 'I:0'], ['OTE', 'B:0', 'S:FS']],\n    [{'I:0': True, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False}]],\n   [['B:0', 'B:3'], [], [], [], [], []]],\n  ['regression: scenario 2',\n   [[['OTL', 'B:2', 'I:1'], ['OTL', 'B:3', 'I:2'], ['OTU', 'B:0', 'I:0'], ['OTL', 'B:0', 'S:FS']],\n    [{'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': True, 'I:2': False}]],\n   [['B:0', 'B:3'],\n    ['B:2', 'B:3'],\n    ['B:2', 'B:3'],\n    ['B:2', 'B:3'],\n    ['B:2', 'B:3'],\n    ['B:0', 'B:2', 'B:3'],\n    ['B:0', 'B:2', 'B:3']]],\n  ['control: scenario 3',\n   [[['OTL', 'B:2', 'I:0'],\n     ['OTL', 'B:3', 'S:FS'],\n     ['OTL', 'B:2', 'I:2'],\n     ['OTL', 'B:1', 'S:FS'],\n     ['OTL', 'B:3', 'I:2']],\n    [{'power_cycle': True},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': False}]],\n   [[],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3']]]],\n [['regression: latch then idle',\n   [[['OTL', 'B:1', 'I:2'], ['OTE', 'B:0', 'I:2']], [{'I:2': True}, {}, {'power_cycle': True}, {}]],\n   [['B:0', 'B:1'], ['B:1'], ['B:1'], ['B:1']]],\n  ['regression: scenario 7',\n   [[['OTU', 'B:3', 'I:2'],\n     ['OTU', 'B:0', 'I:1'],\n     ['OTL', 'B:0', 'I:2'],\n     ['OTU', 'B:2', 'I:0'],\n     ['OTL', 'B:0', 'S:FS'],\n     ['OTL', 'B:1', 'S:FS']],\n    [{'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'power_cycle': True}]],\n   [['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1'],\n    ['B:0', 'B:1']]],\n  ['regression: latched through power cycle',\n   [[['OTL', 'B:0', 'I:0'], ['OTU', 'B:0', 'I:1'], ['OTE', 'B:1', 'I:0'], ['OTE', 'B:2', 'S:FS']],\n    [{'I:0': True}, {}, {'power_cycle': True}, {}, {'I:1': True}]],\n   [['B:0', 'B:1', 'B:2'], ['B:0'], ['B:0'], ['B:0', 'B:2'], []]],\n  ['control: unlatch listed before latch',\n   [[['OTU', 'B:3', 'I:1'], ['OTL', 'B:3', 'I:0']], [{'I:0': True, 'I:1': True}, {}, {'I:1': True}]],\n   [['B:3'], ['B:3'], []]],\n  ['regression: first-scan output then power cycle',\n   [[['OTE', 'B:2', 'S:FS'], ['OTL', 'B:0', 'S:FS']], [{}, {'power_cycle': True}, {}, {}]],\n   [['B:0', 'B:2'], ['B:0'], ['B:0', 'B:2'], ['B:0']]],\n  ['regression: scenario 1',\n   [[['OTL', 'B:3', 'I:2'], ['OTE', 'B:1', 'I:0'], ['OTL', 'B:1', 'I:0']],\n    [{'power_cycle': True},\n     {'power_cycle': True},\n     {'I:0': True, 'I:1': True, 'I:2': True},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': True}]],\n   [[], [], ['B:1', 'B:3'], ['B:1', 'B:3'], ['B:3'], ['B:3']]],\n  ['regression: scenario 2',\n   [[['OTL', 'B:0', 'I:2'], ['OTL', 'B:2', 'S:FS'], ['OTU', 'B:0', 'I:2'], ['OTU', 'B:3', 'I:2']],\n    [{'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': True},\n     {'power_cycle': True},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': True}]],\n   [['B:2'], ['B:2'], ['B:2'], ['B:2'], ['B:2']]],\n  ['regression: scenario 3',\n   [[['OTU', 'B:0', 'I:0'], ['OTL', 'B:0', 'I:0'], ['OTE', 'B:3', 'I:0']],\n    [{'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'power_cycle': True},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'power_cycle': True}]],\n   [[], [], [], [], ['B:0', 'B:3'], ['B:0']]]],\n [['regression: scenario 1',\n   [[['OTL', 'B:3', 'I:1'],\n     ['OTL', 'B:1', 'S:FS'],\n     ['OTU', 'B:1', 'S:FS'],\n     ['OTL', 'B:0', 'S:FS'],\n     ['OTE', 'B:2', 'I:0']],\n    [{'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'power_cycle': True},\n     {'power_cycle': True}]],\n   [['B:0', 'B:2'], ['B:0', 'B:3'], ['B:0', 'B:2', 'B:3'], ['B:0', 'B:3'], ['B:0', 'B:3']]],\n  ['regression: scenario 17',\n   [[['OTU', 'B:2', 'I:2'],\n     ['OTL', 'B:2', 'I:1'],\n     ['OTU', 'B:1', 'I:0'],\n     ['OTU', 'B:2', 'I:2'],\n     ['OTL', 'B:1', 'I:2']],\n    [{'I:0': True, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'power_cycle': True},\n     {'I:0': True, 'I:1': True, 'I:2': True},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': True}]],\n   [['B:2'], ['B:2'], ['B:2'], ['B:2'], ['B:2'], ['B:1'], ['B:2'], ['B:1']]],\n  ['regression: latched through power cycle',\n   [[['OTL', 'B:0', 'I:0'], ['OTU', 'B:0', 'I:1'], ['OTE', 'B:1', 'I:0'], ['OTE', 'B:2', 'S:FS']],\n    [{'I:0': True}, {}, {'power_cycle': True}, {}, {'I:1': True}]],\n   [['B:0', 'B:1', 'B:2'], ['B:0'], ['B:0'], ['B:0', 'B:2'], []]],\n  ['control: unlatch listed before latch',\n   [[['OTU', 'B:3', 'I:1'], ['OTL', 'B:3', 'I:0']], [{'I:0': True, 'I:1': True}, {}, {'I:1': True}]],\n   [['B:3'], ['B:3'], []]],\n  ['regression: first-scan output then power cycle',\n   [[['OTE', 'B:2', 'S:FS'], ['OTL', 'B:0', 'S:FS']], [{}, {'power_cycle': True}, {}, {}]],\n   [['B:0', 'B:2'], ['B:0'], ['B:0', 'B:2'], ['B:0']]],\n  ['regression: latch then idle',\n   [[['OTL', 'B:1', 'I:2'], ['OTE', 'B:0', 'I:2']], [{'I:2': True}, {}, {'power_cycle': True}, {}]],\n   [['B:0', 'B:1'], ['B:1'], ['B:1'], ['B:1']]],\n  ['control: scenario 2',\n   [[['OTE', 'B:1', 'I:1'],\n     ['OTU', 'B:3', 'I:2'],\n     ['OTL', 'B:1', 'I:0'],\n     ['OTL', 'B:1', 'I:0'],\n     ['OTL', 'B:3', 'I:2'],\n     ['OTL', 'B:3', 'I:1']],\n    [{'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': True},\n     {'I:0': True, 'I:1': True, 'I:2': True},\n     {'I:0': True, 'I:1': False, 'I:2': False}]],\n   [['B:1', 'B:3'], ['B:3'], ['B:1', 'B:3'], ['B:1', 'B:3'], ['B:1', 'B:3'], ['B:1', 'B:3']]],\n  ['regression: scenario 3',\n   [[['OTU', 'B:3', 'I:0'],\n     ['OTL', 'B:1', 'I:0'],\n     ['OTE', 'B:1', 'S:FS'],\n     ['OTU', 'B:2', 'S:FS'],\n     ['OTL', 'B:2', 'I:1'],\n     ['OTU', 'B:1', 'S:FS']],\n    [{'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': True},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False}]],\n   [[], [], ['B:2'], ['B:2'], ['B:2'], ['B:2'], [], []]]],\n [['regression: scenario 3',\n   [[['OTU', 'B:0', 'S:FS'],\n     ['OTU', 'B:1', 'S:FS'],\n     ['OTU', 'B:3', 'I:0'],\n     ['OTL', 'B:2', 'I:1'],\n     ['OTL', 'B:1', 'I:2'],\n     ['OTU', 'B:0', 'S:FS']],\n    [{'power_cycle': True},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': True}]],\n   [[],\n    ['B:2'],\n    ['B:2'],\n    ['B:2'],\n    ['B:2'],\n    ['B:1', 'B:2'],\n    ['B:1', 'B:2'],\n    ['B:1', 'B:2'],\n    ['B:1', 'B:2'],\n    ['B:1', 'B:2']]],\n  ['regression: scenario 25',\n   [[['OTE', 'B:0', 'S:FS'],\n     ['OTL', 'B:3', 'I:2'],\n     ['OTU', 'B:1', 'I:0'],\n     ['OTU', 'B:3', 'S:FS'],\n     ['OTL', 'B:0', 'S:FS']],\n    [{'power_cycle': True},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': True, 'I:1': False, 'I:2': True},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'power_cycle': True}]],\n   [[], ['B:0'], ['B:3'], ['B:3'], ['B:3'], ['B:3'], ['B:3']]],\n  ['regression: latched through power cycle',\n   [[['OTL', 'B:0', 'I:0'], ['OTU', 'B:0', 'I:1'], ['OTE', 'B:1', 'I:0'], ['OTE', 'B:2', 'S:FS']],\n    [{'I:0': True}, {}, {'power_cycle': True}, {}, {'I:1': True}]],\n   [['B:0', 'B:1', 'B:2'], ['B:0'], ['B:0'], ['B:0', 'B:2'], []]],\n  ['control: unlatch listed before latch',\n   [[['OTU', 'B:3', 'I:1'], ['OTL', 'B:3', 'I:0']], [{'I:0': True, 'I:1': True}, {}, {'I:1': True}]],\n   [['B:3'], ['B:3'], []]],\n  ['regression: first-scan output then power cycle',\n   [[['OTE', 'B:2', 'S:FS'], ['OTL', 'B:0', 'S:FS']], [{}, {'power_cycle': True}, {}, {}]],\n   [['B:0', 'B:2'], ['B:0'], ['B:0', 'B:2'], ['B:0']]],\n  ['regression: latch then idle',\n   [[['OTL', 'B:1', 'I:2'], ['OTE', 'B:0', 'I:2']], [{'I:2': True}, {}, {'power_cycle': True}, {}]],\n   [['B:0', 'B:1'], ['B:1'], ['B:1'], ['B:1']]],\n  ['control: scenario 1',\n   [[['OTL', 'B:3', 'S:FS'],\n     ['OTL', 'B:1', 'I:1'],\n     ['OTL', 'B:2', 'S:FS'],\n     ['OTL', 'B:1', 'I:0'],\n     ['OTL', 'B:1', 'I:1']],\n    [{'power_cycle': True},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'I:0': False, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': True, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': True},\n     {'I:0': False, 'I:1': False, 'I:2': False}]],\n   [[],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3'],\n    ['B:1', 'B:2', 'B:3']]],\n  ['regression: scenario 2',\n   [[['OTU', 'B:0', 'I:2'], ['OTE', 'B:2', 'I:0'], ['OTL', 'B:1', 'I:2']],\n    [{'power_cycle': True},\n     {'I:0': False, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': False},\n     {'I:0': True, 'I:1': False, 'I:2': True},\n     {'I:0': True, 'I:1': True, 'I:2': False},\n     {'power_cycle': True},\n     {'I:0': False, 'I:1': True, 'I:2': False}]],\n   [[], [], ['B:2'], ['B:2'], ['B:2'], ['B:1', 'B:2'], ['B:1', 'B:2'], ['B:1'], ['B:1']]]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic bounded teaching model of one PLC instruction or rung pattern evaluated scan by scan. The stated contract is a stipulated toy convention, not a claim of conformance to any vendor controller or IEC 61131-3 runtime. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-plc-ladder-logic-scan-cycles-otl-otu-retentive-latch-retention","generated_at":"2026-09-29T14:51:41.863124+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Ladder programs are executed as repeated scans; each defect here changes what a rung, timer, counter or data-table instruction reports on a particular scan, which is how commissioning and field faults are actually observed.","root_cause":"Prescan clears every destination bit, including OTL/OTU targets.","sha256":"db9782e9d7d461d1ac0ded5cafdc58badb903d57793d5939eff6d048bdeadd84","title":"Power cycle clears latched OTL bits · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":43.024,"exit_code":1,"observations":[{"actual":[["B:0","B:1","B:2"],["B:0"],[],["B:2"],[]],"check":"regression: latched through power cycle","expected":[["B:0","B:1","B:2"],["B:0"],["B:0"],["B:0","B:2"],[]],"passed":false},{"actual":[[],["B:2"],["B:2"],[],["B:0","B:2"],["B:0","B:2"]],"check":"regression: scenario 6","expected":[[],["B:2"],["B:2"],["B:2"],["B:0","B:2"],["B:0","B:2"]],"passed":false},{"actual":[["B:3"],["B:3"],[]],"check":"control: unlatch listed before latch","expected":[["B:3"],["B:3"],[]],"passed":true},{"actual":[["B:0","B:2"],["B:0"],["B:0","B:2"],["B:0"]],"check":"regression: first-scan output then power cycle","expected":[["B:0","B:2"],["B:0"],["B:0","B:2"],["B:0"]],"passed":true},{"actual":[["B:0","B:1"],["B:1"],["B:1"],["B:1"]],"check":"regression: latch then idle","expected":[["B:0","B:1"],["B:1"],["B:1"],["B:1"]],"passed":true},{"actual":[["B:0"],[],["B:2","B:3"],["B:3"],["B:3"],["B:3"],["B:2","B:3"],["B:2","B:3"],["B:3"]],"check":"control: scenario 1","expected":[["B:0"],[],["B:2","B:3"],["B:3"],["B:3"],["B:3"],["B:2","B:3"],["B:2","B:3"],["B:3"]],"passed":true},{"actual":[["B:0"],["B:0"],["B:0","B:1"],["B:0","B:1"],["B:0","B:1"],["B:0","B:1"],["B:0","B:1"],["B:0","B:1"],["B:0","B:1"]],"check":"regression: scenario 2","expected":[["B:0"],["B:0"],["B:0","B:1"],["B:0","B:1"],["B:0","B:1"],["B:0","B:1"],["B:0","B:1"],["B:0","B:1"],["B:0","B:1"]],"passed":true},{"actual":[["B:1","B:2","B:3"],["B:2","B:3"],["B:1","B:2"],["B:2"],["B:2"]],"check":"regression: scenario 3","expected":[["B:1","B:2","B:3"],["B:2","B:3"],["B:1","B:2"],["B:2"],["B:2"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: latched through power cycle\", \"actual\": [[\"B:0\", \"B:1\", \"B:2\"], [\"B:0\"], [], [\"B:2\"], []], \"expected\": [[\"B:0\", \"B:1\", \"B:2\"], [\"B:0\"], [\"B:0\"], [\"B:0\", \"B:2\"], []], \"passed\": false}, {\"check\": \"regression: scenario 6\", \"actual\": [[], [\"B:2\"], [\"B:2\"], [], [\"B:0\", \"B:2\"], [\"B:0\", \"B:2\"]], \"expected\": [[], [\"B:2\"], [\"B:2\"], [\"B:2\"], [\"B:0\", \"B:2\"], [\"B:0\", \"B:2\"]], \"passed\": false}, {\"check\": \"control: unlatch listed before latch\", \"actual\": [[\"B:3\"], [\"B:3\"], []], \"expected\": [[\"B:3\"], [\"B:3\"], []], \"passed\": true}, {\"check\": \"regression: first-scan output then power cycle\", \"actual\": [[\"B:0\", \"B:2\"], [\"B:0\"], [\"B:0\", \"B:2\"], [\"B:0\"]], \"expected\": [[\"B:0\", \"B:2\"], [\"B:0\"], [\"B:0\", \"B:2\"], [\"B:0\"]], \"passed\": true}, {\"check\": \"regression: latch then idle\", \"actual\": [[\"B:0\", \"B:1\"], [\"B:1\"], [\"B:1\"], [\"B:1\"]], \"expected\": [[\"B:0\", \"B:1\"], [\"B:1\"], [\"B:1\"], [\"B:1\"]], \"passed\": true}, {\"check\": \"control: scenario 1\", \"actual\": [[\"B:0\"], [], [\"B:2\", \"B:3\"], [\"B:3\"], [\"B:3\"], [\"B:3\"], [\"B:2\", \"B:3\"], [\"B:2\", \"B:3\"], [\"B:3\"]], \"expected\": [[\"B:0\"], [], [\"B:2\", \"B:3\"], [\"B:3\"], [\"B:3\"], [\"B:3\"], [\"B:2\", \"B:3\"], [\"B:2\", \"B:3\"], [\"B:3\"]], \"passed\": true}, {\"check\": \"regression: scenario 2\", \"actual\": [[\"B:0\"], [\"B:0\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"]], \"expected\": [[\"B:0\"], [\"B:0\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"]], \"passed\": true}, {\"check\": \"regression: scenario 3\", \"actual\": [[\"B:1\", \"B:2\", \"B:3\"], [\"B:2\", \"B:3\"], [\"B:1\", \"B:2\"], [\"B:2\"], [\"B:2\"]], \"expected\": [[\"B:1\", \"B:2\", \"B:3\"], [\"B:2\", \"B:3\"], [\"B:1\", \"B:2\"], [\"B:2\"], [\"B:2\"]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.556,"exit_code":1,"observations":[{"actual":[["B:0","B:1","B:2"],["B:0"],[],["B:2"],[]],"check":"regression: latched through power cycle","expected":[["B:0","B:1","B:2"],["B:0"],["B:0"],["B:0","B:2"],[]],"passed":false},{"actual":[[],["B:2"],["B:2"],[],["B:0","B:2"],["B:0","B:2"]],"check":"regression: scenario 6","expected":[[],["B:2"],["B:2"],["B:2"],["B:0","B:2"],["B:0","B:2"]],"passed":false},{"actual":[["B:3"],["B:3"],[]],"check":"control: unlatch listed before latch","expected":[["B:3"],["B:3"],[]],"passed":true},{"actual":[["B:0","B:2"],[],["B:0","B:2"],["B:0"]],"check":"regression: first-scan output then power cycle","expected":[["B:0","B:2"],["B:0"],["B:0","B:2"],["B:0"]],"passed":false},{"actual":[["B:0","B:1"],["B:1"],[],[]],"check":"regression: latch then idle","expected":[["B:0","B:1"],["B:1"],["B:1"],["B:1"]],"passed":false},{"actual":[["B:0"],[],["B:2","B:3"],["B:3"],["B:3"],["B:3"],["B:2","B:3"],["B:2","B:3"],["B:3"]],"check":"control: scenario 1","expected":[["B:0"],[],["B:2","B:3"],["B:3"],["B:3"],["B:3"],["B:2","B:3"],["B:2","B:3"],["B:3"]],"passed":true},{"actual":[["B:0"],[],["B:1"],["B:0","B:1"],["B:0","B:1"],[],["B:1"],["B:1"],["B:1"]],"check":"regression: scenario 2","expected":[["B:0"],["B:0"],["B:0","B:1"],["B:0","B:1"],["B:0","B:1"],["B:0","B:1"],["B:0","B:1"],["B:0","B:1"],["B:0","B:1"]],"passed":false},{"actual":[["B:1","B:2","B:3"],["B:2","B:3"],["B:1","B:2"],["B:2"],[]],"check":"regression: scenario 3","expected":[["B:1","B:2","B:3"],["B:2","B:3"],["B:1","B:2"],["B:2"],["B:2"]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: latched through power cycle\", \"actual\": [[\"B:0\", \"B:1\", \"B:2\"], [\"B:0\"], [], [\"B:2\"], []], \"expected\": [[\"B:0\", \"B:1\", \"B:2\"], [\"B:0\"], [\"B:0\"], [\"B:0\", \"B:2\"], []], \"passed\": false}, {\"check\": \"regression: scenario 6\", \"actual\": [[], [\"B:2\"], [\"B:2\"], [], [\"B:0\", \"B:2\"], [\"B:0\", \"B:2\"]], \"expected\": [[], [\"B:2\"], [\"B:2\"], [\"B:2\"], [\"B:0\", \"B:2\"], [\"B:0\", \"B:2\"]], \"passed\": false}, {\"check\": \"control: unlatch listed before latch\", \"actual\": [[\"B:3\"], [\"B:3\"], []], \"expected\": [[\"B:3\"], [\"B:3\"], []], \"passed\": true}, {\"check\": \"regression: first-scan output then power cycle\", \"actual\": [[\"B:0\", \"B:2\"], [], [\"B:0\", \"B:2\"], [\"B:0\"]], \"expected\": [[\"B:0\", \"B:2\"], [\"B:0\"], [\"B:0\", \"B:2\"], [\"B:0\"]], \"passed\": false}, {\"check\": \"regression: latch then idle\", \"actual\": [[\"B:0\", \"B:1\"], [\"B:1\"], [], []], \"expected\": [[\"B:0\", \"B:1\"], [\"B:1\"], [\"B:1\"], [\"B:1\"]], \"passed\": false}, {\"check\": \"control: scenario 1\", \"actual\": [[\"B:0\"], [], [\"B:2\", \"B:3\"], [\"B:3\"], [\"B:3\"], [\"B:3\"], [\"B:2\", \"B:3\"], [\"B:2\", \"B:3\"], [\"B:3\"]], \"expected\": [[\"B:0\"], [], [\"B:2\", \"B:3\"], [\"B:3\"], [\"B:3\"], [\"B:3\"], [\"B:2\", \"B:3\"], [\"B:2\", \"B:3\"], [\"B:3\"]], \"passed\": true}, {\"check\": \"regression: scenario 2\", \"actual\": [[\"B:0\"], [], [\"B:1\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"], [], [\"B:1\"], [\"B:1\"], [\"B:1\"]], \"expected\": [[\"B:0\"], [\"B:0\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"], [\"B:0\", \"B:1\"]], \"passed\": false}, {\"check\": \"regression: scenario 3\", \"actual\": [[\"B:1\", \"B:2\", \"B:3\"], [\"B:2\", \"B:3\"], [\"B:1\", \"B:2\"], [\"B:2\"], []], \"expected\": [[\"B:1\", \"B:2\", \"B:3\"], [\"B:2\", \"B:3\"], [\"B:1\", \"B:2\"], [\"B:2\"], [\"B:2\"]], \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}