{"abstract":"Fermat inversion is used without a prime-modulus precondition.","category":"Number theory","checks":4,"contract":"Integer inputs; n is positive unless a zero or negative fixture explicitly extends that operation. A modulus is greater than one; p is prime; exponent k may be signed when an inverse exists. a may be signed; return the least nonnegative inverse modulo m or None if gcd(a,m)!=1. Exact operational definition: pow(a,-1,m) if math.gcd(a,m)==1 else None","evaluation_group":"model-1e3640eb8694a06f","failed_approach":"Integer reciprocal is not a modular inverse.","family":"xn-modular-multiplicative-inverse","id":"FA-5541","implementations":{"attempt":{"sha256":"502213d5a548cec5e71b2c6a904b8c767838a2487b19d05ae4536edfdf84e477","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport calendar\nimport statistics\nimport itertools\nfrom fractions import Fraction\nfrom datetime import date, datetime, timedelta, timezone\nfrom decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR\n\nN = 1\nobservations = []\ndef solve(a, m):\n    return 1//a if a else None\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1: (3, 10)', solve(*(3, 10)), 7)\ncheck('fixture 2: (2, 5)', solve(*(2, 5)), 3)\ncheck('fixture 3: (2, 4)', solve(*(2, 4)), None)\ncheck('fixture 4: (-3, 10)', solve(*(-3, 10)), 3)\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":"1a9f81ae2b0d496c6e76b5a3464887e38d877ea6b6073a5392e1dd0650b45d28","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport calendar\nimport statistics\nimport itertools\nfrom fractions import Fraction\nfrom datetime import date, datetime, timedelta, timezone\nfrom decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR\n\nN = 1\nobservations = []\ndef solve(a, m):\n    return pow(a,m-2,m)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1: (3, 10)', solve(*(3, 10)), 7)\ncheck('fixture 2: (2, 5)', solve(*(2, 5)), 3)\ncheck('fixture 3: (2, 4)', solve(*(2, 4)), None)\ncheck('fixture 4: (-3, 10)', solve(*(-3, 10)), 3)\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"},"fixed":{"sha256":"0545f810d55a18dbdef437550dcfbc2abac917ef1d2d6476734f28abf2e1c479","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport calendar\nimport statistics\nimport itertools\nfrom fractions import Fraction\nfrom datetime import date, datetime, timedelta, timezone\nfrom decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR\n\nN = 1\nobservations = []\ndef solve(a, m):\n    return pow(a,-1,m) if math.gcd(a,m)==1 else None\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1: (3, 10)', solve(*(3, 10)), 7)\ncheck('fixture 2: (2, 5)', solve(*(2, 5)), 3)\ncheck('fixture 3: (2, 4)', solve(*(2, 4)), None)\ncheck('fixture 4: (-3, 10)', solve(*(-3, 10)), 3)\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":" 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":"xn-modular-multiplicative-inverse","generated_at":"2026-09-29T14:37:50.797141+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Number theory results depend on the stated convention.","repair":"Apply the specified mathematical contract directly, preserving all terms and boundary cases: return pow(a,-1,m) if math.gcd(a,m)==1 else None","root_cause":"Fermat inversion is used without a prime-modulus precondition.","sha256":"c37a848bb38536d29cfbc6f15bd4c4e287935bb67cf75b9d398f47cb3e7b3f46","title":"Modular multiplicative inverse · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":49.065,"exit_code":1,"observations":[{"actual":0,"check":"fixture 1: (3, 10)","expected":7,"passed":false},{"actual":0,"check":"fixture 2: (2, 5)","expected":3,"passed":false},{"actual":0,"check":"fixture 3: (2, 4)","expected":null,"passed":false},{"actual":-1,"check":"fixture 4: (-3, 10)","expected":3,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1: (3, 10)\", \"actual\": 0, \"expected\": 7, \"passed\": false}, {\"check\": \"fixture 2: (2, 5)\", \"actual\": 0, \"expected\": 3, \"passed\": false}, {\"check\": \"fixture 3: (2, 4)\", \"actual\": 0, \"expected\": null, \"passed\": false}, {\"check\": \"fixture 4: (-3, 10)\", \"actual\": -1, \"expected\": 3, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":46.291,"exit_code":1,"observations":[{"actual":1,"check":"fixture 1: (3, 10)","expected":7,"passed":false},{"actual":3,"check":"fixture 2: (2, 5)","expected":3,"passed":true},{"actual":0,"check":"fixture 3: (2, 4)","expected":null,"passed":false},{"actual":1,"check":"fixture 4: (-3, 10)","expected":3,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1: (3, 10)\", \"actual\": 1, \"expected\": 7, \"passed\": false}, {\"check\": \"fixture 2: (2, 5)\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"fixture 3: (2, 4)\", \"actual\": 0, \"expected\": null, \"passed\": false}, {\"check\": \"fixture 4: (-3, 10)\", \"actual\": 1, \"expected\": 3, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":49.882,"exit_code":0,"observations":[{"actual":7,"check":"fixture 1: (3, 10)","expected":7,"passed":true},{"actual":3,"check":"fixture 2: (2, 5)","expected":3,"passed":true},{"actual":null,"check":"fixture 3: (2, 4)","expected":null,"passed":true},{"actual":3,"check":"fixture 4: (-3, 10)","expected":3,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1: (3, 10)\", \"actual\": 7, \"expected\": 7, \"passed\": true}, {\"check\": \"fixture 2: (2, 5)\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"fixture 3: (2, 4)\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"fixture 4: (-3, 10)\", \"actual\": 3, \"expected\": 3, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}