FA-80931 / Music interval and transposition theory / Open access
Spelled transposition by named interval: diminished imperfect interval equals minor · case 01
C4 up a diminished seventh returns Bb4 instead of Bbb4; diminished thirds and sixths collapse onto minor.
ROOT CAUSE
The diminished offset for imperfect intervals is one semitone below major, which is the minor size.
VERIFIED REPAIR
Restore the diminished imperfect offset step so that it reads `'A': 1, 'd': -2}`.
Unsuccessful approach: Using three semitones below major overshoots to a doubly diminished size.
Case contract
Input [note, interval, direction]. note: letter, # or b accidentals, nonnegative octave. interval: quality letter (P, M, m, A, d) and generic number >= 1 with perfect-class numbers 1, 4, 5 (compounds reduce by 7). Direction up or down moves the letter by number-1 steps and the pitch by the interval size; the result is spelled with the moved letter, octave taken from the letter position. Results needing more than two accidentals, or a negative octave, return None.
Why this case matters
Pitch spelling and interval arithmetic decide the notes that notation, transposition and analysis tools display or play.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
base = {'C': 0, 'D': 2, 'E': 4, 'F': 5, 'G': 7, 'A': 9, 'B': 11}
if not isinstance(x, list) or len(x) != 3:
return None
note, ivl, direction = x
if direction not in ('up', 'down'):
return None
if not isinstance(note, str) or len(note) < 2 or note[0] not in base:
return None
i = 1
acc = 0
while i < len(note) and note[i] in '#b':
acc += 1 if note[i] == '#' else -1
i += 1
if not note[i:].isdigit():
return None
octave = int(note[i:])
if not isinstance(ivl, str) or len(ivl) < 2 or not ivl[1:].isdigit():
return None
quality = ivl[0]
number = int(ivl[1:])
if number < 1:
return None
simple = (number - 1) % 7 + 1
perfect = simple in (1, 4, 5)
offsets = {'P': 0, 'A': 1, 'd': -1} if perfect else {'M': 0, 'm': -1, 'A': 1, 'd': -1}
if quality not in offsets:
return None
size = [0, 2, 4, 5, 7, 9, 11][simple - 1] + 12 * ((number - 1) // 7) + offsets[quality]
sign = 1 if direction == 'up' else -1
idx = 'CDEFGAB'.index(note[0]) + 7 * octave + sign * (number - 1)
pitch = 12 * octave + base[note[0]] + acc + sign * size
letter = 'CDEFGAB'[idx % 7]
new_octave = idx // 7
new_acc = pitch - (12 * new_octave + base[letter])
if abs(new_acc) > 2 or new_octave < 0:
return None
return letter + ('#' * new_acc if new_acc > 0 else 'b' * -new_acc) + str(new_octave)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[(['C4', 'M3', 'up'], 'E4'), (['C4', 'M3', 'down'], 'Ab3'), (['B3', 'm2', 'up'], 'C4'), (['C4', 'm2', 'down'], 'B3'), (['E4', 'A4', 'up'], 'A#4'), (['C4', 'd7', 'up'], 'Bbb4'), (['Db4', 'd3', 'up'], 'Fbb4'), (['Bb4', 'd2', 'up'], 'Cbb5')], [(['C4', 'm2', 'down'], 'B3'), (['E4', 'A4', 'up'], 'A#4'), (['F#4', 'A4', 'up'], 'B#4'), (['C4', 'd5', 'up'], 'Gb4'), (['C4', 'd7', 'up'], 'Bbb4'), (['C4', 'd3', 'up'], 'Ebb4'), (['Cb4', 'd3', 'up'], None), (['C4', 'P8', 'up'], 'C5')], [(['C4', 'd5', 'up'], 'Gb4'), (['C4', 'd3', 'up'], 'Ebb4'), (['Db4', 'd3', 'up'], 'Fbb4'), (['C4', 'P8', 'up'], 'C5'), (['C4', 'M9', 'up'], 'D5'), (['C4', 'M10', 'down'], 'Ab2'), (['G4', 'P5', 'up'], 'D5'), (['Bb4', 'd2', 'up'], 'Cbb5')], [(['C4', 'd7', 'up'], 'Bbb4'), (['Db4', 'd3', 'up'], 'Fbb4'), (['Cb4', 'd3', 'up'], None), (['C4', 'M10', 'down'], 'Ab2'), (['G4', 'P5', 'up'], 'D5'), (['A4', 'M6', 'up'], 'F#5'), (['E#4', 'A6', 'up'], None), (['Bb4', 'd2', 'up'], 'Cbb5')], [(['C4', 'd7', 'up'], 'Bbb4'), (['C4', 'd3', 'up'], 'Ebb4'), (['E#4', 'A6', 'up'], None), (['C0', 'm2', 'down'], None), (['C4', 'X3', 'up'], None), (['C4', 'M4', 'up'], None), (['C4', 'P3', 'up'], None), (['Bb4', 'd2', 'up'], 'Cbb5')]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("oracle %d" % i, solve(args), expected)
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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oracle 0 | E4 | E4 | Passed |
| oracle 1 | Ab3 | Ab3 | Passed |
| oracle 2 | C4 | C4 | Passed |
| oracle 3 | B3 | B3 | Passed |
| oracle 4 | A#4 | A#4 | Passed |
| oracle 5 | Bb4 | Bbb4 | Failed |
| oracle 6 | Fb4 | Fbb4 | Failed |
| oracle 7 | Cb5 | Cbb5 | Failed |
SHA-256 / be40161e0149dc8105302e91ab808cb3007afe9c61c2c11bd29f6517bd422908
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
base = {'C': 0, 'D': 2, 'E': 4, 'F': 5, 'G': 7, 'A': 9, 'B': 11}
if not isinstance(x, list) or len(x) != 3:
return None
note, ivl, direction = x
if direction not in ('up', 'down'):
return None
if not isinstance(note, str) or len(note) < 2 or note[0] not in base:
return None
i = 1
acc = 0
while i < len(note) and note[i] in '#b':
acc += 1 if note[i] == '#' else -1
i += 1
if not note[i:].isdigit():
return None
octave = int(note[i:])
if not isinstance(ivl, str) or len(ivl) < 2 or not ivl[1:].isdigit():
return None
quality = ivl[0]
number = int(ivl[1:])
if number < 1:
return None
simple = (number - 1) % 7 + 1
perfect = simple in (1, 4, 5)
offsets = {'P': 0, 'A': 1, 'd': -1} if perfect else {'M': 0, 'm': -1, 'A': 1, 'd': -3}
if quality not in offsets:
return None
size = [0, 2, 4, 5, 7, 9, 11][simple - 1] + 12 * ((number - 1) // 7) + offsets[quality]
sign = 1 if direction == 'up' else -1
idx = 'CDEFGAB'.index(note[0]) + 7 * octave + sign * (number - 1)
pitch = 12 * octave + base[note[0]] + acc + sign * size
letter = 'CDEFGAB'[idx % 7]
new_octave = idx // 7
new_acc = pitch - (12 * new_octave + base[letter])
if abs(new_acc) > 2 or new_octave < 0:
return None
return letter + ('#' * new_acc if new_acc > 0 else 'b' * -new_acc) + str(new_octave)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[(['C4', 'M3', 'up'], 'E4'), (['C4', 'M3', 'down'], 'Ab3'), (['B3', 'm2', 'up'], 'C4'), (['C4', 'm2', 'down'], 'B3'), (['E4', 'A4', 'up'], 'A#4'), (['C4', 'd7', 'up'], 'Bbb4'), (['Db4', 'd3', 'up'], 'Fbb4'), (['Bb4', 'd2', 'up'], 'Cbb5')], [(['C4', 'm2', 'down'], 'B3'), (['E4', 'A4', 'up'], 'A#4'), (['F#4', 'A4', 'up'], 'B#4'), (['C4', 'd5', 'up'], 'Gb4'), (['C4', 'd7', 'up'], 'Bbb4'), (['C4', 'd3', 'up'], 'Ebb4'), (['Cb4', 'd3', 'up'], None), (['C4', 'P8', 'up'], 'C5')], [(['C4', 'd5', 'up'], 'Gb4'), (['C4', 'd3', 'up'], 'Ebb4'), (['Db4', 'd3', 'up'], 'Fbb4'), (['C4', 'P8', 'up'], 'C5'), (['C4', 'M9', 'up'], 'D5'), (['C4', 'M10', 'down'], 'Ab2'), (['G4', 'P5', 'up'], 'D5'), (['Bb4', 'd2', 'up'], 'Cbb5')], [(['C4', 'd7', 'up'], 'Bbb4'), (['Db4', 'd3', 'up'], 'Fbb4'), (['Cb4', 'd3', 'up'], None), (['C4', 'M10', 'down'], 'Ab2'), (['G4', 'P5', 'up'], 'D5'), (['A4', 'M6', 'up'], 'F#5'), (['E#4', 'A6', 'up'], None), (['Bb4', 'd2', 'up'], 'Cbb5')], [(['C4', 'd7', 'up'], 'Bbb4'), (['C4', 'd3', 'up'], 'Ebb4'), (['E#4', 'A6', 'up'], None), (['C0', 'm2', 'down'], None), (['C4', 'X3', 'up'], None), (['C4', 'M4', 'up'], None), (['C4', 'P3', 'up'], None), (['Bb4', 'd2', 'up'], 'Cbb5')]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("oracle %d" % i, solve(args), expected)
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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oracle 0 | E4 | E4 | Passed |
| oracle 1 | Ab3 | Ab3 | Passed |
| oracle 2 | C4 | C4 | Passed |
| oracle 3 | B3 | B3 | Passed |
| oracle 4 | A#4 | A#4 | Passed |
| oracle 5 | None | Bbb4 | Failed |
| oracle 6 | None | Fbb4 | Failed |
| oracle 7 | None | Cbb5 | Failed |
SHA-256 / c9a467dedccaf66629c5ca28883faa5dd767597de96c59959552e7858c34fc9c
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
base = {'C': 0, 'D': 2, 'E': 4, 'F': 5, 'G': 7, 'A': 9, 'B': 11}
if not isinstance(x, list) or len(x) != 3:
return None
note, ivl, direction = x
if direction not in ('up', 'down'):
return None
if not isinstance(note, str) or len(note) < 2 or note[0] not in base:
return None
i = 1
acc = 0
while i < len(note) and note[i] in '#b':
acc += 1 if note[i] == '#' else -1
i += 1
if not note[i:].isdigit():
return None
octave = int(note[i:])
if not isinstance(ivl, str) or len(ivl) < 2 or not ivl[1:].isdigit():
return None
quality = ivl[0]
number = int(ivl[1:])
if number < 1:
return None
simple = (number - 1) % 7 + 1
perfect = simple in (1, 4, 5)
offsets = {'P': 0, 'A': 1, 'd': -1} if perfect else {'M': 0, 'm': -1, 'A': 1, 'd': -2}
if quality not in offsets:
return None
size = [0, 2, 4, 5, 7, 9, 11][simple - 1] + 12 * ((number - 1) // 7) + offsets[quality]
sign = 1 if direction == 'up' else -1
idx = 'CDEFGAB'.index(note[0]) + 7 * octave + sign * (number - 1)
pitch = 12 * octave + base[note[0]] + acc + sign * size
letter = 'CDEFGAB'[idx % 7]
new_octave = idx // 7
new_acc = pitch - (12 * new_octave + base[letter])
if abs(new_acc) > 2 or new_octave < 0:
return None
return letter + ('#' * new_acc if new_acc > 0 else 'b' * -new_acc) + str(new_octave)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[(['C4', 'M3', 'up'], 'E4'), (['C4', 'M3', 'down'], 'Ab3'), (['B3', 'm2', 'up'], 'C4'), (['C4', 'm2', 'down'], 'B3'), (['E4', 'A4', 'up'], 'A#4'), (['C4', 'd7', 'up'], 'Bbb4'), (['Db4', 'd3', 'up'], 'Fbb4'), (['Bb4', 'd2', 'up'], 'Cbb5')], [(['C4', 'm2', 'down'], 'B3'), (['E4', 'A4', 'up'], 'A#4'), (['F#4', 'A4', 'up'], 'B#4'), (['C4', 'd5', 'up'], 'Gb4'), (['C4', 'd7', 'up'], 'Bbb4'), (['C4', 'd3', 'up'], 'Ebb4'), (['Cb4', 'd3', 'up'], None), (['C4', 'P8', 'up'], 'C5')], [(['C4', 'd5', 'up'], 'Gb4'), (['C4', 'd3', 'up'], 'Ebb4'), (['Db4', 'd3', 'up'], 'Fbb4'), (['C4', 'P8', 'up'], 'C5'), (['C4', 'M9', 'up'], 'D5'), (['C4', 'M10', 'down'], 'Ab2'), (['G4', 'P5', 'up'], 'D5'), (['Bb4', 'd2', 'up'], 'Cbb5')], [(['C4', 'd7', 'up'], 'Bbb4'), (['Db4', 'd3', 'up'], 'Fbb4'), (['Cb4', 'd3', 'up'], None), (['C4', 'M10', 'down'], 'Ab2'), (['G4', 'P5', 'up'], 'D5'), (['A4', 'M6', 'up'], 'F#5'), (['E#4', 'A6', 'up'], None), (['Bb4', 'd2', 'up'], 'Cbb5')], [(['C4', 'd7', 'up'], 'Bbb4'), (['C4', 'd3', 'up'], 'Ebb4'), (['E#4', 'A6', 'up'], None), (['C0', 'm2', 'down'], None), (['C4', 'X3', 'up'], None), (['C4', 'M4', 'up'], None), (['C4', 'P3', 'up'], None), (['Bb4', 'd2', 'up'], 'Cbb5')]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("oracle %d" % i, solve(args), expected)
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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oracle 0 | E4 | E4 | Passed |
| oracle 1 | Ab3 | Ab3 | Passed |
| oracle 2 | C4 | C4 | Passed |
| oracle 3 | B3 | B3 | Passed |
| oracle 4 | A#4 | A#4 | Passed |
| oracle 5 | Bbb4 | Bbb4 | Passed |
| oracle 6 | Fbb4 | Fbb4 | Passed |
| oracle 7 | Cbb5 | Cbb5 | Passed |
SHA-256 / 2c55f68bef5393677aeae260ceb32081cf9b999e255ddea1cf972c1324684564
Verification & scope
A deterministic bounded teaching model with a stipulated toy contract; it is not a complete music notation or theory engine. 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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:49:58.367526+00:00.
Case digest / ada50414d5e7019b55409b5affc61e49e5d1ccb9ecae2082fd3362a5afa81ce1