元記事の一部移転のお知らせ(2026-04-20)
コラッツ予想の証明 - 未解決問題への挑戦(Qiita) で、
ある時点から、それ以上は記事を更新できなくなったので、
該当記事の付録部分をこちらに掲載します。
【論文編 - 付録集(日本語草稿版)】
本稿は、「コラッツ予想の証明 - 未解決問題への挑戦」の付録集です。
必要に応じて、以下の本編を参照願います。
- コラッツ予想の証明 - 未解決問題への挑戦(Qiita)
- コラッツ予想の証明(§4)- 未解決問題への挑戦
- コラッツ予想の証明(§6)- 未解決問題への挑戦
- 付録I (周期 lift 構造有限検査証明書)
付録目次
付録A (定理4.3.30:検査表A)
付録A.1 (検査表Aファイル仕様)
付録A.2 (検査表Aの例)
付録B (定理4.3.30:検査表B)
付録B.1 (検査表Bファイル仕様)
付録B.2 (検査表Bの例)
付録C (定理4.3.30:外部パラメタファイル)
付録D (定理4.3.30:有限検査証明書自動生成スクリプト)
付録E (定理4.3.30:無限集合を有限個の議論に帰着させる方法)
付録G (第5章:実シーケンス確認)
付録A (定理4.3.30:検査表A).
この付録A (検査表A) は、定理4.3.30 で用いる有限検査条件を、
第三者が独立に再検証できるよう記録した検査証明書(certificate)の例である。
本文の理論的主張および結論は本文中の証明だけで完結しており、
当付録に示す具体的な表やファイルに依存しない。
ここに掲げる情報は、条件の充足を機械的に追試・再現するための補助資料である。
付録A (検査表A) と付録B (検査表B) は同一の外部パラメタファイルの設定条件で
生成されたデータであり、対となっている。
付録A.1 (検査表Aファイル仕様).
検査表Aに関する出力ファイル仕様を示す。
■ファイル形式
検査表Aに関する出力ファイルの概要を以下に示す。
-
ファイル名パターン:
tableA_{base_params_str}_{timestamp}.csv-
base_params_str:t{t}_L{L}_K{K}形式 -
timestamp:YYYYMMDD_HHMMSS形式
-
- 形式: CSV (Comma-Separated Values)
- エンコーディング: UTF-8
- 区切り文字: Comma (',')
■フィールド定義
検査表Aに関する出力ファイルのレコード概要を以下に示す。
| フィールド名 | データ型 | 説明 |
|---|---|---|
r |
int | 合同類(剰余類)の値 |
k |
int | 係数値 (V0 = r + 2^t * k の k) |
V0 |
int | 初期値 (V0 = r + 2^t * k) |
V_L |
int | L-step写像適用後の値 |
terminated |
bool | L-step内終了フラグ (1 に到達時、True) |
increase_rate |
float | 増率 (V_L / V0) |
partial_sum |
float | 部分和 S(V0) の値 |
partial_sum_binary_bound |
float | 二進有理数境界用部分和 |
condition_A_satisfied |
bool | 条件Aの合格フラグ |
failure_reason |
str | 失敗理由(条件A不合格の場合) |
collatz_sequence_length |
int | コラッツ数列の長さ(-1は未計算) |
max_value_in_sequence |
int | 数列中の最大値(-1は未計算) |
付録A.2 (検査表Aの例).
検査表Aの出力ファイルの実例を以下に示す。
このデータは、外部パラメタファイルに $t = 8, L = 256, K = 10$ を設定して、
本稿での有限検査証明書自動生成スクリプト(例)を実行して得られたものである。
外部パラメタファイルの他のパラメタはデフォルト値を採用している。
なお、$t, L, K$ の値は、生成されたファイル名の一部に埋め込まれている。
これらの生成手順は再現性のために示すものであり、本文の理論的主張は
これら具体的ファイルに依存しない。
r,k,V0,V_L,terminated,increase_rate,partial_sum,partial_sum_binary_bound,condition_A_satisfied,failure_reason,collatz_sequence_length,max_value_in_sequence
1,0,1,1,True,1.0,0.0,0.0,True,,-1,-1
1,1,257,1,True,0.0038910505836575876,0.17377337223688868,15.21875,True,,-1,-1
1,2,513,1,True,0.001949317738791423,0.09942005649569118,2.375,True,,-1,-1
1,3,769,1,True,0.0013003901170351106,0.1002756472972688,1.78125,True,,-1,-1
1,4,1025,1,True,0.000975609756097561,0.10070892286052703,2.03125,True,,-1,-1
1,5,1281,1,True,0.00078064012490242,0.2156859031699894,3.9375,True,,-1,-1
1,6,1537,1,True,0.0006506180871828237,0.1645896353174876,19.359375,True,,-1,-1
1,7,1793,1,True,0.0005577244841048522,0.14197997021909747,13.875,True,,-1,-1
1,8,2049,1,True,0.0004880429477794046,0.16480646098964719,19.609375,True,,-1,-1
1,9,2305,1,True,0.0004338394793926247,0.12642488189492487,12.09375,True,,-1,-1
1,10,2561,1,True,0.0003904724716907458,0.1773177421397358,17.34375,True,,-1,-1
3,0,3,1,True,0.3333333333333333,0.0625,0.0625,True,,-1,-1
3,1,259,1,True,0.003861003861003861,0.16608935161766872,15.28125,True,,-1,-1
3,2,515,1,True,0.001941747572815534,0.17248026878861283,15.03125,True,,-1,-1
3,3,771,1,True,0.0012970168612191958,0.09769094929303782,1.9375,True,,-1,-1
3,4,1027,1,True,0.0009737098344693282,0.09877126756835554,2.1875,True,,-1,-1
3,5,1283,1,True,0.000779423226812159,0.21412785570169376,4.328125,True,,-1,-1
3,6,1539,1,True,0.000649772579597141,0.09984262189311176,1.59375,True,,-1,-1
3,7,1795,1,True,0.0005571030640668524,0.2181946357033285,6.328125,True,,-1,-1
3,8,2051,1,True,0.00048756704046806434,0.10038396618808336,1.84375,True,,-1,-1
3,9,2307,1,True,0.00043346337234503684,0.16401171196720216,18.921875,True,,-1,-1
3,10,2563,1,True,0.0003901677721420211,0.2154258476914873,3.75,True,,-1,-1
5,0,5,1,True,0.2,0.0,0.0,True,,-1,-1
5,1,261,1,True,0.0038314176245210726,0.19728240757652524,1.75,True,,-1,-1
5,2,517,1,True,0.0019342359767891683,0.16865784476835366,15.46875,True,,-1,-1
5,3,773,1,True,0.00129366106080207,0.1720492343058542,14.96875,True,,-1,-1
5,4,1029,1,True,0.0009718172983479105,0.17377337223688868,15.21875,True,,-1,-1
5,5,1285,1,True,0.0007782101167315176,0.10995021999450014,0.71875,True,,-1,-1
5,6,1541,1,True,0.0006489292667099286,0.09855500459257699,2.125,True,,-1,-1
5,7,1797,1,True,0.0005564830272676684,0.13976169790178336,14.28125,True,,-1,-1
5,8,2053,1,True,0.0004870920603994155,0.09942005649569118,2.375,True,,-1,-1
5,9,2309,1,True,0.00043308791684711995,0.09969828009172607,1.53125,True,,-1,-1
5,10,2565,1,True,0.0003898635477582846,0.21464724628341122,4.515625,True,,-1,-1
7,0,7,1,True,0.14285714285714285,0.1361425339366516,0.9375,True,,-1,-1
7,1,263,1,True,0.0038022813688212928,0.11232586900709089,8.84375,True,,-1,-1
7,2,519,1,True,0.0019267822736030828,0.1909961646683078,5.5,True,,-1,-1
7,3,775,1,True,0.0012903225806451613,0.15600750994720355,19.125,True,,-1,-1
7,4,1031,1,True,0.0009699321047526673,0.09488902050042337,2.125,True,,-1,-1
7,5,1287,1,True,0.000777000777000777,0.17213060219171483,17.78125,True,,-1,-1
7,6,1543,1,True,0.0006480881399870382,0.12224792131492368,12.46875,True,,-1,-1
7,7,1799,1,True,0.0005558643690939411,0.21597012410568425,6.265625,True,,-1,-1
7,8,2055,1,True,0.00048661800486618007,0.09843686162422427,2.109375,True,,-1,-1
7,9,2311,1,True,0.00043271311120726956,0.162280159496046,18.859375,True,,-1,-1
7,10,2567,1,True,0.00038955979742890534,0.17497981834848358,17.71875,True,,-1,-1
9,0,9,1,True,0.1111111111111111,0.18159707939119704,1.4375,True,,-1,-1
9,1,265,1,True,0.0037735849056603774,0.14328936421317268,15.53125,True,,-1,-1
9,2,521,1,True,0.0019193857965451055,0.1609439324377376,15.609375,True,,-1,-1
9,3,777,1,True,0.001287001287001287,0.08979567537958523,2.19140625,True,,-1,-1
9,4,1033,1,True,0.000968054211035818,0.15643743256113304,19.625,True,,-1,-1
9,5,1289,1,True,0.0007757951900698216,0.170626644184441,18.234375,True,,-1,-1
9,6,1545,1,True,0.0006472491909385113,0.1983100479387775,5.65625,True,,-1,-1
9,7,1801,1,True,0.000555247084952804,0.17597123864389796,20.21875,True,,-1,-1
9,8,2057,1,True,0.0004861448711716091,0.12246390403630597,12.96875,True,,-1,-1
9,9,2313,1,True,0.00043233895373973193,0.12296410405689953,12.609375,True,,-1,-1
9,10,2569,1,True,0.00038925652004671076,0.21308949626784188,4.09375,True,,-1,-1
11,0,11,1,True,0.09090909090909091,0.10673076923076924,0.4375,True,,-1,-1
11,1,267,1,True,0.003745318352059925,0.008784185944906878,0.62890625,True,,-1,-1
11,2,523,1,True,0.0019120458891013384,0.1571597194765419,14.96875,True,,-1,-1
11,3,779,1,True,0.0012836970474967907,0.1905684486717295,5.0,True,,-1,-1
11,4,1035,1,True,0.000966183574879227,0.1679697044229586,15.0,True,,-1,-1
11,5,1291,1,True,0.000774593338497289,0.20794166216792348,3.625,True,,-1,-1
11,6,1547,1,True,0.0006464124111182935,0.09467359611438288,1.625,True,,-1,-1
11,7,1803,1,True,0.0005546311702717693,0.11112997550015855,2.40625,True,,-1,-1
11,8,2059,1,True,0.00048567265662943174,0.09650436575381763,2.0625,True,,-1,-1
11,9,2315,1,True,0.00043196544276457883,0.12210395356369996,11.96875,True,,-1,-1
11,10,2571,1,True,0.00038895371450797355,0.2123124632202467,4.015625,True,,-1,-1
13,0,13,1,True,0.07692307692307693,0.0625,0.0625,True,,-1,-1
13,1,269,1,True,0.0037174721189591076,0.1680370232948433,1.625,True,,-1,-1
13,2,525,1,True,0.0019047619047619048,0.19221484000895767,1.5625,True,,-1,-1
13,3,781,1,True,0.0012804097311139564,0.16182409632501615,15.03125,True,,-1,-1
13,4,1037,1,True,0.0009643201542912247,0.16608935161766872,15.28125,True,,-1,-1
13,5,1293,1,True,0.0007733952049497294,0.12905676579260605,11.90625,True,,-1,-1
13,6,1549,1,True,0.0006455777921239509,0.17032905081961566,14.78125,True,,-1,-1
13,7,1805,1,True,0.000554016620498615,0.1616165796732462,4.6875,True,,-1,-1
13,8,2061,1,True,0.00048520135856380397,0.17248026878861283,15.03125,True,,-1,-1
13,9,2317,1,True,0.00043159257660768235,0.09625262411139184,1.6875,True,,-1,-1
13,10,2573,1,True,0.000388651379712398,0.10891430839229019,0.53125,True,,-1,-1
15,0,15,1,True,0.06666666666666667,0.09246967654986524,1.09375,True,,-1,-1
15,1,271,1,True,0.0036900369003690036,0.21180371505419449,3.515625,True,,-1,-1
15,2,527,1,True,0.0018975332068311196,0.11106149483659716,9.0,True,,-1,-1
15,3,783,1,True,0.001277139208173691,0.15924101117594364,15.34765625,True,,-1,-1
15,4,1039,1,True,0.0009624639076034649,0.1903546888556486,5.65625,True,,-1,-1
15,5,1295,1,True,0.0007722007722007722,0.1538019758331448,2.328125,True,,-1,-1
15,6,1551,1,True,0.0006447453255963894,0.1555777545924111,19.28125,True,,-1,-1
15,7,1807,1,True,0.0005534034311012728,0.13422079002686965,14.4140625,True,,-1,-1
15,8,2063,1,True,0.0004847309743092584,0.09456590883583463,2.28125,True,,-1,-1
15,9,2319,1,True,0.00043122035360068997,0.19773507963071607,5.359375,True,,-1,-1
15,10,2575,1,True,0.0003883495145631068,0.1718717296794869,17.9375,True,,-1,-1
17,0,17,1,True,0.058823529411764705,0.0875,0.1875,True,,-1,-1
17,1,273,1,True,0.003663003663003663,0.15343989175125078,1.3125,True,,-1,-1
17,2,529,1,True,0.001890359168241966,0.18466814842283655,1.578125,True,,-1,-1
17,3,785,1,True,0.0012738853503184713,0.15673527125922437,14.71875,True,,-1,-1
17,4,1041,1,True,0.0009606147934678194,0.1622507174854257,15.15625,True,,-1,-1
17,5,1297,1,True,0.0007710100231303007,0.12597519208184527,11.59375,True,,-1,-1
17,6,1553,1,True,0.000643915003219575,0.1677551121482805,14.75,True,,-1,-1
17,7,1809,1,True,0.000552791597567717,0.15940668247143389,4.375,True,,-1,-1
17,8,2065,1,True,0.00048426150121065375,0.1705441971190993,14.90625,True,,-1,-1
17,9,2321,1,True,0.00043084877208099956,0.09453000047969018,1.375,True,,-1,-1
17,10,2577,1,True,0.00038804811796662784,0.10736274184740209,0.5703125,True,,-1,-1
19,0,19,1,True,0.05263157894736842,0.14750617030028795,1.0625,True,,-1,-1
19,1,275,1,True,0.0036363636363636364,0.11987377826456744,10.71875,True,,-1,-1
19,2,531,1,True,0.0018832391713747645,0.142035183611166,15.15625,True,,-1,-1
19,3,787,1,True,0.0012706480304955528,0.18038666590974048,5.125,True,,-1,-1
19,4,1043,1,True,0.0009587727708533077,0.1603050908704463,15.234375,True,,-1,-1
19,5,1299,1,True,0.0007698229407236335,0.16288906704550038,18.234375,True,,-1,-1
19,6,1555,1,True,0.0006430868167202572,0.0893671039510138,1.81640625,True,,-1,-1
19,7,1811,1,True,0.0005521811154058532,0.20935161069287828,5.75,True,,-1,-1
19,8,2067,1,True,0.0004837929366231253,0.15611499060068593,19.25,True,,-1,-1
19,9,2323,1,True,0.00043047783039173483,0.14364175424905923,23.28125,True,,-1,-1
19,10,2579,1,True,0.00038774718883288094,0.17036820173096068,17.859375,True,,-1,-1
21,0,21,1,True,0.047619047619047616,0.0,0.0,True,,-1,-1
21,1,277,1,True,0.0036101083032490976,0.0875,0.1875,True,,-1,-1
21,2,533,1,True,0.001876172607879925,0.17790544434747488,1.8125,True,,-1,-1
21,3,789,1,True,0.0012674271229404308,0.19052565081976847,1.5,True,,-1,-1
21,4,1045,1,True,0.0009569377990430622,0.19728240757652524,1.75,True,,-1,-1
21,5,1301,1,True,0.0007686395080707148,0.09790445915856089,1.21875,True,,-1,-1
21,6,1557,1,True,0.0006422607578676942,0.16523318723410707,15.21875,True,,-1,-1
21,7,1813,1,True,0.0005515719801434088,0.00390625,0.00390625,True,,-1,-1
21,8,2069,1,True,0.0004833252779120348,0.16865784476835366,15.46875,True,,-1,-1
21,9,2325,1,True,0.00043010752688172043,0.1697556563242028,14.71875,True,,-1,-1
21,10,2581,1,True,0.0003874467260751647,0.1311172053530456,12.09375,True,,-1,-1
23,0,23,1,True,0.043478260869565216,0.07818396226415095,0.59375,True,,-1,-1
23,1,279,1,True,0.0035842293906810036,0.18366141273258785,3.40625,True,,-1,-1
23,2,535,1,True,0.001869158878504673,0.007538912902490706,0.78515625,True,,-1,-1
23,3,791,1,True,0.0012642225031605564,0.11064026484502176,8.5,True,,-1,-1
23,4,1047,1,True,0.0009551098376313276,0.15652319718315943,15.125,True,,-1,-1
23,5,1303,1,True,0.0007674597083653108,0.12136854229872106,11.75,True,,-1,-1
23,6,1559,1,True,0.0006414368184733803,0.19014092228873966,5.15625,True,,-1,-1
23,7,1815,1,True,0.0005509641873278236,0.1560983414420789,4.859375,True,,-1,-1
23,8,2071,1,True,0.0004828585224529213,0.1676478543731888,15.15625,True,,-1,-1
23,9,2327,1,True,0.0004297378599054577,0.15543452915557351,18.78125,True,,-1,-1
23,10,2583,1,True,0.00038714672861014324,0.2076836001141884,3.78125,True,,-1,-1
25,0,25,1,True,0.04,0.1647475496106328,1.5625,True,,-1,-1
25,1,281,1,True,0.0035587188612099642,0.17655438644039786,3.375,True,,-1,-1
25,2,537,1,True,0.00186219739292365,0.0038199452337673244,1.1259765625,True,,-1,-1
25,3,793,1,True,0.0012610340479192938,0.10811899940323907,8.46875,True,,-1,-1
25,4,1049,1,True,0.0009532888465204957,0.18081003593514267,5.625,True,,-1,-1
25,5,1305,1,True,0.0007662835249042146,0.19719262262288687,4.46875,True,,-1,-1
25,6,1561,1,True,0.0006406149903907751,0.18886033781810482,5.125,True,,-1,-1
25,7,1817,1,True,0.000550357732526142,0.206045982093714,6.7578125,True,,-1,-1
25,8,2073,1,True,0.000482392667631452,0.08958142028191822,2.31640625,True,,-1,-1
25,9,2329,1,True,0.00042936882782310007,0.1545759455042796,18.9375,True,,-1,-1
25,10,2585,1,True,0.00038684719535783365,0.20691014136026778,3.9375,True,,-1,-1
27,0,27,1,True,0.037037037037037035,0.16670687583639793,14.59375,True,,-1,-1
27,1,283,1,True,0.0035335689045936395,0.10479424330602194,6.21875,True,,-1,-1
27,2,539,1,True,0.0018552875695732839,0.10211671912852929,4.09375,True,,-1,-1
27,3,795,1,True,0.0012578616352201257,0.20792873493834987,12.1328125,True,,-1,-1
27,4,1051,1,True,0.0009514747859181732,0.16550134921271153,10.125,True,,-1,-1
27,5,1307,1,True,0.0007651109410864575,0.14329114342833826,22.65625,True,,-1,-1
27,6,1563,1,True,0.0006397952655150352,0.14790680312358498,19.09375,True,,-1,-1
27,7,1819,1,True,0.0005497526113249038,0.1653525481150694,19.71875,True,,-1,-1
27,8,2075,1,True,0.00048192771084337347,0.17842982857485662,10.7265625,True,,-1,-1
27,9,2331,1,True,0.000429000429000429,0.11522325253201343,12.7265625,True,,-1,-1
27,10,2587,1,True,0.00038654812524159255,0.16727696028392539,18.171875,True,,-1,-1
29,0,29,1,True,0.034482758620689655,0.1361425339366516,0.9375,True,,-1,-1
29,1,285,1,True,0.0035087719298245615,0.1362889111176368,12.84375,True,,-1,-1
29,2,541,1,True,0.0018484288354898336,0.21426129177631612,3.3125,True,,-1,-1
29,3,797,1,True,0.0012547051442910915,0.1416171234104971,15.03125,True,,-1,-1
29,4,1053,1,True,0.000949667616334283,0.11232586900709089,8.84375,True,,-1,-1
29,5,1309,1,True,0.0007639419404125286,0.15527540902608597,18.25,True,,-1,-1
29,6,1565,1,True,0.0006389776357827476,0.16009214368134922,15.109375,True,,-1,-1
29,7,1821,1,True,0.0005491488193300384,0.1015218252678346,2.78125,True,,-1,-1
29,8,2077,1,True,0.00048146364949446316,0.1909961646683078,5.5,True,,-1,-1
29,9,2333,1,True,0.0004286326618088298,0.08922424680815666,1.69140625,True,,-1,-1
29,10,2589,1,True,0.0003862495171881035,0.1543166689699533,2.125,True,,-1,-1
31,0,31,1,True,0.03225806451612903,0.14800406183502524,13.84375,True,,-1,-1
31,1,287,1,True,0.003484320557491289,0.15560439955570357,3.125,True,,-1,-1
31,2,543,1,True,0.001841620626151013,0.17168958730139122,16.90625,True,,-1,-1
31,3,799,1,True,0.0012515644555694619,0.21643331008793407,7.265625,True,,-1,-1
31,4,1055,1,True,0.0009478672985781991,0.1865436198160798,21.796875,True,,-1,-1
31,5,1311,1,True,0.0007627765064836003,0.11525501819633449,11.75,True,,-1,-1
31,6,1567,1,True,0.0006381620931716656,0.18502690106685796,5.265625,True,,-1,-1
31,7,1823,1,True,0.0005485463521667581,0.16387188364093336,20.546875,True,,-1,-1
31,8,2079,1,True,0.000481000481000481,0.13817904935744282,3.9765625,True,,-1,-1
31,9,2335,1,True,0.00042826552462526765,0.17818002739495636,9.9765625,True,,-1,-1
31,10,2591,1,True,0.00038595137012736397,0.20459297683951222,4.1328125,True,,-1,-1
33,0,33,1,True,0.030303030303030304,0.17790544434747488,1.8125,True,,-1,-1
33,1,289,1,True,0.0034602076124567475,0.0974029308598581,1.875,True,,-1,-1
33,2,545,1,True,0.001834862385321101,0.2069289996145684,3.0,True,,-1,-1
33,3,801,1,True,0.0012484394506866417,0.16290945583552469,5.4375,True,,-1,-1
33,4,1057,1,True,0.000946073793755913,0.10853916747046596,8.71875,True,,-1,-1
33,5,1313,1,True,0.0007616146230007616,0.0885896323900573,0.94140625,True,,-1,-1
33,6,1569,1,True,0.0006373486297004461,0.08065905394657762,1.75,True,,-1,-1
33,7,1825,1,True,0.000547945205479452,0.09933915966032783,2.9375,True,,-1,-1
33,8,2081,1,True,0.0004805382027871216,0.18907383055935162,5.375,True,,-1,-1
33,9,2337,1,True,0.0004278990158322636,0.19085119973377287,4.78125,True,,-1,-1
33,10,2593,1,True,0.0003856536829926726,0.15277437767446145,2.09375,True,,-1,-1
35,0,35,1,True,0.02857142857142857,0.06875,0.09375,True,,-1,-1
35,1,291,1,True,0.003436426116838488,0.16746907095834918,14.625,True,,-1,-1
35,2,547,1,True,0.0018281535648994515,0.1522223592837183,1.21875,True,,-1,-1
35,3,803,1,True,0.0012453300124533001,0.007123975143154607,0.28515625,True,,-1,-1
35,4,1059,1,True,0.0009442870632672333,0.18403895379196406,1.484375,True,,-1,-1
35,5,1315,1,True,0.0007604562737642585,0.19040766447932064,4.03125,True,,-1,-1
35,6,1571,1,True,0.0006365372374283895,0.156311063114428,14.625,True,,-1,-1
35,7,1827,1,True,0.0005473453749315818,0.17519030435519273,15.5,True,,-1,-1
35,8,2083,1,True,0.00048007681228996637,0.16193075161511855,15.0625,True,,-1,-1
35,9,2339,1,True,0.00042753313381787086,0.18999843155063764,4.65625,True,,-1,-1
35,10,2595,1,True,0.0003853564547206166,0.1257183427667768,11.5,True,,-1,-1
37,0,37,1,True,0.02702702702702703,0.18159707939119704,1.4375,True,,-1,-1
37,1,293,1,True,0.0034129692832764505,0.1606877326886525,14.96875,True,,-1,-1
37,2,549,1,True,0.0018214936247723133,0.12229313310327711,11.09375,True,,-1,-1
37,3,805,1,True,0.0012422360248447205,0.0046454813316302145,1.0009765625,True,,-1,-1
37,4,1061,1,True,0.000942507068803016,0.14328936421317268,15.53125,True,,-1,-1
37,5,1317,1,True,0.0007593014426727411,0.1888913009992182,4.375,True,,-1,-1
37,6,1573,1,True,0.0006357279084551812,0.18123316703840864,5.5,True,,-1,-1
37,7,1829,1,True,0.0005467468562055768,0.17409797310542163,16.03125,True,,-1,-1
37,8,2085,1,True,0.00047961630695443646,0.1609439324377376,15.609375,True,,-1,-1
37,9,2341,1,True,0.00042716787697565144,0.18914480584238746,5.0,True,,-1,-1
37,10,2597,1,True,0.0003850596842510589,0.1634020629415332,18.609375,True,,-1,-1
39,0,39,1,True,0.02564102564102564,0.18233683915602025,2.875,True,,-1,-1
39,1,295,1,True,0.003389830508474576,0.1801044988668511,5.0,True,,-1,-1
39,2,551,1,True,0.0018148820326678765,0.19602079985039597,3.34375,True,,-1,-1
39,3,807,1,True,0.0012391573729863693,0.20650457988881055,7.5078125,True,,-1,-1
39,4,1063,1,True,0.0009407337723424271,0.21872852076192076,7.578125,True,,-1,-1
39,5,1319,1,True,0.000758150113722517,0.14770151176954827,17.96875,True,,-1,-1
39,6,1575,1,True,0.0006349206349206349,0.1799625448738184,5.390625,True,,-1,-1
39,7,1831,1,True,0.0005461496450027307,0.19840444485142156,6.53125,True,,-1,-1
39,8,2087,1,True,0.0004791566842357451,0.10799829335039944,12.96875,True,,-1,-1
39,9,2343,1,True,0.0004268032437046522,0.14861726101299133,18.46875,True,,-1,-1
39,10,2599,1,True,0.00038476337052712584,0.16263244318067765,18.265625,True,,-1,-1
41,0,41,1,True,0.024390243902439025,0.15864235970736568,14.34375,True,,-1,-1
41,1,297,1,True,0.003367003367003367,0.10867849197398,8.34375,True,,-1,-1
41,2,553,1,True,0.0018083182640144665,0.15354249376996776,17.25,True,,-1,-1
41,3,809,1,True,0.0012360939431396785,0.10170485751403176,3.84375,True,,-1,-1
41,4,1065,1,True,0.0009389671361502347,0.21685032426641612,7.765625,True,,-1,-1
41,5,1321,1,True,0.000757002271006813,0.1076632051883405,11.65625,True,,-1,-1
41,6,1577,1,True,0.0006341154090044388,0.16529002207830745,9.875,True,,-1,-1
41,7,1833,1,True,0.0005455537370430987,0.09496982521151914,3.28125,True,,-1,-1
41,8,2089,1,True,0.0004786979415988511,0.1852395765241102,5.765625,True,,-1,-1
41,9,2345,1,True,0.00042643923240938164,0.1477646769155122,18.84375,True,,-1,-1
41,10,2601,1,True,0.00038446751249519417,0.14840006146883877,22.59375,True,,-1,-1
43,0,43,1,True,0.023255813953488372,0.20238444839285177,2.0,True,,-1,-1
43,1,299,1,True,0.0033444816053511705,0.14050353766439463,14.53125,True,,-1,-1
43,2,555,1,True,0.0018018018018018018,0.1377858102498906,1.4453125,True,,-1,-1
43,3,811,1,True,0.0012330456226880395,0.17619387641403947,16.09375,True,,-1,-1
43,4,1067,1,True,0.0009372071227741331,0.16394840945634429,5.4375,True,,-1,-1
43,5,1323,1,True,0.0007558578987150416,0.1843514537931915,4.03125,True,,-1,-1
43,6,1579,1,True,0.0006333122229259025,0.15124186974019782,14.5,True,,-1,-1
43,7,1835,1,True,0.0005449591280653951,0.170826656942433,15.40625,True,,-1,-1
43,8,2091,1,True,0.00047824007651841227,0.08118980906674753,1.9375,True,,-1,-1
43,9,2347,1,True,0.00042607584149978694,0.10838861886402035,11.90625,True,,-1,-1
43,10,2603,1,True,0.000384172109104879,0.12264397702923571,11.609375,True,,-1,-1
45,0,45,1,True,0.022222222222222223,0.10673076923076924,0.4375,True,,-1,-1
45,1,301,1,True,0.0033222591362126247,0.006847426470588235,0.25390625,True,,-1,-1
45,2,557,1,True,0.0017953321364452424,0.18604783991171495,3.25,True,,-1,-1
45,3,813,1,True,0.0012300123001230013,0.21262194751402105,2.8125,True,,-1,-1
45,4,1069,1,True,0.0009354536950420954,0.008784185944906878,0.62890625,True,,-1,-1
45,5,1325,1,True,0.0007547169811320754,0.07974706069387136,0.875,True,,-1,-1
45,6,1581,1,True,0.0006325110689437065,0.11148269868668617,8.34375,True,,-1,-1
45,7,1837,1,True,0.0005443658138268917,0.16978573365945815,15.78125,True,,-1,-1
45,8,2093,1,True,0.00047778308647873863,0.1571597194765419,14.96875,True,,-1,-1
45,9,2349,1,True,0.0004257130693912303,0.15952460679145136,14.609375,True,,-1,-1
45,10,2605,1,True,0.00038387715930902113,0.1218800415921941,11.59375,True,,-1,-1
47,0,47,1,True,0.02127659574468085,0.14096180831389848,13.34375,True,,-1,-1
47,1,303,1,True,0.0033003300330033004,0.10225388968950369,3.28125,True,,-1,-1
47,2,559,1,True,0.0017889087656529517,0.22011544380444512,9.578125,True,,-1,-1
47,3,815,1,True,0.001226993865030675,0.17128075655731928,16.40625,True,,-1,-1
47,4,1071,1,True,0.0009337068160597573,0.17239767102364234,21.359375,True,,-1,-1
47,5,1327,1,True,0.0007535795026375283,0.1812838971323085,4.140625,True,,-1,-1
47,6,1583,1,True,0.0006317119393556538,0.18633309350029034,21.296875,True,,-1,-1
47,7,1839,1,True,0.000543773790103317,0.1551886684526741,20.375,True,,-1,-1
47,8,2095,1,True,0.00047732696897374703,0.22002054410038416,12.015625,True,,-1,-1
47,9,2351,1,True,0.0004253509145044662,0.18488513752844002,4.765625,True,,-1,-1
47,10,2607,1,True,0.0003835826620636747,0.18577163893253712,8.578125,True,,-1,-1
49,0,49,1,True,0.02040816326530612,0.19052565081976847,1.5,True,,-1,-1
49,1,305,1,True,0.003278688524590164,0.2115302444572525,2.5625,True,,-1,-1
49,2,561,1,True,0.0017825311942959,0.17891949911885982,3.3125,True,,-1,-1
49,3,817,1,True,0.0012239902080783353,0.20774117698720287,2.6875,True,,-1,-1
49,4,1073,1,True,0.0009319664492078285,0.005059388616398427,1.0634765625,True,,-1,-1
49,5,1329,1,True,0.0007524454477050414,0.17985280459315608,4.1875,True,,-1,-1
49,6,1585,1,True,0.0006309148264984228,0.10895876103227596,8.40625,True,,-1,-1
49,7,1841,1,True,0.0005431830526887561,0.16761601140268328,15.84375,True,,-1,-1
49,8,2097,1,True,0.0004768717215069146,0.1814450314451883,5.5625,True,,-1,-1
49,9,2353,1,True,0.00042498937526561835,0.08094191866344104,1.4375,True,,-1,-1
49,10,2609,1,True,0.0003832886163280951,0.197703135515653,4.40625,True,,-1,-1
51,0,51,1,True,0.0196078431372549,0.15181651512787414,1.1875,True,,-1,-1
51,1,307,1,True,0.003257328990228013,0.20503006866852985,2.25,True,,-1,-1
51,2,563,1,True,0.0017761989342806395,0.17537142114071333,3.0,True,,-1,-1
51,3,819,1,True,0.001221001221001221,0.20530121834315024,2.375,True,,-1,-1
51,4,1075,1,True,0.0009302325581395349,0.003200110523023523,0.7509765625,True,,-1,-1
51,5,1331,1,True,0.0007513148009015778,0.17835094960685263,3.875,True,,-1,-1
51,6,1587,1,True,0.000630119722747322,0.10769906659248879,8.09375,True,,-1,-1
51,7,1843,1,True,0.0005425935973955507,0.1665312283978806,15.53125,True,,-1,-1
51,8,2099,1,True,0.0004764173415912339,0.18049250841609102,5.25,True,,-1,-1
51,9,2355,1,True,0.0004246284501061571,0.08009290937083882,1.125,True,,-1,-1
51,10,2611,1,True,0.00038299502106472615,0.1969373469251333,4.09375,True,,-1,-1
53,0,53,1,True,0.018867924528301886,0.0625,0.0625,True,,-1,-1
53,1,309,1,True,0.003236245954692557,0.14750617030028795,1.0625,True,,-1,-1
53,2,565,1,True,0.0017699115044247787,0.06875,0.09375,True,,-1,-1
53,3,821,1,True,0.001218026796589525,0.15181651512787414,1.1875,True,,-1,-1
53,4,1077,1,True,0.0009285051067780873,0.1680370232948433,1.625,True,,-1,-1
53,5,1333,1,True,0.0007501875468867217,0.15066363630311033,13.96875,True,,-1,-1
53,6,1589,1,True,0.0006293266205160479,0.1838292222483399,1.453125,True,,-1,-1
53,7,1845,1,True,0.0005420054200542005,0.2043075253159287,2.125,True,,-1,-1
53,8,2101,1,True,0.00047596382674916705,0.19221484000895767,1.5625,True,,-1,-1
53,9,2357,1,True,0.00042426813746287653,0.15616966039949587,14.59375,True,,-1,-1
53,10,2613,1,True,0.0003827018752391887,0.09382837220203914,1.125,True,,-1,-1
55,0,55,1,True,0.01818181818181818,0.15466363630311036,14.46875,True,,-1,-1
55,1,311,1,True,0.003215434083601286,0.11478024372477258,9.96875,True,,-1,-1
55,2,567,1,True,0.001763668430335097,0.10361920592252505,6.09375,True,,-1,-1
55,3,823,1,True,0.001215066828675577,0.16155365489259593,16.859375,True,,-1,-1
55,4,1079,1,True,0.0009267840593141798,0.10149906797589059,3.96875,True,,-1,-1
55,5,1335,1,True,0.000749063670411985,0.13565907627663643,18.6640625,True,,-1,-1
55,6,1591,1,True,0.0006285355122564425,0.20750980551796333,12.0078125,True,,-1,-1
55,7,1847,1,True,0.0005414185165132648,0.19055514750534772,6.28125,True,,-1,-1
55,8,2103,1,True,0.00047551117451260106,0.16518439571501467,10.0,True,,-1,-1
55,9,2359,1,True,0.000423908435777872,0.18144085934851234,4.765625,True,,-1,-1
55,10,2615,1,True,0.0003824091778202677,0.14303623887193329,22.53125,True,,-1,-1
57,0,57,1,True,0.017543859649122806,0.21007675608515947,2.5,True,,-1,-1
57,1,313,1,True,0.003194888178913738,0.1469054724415238,16.53125,True,,-1,-1
57,2,569,1,True,0.0017574692442882249,0.21594702800440976,5.265625,True,,-1,-1
57,3,825,1,True,0.0012121212121212121,0.1591715668137657,16.46875,True,,-1,-1
57,4,1081,1,True,0.0009250693802035153,0.176604722757507,16.59375,True,,-1,-1
57,5,1337,1,True,0.0007479431563201197,0.007165610650271012,3.9384765625,True,,-1,-1
57,6,1593,1,True,0.0006277463904582549,0.14244470606709786,14.625,True,,-1,-1
57,7,1849,1,True,0.0005408328826392645,0.18947425340834287,6.125,True,,-1,-1
57,8,2105,1,True,0.00047505938242280285,0.1514529292589821,15.0,True,,-1,-1
57,9,2361,1,True,0.00042354934349851756,0.18059621246543486,5.015625,True,,-1,-1
57,10,2617,1,True,0.00038211692777990065,0.18197124728896177,8.25,True,,-1,-1
59,0,59,1,True,0.01694915254237288,0.17671886162793035,2.375,True,,-1,-1
59,1,315,1,True,0.0031746031746031746,0.18017275600352753,2.578125,True,,-1,-1
59,2,571,1,True,0.0017513134851138354,0.10982124559565203,1.28125,True,,-1,-1
59,3,827,1,True,0.0012091898428053204,0.19561789896401402,2.84375,True,,-1,-1
59,4,1083,1,True,0.0009233610341643582,0.17475864841314184,16.84375,True,,-1,-1
59,5,1339,1,True,0.0007468259895444362,0.06928443925005044,0.8515625,True,,-1,-1
59,6,1595,1,True,0.0006269592476489029,0.21851957801223418,7.078125,True,,-1,-1
59,7,1851,1,True,0.0005402485143165856,0.16221077081819102,15.8125,True,,-1,-1
59,8,2107,1,True,0.00047460844803037496,0.13699753048313848,20.1015625,True,,-1,-1
59,9,2363,1,True,0.00042319085907744394,0.1798215011502641,4.890625,True,,-1,-1
59,10,2619,1,True,0.00038182512409316535,0.1165261574524453,11.40625,True,,-1,-1
61,0,61,1,True,0.01639344262295082,0.09246967654986524,1.09375,True,,-1,-1
61,1,317,1,True,0.0031545741324921135,0.17392667920608457,2.75,True,,-1,-1
61,2,573,1,True,0.0017452006980802793,0.13163568124375669,12.90625,True,,-1,-1
61,3,829,1,True,0.0012062726176115801,0.11585090753633576,10.46875,True,,-1,-1
61,4,1085,1,True,0.0009216589861751152,0.21180371505419449,3.515625,True,,-1,-1
61,5,1341,1,True,0.0007457121551081282,0.10619191887525889,7.34375,True,,-1,-1
61,6,1597,1,True,0.0006261740763932373,0.1399474096307205,15.09375,True,,-1,-1
61,7,1853,1,True,0.0005396654074473826,0.16110396607376432,16.234375,True,,-1,-1
61,8,2109,1,True,0.000474158368895211,0.11106149483659716,9.0,True,,-1,-1
61,9,2365,1,True,0.00042283298097251583,0.17897698257064842,4.875,True,,-1,-1
61,10,2621,1,True,0.00038153376573826786,0.1542580168716648,18.3125,True,,-1,-1
63,0,63,1,True,0.015873015873015872,0.13745776613560903,13.90625,True,,-1,-1
63,1,319,1,True,0.003134796238244514,0.1029667029103439,5.46875,True,,-1,-1
63,2,575,1,True,0.0017391304347826088,0.15444541023880257,3.328125,True,,-1,-1
63,3,831,1,True,0.0012033694344163659,0.1519378856430529,16.625,True,,-1,-1
63,4,1087,1,True,0.0009199632014719411,0.17107639913120543,16.96875,True,,-1,-1
63,5,1343,1,True,0.0007446016381236039,0.20702896555253314,10.8828125,True,,-1,-1
63,6,1599,1,True,0.0006253908692933083,0.2160164385946677,7.421875,True,,-1,-1
63,7,1855,1,True,0.0005390835579514825,0.10803821747026127,13.84375,True,,-1,-1
63,8,2111,1,True,0.0004737091425864519,0.18622784571089623,21.859375,True,,-1,-1
63,9,2367,1,True,0.0004224757076468103,0.164726706910596,9.25,True,,-1,-1
63,10,2623,1,True,0.0003812428516965307,0.11500087701603975,11.9765625,True,,-1,-1
65,0,65,1,True,0.015384615384615385,0.19728240757652524,1.75,True,,-1,-1
65,1,321,1,True,0.003115264797507788,0.10995021999450014,0.71875,True,,-1,-1
65,2,577,1,True,0.0017331022530329288,0.09969828009172607,1.53125,True,,-1,-1
65,3,833,1,True,0.0012004801920768306,0.13738581024989058,1.1953125,True,,-1,-1
65,4,1089,1,True,0.0009182736455463728,0.20814900732978037,2.9375,True,,-1,-1
65,5,1345,1,True,0.0007434944237918215,0.14173220014972188,13.625,True,,-1,-1
65,6,1601,1,True,0.0006246096189881324,0.1637402495895666,5.1875,True,,-1,-1
65,7,1857,1,True,0.0005385029617662897,0.19784051957730642,2.015625,True,,-1,-1
65,8,2113,1,True,0.000473260766682442,0.10916902175557285,8.65625,True,,-1,-1
65,9,2369,1,True,0.00042211903756859433,0.151101183189832,14.25,True,,-1,-1
65,10,2625,1,True,0.00038095238095238096,0.0890968168634794,0.515625,True,,-1,-1
67,0,67,1,True,0.014925373134328358,0.1680370232948433,1.625,True,,-1,-1
67,1,323,1,True,0.0030959752321981426,0.12905676579260605,11.90625,True,,-1,-1
67,2,579,1,True,0.0017271157167530224,0.09625262411139184,1.6875,True,,-1,-1
67,3,835,1,True,0.0011976047904191617,0.14717142988833232,16.59375,True,,-1,-1
67,4,1091,1,True,0.0009165902841429881,0.20631825042890065,2.8125,True,,-1,-1
67,5,1347,1,True,0.0007423904974016332,0.21757615037194575,6.078125,True,,-1,-1
67,6,1603,1,True,0.0006238303181534623,0.1624937130417331,5.25,True,,-1,-1
67,7,1859,1,True,0.0005379236148466917,0.15791616501976996,15.53125,True,,-1,-1
67,8,2115,1,True,0.00047281323877068556,0.1082240414200458,8.53125,True,,-1,-1
67,9,2371,1,True,0.00042176296921130323,0.1367515218465427,19.3515625,True,,-1,-1
67,10,2627,1,True,0.00038066235249333843,0.08833591114513173,0.75390625,True,,-1,-1
69,0,69,1,True,0.014492753623188406,0.0875,0.1875,True,,-1,-1
69,1,325,1,True,0.003076923076923077,0.09790445915856089,1.21875,True,,-1,-1
69,2,581,1,True,0.0017211703958691911,0.1697556563242028,14.71875,True,,-1,-1
69,3,837,1,True,0.0011947431302270011,0.18445548322381686,3.0,True,,-1,-1
69,4,1093,1,True,0.0009149130832570906,0.15343989175125078,1.3125,True,,-1,-1
69,5,1349,1,True,0.0007412898443291327,0.13877355560929325,14.03125,True,,-1,-1
69,6,1605,1,True,0.0006230529595015577,0.007953621160853722,0.37890625,True,,-1,-1
69,7,1861,1,True,0.0005373455131649651,0.19570710954822995,2.1875,True,,-1,-1
69,8,2117,1,True,0.0004723665564478035,0.18466814842283655,1.578125,True,,-1,-1
69,9,2373,1,True,0.00042140750105351877,0.11092090093387719,8.09375,True,,-1,-1
69,10,2629,1,True,0.0003803727653100038,0.1909144212360774,4.125,True,,-1,-1
71,0,71,1,True,0.014084507042253521,0.1362889111176368,12.84375,True,,-1,-1
71,1,327,1,True,0.0030581039755351682,0.15527540902608597,18.25,True,,-1,-1
71,2,583,1,True,0.0017152658662092624,0.08922424680815666,1.69140625,True,,-1,-1
71,3,839,1,True,0.0011918951132300357,0.21971830321667704,9.078125,True,,-1,-1
71,4,1095,1,True,0.0009132420091324201,0.18999254651897637,7.125,True,,-1,-1
71,5,1351,1,True,0.0007401924500370096,0.17572456868829855,19.71875,True,,-1,-1
71,6,1607,1,True,0.0006222775357809583,0.17219028819494053,20.859375,True,,-1,-1
71,7,1863,1,True,0.0005367686527106817,0.1818868569246668,6.265625,True,,-1,-1
71,8,2119,1,True,0.00047192071731949034,0.10633523677094936,8.28125,True,,-1,-1
71,9,2375,1,True,0.0004210526315789474,0.1861927623187018,20.796875,True,,-1,-1
71,10,2631,1,True,0.0003800836183960471,0.18807158184834055,24.609375,True,,-1,-1
73,0,73,1,True,0.0136986301369863,0.1606877326886525,14.96875,True,,-1,-1
73,1,329,1,True,0.00303951367781155,0.1888913009992182,4.375,True,,-1,-1
73,2,585,1,True,0.0017094017094017094,0.18914480584238746,5.0,True,,-1,-1
73,3,841,1,True,0.0011890606420927466,0.1796448139118851,2.953125,True,,-1,-1
73,4,1097,1,True,0.0009115770282588879,0.16195851319219107,17.359375,True,,-1,-1
73,5,1353,1,True,0.0007390983000739098,0.11051422102839756,2.40625,True,,-1,-1
73,6,1609,1,True,0.0006215040397762585,0.20981172775039716,6.75,True,,-1,-1
73,7,1865,1,True,0.0005361930294906167,0.18088949765214546,6.25,True,,-1,-1
73,8,2121,1,True,0.0004714757190004715,0.20771927346936678,12.5078125,True,,-1,-1
73,9,2377,1,True,0.00042069835927639884,0.007227952168940918,4.5634765625,True,,-1,-1
73,10,2633,1,True,0.00037979491074819596,0.13754216233440236,2.6328125,True,,-1,-1
75,0,75,1,True,0.013333333333333334,0.006847426470588235,0.25390625,True,,-1,-1
75,1,331,1,True,0.0030211480362537764,0.07974706069387136,0.875,True,,-1,-1
75,2,587,1,True,0.0017035775127768314,0.15952460679145136,14.609375,True,,-1,-1
75,3,843,1,True,0.0011862396204033216,0.17733342041837802,2.65625,True,,-1,-1
75,4,1099,1,True,0.0009099181073703367,0.1479776687113492,1.3203125,True,,-1,-1
75,5,1355,1,True,0.0007380073800738007,0.1343437285338665,13.6875,True,,-1,-1
75,6,1611,1,True,0.0006207324643078833,0.004227966524447617,0.26953125,True,,-1,-1
75,7,1867,1,True,0.0005356186395286556,0.19249246040726933,1.84375,True,,-1,-1
75,8,2123,1,True,0.0004710315591144607,0.18184123461528962,1.6884765625,True,,-1,-1
75,9,2379,1,True,0.0004203446826397646,0.10839825618041812,7.75,True,,-1,-1
75,10,2635,1,True,0.0003795066413662239,0.1886369115133055,4.015625,True,,-1,-1
77,0,77,1,True,0.012987012987012988,0.14750617030028795,1.0625,True,,-1,-1
77,1,333,1,True,0.003003003003003003,0.15066363630311033,13.96875,True,,-1,-1
77,2,589,1,True,0.001697792869269949,0.15616966039949587,14.59375,True,,-1,-1
77,3,845,1,True,0.001183431952662722,0.1749770993741518,2.875,True,,-1,-1
77,4,1101,1,True,0.0009082652134423251,0.11987377826456744,10.71875,True,,-1,-1
77,5,1357,1,True,0.0007369196757553427,0.15916110290365393,4.25,True,,-1,-1
77,6,1613,1,True,0.0006199628022318661,0.0029934989527755887,0.6259765625,True,,-1,-1
77,7,1869,1,True,0.0005350454788657035,0.11406697696300369,9.46875,True,,-1,-1
77,8,2125,1,True,0.00047058823529411766,0.142035183611166,15.15625,True,,-1,-1
77,9,2381,1,True,0.00041999160016799666,0.10755908898890537,7.96875,True,,-1,-1
77,10,2637,1,True,0.0003792188092529389,0.18788051932805916,4.0,True,,-1,-1
79,0,79,1,True,0.012658227848101266,0.17392667920608457,2.75,True,,-1,-1
79,1,335,1,True,0.0029850746268656717,0.10619191887525889,7.34375,True,,-1,-1
79,2,591,1,True,0.001692047377326565,0.17897698257064842,4.875,True,,-1,-1
79,3,847,1,True,0.0011806375442739079,0.005923399421756825,2.4384765625,True,,-1,-1
79,4,1103,1,True,0.0009066183136899365,0.1954165356441867,3.21875,True,,-1,-1
79,5,1359,1,True,0.0007358351729212656,0.20873848213188897,5.5,True,,-1,-1
79,6,1615,1,True,0.0006191950464396285,0.20609185223867738,7.3828125,True,,-1,-1
79,7,1871,1,True,0.0005344735435595938,0.15149252275798492,15.625,True,,-1,-1
79,8,2127,1,True,0.0004701457451810061,0.21841513007540717,7.453125,True,,-1,-1
79,9,2383,1,True,0.000419639110365086,0.004709749326207846,4.4384765625,True,,-1,-1
79,10,2639,1,True,0.00037893141341417203,0.14744891668998725,17.84375,True,,-1,-1
81,0,81,1,True,0.012345679012345678,0.09790445915856089,1.21875,True,,-1,-1
81,1,337,1,True,0.002967359050445104,0.13877355560929325,14.03125,True,,-1,-1
81,2,593,1,True,0.0016863406408094434,0.11092090093387719,8.09375,True,,-1,-1
81,3,849,1,True,0.001177856301531213,0.10557818009735415,5.71875,True,,-1,-1
81,4,1105,1,True,0.0009049773755656109,0.11625283679678591,10.59375,True,,-1,-1
81,5,1361,1,True,0.0007347538574577516,0.1562207204891562,4.453125,True,,-1,-1
81,6,1617,1,True,0.0006184291898577613,0.10252861496422896,3.40625,True,,-1,-1
81,7,1873,1,True,0.0005339028296849973,0.11193079773903133,9.625,True,,-1,-1
81,8,2129,1,True,0.0004697040864255519,0.14015609076594587,15.21875,True,,-1,-1
81,9,2385,1,True,0.0004192872117400419,0.20820810106475893,11.6328125,True,,-1,-1
81,10,2641,1,True,0.0003786444528587656,0.10816775886135588,11.40625,True,,-1,-1
83,0,83,1,True,0.012048192771084338,0.15066363630311033,13.96875,True,,-1,-1
83,1,339,1,True,0.0029498525073746312,0.15916110290365393,4.25,True,,-1,-1
83,2,595,1,True,0.0016806722689075631,0.10755908898890537,7.96875,True,,-1,-1
83,3,851,1,True,0.0011750881316098707,0.10322766324437313,5.59375,True,,-1,-1
83,4,1107,1,True,0.0009033423667570009,0.15294056760624386,16.875,True,,-1,-1
83,5,1363,1,True,0.0007336757153338225,0.2058014833162079,6.2578125,True,,-1,-1
83,6,1619,1,True,0.0006176652254478073,0.10129322194871891,3.46875,True,,-1,-1
83,7,1875,1,True,0.0005333333333333334,0.1869779591980799,22.421875,True,,-1,-1
83,8,2131,1,True,0.0004692632566870014,0.21653756363255458,7.390625,True,,-1,-1
83,9,2387,1,True,0.00041893590280687055,0.20737017971511498,11.5078125,True,,-1,-1
83,10,2643,1,True,0.00037835792659856227,0.10741101957973255,11.28125,True,,-1,-1
85,0,85,1,True,0.011764705882352941,0.0,0.0,True,,-1,-1
85,1,341,1,True,0.002932551319648094,0.0,0.0,True,,-1,-1
85,2,597,1,True,0.0016750418760469012,0.18159707939119704,1.4375,True,,-1,-1
85,3,853,1,True,0.0011723329425556857,0.0625,0.0625,True,,-1,-1
85,4,1109,1,True,0.0009017132551848512,0.0875,0.1875,True,,-1,-1
85,5,1365,1,True,0.0007326007326007326,0.0,0.0,True,,-1,-1
85,6,1621,1,True,0.0006169031462060457,0.1647475496106328,1.5625,True,,-1,-1
85,7,1877,1,True,0.0005327650506126798,0.1361425339366516,0.9375,True,,-1,-1
85,8,2133,1,True,0.00046882325363338024,0.17790544434747488,1.8125,True,,-1,-1
85,9,2389,1,True,0.0004185851820845542,0.18159707939119704,1.4375,True,,-1,-1
85,10,2645,1,True,0.0003780718336483932,0.15864235970736568,14.34375,True,,-1,-1
87,0,87,1,True,0.011494252873563218,0.19475291107494752,2.0625,True,,-1,-1
87,1,343,1,True,0.0029154518950437317,0.17312709931901385,15.53125,True,,-1,-1
87,2,599,1,True,0.001669449081803005,0.13939123610458035,14.59375,True,,-1,-1
87,3,855,1,True,0.0011695906432748538,0.214387595961434,4.828125,True,,-1,-1
87,4,1111,1,True,0.0009000900090009,0.137185943501494,1.5078125,True,,-1,-1
87,5,1367,1,True,0.000731528895391368,0.10054646212568491,2.34375,True,,-1,-1
87,6,1623,1,True,0.0006161429451632779,0.1757832050256773,16.15625,True,,-1,-1
87,7,1879,1,True,0.0005321979776476849,0.10873621335880615,9.28125,True,,-1,-1
87,8,2135,1,True,0.000468384074941452,0.16363620575343124,5.5,True,,-1,-1
87,9,2391,1,True,0.0004182350480970305,0.14188706219875133,14.1875,True,,-1,-1
87,10,2647,1,True,0.00037778617302606723,0.18409963040147231,4.09375,True,,-1,-1
89,0,89,1,True,0.011235955056179775,0.17298751834434825,2.125,True,,-1,-1
89,1,345,1,True,0.002898550724637681,0.16737469866137053,15.78125,True,,-1,-1
89,2,601,1,True,0.0016638935108153079,0.16235513211046926,5.1875,True,,-1,-1
89,3,857,1,True,0.0011668611435239206,0.1094324431073161,1.03125,True,,-1,-1
89,4,1113,1,True,0.0008984725965858042,0.14757047218681596,17.09375,True,,-1,-1
89,5,1369,1,True,0.0007304601899196494,0.0990957322017105,2.6875,True,,-1,-1
89,6,1625,1,True,0.0006153846153846154,0.17455356227696464,16.59375,True,,-1,-1
89,7,1881,1,True,0.000531632110579479,0.18506176243153905,2.140625,True,,-1,-1
89,8,2137,1,True,0.0004679457182966776,0.1627016132496333,5.75,True,,-1,-1
89,9,2393,1,True,0.0004178854993731718,0.21838030224621743,6.828125,True,,-1,-1
89,10,2649,1,True,0.00037750094375235937,0.22099092710893017,10.640625,True,,-1,-1
91,0,91,1,True,0.01098901098901099,0.12472031756929652,11.34375,True,,-1,-1
91,1,347,1,True,0.002881844380403458,0.16158331862699593,15.859375,True,,-1,-1
91,2,603,1,True,0.001658374792703151,0.21008780705623084,6.375,True,,-1,-1
91,3,859,1,True,0.0011641443538998836,0.170885175725289,18.484375,True,,-1,-1
91,4,1115,1,True,0.0008968609865470852,0.10725222717495808,10.28125,True,,-1,-1
91,5,1371,1,True,0.0007293946024799417,0.12262592607130274,13.21875,True,,-1,-1
91,6,1627,1,True,0.0006146281499692685,0.19872299900821283,7.28125,True,,-1,-1
91,7,1883,1,True,0.0005310674455655868,0.10661049911448181,9.03125,True,,-1,-1
91,8,2139,1,True,0.0004675081813931744,0.21279269208146798,7.796875,True,,-1,-1
91,9,2395,1,True,0.0004175365344467641,0.06331772809333393,1.626953125,True,,-1,-1
91,10,2651,1,True,0.0003772161448509996,0.142907425427159,17.5,True,,-1,-1
93,0,93,1,True,0.010752688172043012,0.07818396226415095,0.59375,True,,-1,-1
93,1,349,1,True,0.0028653295128939827,0.19475291107494752,2.0625,True,,-1,-1
93,2,605,1,True,0.001652892561983471,0.002442838159824047,0.5009765625,True,,-1,-1
93,3,861,1,True,0.0011614401858304297,0.1300876936276576,12.40625,True,,-1,-1
93,4,1117,1,True,0.0008952551477170994,0.18366141273258785,3.40625,True,,-1,-1
93,5,1373,1,True,0.0007283321194464676,0.17312709931901385,15.53125,True,,-1,-1
93,6,1629,1,True,0.0006138735420503376,0.21098538444862983,3.015625,True,,-1,-1
93,7,1885,1,True,0.0005305039787798408,0.144074688099333,16.09375,True,,-1,-1
93,8,2141,1,True,0.00046707146193367583,0.007538912902490706,0.78515625,True,,-1,-1
93,9,2397,1,True,0.00041718815185648727,0.13939123610458035,14.59375,True,,-1,-1
93,10,2653,1,True,0.0003769317753486619,0.07874207273204875,1.1015625,True,,-1,-1
95,0,95,1,True,0.010526315789473684,0.13396126263910552,13.40625,True,,-1,-1
95,1,351,1,True,0.002849002849002849,0.11169360608817744,9.5,True,,-1,-1
95,2,607,1,True,0.0016474464579901153,0.10115601009361463,3.34375,True,,-1,-1
95,3,863,1,True,0.0011587485515643105,0.1540593098527022,2.828125,True,,-1,-1
95,4,1119,1,True,0.0008936550491510277,0.21951979682323183,9.640625,True,,-1,-1
95,5,1375,1,True,0.0007272727272727272,0.0947274597243645,2.78125,True,,-1,-1
95,6,1631,1,True,0.0006131207847946045,0.17087206729630555,16.46875,True,,-1,-1
95,7,1887,1,True,0.0005299417064122947,0.18188048507400545,2.937744140625,True,,-1,-1
95,8,2143,1,True,0.0004666355576294914,0.17208661420922666,21.421875,True,,-1,-1
95,9,2399,1,True,0.00041684035014589413,0.2158775111148122,6.921875,True,,-1,-1
95,10,2655,1,True,0.0003766478342749529,0.18103282043967164,4.203125,True,,-1,-1
97,0,97,1,True,0.010309278350515464,0.16523318723410707,15.21875,True,,-1,-1
97,1,353,1,True,0.0028328611898017,0.14454564562020783,15.78125,True,,-1,-1
97,2,609,1,True,0.0016420361247947454,0.17482683607918253,16.28125,True,,-1,-1
97,3,865,1,True,0.0011560693641618498,0.16391540996412046,18.859375,True,,-1,-1
97,4,1121,1,True,0.0008920606601248885,0.1800410104253558,3.203125,True,,-1,-1
97,5,1377,1,True,0.0007262164124909223,0.15676001320629435,19.875,True,,-1,-1
97,6,1633,1,True,0.000612369871402327,0.16969520628284918,16.734375,True,,-1,-1
97,7,1889,1,True,0.0005293806246691371,0.2192771838288308,8.328125,True,,-1,-1
97,8,2145,1,True,0.0004662004662004662,0.21001885285395971,7.0,True,,-1,-1
97,9,2401,1,True,0.00041649312786339027,0.17615628675640724,20.46875,True,,-1,-1
97,10,2657,1,True,0.0003763643206624012,0.18028259126847546,4.265625,True,,-1,-1
99,0,99,1,True,0.010101010101010102,0.1838292222483399,1.453125,True,,-1,-1
99,1,355,1,True,0.0028169014084507044,0.1785304443474749,1.828125,True,,-1,-1
99,2,611,1,True,0.0016366612111292963,0.21044012817818272,2.515625,True,,-1,-1
99,3,867,1,True,0.0011534025374855825,0.09816060669954449,1.234375,True,,-1,-1
99,4,1123,1,True,0.0008904719501335708,0.17832614468848007,3.265625,True,,-1,-1
99,5,1379,1,True,0.0007251631617113851,0.16881892724258046,15.484375,True,,-1,-1
99,6,1635,1,True,0.0006116207951070336,0.2073335682915507,2.640625,True,,-1,-1
99,7,1891,1,True,0.0005288207297726071,0.1805229255504824,1.890625,True,,-1,-1
99,8,2147,1,True,0.0004657661853749418,0.004748958152822268,1.0166015625,True,,-1,-1
99,9,2403,1,True,0.0004161464835622139,0.16318541324730387,4.890625,True,,-1,-1
99,10,2659,1,True,0.000376081233546446,0.1796021361439582,4.140625,True,,-1,-1
101,0,101,1,True,0.009900990099009901,0.1647475496106328,1.5625,True,,-1,-1
101,1,357,1,True,0.0028011204481792717,0.17298751834434825,2.125,True,,-1,-1
101,2,613,1,True,0.0016313213703099511,0.2071976987263333,2.625,True,,-1,-1
101,3,869,1,True,0.0011507479861910242,0.09586918852856975,1.625,True,,-1,-1
101,4,1125,1,True,0.0008888888888888889,0.17655438644039786,3.375,True,,-1,-1
101,5,1381,1,True,0.000724112961622013,0.16737469866137053,15.78125,True,,-1,-1
101,6,1637,1,True,0.0006108735491753207,0.2061146673670114,2.75,True,,-1,-1
101,7,1893,1,True,0.0005282620179609086,0.17946853065141485,2.328125,True,,-1,-1
101,8,2149,1,True,0.00046533271288971617,0.0038199452337673244,1.1259765625,True,,-1,-1
101,9,2405,1,True,0.0004158004158004158,0.16235513211046926,5.1875,True,,-1,-1
101,10,2661,1,True,0.0003757985719654265,0.17885161716359496,4.25,True,,-1,-1
103,0,103,1,True,0.009708737864077669,0.11906732665166422,10.59375,True,,-1,-1
103,1,359,1,True,0.002785515320334262,0.10273476610009913,4.59375,True,,-1,-1
103,2,615,1,True,0.0016260162601626016,0.19127703407211108,6.90625,True,,-1,-1
103,3,871,1,True,0.001148105625717566,0.14354611538142342,23.15625,True,,-1,-1
103,4,1127,1,True,0.0008873114463176575,0.13508608996697097,17.5390625,True,,-1,-1
103,5,1383,1,True,0.0007230657989877079,0.17859044534324722,11.2265625,True,,-1,-1
103,6,1639,1,True,0.0006101281269066504,0.17869587559091338,12.3515625,True,,-1,-1
103,7,1895,1,True,0.0005277044854881266,0.17721793438394717,21.9375,True,,-1,-1
103,8,2151,1,True,0.00046490004649000463,0.19371296373631092,11.71875,True,,-1,-1
103,9,2407,1,True,0.0004154549231408392,0.21255036255173512,7.046875,True,,-1,-1
103,10,2663,1,True,0.0003755163349605708,0.16469541732442516,8.375,True,,-1,-1
105,0,105,1,True,0.009523809523809525,0.1781283598783535,3.25,True,,-1,-1
105,1,361,1,True,0.002770083102493075,0.21303221628269567,4.015625,True,,-1,-1
105,2,617,1,True,0.0016207455429497568,0.16182339053419598,16.734375,True,,-1,-1
105,3,873,1,True,0.001145475372279496,0.1547666638706475,18.8125,True,,-1,-1
105,4,1129,1,True,0.0008857395925597874,0.006316790452441327,2.9384765625,True,,-1,-1
105,5,1385,1,True,0.0007220216606498195,0.1906754072648853,6.15625,True,,-1,-1
105,6,1641,1,True,0.0006093845216331506,0.19100629703787356,7.28125,True,,-1,-1
105,7,1897,1,True,0.0005271481286241434,0.16402650144372743,6.5,True,,-1,-1
105,8,2153,1,True,0.00046446818392940084,0.206298207996003,7.8828125,True,,-1,-1
105,9,2409,1,True,0.00041511000415110004,0.13440522381513967,14.9140625,True,,-1,-1
105,10,2665,1,True,0.000375234521575985,0.177339656126543,4.5078125,True,,-1,-1
107,0,107,1,True,0.009345794392523364,0.133183321055525,12.34375,True,,-1,-1
107,1,363,1,True,0.0027548209366391185,0.2075402465583337,3.25,True,,-1,-1
107,2,619,1,True,0.0016155088852988692,0.15863335368136527,15.96875,True,,-1,-1
107,3,875,1,True,0.001142857142857143,0.08884343949665628,1.19140625,True,,-1,-1
107,4,1131,1,True,0.0008841732979664014,0.004549735010101338,2.5009765625,True,,-1,-1
107,5,1387,1,True,0.0007209805335255948,0.1892339843069493,5.625,True,,-1,-1
107,6,1643,1,True,0.0006086427267194157,0.18978970676238408,6.625,True,,-1,-1
107,7,1899,1,True,0.000526592943654555,0.16297455725874585,6.25,True,,-1,-1
107,8,2155,1,True,0.0004640371229698376,0.1657762963471185,20.71875,True,,-1,-1
107,9,2411,1,True,0.00041476565740356696,0.17205205208766933,20.359375,True,,-1,-1
107,10,2667,1,True,0.0003749531308586427,0.009902833768592955,3.34765625,True,,-1,-1
109,0,109,1,True,0.009174311926605505,0.16670687583639793,14.59375,True,,-1,-1
109,1,365,1,True,0.0027397260273972603,0.12472031756929652,11.34375,True,,-1,-1
109,2,621,1,True,0.001610305958132045,0.11692140390488309,10.09375,True,,-1,-1
109,3,877,1,True,0.0011402508551881414,0.18990344674820603,4.625,True,,-1,-1
109,4,1133,1,True,0.00088261253309797,0.10479424330602194,6.21875,True,,-1,-1
109,5,1389,1,True,0.0007199424046076314,0.16158331862699593,15.859375,True,,-1,-1
109,6,1645,1,True,0.0006079027355623101,0.16236334733765173,16.984375,True,,-1,-1
109,7,1901,1,True,0.0005260389268805891,0.008628867628343525,1.53515625,True,,-1,-1
109,8,2157,1,True,0.0004636068613815484,0.10211671912852929,4.09375,True,,-1,-1
109,9,2413,1,True,0.0004144218814753419,0.21008780705623084,6.375,True,,-1,-1
109,10,2669,1,True,0.0003746721618583739,0.13615831819861643,18.7890625,True,,-1,-1
111,0,111,1,True,0.009009009009009009,0.1101723979398652,7.96875,True,,-1,-1
111,1,367,1,True,0.0027247956403269754,0.19662539477179863,3.84375,True,,-1,-1
111,2,623,1,True,0.0016051364365971107,0.15220516619338043,16.25,True,,-1,-1
111,3,879,1,True,0.0011376564277588168,0.14795416462452554,18.46875,True,,-1,-1
111,4,1135,1,True,0.000881057268722467,0.10303190576680474,5.8125,True,,-1,-1
111,5,1391,1,True,0.0007189072609633358,0.10815798673909315,13.46875,True,,-1,-1
111,6,1647,1,True,0.0006071645415907711,0.16117666625307742,16.97265625,True,,-1,-1
111,7,1903,1,True,0.0005254860746190226,0.13458250393070748,16.2890625,True,,-1,-1
111,8,2159,1,True,0.0004631773969430292,0.1261836867280674,14.875,True,,-1,-1
111,9,2415,1,True,0.00041407867494824016,0.13192073276108,14.6640625,True,,-1,-1
111,10,2671,1,True,0.00037439161362785476,0.008404415134390504,3.39453125,True,,-1,-1
113,0,113,1,True,0.008849557522123894,0.00390625,0.00390625,True,,-1,-1
113,1,369,1,True,0.0027100271002710027,0.08870192307692308,0.203125,True,,-1,-1
113,2,625,1,True,0.0016,0.13685276120937886,0.9453125,True,,-1,-1
113,3,881,1,True,0.0011350737797956867,0.15914639196543018,14.359375,True,,-1,-1
113,4,1137,1,True,0.0008795074758135445,0.062890625,0.064453125,True,,-1,-1
113,5,1393,1,True,0.0007178750897343862,0.19760128512754563,1.765625,True,,-1,-1
113,6,1649,1,True,0.0006064281382656155,0.1477755668520121,1.0703125,True,,-1,-1
113,7,1905,1,True,0.0005249343832020997,0.17322072729957214,2.140625,True,,-1,-1
113,8,2161,1,True,0.00046274872744099955,0.16495314171589592,1.56640625,True,,-1,-1
113,9,2417,1,True,0.0004137360364087712,0.004090073529411765,0.01953125,True,,-1,-1
113,10,2673,1,True,0.0003741114852225963,0.14817028523928055,13.8515625,True,,-1,-1
115,0,115,1,True,0.008695652173913044,0.2043075253159287,2.125,True,,-1,-1
115,1,371,1,True,0.0026954177897574125,0.18664592603611685,3.375,True,,-1,-1
115,2,627,1,True,0.001594896331738437,0.14584314949534816,16.15625,True,,-1,-1
115,3,883,1,True,0.0011325028312570782,0.07999856974819732,1.0,True,,-1,-1
115,4,1139,1,True,0.000877963125548727,0.21536200460347374,4.890625,True,,-1,-1
115,5,1395,1,True,0.0007168458781362007,0.15731895514533167,15.09375,True,,-1,-1
115,6,1651,1,True,0.0006056935190793458,0.15876790696446536,16.09375,True,,-1,-1
115,7,1907,1,True,0.0005243838489774515,0.005486443428760585,1.4384765625,True,,-1,-1
115,8,2163,1,True,0.0004623208506703652,0.17629658799990636,16.21875,True,,-1,-1
115,9,2419,1,True,0.00041339396444811904,0.15655742270370865,4.828125,True,,-1,-1
115,10,2675,1,True,0.00037383177570093456,0.006916441215055066,3.5634765625,True,,-1,-1
117,0,117,1,True,0.008547008547008548,0.1361425339366516,0.9375,True,,-1,-1
117,1,373,1,True,0.002680965147453083,0.07818396226415095,0.59375,True,,-1,-1
117,2,629,1,True,0.001589825119236884,0.18233683915602025,2.875,True,,-1,-1
117,3,885,1,True,0.0011299435028248588,0.15466363630311036,14.46875,True,,-1,-1
117,4,1141,1,True,0.0008764241893076249,0.1362889111176368,12.84375,True,,-1,-1
117,5,1397,1,True,0.0007158196134574087,0.19475291107494752,2.0625,True,,-1,-1
117,6,1653,1,True,0.0006049606775559589,0.11906732665166422,10.59375,True,,-1,-1
117,7,1909,1,True,0.0005238344683080147,0.1711333831166991,2.25,True,,-1,-1
117,8,2165,1,True,0.00046189376443418013,0.21426129177631612,3.3125,True,,-1,-1
117,9,2421,1,True,0.0004130524576621231,0.002442838159824047,0.5009765625,True,,-1,-1
117,10,2677,1,True,0.00037355248412401944,0.10818036606735525,7.46875,True,,-1,-1
119,0,119,1,True,0.008403361344537815,0.1711333831166991,2.25,True,,-1,-1
119,1,375,1,True,0.0026666666666666666,0.17596313711704467,3.5,True,,-1,-1
119,2,631,1,True,0.001584786053882726,0.17911683080734447,2.453125,True,,-1,-1
119,3,887,1,True,0.0011273957158962795,0.17860132517019764,4.375,True,,-1,-1
119,4,1143,1,True,0.0008748906386701663,0.10923816776090287,1.15625,True,,-1,-1
119,5,1399,1,True,0.0007147962830593281,0.18065128898134983,5.75,True,,-1,-1
119,6,1655,1,True,0.0006042296072507553,0.19521516633286976,2.71875,True,,-1,-1
119,7,1911,1,True,0.0005232862375719519,0.003393857907713108,1.3759765625,True,,-1,-1
119,8,2167,1,True,0.00046146746654360867,0.17445105424812662,16.71875,True,,-1,-1
119,9,2423,1,True,0.0004127115146512588,0.2059543006568342,6.8828125,True,,-1,-1
119,10,2679,1,True,0.0003732736095558044,0.06903562342533164,0.7265625,True,,-1,-1
121,0,121,1,True,0.008264462809917356,0.12836995260579287,11.84375,True,,-1,-1
121,1,377,1,True,0.002652519893899204,0.10597071389425725,6.71875,True,,-1,-1
121,2,633,1,True,0.001579778830963665,0.009330129900433286,2.03515625,True,,-1,-1
121,3,889,1,True,0.0011248593925759281,0.13665781869811694,19.2890625,True,,-1,-1
121,4,1145,1,True,0.0008733624454148472,0.17127307332032393,18.984375,True,,-1,-1
121,5,1401,1,True,0.0007137758743754461,0.16581840691721375,10.625,True,,-1,-1
121,6,1657,1,True,0.0006035003017501509,0.1813362932376556,7.0,True,,-1,-1
121,7,1913,1,True,0.0005227391531625719,0.20668524084957762,8.6328125,True,,-1,-1
121,8,2169,1,True,0.0004610419548178884,0.19892783309260448,7.78125,True,,-1,-1
121,9,2425,1,True,0.0004123711340206186,0.1655357654107821,20.21875,True,,-1,-1
121,10,2681,1,True,0.0003729951510630362,0.004678663179832936,3.8134765625,True,,-1,-1
123,0,123,1,True,0.008130081300813009,0.19023874556040174,4.0,True,,-1,-1
123,1,379,1,True,0.002638522427440633,0.21653250809808658,5.515625,True,,-1,-1
123,2,635,1,True,0.0015748031496062992,0.00618558119686387,2.0634765625,True,,-1,-1
123,3,891,1,True,0.001122334455667789,0.007414862893541202,4.1884765625,True,,-1,-1
123,4,1147,1,True,0.0008718395815170009,0.20839344163316215,4.375,True,,-1,-1
123,5,1403,1,True,0.0007127583749109052,0.1516112573147136,15.25,True,,-1,-1
123,6,1659,1,True,0.0006027727546714888,0.19280487274298155,2.59375,True,,-1,-1
123,7,1915,1,True,0.0005221932114882506,0.1660469607469454,21.46875,True,,-1,-1
123,8,2171,1,True,0.00046061722708429296,0.09566316922477325,3.75,True,,-1,-1
123,9,2427,1,True,0.00041203131437989287,0.12697286981794906,13.59375,True,,-1,-1
123,10,2683,1,True,0.0003727171077152441,0.10594309913868573,6.78125,True,,-1,-1
125,0,125,1,True,0.008,0.14800406183502524,13.84375,True,,-1,-1
125,1,381,1,True,0.0026246719160104987,0.13396126263910552,13.40625,True,,-1,-1
125,2,637,1,True,0.0015698587127158557,0.1050551675450529,5.59375,True,,-1,-1
125,3,893,1,True,0.0011198208286674132,0.10718595466054716,7.84375,True,,-1,-1
125,4,1149,1,True,0.0008703220191470844,0.15560439955570357,3.125,True,,-1,-1
125,5,1405,1,True,0.0007117437722419929,0.11169360608817744,9.5,True,,-1,-1
125,6,1661,1,True,0.0006020469596628537,0.1527399255516692,16.75,True,,-1,-1
125,7,1917,1,True,0.0005216484089723526,0.10227129261827159,4.96875,True,,-1,-1
125,8,2173,1,True,0.0004601932811780948,0.17168958730139122,16.90625,True,,-1,-1
125,9,2429,1,True,0.0004116920543433512,0.10115601009361463,3.34375,True,,-1,-1
125,10,2685,1,True,0.00037243947858472997,0.20752528761435143,11.0078125,True,,-1,-1
127,0,127,1,True,0.007874015748031496,0.1585066526418738,4.125,True,,-1,-1
127,1,383,1,True,0.0026109660574412533,0.15502478451458473,3.828125,True,,-1,-1
127,2,639,1,True,0.001564945226917058,0.12691710757516364,16.375,True,,-1,-1
127,3,895,1,True,0.0011173184357541898,0.20727710451034953,11.3828125,True,,-1,-1
127,4,1151,1,True,0.0008688097306689834,0.204914586432474,5.1328125,True,,-1,-1
127,5,1407,1,True,0.0007107320540156361,0.18638572382898905,22.359375,True,,-1,-1
127,6,1663,1,True,0.0006013229104028864,0.17771299743488025,7.6640625,True,,-1,-1
127,7,1919,1,True,0.0005211047420531526,0.12622227821413204,15.75,True,,-1,-1
127,8,2175,1,True,0.0004597701149425287,0.19616661596371596,7.875,True,,-1,-1
127,9,2431,1,True,0.00041135335252982314,0.16378048668309875,21.203125,True,,-1,-1
127,10,2687,1,True,0.0003721622627465575,0.20678084468008542,10.9140625,True,,-1,-1
129,0,129,1,True,0.007751937984496124,0.16865784476835366,15.46875,True,,-1,-1
129,1,385,1,True,0.0025974025974025974,0.09855500459257699,2.125,True,,-1,-1
129,2,641,1,True,0.0015600624024961,0.21464724628341122,4.515625,True,,-1,-1
129,3,897,1,True,0.0011148272017837235,0.21856592283204138,6.515625,True,,-1,-1
129,4,1153,1,True,0.0008673026886383347,0.16430061797644713,19.109375,True,,-1,-1
129,5,1409,1,True,0.0007097232079489,0.1088544259824458,8.96875,True,,-1,-1
129,6,1665,1,True,0.0006006006006006006,0.18795583717649936,23.296875,True,,-1,-1
129,7,1921,1,True,0.0005205622071837585,0.1771442515082299,17.09375,True,,-1,-1
129,8,2177,1,True,0.00045934772622875517,0.16989928791550224,16.984375,True,,-1,-1
129,9,2433,1,True,0.0004110152075626798,0.09952177470780774,3.1875,True,,-1,-1
129,10,2689,1,True,0.0003718854592785422,0.10371100424740523,6.8125,True,,-1,-1
131,0,131,1,True,0.007633587786259542,0.19221484000895767,1.5625,True,,-1,-1
131,1,387,1,True,0.002583979328165375,0.17032905081961566,14.78125,True,,-1,-1
131,2,643,1,True,0.0015552099533437014,0.10891430839229019,0.53125,True,,-1,-1
131,3,899,1,True,0.0011123470522803114,0.13902059118241578,14.09375,True,,-1,-1
131,4,1155,1,True,0.0008658008658008658,0.099121357014803,1.34375,True,,-1,-1
131,5,1411,1,True,0.0007087172218284905,0.18482557915331513,1.640625,True,,-1,-1
131,6,1667,1,True,0.0005998800239952009,0.13698602346950678,1.0078125,True,,-1,-1
131,7,1923,1,True,0.0005200208008320333,0.21499258212533226,3.5,True,,-1,-1
131,8,2179,1,True,0.0004589261128958238,0.20784313457284725,2.75,True,,-1,-1
131,9,2435,1,True,0.0004106776180698152,0.17564633122332307,15.65625,True,,-1,-1
131,10,2691,1,True,0.0003716090672612412,0.14148451190665712,13.4375,True,,-1,-1
133,0,133,1,True,0.007518796992481203,0.17790544434747488,1.8125,True,,-1,-1
133,1,389,1,True,0.002570694087403599,0.16523318723410707,15.21875,True,,-1,-1
133,2,645,1,True,0.0015503875968992248,0.1311172053530456,12.09375,True,,-1,-1
133,3,901,1,True,0.0011098779134295228,0.1630929576260021,4.875,True,,-1,-1
133,4,1157,1,True,0.000864304235090752,0.0974029308598581,1.875,True,,-1,-1
133,5,1413,1,True,0.0007077140835102619,0.14454564562020783,15.78125,True,,-1,-1
133,6,1669,1,True,0.0005991611743559018,0.14796930222875784,16.78125,True,,-1,-1
133,7,1925,1,True,0.0005194805194805195,0.21395472550778796,4.265625,True,,-1,-1
133,8,2181,1,True,0.0004585052728106373,0.2069289996145684,3.0,True,,-1,-1
133,9,2437,1,True,0.0004103405826836274,0.17482683607918253,16.28125,True,,-1,-1
133,10,2693,1,True,0.0003713330857779428,0.21807087332709088,6.265625,True,,-1,-1
135,0,135,1,True,0.007407407407407408,0.21426129177631612,3.3125,True,,-1,-1
135,1,391,1,True,0.0025575447570332483,0.16009214368134922,15.109375,True,,-1,-1
135,2,647,1,True,0.0015455950540958269,0.1543166689699533,2.125,True,,-1,-1
135,3,903,1,True,0.0011074197120708748,0.1345896704915645,14.1875,True,,-1,-1
135,4,1159,1,True,0.0008628127696289905,0.19802252637466017,5.15625,True,,-1,-1
135,5,1415,1,True,0.0007067137809187279,0.1819982204865612,2.1884765625,True,,-1,-1
135,6,1671,1,True,0.0005984440454817474,0.18563758321525506,2.640625,True,,-1,-1
135,7,1927,1,True,0.0005189413596263622,0.2129165457316952,3.59375,True,,-1,-1
135,8,2183,1,True,0.0004580852038479157,0.1671529104982078,16.71875,True,,-1,-1
135,9,2439,1,True,0.0004100041000410004,0.1740061458875976,15.984375,True,,-1,-1
135,10,2695,1,True,0.00037105751391465676,0.0631012931731783,0.876953125,True,,-1,-1
137,0,137,1,True,0.0072992700729927005,0.12229313310327711,11.09375,True,,-1,-1
137,1,393,1,True,0.002544529262086514,0.18123316703840864,5.5,True,,-1,-1
137,2,649,1,True,0.0015408320493066256,0.1634020629415332,18.609375,True,,-1,-1
137,3,905,1,True,0.0011049723756906078,0.20971961854371243,6.125,True,,-1,-1
137,4,1161,1,True,0.0008613264427217916,0.14392867085196664,23.65625,True,,-1,-1
137,5,1417,1,True,0.0007057163020465773,0.2190420003857452,8.078125,True,,-1,-1
137,6,1673,1,True,0.0005977286312014345,0.10705302398770708,10.03125,True,,-1,-1
137,7,1929,1,True,0.0005184033177812338,0.0960469933433814,4.75,True,,-1,-1
137,8,2185,1,True,0.0004576659038901602,0.17889921027981132,12.8515625,True,,-1,-1
137,9,2441,1,True,0.00040966816878328555,0.19858646159696217,7.03125,True,,-1,-1
137,10,2697,1,True,0.0003707823507601038,0.17769805382845322,19.40625,True,,-1,-1
139,0,139,1,True,0.007194244604316547,0.18604783991171495,3.25,True,,-1,-1
139,1,395,1,True,0.002531645569620253,0.11148269868668617,8.34375,True,,-1,-1
139,2,651,1,True,0.0015360983102918587,0.1218800415921941,11.59375,True,,-1,-1
139,3,907,1,True,0.0011025358324145535,0.15646557847152642,4.703125,True,,-1,-1
139,4,1163,1,True,0.0008598452278589854,0.15572097699591414,18.625,True,,-1,-1
139,5,1419,1,True,0.0007047216349541931,0.1403126342850442,15.46875,True,,-1,-1
139,6,1675,1,True,0.0005970149253731343,0.1443841174886531,16.46875,True,,-1,-1
139,7,1931,1,True,0.0005178663904712584,0.17195800985481458,17.28125,True,,-1,-1
139,8,2187,1,True,0.0004572473708276177,0.1915140467460983,7.28125,True,,-1,-1
139,9,2443,1,True,0.00040933278755628325,0.09542441037986235,3.0,True,,-1,-1
139,10,2699,1,True,0.0003705075954057058,0.21584663682487418,5.765625,True,,-1,-1
141,0,141,1,True,0.0070921985815602835,0.06875,0.09375,True,,-1,-1
141,1,397,1,True,0.0025188916876574307,0.1838292222483399,1.453125,True,,-1,-1
141,2,653,1,True,0.0015313935681470138,0.09382837220203914,1.125,True,,-1,-1
141,3,909,1,True,0.0011001100110011,0.0009765625,0.0009765625,True,,-1,-1
141,4,1165,1,True,0.0008583690987124463,0.16746907095834918,14.625,True,,-1,-1
141,5,1421,1,True,0.0007037297677691766,0.1785304443474749,1.828125,True,,-1,-1
141,6,1677,1,True,0.0005963029218843172,0.1828665001729694,2.90625,True,,-1,-1
141,7,1933,1,True,0.0005173305742369374,0.10719032805429865,0.4453125,True,,-1,-1
141,8,2189,1,True,0.00045682960255824577,0.1522223592837183,1.21875,True,,-1,-1
141,9,2445,1,True,0.00040899795501022495,0.21044012817818272,2.515625,True,,-1,-1
141,10,2701,1,True,0.00037023324694557573,0.1377867135040301,13.9375,True,,-1,-1
143,0,143,1,True,0.006993006993006993,0.13163568124375669,12.90625,True,,-1,-1
143,1,399,1,True,0.002506265664160401,0.1399474096307205,15.09375,True,,-1,-1
143,2,655,1,True,0.0015267175572519084,0.1542580168716648,18.3125,True,,-1,-1
143,3,911,1,True,0.0010976948408342481,0.10079024564591896,2.84375,True,,-1,-1
143,4,1167,1,True,0.000856898029134533,0.088653113673827,1.75390625,True,,-1,-1
143,5,1423,1,True,0.0007027406886858749,0.1637923094062567,6.0,True,,-1,-1
143,6,1679,1,True,0.0005955926146515784,0.21932130535836483,9.140625,True,,-1,-1
143,7,1935,1,True,0.0005167958656330749,0.1699375717706514,17.796875,True,,-1,-1
143,8,2191,1,True,0.00045641259698767686,0.18968830897310707,7.1875,True,,-1,-1
143,9,2447,1,True,0.0004086636697997548,0.17073586462673324,15.96875,True,,-1,-1
143,10,2703,1,True,0.0003699593044765076,0.17547795380459869,19.78125,True,,-1,-1
145,0,145,1,True,0.006896551724137931,0.1697556563242028,14.71875,True,,-1,-1
145,1,401,1,True,0.0024937655860349127,0.007953621160853722,0.37890625,True,,-1,-1
145,2,657,1,True,0.0015220700152207,0.1909144212360774,4.125,True,,-1,-1
145,3,913,1,True,0.001095290251916758,0.17555509034741065,15.59375,True,,-1,-1
145,4,1169,1,True,0.000855431993156544,0.19028338595793248,4.75,True,,-1,-1
145,5,1425,1,True,0.0007017543859649122,0.009095906643161242,0.75390625,True,,-1,-1
145,6,1681,1,True,0.000594883997620464,0.18043702661663535,2.703125,True,,-1,-1
145,7,1937,1,True,0.0005162622612287042,0.20776960435649883,3.375,True,,-1,-1
145,8,2193,1,True,0.00045599635202918376,0.16256594053052043,17.109375,True,,-1,-1
145,9,2449,1,True,0.0004083299305839118,0.16996715601069184,15.90625,True,,-1,-1
145,10,2705,1,True,0.0003696857670979667,0.11100676209454002,2.15625,True,,-1,-1
147,0,147,1,True,0.006802721088435374,0.15616966039949587,14.59375,True,,-1,-1
147,1,403,1,True,0.0024813895781637717,0.0029934989527755887,0.6259765625,True,,-1,-1
147,2,659,1,True,0.0015174506828528073,0.18788051932805916,4.0,True,,-1,-1
147,3,915,1,True,0.001092896174863388,0.1733698177656158,15.65625,True,,-1,-1
147,4,1171,1,True,0.0008539709649871904,0.18857576183631766,4.625,True,,-1,-1
147,5,1427,1,True,0.000700770847932726,0.007694579154047369,0.91015625,True,,-1,-1
147,6,1683,1,True,0.0005941770647653001,0.17924882658347963,2.578125,True,,-1,-1
147,7,1939,1,True,0.0005157297576070139,0.2067382609890062,3.4375,True,,-1,-1
147,8,2195,1,True,0.00045558086560364467,0.16165486946749472,16.984375,True,,-1,-1
147,9,2451,1,True,0.0004079967360261118,0.1691512352767504,16.109375,True,,-1,-1
147,10,2707,1,True,0.0003694126339120798,0.11026799647160176,2.03125,True,,-1,-1
149,0,149,1,True,0.006711409395973154,0.18159707939119704,1.4375,True,,-1,-1
149,1,405,1,True,0.0024691358024691358,0.1647475496106328,1.5625,True,,-1,-1
149,2,661,1,True,0.0015128593040847202,0.15864235970736568,14.34375,True,,-1,-1
149,3,917,1,True,0.0010905125408942203,0.21007675608515947,2.5,True,,-1,-1
149,4,1173,1,True,0.0008525149190110827,0.1606877326886525,14.96875,True,,-1,-1
149,5,1429,1,True,0.0006997900629811056,0.17298751834434825,2.125,True,,-1,-1
149,6,1685,1,True,0.0005934718100890207,0.1781283598783535,3.25,True,,-1,-1
149,7,1941,1,True,0.0005151983513652757,0.12836995260579287,11.84375,True,,-1,-1
149,8,2197,1,True,0.0004551661356395084,0.12229313310327711,11.09375,True,,-1,-1
149,9,2453,1,True,0.00040766408479412964,0.2071976987263333,2.625,True,,-1,-1
149,10,2709,1,True,0.00036913990402362494,0.16112445368899422,4.625,True,,-1,-1
151,0,151,1,True,0.006622516556291391,0.002442838159824047,0.5009765625,True,,-1,-1
151,1,407,1,True,0.002457002457002457,0.21098538444862983,3.015625,True,,-1,-1
151,2,663,1,True,0.0015082956259426848,0.07874207273204875,1.1015625,True,,-1,-1
151,3,919,1,True,0.001088139281828074,0.1690605898815365,15.984375,True,,-1,-1
151,4,1175,1,True,0.000851063829787234,0.15895740368870598,14.84765625,True,,-1,-1
151,5,1431,1,True,0.0006988120195667365,0.004904189447451265,1.5166015625,True,,-1,-1
151,6,1687,1,True,0.0005927682276229994,0.17693832543436536,2.8828125,True,,-1,-1
151,7,1943,1,True,0.000514668039114771,0.1536304492465239,1.828125,True,,-1,-1
151,8,2199,1,True,0.00045475216007276033,0.14767454994943338,1.564453125,True,,-1,-1
151,9,2455,1,True,0.0004073319755600815,0.1675255245842553,16.296875,True,,-1,-1
151,10,2711,1,True,0.00036886757654002215,0.13409784928430757,13.9140625,True,,-1,-1
153,0,153,1,True,0.006535947712418301,0.2071976987263333,2.625,True,,-1,-1
153,1,409,1,True,0.0024449877750611247,0.2061146673670114,2.75,True,,-1,-1
153,2,665,1,True,0.0015037593984962407,0.17885161716359496,4.25,True,,-1,-1
153,3,921,1,True,0.0010857763300760044,0.1668928484557398,15.90625,True,,-1,-1
153,4,1177,1,True,0.0008496176720475786,0.08037592823876336,1.5,True,,-1,-1
153,5,1433,1,True,0.0006978367062107466,0.003510091924139456,1.2509765625,True,,-1,-1
153,6,1689,1,True,0.0005920663114268798,0.00906720265980626,2.16015625,True,,-1,-1
153,7,1945,1,True,0.0005141388174807198,0.15260302743457113,1.84375,True,,-1,-1
153,8,2201,1,True,0.00045433893684688776,0.15896976404964908,16.59375,True,,-1,-1
153,9,2457,1,True,0.000407000407000407,0.16671206022428203,16.03125,True,,-1,-1
153,10,2713,1,True,0.00036859565057132326,0.17183705305217636,19.859375,True,,-1,-1
155,0,155,1,True,0.0064516129032258064,0.11692140390488309,10.09375,True,,-1,-1
155,1,411,1,True,0.0024330900243309003,0.16236334733765173,16.984375,True,,-1,-1
155,2,667,1,True,0.0014992503748125937,0.13615831819861643,18.7890625,True,,-1,-1
155,3,923,1,True,0.0010834236186348862,0.19091602324178616,6.40625,True,,-1,-1
155,4,1179,1,True,0.0008481764206955047,0.1817234220933521,4.890625,True,,-1,-1
155,5,1435,1,True,0.0006968641114982578,0.2064530067576129,8.1328125,True,,-1,-1
155,6,1691,1,True,0.0005913660555884093,0.13488900679787363,17.0390625,True,,-1,-1
155,7,1947,1,True,0.0005136106831022085,0.18995452651237527,7.9375,True,,-1,-1
155,8,2203,1,True,0.00045392646391284613,0.0811366409437893,3.8125,True,,-1,-1
155,9,2459,1,True,0.00040666937779585197,0.17856033750471115,11.8515625,True,,-1,-1
155,10,2715,1,True,0.00036832412523020257,0.19644883481526038,11.15625,True,,-1,-1
157,0,157,1,True,0.006369426751592357,0.18233683915602025,2.875,True,,-1,-1
157,1,413,1,True,0.002421307506053269,0.11906732665166422,10.59375,True,,-1,-1
157,2,669,1,True,0.0014947683109118087,0.10818036606735525,7.46875,True,,-1,-1
157,3,925,1,True,0.001081081081081081,0.16254301152526848,16.359375,True,,-1,-1
157,4,1181,1,True,0.000846740050804403,0.1801044988668511,5.0,True,,-1,-1
157,5,1437,1,True,0.0006958942240779402,0.10273476610009913,4.59375,True,,-1,-1
157,6,1693,1,True,0.0005906674542232723,0.006710240168532286,2.5634765625,True,,-1,-1
157,7,1949,1,True,0.000513083632632119,0.1627180684134894,18.109375,True,,-1,-1
157,8,2205,1,True,0.00045351473922902497,0.19602079985039597,3.34375,True,,-1,-1
157,9,2461,1,True,0.0004063388866314506,0.19127703407211108,6.90625,True,,-1,-1
157,10,2717,1,True,0.000368052999631947,0.2092289414092669,5.625,True,,-1,-1
159,0,159,1,True,0.006289308176100629,0.1050551675450529,5.59375,True,,-1,-1
159,1,415,1,True,0.0024096385542168677,0.1527399255516692,16.75,True,,-1,-1
159,2,671,1,True,0.0014903129657228018,0.20752528761435143,11.0078125,True,,-1,-1
159,3,927,1,True,0.0010787486515641855,0.10839756508121101,13.96875,True,,-1,-1
159,4,1183,1,True,0.0008453085376162299,0.1650083319374624,9.375,True,,-1,-1
159,5,1439,1,True,0.0006949270326615705,0.12633805536036136,15.375,True,,-1,-1
159,6,1695,1,True,0.0005899705014749262,0.17100347570834223,22.59375,True,,-1,-1
159,7,1951,1,True,0.0005125576627370579,0.14822923810020197,22.09375,True,,-1,-1
159,8,2207,1,True,0.00045310376076121433,0.14274362735571464,21.40625,True,,-1,-1
159,9,2463,1,True,0.0004060089321965083,0.18837978115593842,27.234375,True,,-1,-1
159,10,2719,1,True,0.0003677822728944465,0.20849035237029886,5.8125,True,,-1,-1
161,0,161,1,True,0.006211180124223602,0.1311172053530456,12.09375,True,,-1,-1
161,1,417,1,True,0.002398081534772182,0.14796930222875784,16.78125,True,,-1,-1
161,2,673,1,True,0.0014858841010401188,0.21807087332709088,6.265625,True,,-1,-1
161,3,929,1,True,0.001076426264800861,0.15827467362397646,15.71875,True,,-1,-1
161,4,1185,1,True,0.0008438818565400844,0.13703263129182008,19.5390625,True,,-1,-1
161,5,1441,1,True,0.0006939625260235947,0.17691298416317902,16.84375,True,,-1,-1
161,6,1697,1,True,0.0005892751915144372,0.004353348521491754,2.2509765625,True,,-1,-1
161,7,1953,1,True,0.0005120327700972862,0.1485083623073246,2.0703125,True,,-1,-1
161,8,2209,1,True,0.0004526935264825713,0.1815374195449766,7.25,True,,-1,-1
161,9,2465,1,True,0.00040567951318458417,0.18965449854172425,6.375,True,,-1,-1
161,10,2721,1,True,0.0003675119441381845,0.20775856035514645,5.6875,True,,-1,-1
163,0,163,1,True,0.006134969325153374,0.09382837220203914,1.125,True,,-1,-1
163,1,419,1,True,0.002386634844868735,0.1828665001729694,2.90625,True,,-1,-1
163,2,675,1,True,0.0014814814814814814,0.1377867135040301,13.9375,True,,-1,-1
163,3,931,1,True,0.0010741138560687433,0.19499146069326811,2.09375,True,,-1,-1
163,4,1187,1,True,0.0008424599831508003,0.11035952368836821,8.0,True,,-1,-1
163,5,1443,1,True,0.000693000693000693,0.21441523266301563,3.34375,True,,-1,-1
163,6,1699,1,True,0.0005885815185403178,0.10518592068312821,5.625,True,,-1,-1
163,7,1955,1,True,0.0005115089514066496,0.12119806838123043,11.25,True,,-1,-1
163,8,2211,1,True,0.0004522840343735866,0.11595138985144829,10.5,True,,-1,-1
163,9,2467,1,True,0.00040535062829347385,0.16263306916215609,16.390625,True,,-1,-1
163,10,2723,1,True,0.0003672420124862284,0.15597594242127108,4.359375,True,,-1,-1
165,0,165,1,True,0.006060606060606061,0.15864235970736568,14.34375,True,,-1,-1
165,1,421,1,True,0.0023752969121140144,0.1781283598783535,3.25,True,,-1,-1
165,2,677,1,True,0.0014771048744460858,0.16112445368899422,4.625,True,,-1,-1
165,3,933,1,True,0.0010718113612004287,0.11549283247631167,9.84375,True,,-1,-1
165,4,1189,1,True,0.0008410428931875525,0.10867849197398,8.34375,True,,-1,-1
165,5,1445,1,True,0.0006920415224913495,0.21303221628269567,4.015625,True,,-1,-1
165,6,1701,1,True,0.0005878894767783657,0.1040105442464608,5.96875,True,,-1,-1
165,7,1957,1,True,0.000510986203372509,0.19753283578813255,4.34375,True,,-1,-1
165,8,2213,1,True,0.00045187528242205153,0.15354249376996776,17.25,True,,-1,-1
165,9,2469,1,True,0.0004050222762251924,0.16182339053419598,16.734375,True,,-1,-1
165,10,2725,1,True,0.0003669724770642202,0.20629040117800712,6.6328125,True,,-1,-1
167,0,167,1,True,0.005988023952095809,0.10818036606735525,7.46875,True,,-1,-1
167,1,423,1,True,0.002364066193853428,0.006710240168532286,2.5634765625,True,,-1,-1
167,2,679,1,True,0.0014727540500736377,0.2092289414092669,5.625,True,,-1,-1
167,3,935,1,True,0.0010695187165775401,0.15184878700592497,15.75,True,,-1,-1
167,4,1191,1,True,0.0008396305625524769,0.004989477015931337,4.5634765625,True,,-1,-1
167,5,1447,1,True,0.000691085003455425,0.09581668472983926,4.25,True,,-1,-1
167,6,1703,1,True,0.0005871990604815032,0.10283621105056208,5.3125,True,,-1,-1
167,7,1959,1,True,0.0005104645227156713,0.18381541701754128,8.6640625,True,,-1,-1
167,8,2215,1,True,0.0004514672686230248,0.2164462816732264,13.828125,True,,-1,-1
167,9,2471,1,True,0.0004046944556859571,0.161041786296239,16.47265625,True,,-1,-1
167,10,2727,1,True,0.0003667033370003667,0.17935827565293155,15.6640625,True,,-1,-1
169,0,169,1,True,0.005917159763313609,0.16112445368899422,4.625,True,,-1,-1
169,1,425,1,True,0.002352941176470588,0.1040105442464608,5.96875,True,,-1,-1
169,2,681,1,True,0.0014684287812041115,0.20629040117800712,6.6328125,True,,-1,-1
169,3,937,1,True,0.0010672358591248667,0.18733340943504673,22.796875,True,,-1,-1
169,4,1193,1,True,0.0008382229673093043,0.2076494053294113,11.8828125,True,,-1,-1
169,5,1449,1,True,0.0006901311249137336,0.17138295952360272,17.46875,True,,-1,-1
169,6,1705,1,True,0.0005865102639296188,0.12665650199884393,16.75,True,,-1,-1
169,7,1961,1,True,0.0005099439061703213,0.143121191015014,22.40625,True,,-1,-1
169,8,2217,1,True,0.0004510599909788002,0.17791339823648344,8.1640625,True,,-1,-1
169,9,2473,1,True,0.0004043671653861706,0.10821787970525948,14.34375,True,,-1,-1
169,10,2729,1,True,0.00036643459142543056,0.16523041816880657,19.46875,True,,-1,-1
171,0,171,1,True,0.005847953216374269,0.17506870902445343,15.46875,True,,-1,-1
171,1,427,1,True,0.00234192037470726,0.21516699680316173,4.765625,True,,-1,-1
171,2,683,1,True,0.0014641288433382138,0.10103402038978582,2.28125,True,,-1,-1
171,3,939,1,True,0.0010649627263045794,0.10909094443088477,9.21875,True,,-1,-1
171,4,1195,1,True,0.0008368200836820083,0.14216584382504543,14.125,True,,-1,-1
171,5,1451,1,True,0.0006891798759476223,0.17005238038335285,17.234375,True,,-1,-1
171,6,1707,1,True,0.0005858230814294083,0.17744788269153172,17.59375,True,,-1,-1
171,7,1963,1,True,0.0005094243504839531,0.18180146800203478,7.75,True,,-1,-1
171,8,2219,1,True,0.0004506534474988734,0.11234232953368609,10.375,True,,-1,-1
171,9,2475,1,True,0.00040404040404040404,0.18560855813962507,6.515625,True,,-1,-1
171,10,2731,1,True,0.0003661662394727206,0.12675928774062908,12.84375,True,,-1,-1
173,0,173,1,True,0.005780346820809248,0.20238444839285177,2.0,True,,-1,-1
173,1,429,1,True,0.002331002331002331,0.133183321055525,12.34375,True,,-1,-1
173,2,685,1,True,0.00145985401459854,0.17506870902445343,15.46875,True,,-1,-1
173,3,941,1,True,0.0010626992561105207,0.14548904184662295,16.03125,True,,-1,-1
173,4,1197,1,True,0.000835421888053467,0.14050353766439463,14.53125,True,,-1,-1
173,5,1453,1,True,0.0006882312456985547,0.2075402465583337,3.25,True,,-1,-1
173,6,1709,1,True,0.0005851375073142189,0.21516699680316173,4.765625,True,,-1,-1
173,7,1965,1,True,0.0005089058524173028,0.1545969829745256,17.75,True,,-1,-1
173,8,2221,1,True,0.00045024763619990995,0.1377858102498906,1.4453125,True,,-1,-1
173,9,2477,1,True,0.0004037141703673799,0.15863335368136527,15.96875,True,,-1,-1
173,10,2733,1,True,0.00036589828027808267,0.10103402038978582,2.28125,True,,-1,-1
175,0,175,1,True,0.005714285714285714,0.11359169179190103,9.34375,True,,-1,-1
175,1,431,1,True,0.002320185614849188,0.15483160202865567,2.625,True,,-1,-1
175,2,687,1,True,0.001455604075691412,0.09521222670598252,2.625,True,,-1,-1
175,3,943,1,True,0.0010604453870625664,0.18223373626611844,2.6884765625,True,,-1,-1
175,4,1199,1,True,0.0008340283569641367,0.2161553779033871,6.765625,True,,-1,-1
175,5,1455,1,True,0.0006872852233676976,0.167305582253933,17.21875,True,,-1,-1
175,6,1711,1,True,0.0005844535359438924,0.17510965475461188,18.21875,True,,-1,-1
175,7,1967,1,True,0.0005083884087442806,0.11508558410619554,11.25,True,,-1,-1
175,8,2223,1,True,0.000449842555105713,0.1866559126215877,23.734375,True,,-1,-1
175,9,2479,1,True,0.0004033884630899556,0.08090134908480628,3.0625,True,,-1,-1
175,10,2735,1,True,0.00036563071297989033,0.1637500215887764,20.046875,True,,-1,-1
177,0,177,1,True,0.005649717514124294,0.18040544434747488,1.875,True,,-1,-1
177,1,433,1,True,0.0023094688221709007,0.0989290493224953,1.28125,True,,-1,-1
177,2,689,1,True,0.001451378809869376,0.16930217466526087,15.53125,True,,-1,-1
177,3,945,1,True,0.0010582010582010583,0.18087536915950497,1.9375,True,,-1,-1
177,4,1201,1,True,0.0008326394671107411,0.1634627801112092,4.9375,True,,-1,-1
177,5,1457,1,True,0.0006863417982155113,0.15374476980003127,1.375,True,,-1,-1
177,6,1713,1,True,0.0005837711617046118,0.1102095560940852,0.78125,True,,-1,-1
177,7,1969,1,True,0.0005078720162519045,0.08892755484587614,0.265625,True,,-1,-1
177,8,2225,1,True,0.00044943820224719103,0.14816898273993995,16.84375,True,,-1,-1
177,9,2481,1,True,0.00040306328093510683,0.19588619264278584,2.25,True,,-1,-1
177,10,2737,1,True,0.00036536353671903543,0.09958239415802883,2.4375,True,,-1,-1
179,0,179,1,True,0.00558659217877095,0.16927464705721953,1.75,True,,-1,-1
179,1,435,1,True,0.0022988505747126436,0.09433857628367179,1.25,True,,-1,-1
179,2,691,1,True,0.001447178002894356,0.16641068837859418,15.40625,True,,-1,-1
179,3,947,1,True,0.0010559662090813093,0.1787649659234599,1.953125,True,,-1,-1
179,4,1203,1,True,0.0008312551953449709,0.16180121778255196,4.8125,True,,-1,-1
179,5,1459,1,True,0.0006854009595613434,0.152374612633292,1.34375,True,,-1,-1
179,6,1715,1,True,0.0005830903790087463,0.10904384207104667,0.65625,True,,-1,-1
179,7,1971,1,True,0.0005073566717402334,0.08791319492612888,0.31640625,True,,-1,-1
179,8,2227,1,True,0.000449034575662326,0.14727119046295323,16.71875,True,,-1,-1
179,9,2483,1,True,0.0004027386226339106,0.1950809381449503,2.21875,True,,-1,-1
179,10,2739,1,True,0.0003650967506389193,0.09885238372669428,2.3125,True,,-1,-1
181,0,181,1,True,0.0055248618784530384,0.10673076923076924,0.4375,True,,-1,-1
181,1,437,1,True,0.002288329519450801,0.16670687583639793,14.59375,True,,-1,-1
181,2,693,1,True,0.001443001443001443,0.20238444839285177,2.0,True,,-1,-1
181,3,949,1,True,0.001053740779768177,0.17671886162793035,2.375,True,,-1,-1
181,4,1205,1,True,0.0008298755186721991,0.006847426470588235,0.25390625,True,,-1,-1
181,5,1461,1,True,0.0006844626967830253,0.12472031756929652,11.34375,True,,-1,-1
181,6,1717,1,True,0.0005824111822947001,0.133183321055525,12.34375,True,,-1,-1
181,7,1973,1,True,0.0005068423720223011,0.19023874556040174,4.0,True,,-1,-1
181,8,2229,1,True,0.00044863167339614175,0.18604783991171495,3.25,True,,-1,-1
181,9,2485,1,True,0.00040241448692152917,0.11692140390488309,10.09375,True,,-1,-1
181,10,2741,1,True,0.00036483035388544326,0.17506870902445343,15.46875,True,,-1,-1
183,0,183,1,True,0.00546448087431694,0.12108443201759407,11.21875,True,,-1,-1
183,1,439,1,True,0.002277904328018223,0.18838608050096106,4.5,True,,-1,-1
183,2,695,1,True,0.0014388489208633094,0.16062457968833765,15.734375,True,,-1,-1
183,3,951,1,True,0.0010515247108307045,0.007928114885014208,1.41015625,True,,-1,-1
183,4,1207,1,True,0.0008285004142502071,0.20953563719269425,6.25,True,,-1,-1
183,5,1463,1,True,0.000683526999316473,0.16180670669798364,17.484375,True,,-1,-1
183,6,1719,1,True,0.0005817335660267597,0.17049743409074355,18.359375,True,,-1,-1
183,7,1975,1,True,0.0005063291139240507,0.13737341444375098,2.1328125,True,,-1,-1
183,8,2231,1,True,0.00044822949350067237,0.10695345545224216,10.15625,True,,-1,-1
183,9,2487,1,True,0.0004020908725371934,0.18080017472060494,6.375,True,,-1,-1
183,10,2743,1,True,0.0003645643456069996,0.12238291488932401,13.09375,True,,-1,-1
185,0,185,1,True,0.005405405405405406,0.1884401844093226,3.75,True,,-1,-1
185,1,441,1,True,0.0022675736961451248,0.08075309691117519,1.375,True,,-1,-1
185,2,697,1,True,0.0014347202295552368,0.15779666215170113,15.46875,True,,-1,-1
185,3,953,1,True,0.001049317943336831,0.005835930847213521,1.8134765625,True,,-1,-1
185,4,1209,1,True,0.0008271298593879239,0.1568329554002553,5.203125,True,,-1,-1
185,5,1465,1,True,0.0006825938566552901,0.14828088278048202,1.8203125,True,,-1,-1
185,6,1721,1,True,0.0005810575246949448,0.20819979329853783,4.125,True,,-1,-1
185,7,1977,1,True,0.0005058168942842691,0.1485434921346525,17.59375,True,,-1,-1
185,8,2233,1,True,0.0004478280340349306,0.144583082868677,16.96875,True,,-1,-1
185,9,2489,1,True,0.0004017677782241864,0.1926709680830994,2.34375,True,,-1,-1
185,10,2745,1,True,0.00036429872495446266,0.09666623043494421,2.5625,True,,-1,-1
187,0,187,1,True,0.0053475935828877,0.1777392205636206,3.625,True,,-1,-1
187,1,443,1,True,0.002257336343115124,0.17935261916760298,4.5,True,,-1,-1
187,2,699,1,True,0.001430615164520744,0.18112769794276656,5.875,True,,-1,-1
187,3,955,1,True,0.0010471204188481676,0.0037426500636743394,1.5009765625,True,,-1,-1
187,4,1211,1,True,0.0008257638315441783,0.20622940102254747,7.0078125,True,,-1,-1
187,5,1467,1,True,0.0006816632583503749,0.1591211874294189,16.84375,True,,-1,-1
187,6,1723,1,True,0.0005803830528148578,0.20703907379966954,4.1875,True,,-1,-1
187,7,1979,1,True,0.0005053057099545225,0.14753310489854793,17.46875,True,,-1,-1
187,8,2235,1,True,0.00044742729306487697,0.1825539996079459,3.5634765625,True,,-1,-1
187,9,2491,1,True,0.0004014452027298274,0.16578870985645341,11.0,True,,-1,-1
187,10,2747,1,True,0.00036403349108117945,0.19828311507709495,6.03125,True,,-1,-1
189,0,189,1,True,0.005291005291005291,0.14096180831389848,13.34375,True,,-1,-1
189,1,445,1,True,0.0022471910112359553,0.1101723979398652,7.96875,True,,-1,-1
189,2,701,1,True,0.0014265335235378032,0.11359169179190103,9.34375,True,,-1,-1
189,3,957,1,True,0.0010449320794148381,0.10366240988488576,5.09375,True,,-1,-1
189,4,1213,1,True,0.0008244023083264633,0.10225388968950369,3.28125,True,,-1,-1
189,5,1469,1,True,0.0006807351940095302,0.19662539477179863,3.84375,True,,-1,-1
189,6,1725,1,True,0.0005797101449275362,0.15483160202865567,2.625,True,,-1,-1
189,7,1981,1,True,0.0005047955577990914,0.10799952198383234,11.28125,True,,-1,-1
189,8,2237,1,True,0.0004470272686633885,0.22011544380444512,9.578125,True,,-1,-1
189,9,2493,1,True,0.00040112314480545525,0.15220516619338043,16.25,True,,-1,-1
189,10,2749,1,True,0.0003637686431429611,0.09521222670598252,2.625,True,,-1,-1
191,0,191,1,True,0.005235602094240838,0.15676449236312817,3.625,True,,-1,-1
191,1,447,1,True,0.0022371364653243847,0.2080218119440436,11.5078125,True,,-1,-1
191,2,703,1,True,0.001422475106685633,0.18685947578575762,22.296875,True,,-1,-1
191,3,959,1,True,0.0010427528675703858,0.12656964405883286,15.875,True,,-1,-1
191,4,1215,1,True,0.0008230452674897119,0.1640546989974233,21.046875,True,,-1,-1
191,5,1471,1,True,0.0006798096532970768,0.1428946391346334,21.90625,True,,-1,-1
191,6,1727,1,True,0.0005790387955993051,0.20472161074741033,4.6328125,True,,-1,-1
191,7,1983,1,True,0.0005042864346949068,0.18437993666310556,4.265625,True,,-1,-1
191,8,2239,1,True,0.00044662795891022776,0.141901713410825,17.2890625,True,,-1,-1
191,9,2495,1,True,0.0004008016032064128,0.17757941474719657,7.1640625,True,,-1,-1
191,10,2751,1,True,0.0003635041802980734,0.20825846532910014,21.5703125,True,,-1,-1
193,0,193,1,True,0.0051813471502590676,0.1720492343058542,14.96875,True,,-1,-1
193,1,449,1,True,0.0022271714922048997,0.13976169790178336,14.28125,True,,-1,-1
193,2,705,1,True,0.0014184397163120568,0.1852978713447509,1.828125,True,,-1,-1
193,3,961,1,True,0.001040582726326743,0.21533916253198662,3.6875,True,,-1,-1
193,4,1217,1,True,0.0008216926869350862,0.1759200538510603,15.84375,True,,-1,-1
193,5,1473,1,True,0.0006788866259334691,0.11655440495118882,10.84375,True,,-1,-1
193,6,1729,1,True,0.000578368999421631,0.1262321293891423,11.84375,True,,-1,-1
193,7,1985,1,True,0.0005037783375314861,0.1841835558751257,3.78125,True,,-1,-1
193,8,2241,1,True,0.0004462293618920125,0.18063528196952988,2.953125,True,,-1,-1
193,9,2497,1,True,0.00040048057669203043,0.11210873368209184,9.875,True,,-1,-1
193,10,2753,1,True,0.0003632401017072285,0.1707055915671303,15.15625,True,,-1,-1
195,0,195,1,True,0.005128205128205128,0.16182409632501615,15.03125,True,,-1,-1
195,1,451,1,True,0.0022172949002217295,0.1616165796732462,4.6875,True,,-1,-1
195,2,707,1,True,0.0014144271570014145,0.14360343456493146,15.59375,True,,-1,-1
195,3,963,1,True,0.0010384215991692627,0.21326284358896877,4.078125,True,,-1,-1
195,4,1219,1,True,0.0008203445447087777,0.17428018884886187,16.09375,True,,-1,-1
195,5,1475,1,True,0.0006779661016949153,0.1536930961796063,17.3125,True,,-1,-1
195,6,1731,1,True,0.0005777007510109763,0.16353039969718003,18.671875,True,,-1,-1
195,7,1987,1,True,0.0005032712632108706,0.2208231981589134,10.140625,True,,-1,-1
195,8,2243,1,True,0.00044583147570218456,0.1797438630402528,3.015625,True,,-1,-1
195,9,2499,1,True,0.00040016006402561027,0.1874223141292146,22.859375,True,,-1,-1
195,10,2755,1,True,0.0003629764065335753,0.15651807772242338,19.6875,True,,-1,-1
197,0,197,1,True,0.005076142131979695,0.19052565081976847,1.5,True,,-1,-1
197,1,453,1,True,0.002207505518763797,0.00390625,0.00390625,True,,-1,-1
197,2,709,1,True,0.0014104372355430183,0.18040544434747488,1.875,True,,-1,-1
197,3,965,1,True,0.0010362694300518134,0.10856900452488688,0.46875,True,,-1,-1
197,4,1221,1,True,0.000819000819000819,0.2115302444572525,2.5625,True,,-1,-1
197,5,1477,1,True,0.0006770480704129993,0.08870192307692308,0.203125,True,,-1,-1
197,6,1733,1,True,0.0005770340450086555,0.0989290493224953,1.28125,True,,-1,-1
197,7,1989,1,True,0.0005027652086475615,0.07907681940700809,0.625,True,,-1,-1
197,8,2245,1,True,0.00044543429844097997,0.17891949911885982,3.3125,True,,-1,-1
197,9,2501,1,True,0.00039984006397441024,0.13685276120937886,0.9453125,True,,-1,-1
197,10,2757,1,True,0.0003627130939426913,0.16930217466526087,15.53125,True,,-1,-1
199,0,199,1,True,0.005025125628140704,0.1416171234104971,15.03125,True,,-1,-1
199,1,455,1,True,0.002197802197802198,0.1015218252678346,2.78125,True,,-1,-1
199,2,711,1,True,0.0014064697609001407,0.16426071426583835,5.9375,True,,-1,-1
199,3,967,1,True,0.001034126163391934,0.1702820542464672,17.734375,True,,-1,-1
199,4,1223,1,True,0.0008176614881439084,0.17100827699328658,15.90625,True,,-1,-1
199,5,1479,1,True,0.000676132521974307,0.11249252478751606,10.875,True,,-1,-1
199,6,1735,1,True,0.0005763688760806917,0.1227720180023471,12.109375,True,,-1,-1
199,7,1991,1,True,0.0005022601707684581,0.18111650510016922,3.640625,True,,-1,-1
199,8,2247,1,True,0.0004450378282153983,0.16463052235639383,7.0625,True,,-1,-1
199,9,2503,1,True,0.00039952057530962844,0.0077001633685267225,6.0634765625,True,,-1,-1
199,10,2759,1,True,0.0003624501631025734,0.15506786632655667,19.875,True,,-1,-1
201,0,201,1,True,0.004975124378109453,0.0046454813316302145,1.0009765625,True,,-1,-1
201,1,457,1,True,0.002188183807439825,0.17409797310542163,16.03125,True,,-1,-1
201,2,713,1,True,0.001402524544179523,0.008161577908717356,1.28515625,True,,-1,-1
201,3,969,1,True,0.0010319917440660474,0.2070819823455598,3.8125,True,,-1,-1
201,4,1225,1,True,0.0008163265306122449,0.16942317146239216,16.484375,True,,-1,-1
201,5,1481,1,True,0.0006752194463200541,0.13748588351349159,2.0078125,True,,-1,-1
201,6,1737,1,True,0.0005757052389176742,0.12162429677442438,12.25,True,,-1,-1
201,7,1993,1,True,0.0005017561465127947,0.1801153671882079,4.015625,True,,-1,-1
201,8,2249,1,True,0.00044464206313917296,0.17713587580971107,3.3828125,True,,-1,-1
201,9,2505,1,True,0.0003992015968063872,0.10891358121974976,9.78125,True,,-1,-1
201,10,2761,1,True,0.0003621876131836291,0.1678087813123584,15.65625,True,,-1,-1
203,0,203,1,True,0.0049261083743842365,0.21262194751402105,2.8125,True,,-1,-1
203,1,459,1,True,0.002178649237472767,0.16978573365945815,15.78125,True,,-1,-1
203,2,715,1,True,0.0013986013986013986,0.005369947622609606,1.3134765625,True,,-1,-1
203,3,971,1,True,0.0010298661174047373,0.15397349807084554,1.625,True,,-1,-1
203,4,1227,1,True,0.0008149959250203749,0.16779703964308879,16.09375,True,,-1,-1
203,5,1483,1,True,0.0006743088334457181,0.14831877303352892,17.09375,True,,-1,-1
203,6,1739,1,True,0.0005750431282346176,0.19783088206649613,4.65625,True,,-1,-1
203,7,1995,1,True,0.0005012531328320802,0.1791793137504772,3.625,True,,-1,-1
203,8,2251,1,True,0.000444247001332741,0.009560406044801312,2.34765625,True,,-1,-1
203,9,2507,1,True,0.00039888312724371757,0.18550463984912902,2.140625,True,,-1,-1
203,10,2763,1,True,0.0003619254433586681,0.08998329120416798,2.50390625,True,,-1,-1
205,0,205,1,True,0.004878048780487805,0.15181651512787414,1.1875,True,,-1,-1
205,1,461,1,True,0.0021691973969631237,0.2043075253159287,2.125,True,,-1,-1
205,2,717,1,True,0.001394700139470014,0.16927464705721953,1.75,True,,-1,-1
205,3,973,1,True,0.0010277492291880781,0.12563272632842062,11.46875,True,,-1,-1
205,4,1229,1,True,0.0008136696501220504,0.20503006866852985,2.25,True,,-1,-1
205,5,1485,1,True,0.0006734006734006734,0.18664592603611685,3.375,True,,-1,-1
205,6,1741,1,True,0.0005743825387708214,0.09433857628367179,1.25,True,,-1,-1
205,7,1997,1,True,0.000500751126690035,0.17818406042127186,3.75,True,,-1,-1
205,8,2253,1,True,0.0004438526409232135,0.17537142114071333,3.0,True,,-1,-1
205,9,2509,1,True,0.00039856516540454366,0.14584314949534816,16.15625,True,,-1,-1
205,10,2765,1,True,0.0003616636528028933,0.16641068837859418,15.40625,True,,-1,-1
207,0,207,1,True,0.004830917874396135,0.11585090753633576,10.46875,True,,-1,-1
207,1,463,1,True,0.0021598272138228943,0.16110396607376432,16.234375,True,,-1,-1
207,2,719,1,True,0.0013908205841446453,0.1018079005886145,4.46875,True,,-1,-1
207,3,975,1,True,0.0010256410256410256,0.16203449713078544,17.984375,True,,-1,-1
207,4,1231,1,True,0.0008123476848090983,0.19073558777961694,6.78125,True,,-1,-1
207,5,1487,1,True,0.0006724949562878278,0.10710284296344624,10.65625,True,,-1,-1
207,6,1743,1,True,0.0005737234652897303,0.1431636923514133,23.03125,True,,-1,-1
207,7,1999,1,True,0.0005002501250625312,0.17717293388579608,4.0078125,True,,-1,-1
207,8,2255,1,True,0.0004434589800443459,0.13479048606654592,17.4140625,True,,-1,-1
207,9,2511,1,True,0.00039824771007566706,0.10652202035788387,9.40625,True,,-1,-1
207,10,2767,1,True,0.0003614022406938923,0.1783495340416227,11.1015625,True,,-1,-1
209,0,209,1,True,0.004784688995215311,0.18445548322381686,3.0,True,,-1,-1
209,1,465,1,True,0.002150537634408602,0.19570710954822995,2.1875,True,,-1,-1
209,2,721,1,True,0.0013869625520110957,0.21487705532311416,3.4375,True,,-1,-1
209,3,977,1,True,0.0010235414534288639,0.12153897747213953,11.34375,True,,-1,-1
209,4,1233,1,True,0.0008110300081103001,0.16290324207281892,16.484375,True,,-1,-1
209,5,1489,1,True,0.000671591672263264,0.18395974208819643,3.53125,True,,-1,-1
209,6,1745,1,True,0.0005730659025787965,0.15552999151081104,18.375,True,,-1,-1
209,7,2001,1,True,0.0004997501249375312,0.17618516198382975,3.625,True,,-1,-1
209,8,2257,1,True,0.00044306601683650863,0.006907090562233074,2.6884765625,True,,-1,-1
209,9,2513,1,True,0.0003979307600477517,0.14425149149395816,16.21875,True,,-1,-1
209,10,2769,1,True,0.00036114120621162876,0.1911566267992449,5.625,True,,-1,-1
211,0,211,1,True,0.004739336492890996,0.1749770993741518,2.875,True,,-1,-1
211,1,467,1,True,0.0021413276231263384,0.11406697696300369,9.46875,True,,-1,-1
211,2,723,1,True,0.0013831258644536654,0.21211084036131977,3.640625,True,,-1,-1
211,3,979,1,True,0.0010214504596527069,0.1968522550258821,3.96875,True,,-1,-1
211,4,1235,1,True,0.0008097165991902834,0.16128382218887224,16.359375,True,,-1,-1
211,5,1491,1,True,0.0006706908115358819,0.22026443069359883,9.703125,True,,-1,-1
211,6,1747,1,True,0.0005724098454493417,0.1543851786214105,18.4375,True,,-1,-1
211,7,2003,1,True,0.0004992511233150275,0.13549268692555488,18.1640625,True,,-1,-1
211,8,2259,1,True,0.0004426737494466578,0.006021747179427951,2.5634765625,True,,-1,-1
211,9,2515,1,True,0.00039761431411530816,0.18232207548873328,2.8134765625,True,,-1,-1
211,10,2771,1,True,0.00036088054853843375,0.1904348684579578,5.78125,True,,-1,-1
213,0,213,1,True,0.004694835680751174,0.0625,0.0625,True,,-1,-1
213,1,469,1,True,0.0021321961620469083,0.1361425339366516,0.9375,True,,-1,-1
213,2,725,1,True,0.001379310344827586,0.10673076923076924,0.4375,True,,-1,-1
213,3,981,1,True,0.0010193679918450561,0.09246967654986524,1.09375,True,,-1,-1
213,4,1237,1,True,0.0008084074373484236,0.14750617030028795,1.0625,True,,-1,-1
213,5,1493,1,True,0.0006697923643670462,0.07818396226415095,0.59375,True,,-1,-1
213,6,1749,1,True,0.0005717552887364208,0.16670687583639793,14.59375,True,,-1,-1
213,7,2005,1,True,0.0004987531172069825,0.14800406183502524,13.84375,True,,-1,-1
213,8,2261,1,True,0.0004422821760283061,0.06875,0.09375,True,,-1,-1
213,9,2517,1,True,0.0003972983710766786,0.18233683915602025,2.875,True,,-1,-1
213,10,2773,1,True,0.0003606202668589975,0.20238444839285177,2.0,True,,-1,-1
215,0,215,1,True,0.004651162790697674,0.1300876936276576,12.40625,True,,-1,-1
215,1,471,1,True,0.0021231422505307855,0.144074688099333,16.09375,True,,-1,-1
215,2,727,1,True,0.001375515818431912,0.2066236872034883,3.3125,True,,-1,-1
215,3,983,1,True,0.001017293997965412,0.15391903382081734,17.8125,True,,-1,-1
215,4,1239,1,True,0.0008071025020177562,0.15809544074583665,16.03125,True,,-1,-1
215,5,1495,1,True,0.0006688963210702341,0.17989245145035682,3.515625,True,,-1,-1
215,6,1751,1,True,0.0005711022272986865,0.08846278249758034,1.25390625,True,,-1,-1
215,7,2007,1,True,0.0004982561036372695,0.006501273236749015,3.5009765625,True,,-1,-1
215,8,2263,1,True,0.0004418912947414936,0.0042551874072224005,2.5634765625,True,,-1,-1
215,9,2519,1,True,0.0003969829297340214,0.21918899522340848,8.640625,True,,-1,-1
215,10,2775,1,True,0.00036036036036036037,0.1889937750546575,5.6875,True,,-1,-1
217,0,217,1,True,0.004608294930875576,0.09586918852856975,1.625,True,,-1,-1
217,1,473,1,True,0.0021141649048625794,0.17946853065141485,2.328125,True,,-1,-1
217,2,729,1,True,0.0013717421124828531,0.15283137268201308,1.71875,True,,-1,-1
217,3,985,1,True,0.0010152284263959391,0.0882513373968232,0.69140625,True,,-1,-1
217,4,1241,1,True,0.0008058017727639,0.19534937049999682,2.59375,True,,-1,-1
217,5,1497,1,True,0.0006680026720106881,0.17862288059352457,3.765625,True,,-1,-1
217,6,1753,1,True,0.0005704506560182544,0.1906610856653318,4.53125,True,,-1,-1
217,7,2009,1,True,0.0004977600796416127,0.06911854674839152,0.6015625,True,,-1,-1
217,8,2265,1,True,0.0004415011037527594,0.1053820760381694,6.125,True,,-1,-1
217,9,2521,1,True,0.0003966679888932963,0.18069916806017575,2.390625,True,,-1,-1
217,10,2777,1,True,0.00036010082823190496,0.16209075161511854,15.5625,True,,-1,-1
219,0,219,1,True,0.0045662100456621,0.18990344674820603,4.625,True,,-1,-1
219,1,475,1,True,0.002105263157894737,0.008628867628343525,1.53515625,True,,-1,-1
219,2,731,1,True,0.0013679890560875513,0.16226227989935998,17.609375,True,,-1,-1
219,3,987,1,True,0.0010131712259371835,0.13771090601574182,2.2578125,True,,-1,-1
219,4,1243,1,True,0.0008045052292839903,0.1810681967229103,6.5,True,,-1,-1
219,5,1499,1,True,0.00066711140760507,0.17728406786661682,3.6328125,True,,-1,-1
219,6,1755,1,True,0.0005698005698005698,0.13766874461288336,2.8828125,True,,-1,-1
219,7,2011,1,True,0.0004972650422675286,0.004512935635915137,3.3134765625,True,,-1,-1
219,8,2267,1,True,0.0004411116012351125,0.206826809545767,9.5078125,True,,-1,-1
219,9,2523,1,True,0.00039635354736424893,0.1402832970491637,16.375,True,,-1,-1
219,10,2779,1,True,0.0003598416696653472,0.14788016655541678,19.71875,True,,-1,-1
221,0,221,1,True,0.004524886877828055,0.15466363630311036,14.46875,True,,-1,-1
221,1,477,1,True,0.0020964360587002098,0.1711333831166991,2.25,True,,-1,-1
221,2,733,1,True,0.001364256480218281,0.12108443201759407,11.21875,True,,-1,-1
221,3,989,1,True,0.0010111223458038423,0.18754359210433946,3.875,True,,-1,-1
221,4,1245,1,True,0.0008032128514056225,0.11478024372477258,9.96875,True,,-1,-1
221,5,1501,1,True,0.0006662225183211193,0.17596313711704467,3.5,True,,-1,-1
221,6,1757,1,True,0.0005691519635742744,0.18838608050096106,4.5,True,,-1,-1
221,7,2013,1,True,0.0004967709885742673,0.10552966721962975,6.84375,True,,-1,-1
221,8,2269,1,True,0.00044072278536800354,0.10361920592252505,6.09375,True,,-1,-1
221,9,2525,1,True,0.00039603960396039607,0.17911683080734447,2.453125,True,,-1,-1
221,10,2781,1,True,0.0003595828838547285,0.16062457968833765,15.734375,True,,-1,-1
223,0,223,1,True,0.004484304932735426,0.10718595466054716,7.84375,True,,-1,-1
223,1,479,1,True,0.0020876826722338203,0.10227129261827159,4.96875,True,,-1,-1
223,2,735,1,True,0.0013605442176870747,0.1957186504478121,3.71875,True,,-1,-1
223,3,991,1,True,0.0010090817356205853,0.10732695771019657,11.15625,True,,-1,-1
223,4,1247,1,True,0.0008019246190858059,0.15167064887127313,16.125,True,,-1,-1
223,5,1503,1,True,0.0006653359946773121,0.1349382838791383,17.9140625,True,,-1,-1
223,6,1759,1,True,0.0005685048322910744,0.14757521120880512,18.34375,True,,-1,-1
223,7,2015,1,True,0.0004962779156327543,0.20686356694188146,10.3828125,True,,-1,-1
223,8,2271,1,True,0.00044033465433729633,0.10273837921210618,5.6875,True,,-1,-1
223,9,2527,1,True,0.0003957261574990107,0.17713001163922126,22.3125,True,,-1,-1
223,10,2783,1,True,0.00035932446999640676,0.10791845699121935,13.34375,True,,-1,-1
225,0,225,1,True,0.0044444444444444444,0.1630929576260021,4.875,True,,-1,-1
225,1,481,1,True,0.002079002079002079,0.21395472550778796,4.265625,True,,-1,-1
225,2,737,1,True,0.0013568521031207597,0.154144903408522,17.5,True,,-1,-1
225,3,993,1,True,0.0010070493454179255,0.22115861855247335,10.328125,True,,-1,-1
225,4,1249,1,True,0.0008006405124099279,0.18768902821171815,23.046875,True,,-1,-1
225,5,1505,1,True,0.000664451827242525,0.006611949838509804,3.1884765625,True,,-1,-1
225,6,1761,1,True,0.0005678591709256105,0.10791547562224563,11.90625,True,,-1,-1
225,7,2017,1,True,0.0004957858205255329,0.10354576961422611,6.5625,True,,-1,-1
225,8,2273,1,True,0.0004399472063352398,0.12685196720603703,17.0,True,,-1,-1
225,9,2529,1,True,0.00039541320680110717,0.1642021866158989,6.75,True,,-1,-1
225,10,2785,1,True,0.0003590664272890485,0.1853991170474031,6.015625,True,,-1,-1
227,0,227,1,True,0.004405286343612335,0.0009765625,0.0009765625,True,,-1,-1
227,1,483,1,True,0.002070393374741201,0.10719032805429865,0.4453125,True,,-1,-1
227,2,739,1,True,0.0013531799729364006,0.08780048076923078,0.19140625,True,,-1,-1
227,3,995,1,True,0.0010050251256281408,0.07840717654986523,0.6015625,True,,-1,-1
227,4,1251,1,True,0.0007993605115907274,0.1363200907548334,0.939453125,True,,-1,-1
227,5,1507,1,True,0.0006635700066357001,0.06889740566037736,0.1015625,True,,-1,-1
227,6,1763,1,True,0.0005672149744753262,0.1587683677718818,14.34765625,True,,-1,-1
227,7,2019,1,True,0.0004952947003467063,0.14107184352516605,13.3515625,True,,-1,-1
227,8,2275,1,True,0.00043956043956043956,0.06259765625,0.06298828125,True,,-1,-1
227,9,2531,1,True,0.0003951007506914263,0.17680664252680675,2.3828125,True,,-1,-1
227,10,2787,1,True,0.0003588087549336204,0.19736212696428032,1.75390625,True,,-1,-1
229,0,229,1,True,0.004366812227074236,0.21007675608515947,2.5,True,,-1,-1
229,1,485,1,True,0.002061855670103093,0.12836995260579287,11.84375,True,,-1,-1
229,2,741,1,True,0.001349527665317139,0.1884401844093226,3.75,True,,-1,-1
229,3,997,1,True,0.0010030090270812437,0.1795185799942256,4.125,True,,-1,-1
229,4,1253,1,True,0.0007980845969672786,0.1469054724415238,16.53125,True,,-1,-1
229,5,1509,1,True,0.0006626905235255136,0.10597071389425725,6.71875,True,,-1,-1
229,6,1765,1,True,0.0005665722379603399,0.08075309691117519,1.375,True,,-1,-1
229,7,2021,1,True,0.0004948045522018803,0.21741124272023069,6.015625,True,,-1,-1
229,8,2277,1,True,0.0004391743522178305,0.21594702800440976,5.265625,True,,-1,-1
229,9,2533,1,True,0.00039478878799842083,0.009330129900433286,2.03515625,True,,-1,-1
229,10,2789,1,True,0.00035855145213338117,0.15779666215170113,15.46875,True,,-1,-1
231,0,231,1,True,0.004329004329004329,0.16254301152526848,16.359375,True,,-1,-1
231,1,487,1,True,0.002053388090349076,0.1627180684134894,18.109375,True,,-1,-1
231,2,743,1,True,0.0013458950201884253,0.10755109149055879,10.78125,True,,-1,-1
231,3,999,1,True,0.001001001001001001,0.1775063888981864,4.1328125,True,,-1,-1
231,4,1255,1,True,0.0007968127490039841,0.10678749026492429,9.53125,True,,-1,-1
231,5,1511,1,True,0.0006618133686300463,0.20697382512941884,10.0078125,True,,-1,-1
231,6,1767,1,True,0.0005659309564233164,0.1430331483338726,18.0,True,,-1,-1
231,7,2023,1,True,0.0004943153732081067,0.17753330918265423,18.90625,True,,-1,-1
231,8,2279,1,True,0.00043878894251864854,0.17617991014985346,18.28125,True,,-1,-1
231,9,2535,1,True,0.0003944773175542406,0.2128608665110621,8.921875,True,,-1,-1
231,10,2791,1,True,0.00035829451809387314,0.18324945215396846,6.4140625,True,,-1,-1
233,0,233,1,True,0.004291845493562232,0.11549283247631167,9.84375,True,,-1,-1
233,1,489,1,True,0.002044989775051125,0.19753283578813255,4.34375,True,,-1,-1
233,2,745,1,True,0.0013422818791946308,0.22071139136106013,10.078125,True,,-1,-1
233,3,1001,1,True,0.000999000999000999,0.13582542871792402,18.5390625,True,,-1,-1
233,4,1257,1,True,0.0007955449482895784,0.18258709315657778,3.1884765625,True,,-1,-1
233,5,1513,1,True,0.0006609385327164573,0.1033255052970455,6.3125,True,,-1,-1
233,6,1769,1,True,0.0005652911249293386,0.1815350272176927,4.640625,True,,-1,-1
233,7,2025,1,True,0.0004938271604938272,0.1765455462122213,19.28125,True,,-1,-1
233,8,2281,1,True,0.00043840420868040335,0.17530443465332632,18.71875,True,,-1,-1
233,9,2537,1,True,0.00039416633819471815,0.13475763527921886,16.7890625,True,,-1,-1
233,10,2793,1,True,0.00035803795202291446,0.2201796277783988,12.515625,True,,-1,-1
235,0,235,1,True,0.00425531914893617,0.14548904184662295,16.03125,True,,-1,-1
235,1,491,1,True,0.002036659877800407,0.1545969829745256,17.75,True,,-1,-1
235,2,747,1,True,0.0013386880856760374,0.180338275585879,3.453125,True,,-1,-1
235,3,1003,1,True,0.0009970089730807576,0.0068333847366497495,3.4384765625,True,,-1,-1
235,4,1259,1,True,0.0007942811755361397,0.21945361290434248,8.578125,True,,-1,-1
235,5,1515,1,True,0.0006600660066006601,0.12699859477201944,17.25,True,,-1,-1
235,6,1771,1,True,0.000564652738565782,0.18040803030510366,4.515625,True,,-1,-1
235,7,2027,1,True,0.000493339911198816,0.1755601490894824,19.21875,True,,-1,-1
235,8,2283,1,True,0.0004380201489268506,0.21331654573776013,4.59375,True,,-1,-1
235,9,2539,1,True,0.00039385584875935406,0.1724462984691872,22.421875,True,,-1,-1
235,10,2795,1,True,0.00035778175313059033,0.18176761056168086,5.765625,True,,-1,-1
237,0,237,1,True,0.004219409282700422,0.17671886162793035,2.375,True,,-1,-1
237,1,493,1,True,0.002028397565922921,0.19023874556040174,4.0,True,,-1,-1
237,2,749,1,True,0.0013351134846461949,0.1777392205636206,3.625,True,,-1,-1
237,3,1005,1,True,0.0009950248756218905,0.10685410612040565,6.96875,True,,-1,-1
237,4,1261,1,True,0.0007930214115781126,0.18017275600352753,2.578125,True,,-1,-1
237,5,1517,1,True,0.0006591957811470006,0.21653250809808658,5.515625,True,,-1,-1
237,6,1773,1,True,0.0005640157924421884,0.17935261916760298,4.5,True,,-1,-1
237,7,2029,1,True,0.0004928536224741252,0.11084250453869245,2.03125,True,,-1,-1
237,8,2285,1,True,0.000437636761487965,0.10982124559565203,1.28125,True,,-1,-1
237,9,2541,1,True,0.0003935458480913026,0.00618558119686387,2.0634765625,True,,-1,-1
237,10,2797,1,True,0.0003575259206292456,0.18112769794276656,5.875,True,,-1,-1
239,0,239,1,True,0.0041841004184100415,0.10366240988488576,5.09375,True,,-1,-1
239,1,495,1,True,0.00202020202020202,0.10799952198383234,11.28125,True,,-1,-1
239,2,751,1,True,0.0013315579227696406,0.13538177299476517,18.0390625,True,,-1,-1
239,3,1007,1,True,0.0009930486593843098,0.2071943809300364,10.5078125,True,,-1,-1
239,4,1263,1,True,0.000791765637371338,0.17739380494321555,22.4375,True,,-1,-1
239,5,1519,1,True,0.0006583278472679394,0.17632615174096194,18.78125,True,,-1,-1
239,6,1775,1,True,0.0005633802816901409,0.1648205737699821,8.875,True,,-1,-1
239,7,2031,1,True,0.0004923682914820286,0.21247856822947167,5.921875,True,,-1,-1
239,8,2287,1,True,0.00043725404459991256,0.1853789499058361,14.359375,True,,-1,-1
239,9,2543,1,True,0.00039323633503735744,0.17087241410939075,22.09375,True,,-1,-1
239,10,2799,1,True,0.0003572704537334762,0.18034038150982093,6.21875,True,,-1,-1
241,0,241,1,True,0.004149377593360996,0.10856900452488688,0.46875,True,,-1,-1
241,1,497,1,True,0.002012072434607646,0.07907681940700809,0.625,True,,-1,-1
241,2,753,1,True,0.0013280212483399733,0.06933962264150943,0.125,True,,-1,-1
241,3,1009,1,True,0.0009910802775024777,0.1414019491589689,13.375,True,,-1,-1
241,4,1265,1,True,0.0007905138339920949,0.17706998522343598,2.40625,True,,-1,-1
241,5,1521,1,True,0.0006574621959237344,0.13658096719240315,12.875,True,,-1,-1
241,6,1777,1,True,0.0005627462014631402,0.15091363630311033,14.0,True,,-1,-1
241,7,2033,1,True,0.0004918839153959665,0.134179794107637,13.4375,True,,-1,-1
241,8,2289,1,True,0.00043687199650502403,0.13337742043440698,12.375,True,,-1,-1
241,9,2545,1,True,0.0003929273084479371,0.1713079641222857,2.28125,True,,-1,-1
241,10,2801,1,True,0.0003570153516601214,0.19237346945058204,1.59375,True,,-1,-1
243,0,243,1,True,0.00411522633744856,0.12563272632842062,11.46875,True,,-1,-1
243,1,499,1,True,0.002004008016032064,0.17818406042127186,3.75,True,,-1,-1
243,2,755,1,True,0.0013245033112582781,0.10508836095308077,6.34375,True,,-1,-1
243,3,1011,1,True,0.0009891196834817012,0.21675219175362262,5.640625,True,,-1,-1
243,4,1267,1,True,0.0007892659826361484,0.008804183196365965,1.66015625,True,,-1,-1
243,5,1523,1,True,0.0006565988181221273,0.10996710323859252,1.40625,True,,-1,-1
243,6,1779,1,True,0.0005621135469364812,0.13628319332349154,18.9140625,True,,-1,-1
243,7,2035,1,True,0.0004914004914004914,0.17167327971447574,19.359375,True,,-1,-1
243,8,2291,1,True,0.00043649061545176777,0.17098215012404772,18.609375,True,,-1,-1
243,9,2547,1,True,0.00039261876717707107,0.0038298796519506827,1.6259765625,True,,-1,-1
243,10,2803,1,True,0.00035676061362825543,0.16558061363883708,10.25,True,,-1,-1
245,0,245,1,True,0.004081632653061225,0.09246967654986524,1.09375,True,,-1,-1
245,1,501,1,True,0.001996007984031936,0.14800406183502524,13.84375,True,,-1,-1
245,2,757,1,True,0.001321003963011889,0.14096180831389848,13.34375,True,,-1,-1
245,3,1013,1,True,0.0009871668311944718,0.13745776613560903,13.90625,True,,-1,-1
245,4,1269,1,True,0.0007880220646178094,0.17392667920608457,2.75,True,,-1,-1
245,5,1525,1,True,0.0006557377049180328,0.13396126263910552,13.40625,True,,-1,-1
245,6,1781,1,True,0.0005614823133071309,0.1101723979398652,7.96875,True,,-1,-1
245,7,2037,1,True,0.0004909180166912126,0.1585066526418738,4.125,True,,-1,-1
245,8,2293,1,True,0.0004361098996947231,0.13163568124375669,12.90625,True,,-1,-1
245,9,2549,1,True,0.00039231071008238524,0.1050551675450529,5.59375,True,,-1,-1
245,10,2805,1,True,0.00035650623885918,0.11359169179190103,9.34375,True,,-1,-1
247,0,247,1,True,0.004048582995951417,0.18754359210433946,3.875,True,,-1,-1
247,1,503,1,True,0.0019880715705765406,0.10552966721962975,6.84375,True,,-1,-1
247,2,759,1,True,0.0013175230566534915,0.21565457335713087,5.390625,True,,-1,-1
247,3,1015,1,True,0.0009852216748768472,0.11018592161933649,1.90625,True,,-1,-1
247,4,1271,1,True,0.0007867820613690008,0.0056612074972681,1.9384765625,True,,-1,-1
247,5,1527,1,True,0.0006548788474132286,0.1711276258296049,19.109375,True,,-1,-1
247,6,1783,1,True,0.0005608524957936063,0.00704103628109045,4.0634765625,True,,-1,-1
247,7,2039,1,True,0.0004904364884747426,0.20857503002335676,5.0,True,,-1,-1
247,8,2295,1,True,0.00043572984749455336,0.20810300037168064,4.25,True,,-1,-1
247,9,2551,1,True,0.0003920031360250882,0.20659815812157256,8.7578125,True,,-1,-1
247,10,2807,1,True,0.0003562522265764161,0.15137378611585717,15.125,True,,-1,-1
249,0,249,1,True,0.004016064257028112,0.1795185799942256,4.125,True,,-1,-1
249,1,505,1,True,0.0019801980198019802,0.21741124272023069,6.015625,True,,-1,-1
249,2,761,1,True,0.001314060446780552,0.11040467616741398,1.78125,True,,-1,-1
249,3,1017,1,True,0.0009832841691248771,0.1720007906315063,19.734375,True,,-1,-1
249,4,1273,1,True,0.0007855459544383347,0.0040915684167797135,2.0009765625,True,,-1,-1
249,5,1529,1,True,0.0006540222367560497,0.20868397039550962,4.875,True,,-1,-1
249,6,1785,1,True,0.0005602240896358543,0.06953331928987125,1.3515625,True,,-1,-1
249,7,2041,1,True,0.0004899559039686428,0.20759526838911116,5.4375,True,,-1,-1
249,8,2297,1,True,0.00043535045711797995,0.20723249739734848,4.6875,True,,-1,-1
249,9,2553,1,True,0.0003916960438699569,0.1662209948576311,21.96875,True,,-1,-1
249,10,2809,1,True,0.000355998576005696,0.1371557082749765,20.6015625,True,,-1,-1
251,0,251,1,True,0.00398406374501992,0.10685410612040565,6.96875,True,,-1,-1
251,1,507,1,True,0.0019723865877712033,0.11084250453869245,2.03125,True,,-1,-1
251,2,763,1,True,0.001310615989515072,0.1715641094087989,19.234375,True,,-1,-1
251,3,1019,1,True,0.0009813542688910696,0.20890193029088885,5.125,True,,-1,-1
251,4,1275,1,True,0.000784313725490196,0.2068594568774522,8.8828125,True,,-1,-1
251,5,1531,1,True,0.0006531678641410843,0.20737759316055218,4.9375,True,,-1,-1
251,6,1787,1,True,0.0005595970900951316,0.004802979440399819,4.0634765625,True,,-1,-1
251,7,2043,1,True,0.0004894762604013706,0.16775614257839636,19.671875,True,,-1,-1
251,8,2299,1,True,0.00043497172683775554,0.16750243009029375,18.921875,True,,-1,-1
251,9,2555,1,True,0.0003913894324853229,0.10270576492481201,4.8125,True,,-1,-1
251,10,2811,1,True,0.0003557452863749555,0.009439431742951308,5.16015625,True,,-1,-1
253,0,253,1,True,0.003952569169960474,0.13745776613560903,13.90625,True,,-1,-1
253,1,509,1,True,0.0019646365422396855,0.1585066526418738,4.125,True,,-1,-1
253,2,765,1,True,0.00130718954248366,0.15676449236312817,3.625,True,,-1,-1
253,3,1021,1,True,0.0009794319294809011,0.15589434973197602,4.328125,True,,-1,-1
253,4,1277,1,True,0.0007830853563038371,0.1029667029103439,5.46875,True,,-1,-1
253,5,1533,1,True,0.0006523157208088715,0.15502478451458473,3.828125,True,,-1,-1
253,6,1789,1,True,0.0005589714924538849,0.2080218119440436,11.5078125,True,,-1,-1
253,7,2045,1,True,0.0004889975550122249,0.20563851069560815,6.1328125,True,,-1,-1
253,8,2301,1,True,0.000434593654932638,0.15444541023880257,3.328125,True,,-1,-1
253,9,2557,1,True,0.00039108330074305825,0.12691710757516364,16.375,True,,-1,-1
253,10,2813,1,True,0.00035549235691432633,0.18685947578575762,22.296875,True,,-1,-1
255,0,255,1,True,0.00392156862745098,0.15589434973197602,4.328125,True,,-1,-1
255,1,511,1,True,0.0019569471624266144,0.20563851069560815,6.1328125,True,,-1,-1
255,2,767,1,True,0.001303780964797914,0.20520410583027365,5.6328125,True,,-1,-1
255,3,1023,1,True,0.0009775171065493646,0.2049869603398216,6.1953125,True,,-1,-1
255,4,1279,1,True,0.0007818608287724785,0.12639594962781736,16.25,True,,-1,-1
255,5,1535,1,True,0.0006514657980456026,0.20476985221997793,5.6953125,True,,-1,-1
255,6,1791,1,True,0.0005583472920156337,0.20690488338015986,11.4140625,True,,-1,-1
255,7,2047,1,True,0.0004885197850512946,0.1650676047529811,18.96875,True,,-1,-1
255,8,2303,1,True,0.0004342162396873643,0.2046251344196885,5.1953125,True,,-1,-1
255,9,2559,1,True,0.00039077764751856197,0.19079608012325866,13.421875,True,,-1,-1
255,10,2815,1,True,0.00035523978685612787,0.13502263221792932,20.6953125,True,,-1,-1
付録B (定理4.3.30:検査表B).
この付録B (検査表B) は、定理4.3.30 で用いる有限検査条件に対応する
検査証明書の例であり、第三者が条件の充足を機械的に再確認できるように
整備した補助資料である。
本文の証明は理論的に完結しており、当付録の具体的データは再現性の
便宜のために提供するものであって、結論自体はそれらの個別データに依存しない。
付録A (検査表A) と付録B (検査表B) は同一の外部パラメタファイルの設定条件で
生成されたデータであり、対となっている。
付録B.1 (検査表Bファイル仕様).
検査表Bに関する出力ファイル仕様を示す。
■ファイル形式
検査表Bに関する出力ファイルの概要を以下に示す。
-
ファイル名パターン:
tableB_{base_params_str}_{timestamp}.csv-
base_params_str:t{t}_L{L}_K{K}形式 -
timestamp:YYYYMMDD_HHMMSS形式
-
- 形式: CSV (Comma-Separated Values)
- エンコーディング: UTF-8
- 区切り文字: Comma (',')
■フィールド定義
検査表Bに関する出力ファイルのレコード概要を以下に示す。
| フィールド名 | データ型 | 説明 |
|---|---|---|
r |
int | 合同類(剰余類)の値 |
quotient_reduction_verified |
bool | 商の減少検証フラグ |
total_tests |
int | 実行したテストの総数 |
successful_reductions |
int | 成功した減少回数 |
early_terminations |
int | 早期終了回数(1に到達) |
max_steps_reached_count |
int | 最大ステップ到達回数 |
max_k_tested |
int | テストした最大k値 |
failed_k_count |
int | 失敗したk値の個数 |
first_failed_k |
int/null | 最初に失敗したk値(失敗がない場合null) |
first_failure_details |
str/null | 最初の失敗の詳細情報(JSON形式またはnull) |
付録B.2 (検査表Bの例).
検査表Bの出力ファイルの実例を以下に示す。
このデータは、外部パラメタファイルに $t = 8, L = 256, K = 10$ を設定して、
本稿での有限検査証明書自動生成スクリプト(例)を実行して得られたものである。
外部パラメタファイルの他のパラメタはデフォルト値を採用している。
なお、$t, L, K$ の値は、生成されたファイル名の一部に埋め込まれている。
これらの生成手順は再現性のために示すものであり、本文の理論的主張は
これら具体的ファイルに依存しない。
r,quotient_reduction_verified,total_tests,successful_reductions,early_terminations,max_steps_reached_count,max_k_tested,failed_k_count,first_failed_k,first_failure_details
1,True,10,10,10,0,20,0,,
3,True,10,10,10,0,20,0,,
5,True,10,10,10,0,20,0,,
7,True,10,10,10,0,20,0,,
9,True,10,10,10,0,20,0,,
11,True,10,10,10,0,20,0,,
13,True,10,10,10,0,20,0,,
15,True,10,10,10,0,20,0,,
17,True,10,10,10,0,20,0,,
19,True,10,10,10,0,20,0,,
21,True,10,10,10,0,20,0,,
23,True,10,10,10,0,20,0,,
25,True,10,10,10,0,20,0,,
27,True,10,10,10,0,20,0,,
29,True,10,10,10,0,20,0,,
31,True,10,10,10,0,20,0,,
33,True,10,10,10,0,20,0,,
35,True,10,10,10,0,20,0,,
37,True,10,10,10,0,20,0,,
39,True,10,10,10,0,20,0,,
41,True,10,10,10,0,20,0,,
43,True,10,10,10,0,20,0,,
45,True,10,10,10,0,20,0,,
47,True,10,10,10,0,20,0,,
49,True,10,10,10,0,20,0,,
51,True,10,10,10,0,20,0,,
53,True,10,10,10,0,20,0,,
55,True,10,10,10,0,20,0,,
57,True,10,10,10,0,20,0,,
59,True,10,10,10,0,20,0,,
61,True,10,10,10,0,20,0,,
63,True,10,10,10,0,20,0,,
65,True,10,10,10,0,20,0,,
67,True,10,10,10,0,20,0,,
69,True,10,10,10,0,20,0,,
71,True,10,10,10,0,20,0,,
73,True,10,10,10,0,20,0,,
75,True,10,10,10,0,20,0,,
77,True,10,10,10,0,20,0,,
79,True,10,10,10,0,20,0,,
81,True,10,10,10,0,20,0,,
83,True,10,10,10,0,20,0,,
85,True,10,10,10,0,20,0,,
87,True,10,10,10,0,20,0,,
89,True,10,10,10,0,20,0,,
91,True,10,10,10,0,20,0,,
93,True,10,10,10,0,20,0,,
95,True,10,10,10,0,20,0,,
97,True,10,10,10,0,20,0,,
99,True,10,10,10,0,20,0,,
101,True,10,10,10,0,20,0,,
103,True,10,10,10,0,20,0,,
105,True,10,10,10,0,20,0,,
107,True,10,10,10,0,20,0,,
109,True,10,10,10,0,20,0,,
111,True,10,10,10,0,20,0,,
113,True,10,10,10,0,20,0,,
115,True,10,10,10,0,20,0,,
117,True,10,10,10,0,20,0,,
119,True,10,10,10,0,20,0,,
121,True,10,10,10,0,20,0,,
123,True,10,10,10,0,20,0,,
125,True,10,10,10,0,20,0,,
127,True,10,10,10,0,20,0,,
129,True,10,10,10,0,20,0,,
131,True,10,10,10,0,20,0,,
133,True,10,10,10,0,20,0,,
135,True,10,10,10,0,20,0,,
137,True,10,10,10,0,20,0,,
139,True,10,10,10,0,20,0,,
141,True,10,10,10,0,20,0,,
143,True,10,10,10,0,20,0,,
145,True,10,10,10,0,20,0,,
147,True,10,10,10,0,20,0,,
149,True,10,10,10,0,20,0,,
151,True,10,10,10,0,20,0,,
153,True,10,10,10,0,20,0,,
155,True,10,10,10,0,20,0,,
157,True,10,10,10,0,20,0,,
159,True,10,10,10,0,20,0,,
161,True,10,10,10,0,20,0,,
163,True,10,10,10,0,20,0,,
165,True,10,10,10,0,20,0,,
167,True,10,10,10,0,20,0,,
169,True,10,10,10,0,20,0,,
171,True,10,10,10,0,20,0,,
173,True,10,10,10,0,20,0,,
175,True,10,10,10,0,20,0,,
177,True,10,10,10,0,20,0,,
179,True,10,10,10,0,20,0,,
181,True,10,10,10,0,20,0,,
183,True,10,10,10,0,20,0,,
185,True,10,10,10,0,20,0,,
187,True,10,10,10,0,20,0,,
189,True,10,10,10,0,20,0,,
191,True,10,10,10,0,20,0,,
193,True,10,10,10,0,20,0,,
195,True,10,10,10,0,20,0,,
197,True,10,10,10,0,20,0,,
199,True,10,10,10,0,20,0,,
201,True,10,10,10,0,20,0,,
203,True,10,10,10,0,20,0,,
205,True,10,10,10,0,20,0,,
207,True,10,10,10,0,20,0,,
209,True,10,10,10,0,20,0,,
211,True,10,10,10,0,20,0,,
213,True,10,10,10,0,20,0,,
215,True,10,10,10,0,20,0,,
217,True,10,10,10,0,20,0,,
219,True,10,10,10,0,20,0,,
221,True,10,10,10,0,20,0,,
223,True,10,10,10,0,20,0,,
225,True,10,10,10,0,20,0,,
227,True,10,10,10,0,20,0,,
229,True,10,10,10,0,20,0,,
231,True,10,10,10,0,20,0,,
233,True,10,10,10,0,20,0,,
235,True,10,10,10,0,20,0,,
237,True,10,10,10,0,20,0,,
239,True,10,10,10,0,20,0,,
241,True,10,10,10,0,20,0,,
243,True,10,10,10,0,20,0,,
245,True,10,10,10,0,20,0,,
247,True,10,10,10,0,20,0,,
249,True,10,10,10,0,20,0,,
251,True,10,10,10,0,20,0,,
253,True,10,10,10,0,20,0,,
255,True,10,10,10,0,20,0,,
付録C (定理4.3.30:外部パラメタファイル).
本稿では、本文で定義した有限検査証明書を
再現・点検しやすくするための参考スクリプトを付す。
なお、証明自体は当該スクリプトに依存しない。
有限検査証明書自動生成スクリプトは、外部パラメタファイルが
存在しないか、ファイルの定義に異常がある場合、内部定義された
デフォルト値に従って動作する。
有限検査証明書自動生成スクリプトは、自身が存在する
同一のディレクトリ内に外部パラメタファイルが存在する場合、
そのファイルに定義された設定パラメタの内容を読み取り、
その指定に従って、検査表A と検査表B を生成する。
ここでは、外部パラメタファイルの設定例(推奨値)を示す。
外部パラメタファイルは JSON 形式のテキストファイルである。
本稿における有限検査証明書自動生成スクリプトの読み込み対象である
外部パラメタファイルの名称は、"inspection_parameters.json" である。
JSON ファイルの各定義項目の説明は、ファイル内のコメントブロックに
概要が記されている。
{
"_comment": "Configuration file for Collatz Conjecture Inspection Table A/B generation (Theorem 2.1.4 new spec support)",
"_description": {
"t": "Exponent for mod 2^t",
"L": "Number of steps for L-step map",
"K": "Maximum k value for each residue class",
"e_max": "Maximum allowable error (0 < e_max < 1)",
"c_min": "Minimum growth rate threshold",
"C_u": "Upper bound constant",
"s_star_method": "Use of Binary Rational Bound ('binary_bound' or 'precise')",
"enable_bernoulli_bound": "Use Bernoulli-type upper bound (always used in Stage 1 of the gradual method)",
"enable_table_B": "Enable Inspection Table B generation",
"K_extend_factor": "k extension factor for Inspection Table B",
"max_quotient_reduction_steps": "Maximum steps for quotient reduction verification",
"timezone": "Timezone for log and output to display (e.g., 'Asia/Tokyo', 'UTC')",
"log_level": "Log level",
"verbose": "Verbose mode to display",
"use_multiprocessing": "Flag to use multiprocessing",
"processes": "Number of processes to use (0 for auto-detection)"
},
"parameters": {
"t": 8,
"L": 256,
"K": 1000,
"e_max": 0.1,
"c_min": 0.1,
"C_u": 0.5,
"s_star_method": "binary_bound",
"enable_bernoulli_bound": true,
"enable_table_B": true,
"K_extend_factor": 2,
"max_quotient_reduction_steps": 100,
"timezone": "UTC",
"log_level": "INFO",
"verbose": false,
"use_multiprocessing": true,
"processes": 1
}
}
付録C.1 (Lmin).
有限検査証明書の作成上で得られた複数ケースの $L_{min}$ の対応表を示す。
[表C.1]は、$t = 8 ~ 10, 0 \lt k \le 10000$ を外部パラメタファイル上で
設定した場合に、有限検査証明書が合格となった場合の L 値を示す。
$L_{min}$ の定義は、定理4.3.30 の補足 (有限検査証明書の整数パラメタの連関) で
与えられている。すなわち、特定の条件下において有限検査証明書が
有効となる場合の $L$ の最小値である。
[表C.1]$L_{min}$
| No. | K | $L_{min}T8$ | $L_{min}T9$ | $L_{min}T10$ |
|---|---|---|---|---|
| 1 | 10 | 76 | 87 | 98 |
| 2 | 20 | 79 | 95 | 102 |
| 3 | 50 | 101 | 103 | 119 |
| 4 | 100 | 103 | 119 | 129 |
| 5 | 200 | 119 | 129 | 141 |
| 6 | 500 | 130 | 164 | 174 |
| 7 | 1000 | 164 | 174 | 195 |
| 8 | 2000 | 174 | 195 | 207 |
| 9 | 5000 | 196 | 208 | 222 |
| 10 | 10000 | 208 | 222 | 256 |
外部パラメタファイルの設定例における$L$値の推奨値(256)は、
$T = 10, K = 10000$ の場合の $L_{min}$ である。
この値を採用している理由は、$t = 8 ~ 10, 0 \lt K \le 10000$ の範囲で検証を
行うときに $L$ 推奨値を利用した場合、外部パラメタファイルの変更は、実務上、
$t, K$ の変更操作だけで済むからである。
そうしない場合は、有限検査証明書が合格状態となることを確認するためには、
$L$ の適正値を探索する必要がある可能性が極めて高い。
付録C.2 (奇数のコラッツ遷移回数の分布状態).
$1 ~ 10^8$ における奇数に対するコラッツ遷移回数の出現頻度の分布を以下に示す。

[図C.2]奇数の遷移回数の頻度分布
図C.2より、奇数の遷移回数の出現頻度には以下の傾向がある。
・大多数の奇数のコラッツ遷移回数は、256 以下である。
・256 を超えるコラッツ遷移回数を発生させる奇数は稀である。
したがって、定理4.3.30 の有限検査証明書を作成する上での $L_{min}$ は、
奇数の遷移回数の発生頻度が $256$ 以下に集中する特徴がある関係から、
合同類による奇数の分類を考えると、大抵の場合は、$256$ で必要十分である。
ただし、外部パラメタファイルで指定するパラメタ値によっては、L 値を
稀に存在する非常に大きなコラッツ遷移回数に合わせる必要がある。
図C.2 は、以下のプログラムで生成したグラフである。
# CollatzGraph.py
# coding: UTF-8
# Diplay a graph as a histgram of transitions for Collatz operations of odd numbers to reach one.
import numpy as np # a library adding support for large, multi-dimensional arrays etc.
import matplotlib.pyplot as plt # Graph library
import datetime as dt
import threading
import multiprocessing
import re # regular expression
# Globals
s_max = 1000 # Initial value. s_max will be changed by users.
M = np.empty(2)
lock = threading.Lock()
def collatzOp(n):
"""
Calculate steps for odd numbers only in Collats conjecture.
"""
N = n
c = 0
while n != 1:
# convert to the binary, and remove all zeroes at the tail part.
binary_n = bin(n) # to binary type
count_zeros = len(binary_n) - len(binary_n.rstrip('0'))
n = n >> count_zeros # remove zeroes (i.e. equal to divisions by two)
# break when it reaches to one.
if n == 1:
break
c += 1 # count up of transitions from an odd number to an odd number
n = 3 * n + 1
# Update data with locking in threading safe.
with lock:
if c < s_max:
S[c] = S[c] + 1
if c > M[1]:
M[0] = N
M[1] = c
def workerThread(start, end):
"""
The worker thread of some calculation for odd numbers in N
"""
# Starting from the first odd number for assigned range
if start % 2 == 0:
start += 1
for i in range(start, end + 1, 2):
collatzOp(i)
def plot_graph(a, b, s_max, s, S):
"""
Display the results
"""
# Set the double size of the horizontal direction in the graph
plt.figure(figsize=(16, 6))
plt.bar(s, S, color="blue")
plt.title('Bar graph of steps of odd numbers for Collatz conjecture ({}≦n≦{})'.format(a, b))
plt.xlabel('Number of step (odd-to-odd transitions)')
plt.ylabel('Frequency')
plt.xticks(np.arange(0, s_max + 0.1, s_max / 20))
plt.grid(True)
plt.show()
def main_cli():
"""
main processing
"""
global s_max, s, S, M
# Initialization for the program
M[0] = 0
M[1] = 0
# Set the maximum graph value for the horizontal axis
while True:
user_input_s_max = input(f'Input a max graph value for the horizontal axis(defaule: {s_max}):')
if user_input_s_max == '':
break # using the default value (ex. 1000)
try:
sanitized_input = re.sub(r'[,_ ]', '', user_input_s_max)
match = re.search(r'(\d+)\*\*(\d+)', sanitized_input)
if match:
base = int(match.group(1))
exponent = int(match.group(2))
new_s_max = base ** exponent
else:
new_s_max = int(sanitized_input)
if new_s_max <= 0:
print("Input an available value.")
else:
s_max = new_s_max
break
except (ValueError, IndexError):
print("Invalid value. Type {integer | 999,9999 | n**p (i,e. n^p)")
# Initialize arrayes after s_max was fixed
s = np.empty(s_max)
S = np.empty(s_max)
for i in range(s_max):
s[i] = i
S[i] = 0
a = 1
while True:
user_input = input('n to: ')
sanitized_input = re.sub(r'[,_ ]', '', user_input)
try:
match = re.search(r'(\d+)\*\*(\d+)', sanitized_input)
if match:
base = int(match.group(1))
exponent = int(match.group(2))
b = base ** exponent
else:
b = int(sanitized_input)
break
except (ValueError, IndexError):
print("Invalid value.")
continue_prompt = input("Continue the process? (y/n): ")
if continue_prompt.lower() != 'y':
print("Exit now.")
return
# Set number of threads
num_threads = multiprocessing.cpu_count()
print(f"Using {num_threads} threads based on CPU cores.")
chunk_size = (b - a + 1) // num_threads
threads = []
start_time = dt.datetime.now()
for ix in range(num_threads):
start = a + ix * chunk_size
end = start + chunk_size - 1
if ix == num_threads - 1:
end = b
thread = threading.Thread(target = workerThread, args = (start, end) )
threads.append(thread)
thread.start()
for thread in threads:
thread.join()
end_time = dt.datetime.now()
elapsed_time = end_time - start_time
print('n = ', int(M[0]), 'maximum (steps) = ', int(M[1]))
print('Elapsed time:', elapsed_time)
# Display a graph of histogram
plot_graph(a, b, s_max, s, S)
if __name__ == '__main__':
main_cli()
上記のプログラムは、起動されると2つの値を問い合わせてくる。
・出力するグラフ横軸のの最大値
・コラッツ演算対象の最大値 n (1 ~ n)
通常利用では、最初の問い合わせには return キーでデフォルト指定 (1000)とし、
2番目の問い合わせには、計算対象範囲の最大値(ex. "10**6")を指定する。
プログラム実行が正常終了すると、図C.2 で示したようなグラフが表示される。
付録D (定理4.3.30:有限検査証明書自動生成スクリプト).
本文で定義した有限検査証明書(検査表A、検査表B)の
生成手順を第三者が機械的に再現・点検できるようにするための
参考スクリプトを示す。
なお、証明自体は本文の理論により完結しており、
再現性と監査可能性のための補助資料である。
以下に、有限検査証明書自動生成スクリプトの例を示す。
この自動生成スクリプトは、Python で実装されている。
付録D.1 (自動生成スクリプトの利用方法).
有限検査証明書自動生成スクリプト(例)の利用方法を以下に示す。
付録D.1.1 概要
本稿は、Pythonスクリプト Theorem4_3-20250907b.py (以下、本プログラム)の
仕様および利用方法について記述するものである。
本プログラムは定理4.3.30 に関連する有限検査証明書 (検査表A, B)と
合成条件C の各項目を機械的に生成・点検する手続きを再現するために実装された。
本プログラムの主な機能は有限検査証明書 の構成要素である検査表A、検査表B、
および合成条件Cに対応する点検ログと整形出力を自動生成することにある。
これらの出力は、設定されたパラメータの範囲内での自動点検結果(ログ)を
提供し、再現性と監査可能性を補強するものである。
(※本文の理論証明に依存しない補助資料である。)
本プログラムは、以下の設計思想に基づき開発された。
再現性と堅牢性: すべての検査パラメータは外部設定ファイルによって
一元管理され、再現性の高い検証を可能とする。
高性能計算: 計算負荷の高い処理に対し、マルチプロセッシングを活用することで、
マルチコア環境下における実行時間の大幅な短縮を実現する。
包括的な報告: 検証プロセスの完全な透明性を確保するため、詳細な実行ログ、
CSV 形式のデータファイル、および JSON 形式の集計レポートを出力する。
付録D.1.2 利用方法
有限検査証明書を自動生成するスクリプト(例)の利用方法を以下に示す。
-
動作環境
- Python 3.x
- pytzライブラリ(タイムゾーンサポート用)
-
設定ファイル
本プログラムの動作は、inspection_parameters.json という単一の
JSON 形式ファイルによって制御される。-
設定ファイルの生成:初回実行時、同ファイルが存在しない場合、
デフォルト値および各パラメータの説明コメントを含む
ファイルが自動的に生成される。 -
パラメータの編集:テキストエディタ等で同ファイルを開き、
検証要件に応じて各パラメータ値を修正する。
-
-
主要パラメータ一覧
parameters オブジェクト内で設定可能な主要パラメータを以下に示す。
| パラメータ | 型 | 説明 |
|---|---|---|
| t | 整数 | 合同類分解に用いる法 $2^t$ の指数。値を大きくすると、より細かく多くの合同類が生成される。 |
| L | 整数 | 検査表AおよびBの各テストケースで適用する L ステップ写像のステップ数。論文の付録C.1 は、t, K に対する適切な L 値の指針となる。広範な検証には 256 が推奨される。 |
| K | 整数 | 検査表Aにおいて、各合同類に対し検証する係数 k の最大値($V_0 = r + {2^t} k$)。 |
| e_max | 浮動小数点数 | 合成条件Cの計算で許容される単一誤差項の上限値。0から1の範囲で指定する。 |
| c_min | 浮動小数点数 | 非終了系列が条件Aを満たすために要求される最小増加率($V_L/V_0$)。 |
| s_star_method | 文字列 | $S^{\star}$ の精密計算に用いる手法。'binary_bound'(デフォルト)または'precise'を指定。 |
| enable_table_B | ブール値 | true の場合、検査表Bを生成し商の縮約特性を検証する。完全な証明には本検証が不可欠である。 |
| use_multiprocessing | ブール値 | true の場合、複数の CPU コアを利用して並列計算を実行し、処理を高速化する。 |
| processes | 整数 | 並列計算に使用する CPU プロセス数。0 または負数を指定した場合、システムで利用可能な全コアが自動的に割り当てられる。 |
| timezone | 文字列 | ログおよびレポートに出力されるタイムスタンプのタイムゾーン(例: 'UTC', 'Asia/Tokyo') |
2.4 実行手順
本プログラムはコマンドライン端末から実行する。
外部パラメタファイル inspection_parameters.json が初回実行時に
存在しない場合、デフォルト設定で自動的に生成される。
本プログラムが存在するディレクトリ内に外部パラメタファイルが存在する場合、
外部パラメタファイルで指定された内容に従ってプログラムは動作する。
最初に、本プログラム (Theorem4_3-20250907b.py) が存在するディレクトリに移動する。
または、稼働システムにおける環境変数で参照用パスを事前設定しておく。
以下のコマンドを実行する。
python Theorem4_3-20250907b.py
実行が開始されると、まず設定パラメータが表示され、続いて検査プロセスが
進行する。完了後、最終的な集計結果がコンソールに出力される。
なお、プログラム実行に必要な Python ライブラリ等は、
事前に適切な実行可能環境を準備しておく必要がある。
付録D.1.3 出力ファイルの概要
プログラム実行完了後、コンソールには検査表A、検査表B、合成条件Cの
各判定結果、およびそれらを統合した総合結果(Overall Result)が表示され、
検証の成否を一目で確認できる。
全ての出力ファイルは、実行時に自動生成される results ディレクトリに
保存される。
ファイル名には、検証に用いた主要パラメータ(t, L, K)と
実行タイムスタンプが付与され、各実行結果の識別を容易にしている。
-
inspection_log_{...}.txt
- 役割:実行中のすべてのコンソール出力を記録した完全なログファイル。
- 説明:プログラムの実行が終了した直後に、ファイル最終部分にある
総合判定(✅ Passedまたは❌ Failed)を確認し、実行結果全体の状況を
把握する。また、特定の実行内容の監査結果としてとして、あるいは予期せぬエラー発生時のデバッグ情報として利用する。
-
summary_{...}.json
- 役割:検証結果の全体概要を示す JSON ファイル。実行時間、
各条件の合否判定、パラメータ設定など、当該実行に関する全ての情報が
集約されている。 - 説明:このファイルを確認し、総合判定(✅ Passedまたは❌ Failed)に
対する個別の概況を把握する。
- 役割:検証結果の全体概要を示す JSON ファイル。実行時間、
-
tableA_{...}.csv
- 役割:検査表Aの詳細な生データ。
各行が初期値 $V_0$ に対する検証結果に対応する。 - 説明:各合同類の詳細な挙動、失敗理由、増加率分布などの分析が
可能である。
- 役割:検査表Aの詳細な生データ。
-
tableB_{...}.csv
-
役割:検査表Bの詳細な生データ。
各合同類に対する商の縮約特性の検証結果が記録される。 -
説明:全ての合同類で quotient_reduction_verified が True となっていることを確認する。False のクラスが存在する場合、その詳細が記録される。
-
-
synthesis_condition_C_{...}.txt
- 役割:合成条件Cの検証プロセスに関する人間が可読な形式の詳細レポート。
- 説明:最終的に算出された$S^\star$ の値、判定に用いられた手法
(ベルヌーイ型または二進有理上界)、閾値、そして、最終的な合否判定が
明記される。
付録D.2 (Python コード).
有限検査証明書自動生成スクリプトのコード例を以下に示す。
#!/usr/bin/env python3
"""
Filename: Theorem4_3-20250902d.py
Program ID: collatz_inspector
Collatz Conjecture Inspection Table A/B Generation Program (Theorem 4.3)
Clarified/Improved Version of S* Calculation Logic
Includes Binary Rational Bound (M_S, B_S) Calculation Function
Bernoulli Type Bound Support
*** New Feature: Theorem 4.3 Synthesis Condition C Automated Verification ***
*** Extended Version: Includes Binary Rational Bound (M_S, B_S) Calculation ***
*** Includes Log File Output Function ***
Implementation Status Reflection:
The provided Python script, `Theorem4.3-20250902d.py`, represents
a complete and functional implementation designed to verify the
conditions outlined in Theorem 4.3 of the accompanying paper
on the Collatz Conjecture. The implementation is comprehensive,
covering all necessary logical steps, data handling, and reporting.
Key implemented features include:
- **Parameter Management:** A robust configuration system loads all
necessary integer parameters (t, L, K) and control variables
from an external JSON file (`inspection_parameters.json`),
creating a default file if one does not exist. This allows for
flexible and repeatable experimentation.
- **Core Collatz Logic:** The script accurately implements the core
functions required for the analysis, including the `g(n) = 3n + 1`
function, the 2-adic valuation `ord2(n)`, and the crucial
`L_step_mapping` which simulates L steps of the Collatz sequence
for any given starting value `V0`.
- **Inspection Table A Generation:** The program systematically
generates Inspection Table A by iterating through all specified
residue classes `r` (mod 2^t) and `k` values (up to K). For each
`V0 = r + 2^t * k`, it verifies "Condition A" — checking if the
sequence either terminates (reaches 1) or exhibits a sufficient
growth rate within L steps.
- **Synthesis Condition C Verification:** A key feature is the
automated, two-stage verification of "Synthesis Condition C".
1. It first applies a computationally inexpensive check using a
**Bernoulli-type upper bound**.
2. If the condition is not met, it proceeds to a more precise
evaluation using a **Binary Rational Bound (M_S, B_S)**, which
aggregates detailed 2-adic valuation data from all
non-terminating sequences.
- **Inspection Table B Generation:** For `k` values greater than K,
the script generates Inspection Table B to verify the "quotient
reduction" property. This confirms that for any starting value,
repeated application of the L-step map will eventually lead to a
state with a quotient `k' <= K`, thus ensuring that the finite
inspection of Table A is sufficient.
- **Performance and Scalability:** The implementation leverages
Python's `multiprocessing` library to parallelize the
computationally intensive generation of both Table A and Table B,
significantly reducing execution time on multi-core systems.
- **Data Handling and Reporting:** The script is equipped with
extensive output capabilities:
- **CSV Export:** Inspection Tables A and B are exported to
separate, well-formatted CSV files for easy analysis. A
streaming approach is used for memory efficiency with large
datasets.
- **JSON Summary:** A detailed summary report, including all
parameters, execution times, success rates, and failure
analyses, is saved as a JSON file.
- **Detailed Reports:** A human-readable text file is generated
specifically for the Synthesis Condition C verification,
detailing the calculated S* value, thresholds, and final
judgment.
- **Logging:** A comprehensive log file is created for each run,
capturing all console output, parameters, and timestamps with
timezone support, providing a complete audit trail of the
verification process.
In summary, the code is a complete, production-ready tool that
fully implements the verification strategy for Theorem 4.3,
providing the necessary evidence through the automated generation
and validation of Inspection Tables A and B and the crucial
Synthesis Condition C.
"""
"""
Defined Classes and Functions:
- Class: InspectionParameters - Data class for inspection parameters (Theorem 4.3).
- Class: ConfigManager - Handles loading and creating configuration files.
- create_default_config(filename) - Creates a default config file with comments and descriptions.
- load_config(filename) - Loads config from a specified file and returns parameters dictionary.
- Function: get_inspection_parameters(config_file) - Gets parameters from file or creates defaults if not found.
- Function: print_and_log_parameters(params, logger) - Prints and logs the current inspection parameters.
- Class: FailureCase (dataclass) - Data structure for storing failure case details.
- Class: TableBResult (dataclass) - Data structure for storing Table B results per residue class.
- Class: FailureAnalysis (dataclass) - Data structure for storing overall failure analysis.
- Class: BinaryRationalBound (dataclass) - Data structure for the binary rational bound (M_S, B_S).
- Class: SynthesisConditionCReport (dataclass) - Data structure for Synthesis Condition C report.
- Class: TableBSummary (dataclass) - Data structure for the Inspection Table B summary.
- Class: SummaryReport (dataclass) - Data structure for the overall inspection summary.
- Class: FileAndConsoleLogger - Logs messages to console and a file with timezone support.
- log(message, level) - Logs a message with timestamp and level.
- save_to_file(filename) - Saves the accumulated log entries to a file.
- Function: ord2(n) - Calculates the 2-adic valuation of n.
- Function: g(n) - Applies the g function: 3*n + 1.
- Class: CollatzInspectorEnhanced - Main class for performing Collatz inspection based on Theorem 4.3.
- __init__(self, params) - Initializes the inspector with parameters and target classes.
- L_step_mapping(self, V0) - Applies the L-step map and returns results with partial sums.
- decompose(self, V) - Decomposes V into congruence class expression V = r + 2^t * k.
- verify_quotient_reduction(self, r, k_start) - Verifies quotient reduction for Table B.
- build_table_B_for_residue(self, r) - Builds Table B results for a specific residue class.
- _inspect_one_r_k(self, args) - Worker function to inspect a single (r, k) pair.
- _calculate_synthesis_condition_C(self, table_A) - Verifies Synthesis Condition C using gradual method.
- build_inspection_tables(self) - Builds Table A & B and generates comprehensive summary.
- build_inspection_tableA_stream(self) - Generates Table A data in stream format for CSV export.
- build_inspection_tableB_stream(self) - Generates Table B data in stream format for CSV export.
- export_csv_stream(self, results_iter, filename, fieldnames) - Exports data using stream processing.
- export_json(self, data, filename) - Exports data to JSON with enhanced encoding support.
- export_synthesis_condition_report(self, report, filename) - Exports detailed Synthesis Condition C report.
- print_summary(self, summary) - Prints the comprehensive summary to console/log.
"""
import dataclasses # Import dataclasses module
from dataclasses import dataclass, asdict, field
from typing import Dict, List, Tuple, Any, Optional
import csv
import json
import math
import argparse
import logging
from multiprocessing import Pool, cpu_count
import sys
import platform
import time
from datetime import datetime
import matplotlib.pyplot as plt
import numpy as np
import os
from pathlib import Path
from collections import Counter, defaultdict
import pytz # timezone
# =================================================================
# Global Constants for Display and Formatting
# =================================================================
LINE_60_CHAR = "=" * 60
LINE_70_CHAR = "=" * 70
LINE_80_CHAR = "=" * 80
LINE_60_DASH = "-" * 60
LINE_70_DASH = "-" * 70
LINE_80_DASH = "-" * 80
# =================================================================
# Enhanced config.py with Theorem 4.3 new spec support
# =================================================================
@dataclass
class InspectionParameters:
"""Data class for inspection parameters (Theorem 4.3 new spec support)"""
t: int = 8
L: int = 256
K: int = 10
e_max: float = 0.1
c_min: float = 0.1
C_u: float = 0.5
# Theorem 4.3 New Specification Parameters
s_star_method: str = 'binary_bound' # Use of Binary Rational Bound: 'binary_bound' or 'precise'
enable_bernoulli_bound: bool = True # Use Bernoulli-type upper bound (always used in stage 1)
# Parameters for Inspection Table B
enable_table_B: bool = True
K_extend_factor: int = 2
max_quotient_reduction_steps: int = 100
# Output controls
timezone: str = "UTC"
log_level: str = "INFO"
verbose: bool = False
# Mutithread environments
use_multiprocessing: bool = True
processes: int = field(default_factory=lambda: max(1, cpu_count() - 1))
def __post_init__(self):
self.validate()
def validate(self):
if self.t < 1: raise ValueError("t must be >= 1")
if self.L < 1: raise ValueError("L must be >= 1")
if self.K < 0: raise ValueError("K must be >= 0")
if not (0 < self.e_max < 1): raise ValueError("e_max must be between 0 and 1")
if self.c_min <= 0: raise ValueError("c_min must be > 0")
if self.C_u <= 0: raise ValueError("C_u must be > 0")
if self.processes < 0: self.processes = cpu_count()
if self.K_extend_factor < 1: raise ValueError("K_extend_factor must be >= 1")
if self.max_quotient_reduction_steps < 1: raise ValueError("max_quotient_reduction_steps must be >= 1")
if self.s_star_method not in ['binary_bound', 'precise']:
raise ValueError("s_star_method must be 'binary_bound' or 'precise'")
max_processes = cpu_count()
if self.processes > max_processes:
logging.warning(f"processes={self.processes} > CPU count={max_processes}, adjusting to {max_processes}")
self.processes = max_processes
try:
pytz.timezone(self.timezone)
except pytz.UnknownTimeZoneError:
raise ValueError(f"Unknown timezone: {self.timezone}")
class ConfigManager:
DEFAULT_CONFIG_FILENAME = "inspection_parameters.json"
@staticmethod
def create_default_config(filename: Optional[str] = None) -> str:
if filename is None:
filename = ConfigManager.DEFAULT_CONFIG_FILENAME
default_params = InspectionParameters()
config_dict = asdict(default_params)
config_with_comments = {
"_comment": "Configuration file for Collatz Conjecture Inspection Table A/B generation (Theorem 4.3)",
"_description": {
"t": "Exponent for mod 2^t",
"L": "Number of steps for L-step map",
"K": "Maximum k value for each residue class",
"e_max": "Maximum allowable error (0 < e_max < 1)",
"c_min": "Minimum growth rate threshold",
"C_u": "Upper bound constant",
"s_star_method": "Use of Binary Rational Bound ('binary_bound' or 'precise')",
"enable_bernoulli_bound": "Use Bernoulli-type upper bound (always used in Stage 1 of the gradual method)",
"enable_table_B": "Enable Inspection Table B generation",
"K_extend_factor": "k extension factor for Inspection Table B",
"max_quotient_reduction_steps": "Maximum steps for quotient reduction verification",
"timezone": "Timezone for log and output to display (e.g., 'Asia/Tokyo', 'UTC')",
"log_level": "Log level",
"verbose": "Verbose mode to display",
"use_multiprocessing": "Flag to use multiprocessing",
"processes": "Number of processes to use (0 for auto-detection)"
},
"parameters": config_dict
}
try:
with open(filename, 'w', encoding='utf-8') as f:
json.dump(config_with_comments, f, indent=2, ensure_ascii=False)
logging.info(f"Created default configuration file '{filename}'")
return filename
except Exception as e:
logging.error(f"Failed to create configuration file: {e}")
raise
@staticmethod
def load_config(filename: str) -> Dict[str, Any]:
if not os.path.exists(filename):
raise FileNotFoundError(f"Configuration file '{filename}' not found")
try:
with open(filename, 'r', encoding='utf-8') as f:
config = json.load(f)
return config.get('parameters', config)
except json.JSONDecodeError as e:
logging.error(f"Invalid JSON format in configuration file '{filename}': {e}")
raise
except Exception as e:
logging.error(f"Failed to load configuration file '{filename}': {e}")
raise
def get_inspection_parameters(config_file: str = "inspection_parameters.json") -> InspectionParameters:
if not os.path.exists(config_file):
logging.warning(f"Configuration file '{config_file}' does not exist. Creating with default settings.")
ConfigManager.create_default_config(config_file)
try:
config_dict = ConfigManager.load_config(config_file)
params = InspectionParameters(**config_dict)
logging.info(f"Loaded configuration from file '{config_file}'")
logging.debug(f"Loaded configuration: {asdict(params)}")
return params
except (TypeError, ValueError) as e:
logging.error(f"Invalid parameters in configuration file: {e}. Using default configuration.")
return InspectionParameters()
except Exception as e:
logging.error(f"Failed to load configuration. Using default configuration: {e}")
return InspectionParameters()
def print_and_log_parameters(params: InspectionParameters, logger: Any) -> None:
"""Prints and logs the current inspection parameters."""
logger.log(LINE_60_CHAR)
logger.log("Collatz Conjecture Inspection Parameters (Theorem 4.3)")
logger.log(LINE_60_CHAR)
logger.log(f" t (Exponent for mod 2^t): {params.t}, mod 2^t = 2^{params.t} = {2**params.t}")
logger.log(f" L-step map length: {params.L}")
logger.log(f" Max k value: {params.K}")
logger.log(f" Max allowable error e_max: {params.e_max}")
logger.log(f" Minimum growth rate threshold c_min: {params.c_min}")
logger.log(f" S* evaluation method: Gradual method (Bernoulli-type -> {'Binary Rational Bound' if params.s_star_method == 'binary_bound' else 'Precise calculation only'})")
logger.log(f" Use Bernoulli-type bound: {'Enabled (Stage 1)' if params.enable_bernoulli_bound else 'Disabled'}")
logger.log(f" Local Timezone: {params.timezone}")
logger.log(LINE_60_DASH)
logger.log("Inspection Table B specific settings:")
logger.log(f" Generate Inspection Table B: {'Enabled' if params.enable_table_B else 'Disabled'}")
logger.log(f" k extension factor: {params.K_extend_factor} (Max k = {params.K * params.K_extend_factor})")
logger.log(f" Max steps for quotient reduction verification: {params.max_quotient_reduction_steps}")
logger.log(LINE_60_CHAR)
# =================================================================
# Data structures
# =================================================================
@dataclass
class FailureCase:
r: int; k: int; V0: int; V_L: int; increase_rate: float; partial_sum: float
terminated: bool; failure_reason: str; collatz_sequence_length: int
max_value_in_sequence: int
@dataclass
class TableBResult:
r: int; quotient_reduction_verified: bool; failed_k_values: List[int]
max_k_tested: int; total_tests: int; successful_reductions: int
early_terminations: int; max_steps_reached_count: int
first_failure_details: Optional[Dict[str, Any]] = None # Add this line
@dataclass
class FailureAnalysis:
total_failures: int; failure_rate: float; failures_by_reason: Dict[str, int]
failures_by_residue_class: Dict[int, int]; smallest_failing_V0: int; largest_failing_V0: int
failure_cases: List[FailureCase]
@dataclass
class BinaryRationalBound:
"""Data structure representing the binary rational bound (M_S, B_S)"""
M_S: int # Numerator
B_S: int # Exponent of the denominator (2^B_S)
distribution: Dict[int, int] # {p: c_p} Count of each exponent
max_p: int # Maximum observed p
@property
def value(self) -> float:
"""Calculates the numerical value of the bound"""
return self.M_S / (2 ** self.B_S)
@dataclass
class SynthesisConditionCReport:
S_star: float
inequality_value: float
ln2_threshold: float
passed: bool
method: str
binary_bound: Optional[BinaryRationalBound] = None
bernoulli_bound_used: bool = False
# Move TableBSummary definition before SummaryReport
@dataclass
class TableBSummary:
"""Detailed summary for Inspection Table B"""
execution_time: float
total_classes: int
verified_classes: int
verification_rate: float
failed_classes: List[int]
first_failure_details: Optional[Dict[str, Any]] = None # Detailed info for the first failure
verification_statistics: Optional[Dict[str, Any]] = None
@dataclass
class SummaryReport:
execution_time: float; total_cases: int; satisfied_cases: int; satisfaction_rate: float
terminated_cases: int; termination_rate: float; target_classes_count: int
parameters: InspectionParameters; execution_timestamp: str
failure_analysis: Optional[FailureAnalysis] = None
table_B_summary: Optional[TableBSummary] = None
synthesis_condition_C_report: Optional[SynthesisConditionCReport] = None
# =================================================================
# Logging utilities
# =================================================================
class FileAndConsoleLogger:
"""Logger class that outputs to both console and a file"""
def __init__(self, log_filename: Optional[str] = None, timezone_name: str = "UTC"):
self.log_filename = log_filename
self.log_entries = []
self.timezone = pytz.timezone(timezone_name) # hold the timezone object
def log(self, message: str, level: str = "INFO"):
"""Logs a message"""
# Apply the local timezone
timestamp = datetime.now(self.timezone).strftime("%Y-%m-%d %H:%M:%S %Z") # set timezone
formatted_message = f"[{timestamp}] [{level}] {message}"
# Console output
print(message)
# Save entry for file output
self.log_entries.append(formatted_message)
def save_to_file(self, filename: Optional[str] = None):
"""Saves the log to a file"""
if filename is None:
filename = self.log_filename
if filename is None:
# Generate a file name with timezone
filename = f"inspection_log_{datetime.now(self.timezone).strftime('%Y%m%d_%H%M%S')}.txt"
try:
with open(filename, 'w', encoding='utf-8') as f:
f.write('\n'.join(self.log_entries))
f.write('\n\n') # Add a blank line at the end
logging.info(f"Log file saved to '{filename}'")
except Exception as e:
logging.error(f"Failed to save log file: {e}")
# =================================================================
# Core Logic
# =================================================================
def ord2(n: int) -> int:
"""Calculates the 2-adic valuation of n."""
if n <= 0: return 0
return (n & -n).bit_length() - 1
def g(n: int) -> int: return 3 * n + 1
class CollatzInspectorEnhanced:
def __init__(self, params: InspectionParameters):
self.params = params
self.mod = 2 ** self.params.t # 2^t
self.target_classes = [r for r in range(1, self.mod, 2)] # including odd multiples of 3 to process targets
# pass timezone to the logger
self.logger = FileAndConsoleLogger(timezone_name=self.params.timezone)
logging.info(f"Number of target congruence classes: {len(self.target_classes)} (mod={self.mod})")
def L_step_mapping(self, V0: int) -> Tuple[int, float, bool, float, List[int]]:
"""
Applies the L-step map and returns V_L, partial sum, termination flag, binary rational bound partial sum, and a list of 2-adic valuations.
Returns: (V_L, partial_sum, terminated, partial_sum_binary_bound, p_values)
"""
if V0 <= 0: raise ValueError("V0 must be positive")
if V0 == 1: return 1, 0.0, True, 0.0, []
current = V0
partial_sum = 0.0
partial_sum_binary_bound = 0.0
terminated = False
p_values = [] # Record 2-adic valuation at each step
for i in range(self.params.L):
g_val = g(current)
p = ord2(g_val)
next_odd = g_val >> p
# The partial sum is calculated based on V_j (j=1..L-1)
# This loop is i=0..L-1, current=V_i, next_odd=V_{i+1}
# V_L is the result of g on V_L-1 divided by ord2, so it needs to be calculated with V_L-1 info at the end of the loop
# S(V0) = sum_{j=0}^{L-1} 1/g(V_j) (V_j != 1)
# V_j is the next_odd at step i=j-1, so using loop variable i
# S(V0) = sum_{i=0}^{L-2} 1/g(next_odd_at_step_i) (next_odd_at_step_i != 1)
# The loop variable i is from 0 to L-1, so we add the reciprocal of g(V_{i+1}) to the partial_sum
# V_{i+1} is the next_odd calculated in the current step i
if i < self.params.L - 1 and next_odd > 1: # Up to the step before the L-th map result (V_L)
g_of_next_odd = g(next_odd) # This is g(V_{i+1})
partial_sum += 1.0 / g_of_next_odd
p_of_next_odd = ord2(g_of_next_odd)
partial_sum_binary_bound += 2**(-p_of_next_odd)
p_values.append(p_of_next_odd)
current = next_odd
if current == 1:
terminated = True
break
V_L = current
return V_L, partial_sum, terminated, partial_sum_binary_bound, p_values
def decompose(self, V: int) -> Tuple[int, int]:
"""Decomposes value into congruence class expression V = r + 2^t * k"""
r = V % self.mod
# Ensure r is odd and in the range [1, mod).
# If V is even, r = V % mod will be even. We need the odd residue V mod 2^t.
# The odd residue of V is V if V is odd.
# If V is even, it doesn't belong to any target residue class r in range(1, mod, 2).
# Collatz conjecture implies V_L should be odd unless it's 1.
# If V_L is 1, decompose(1) should give r=1, k=0 (for t>=1).
# If V_L is an even number greater than 1 (which shouldn't happen for V_L after L steps of odd numbers),
# this decomposition doesn't make sense in the context of r + 2^t * k where r is odd.
# Assuming V_L is always odd or 1 for valid Collatz sequences starting from odd V0.
if V == 1:
# For V=1, the decomposition is r=1, k=0 for any t>=1
return 1, 0
if V % 2 == 0:
# This case shouldn't happen if L_step_mapping works correctly on odd V0 > 1.
# However, for robustness or debugging, we can log or raise an error.
# For now, return a dummy value or handle as an error case.
# Returning r=0, k=-1 as an invalid decomposition for even V > 1.
return 0, -1 # Indicate error or unexpected value
# If V is odd and > 1, r = V % mod is the correct odd residue.
k = (V - r) // self.mod
return r, k
def verify_quotient_reduction(self, r: int, k_start: int) -> Dict[str, Any]:
"""Inspection Table B: Verifies quotient reduction"""
current_k = k_start
for step in range(self.params.max_quotient_reduction_steps):
V0 = r + self.mod * current_k
# Ensure V0 is positive and odd. r is already odd >= 1. mod = 2^t >= 2. k_start >= K+1 >= 1.
# So V0 = r + 2^t * k is always odd and >= 1 + 2^t * 1 > 1.
# V0 > 0 check inside L_step_mapping is technically redundant here but safe.
V_L, _, terminated, _, _ = self.L_step_mapping(V0)
if terminated:
# If sequence terminates at 1, quotient reduction is considered verified implicitly
# for all k >= k_start as the sequence goes to 1.
# This step path terminates, so quotient reduction verified for this V0.
return {"successful": True, "terminated_early": True, "max_steps_reached": False}
# V_L is odd and > 1 if not terminated
r_new, k_new = self.decompose(V_L)
if r_new == 0 and k_new == -1:
# Handle error case from decompose
return {"successful": False, "terminated_early": False, "max_steps_reached": False, "reason": "decompose_error"}
if k_new < current_k:
# Quotient reduction verified for this step
return {"successful": True, "terminated_early": False, "max_steps_reached": False}
current_k = k_new # Continue verification with the new k
# If max steps reached without reduction or termination
return {"successful": False, "terminated_early": False, "max_steps_reached": True}
def build_table_B_for_residue(self, r: int) -> TableBResult:
"""Builds Inspection Table B for the specified residue class r"""
failed_k, successful, early_term, max_steps = [], 0, 0, 0
max_k_tested = self.params.K * self.params.K_extend_factor
k_range = range(self.params.K + 1, max_k_tested + 1)
first_failure = None
for k in k_range:
res = self.verify_quotient_reduction(r, k)
if res["successful"]:
successful += 1
if res["terminated_early"]: early_term += 1
else:
failed_k.append(k)
if res["max_steps_reached"]: max_steps += 1
if first_failure is None:
first_failure = {"r": r, "k": k, "reason": res.get("reason", "max_steps_reached" if res["max_steps_reached"] else "other")}
result = TableBResult(
r=r, quotient_reduction_verified=not failed_k,
failed_k_values=failed_k, max_k_tested=max_k_tested,
total_tests=len(k_range), successful_reductions=successful,
early_terminations=early_term, max_steps_reached_count=max_steps
)
if first_failure:
result.first_failure_details = first_failure
return result
def _inspect_one_r_k(self, args: Tuple[int, int]) -> Dict[str, Any]:
"""Worker function to inspect a single (r, k) pair"""
r, k = args
V0 = r + self.mod * k
# Handle V0 = 1 specifically if t=1, r=1, k=0. r is always odd, mod=2^t.
# V0=1 happens only if r=1 and k=0.
if r == 1 and k == 0:
V0 = 1
if V0 <= 0:
logging.warning(f"Skipping inspection for V0 <= 0: r={r}, k={k}, V0={V0}")
return {
"r": r, "k": k, "V0": V0, "V_L": -1,
"terminated": False, "increase_rate": 0.0,
"partial_sum": 0.0, "partial_sum_binary_bound": 0.0,
"condition_A_satisfied": False, "failure_reason": "V0 <= 0",
"collatz_sequence_length": 0, "max_value_in_sequence": 0
}
try:
V_L, partial_sum, terminated, partial_sum_binary_bound, p_values = self.L_step_mapping(V0)
# Calculate Collatz sequence length and max value for failure cases
collatz_seq = [V0]
current_val = V0
seq_len = 1
max_val = V0
# Simulate further steps if not terminated within L
# Only calculate this for potential failure analysis if needed, can be expensive
# For now, let's calculate it only if condition_A is not met.
# Or, if needed for FailureCase dataclass, calculate it always but maybe limit steps.
# The current L_step_mapping doesn't return full sequence, only V_L.
# We might need a separate function or modify L_step_mapping to get the sequence.
# For now, just populate the FailureCase fields with dummy/partial info if not easily available.
increase_rate = V_L / V0 if V0 > 0 and V_L > 0 else 0.0
condition_A1 = terminated
condition_A2 = increase_rate >= self.params.c_min
condition_A = condition_A1 or condition_A2
failure_reason = ""
if not condition_A:
if not condition_A1 and not condition_A2:
failure_reason = f"Non-terminated and insufficient increase rate (rate={increase_rate:.4f} < {self.params.c_min})"
elif not condition_A2:
failure_reason = f"Insufficient increase rate (rate={increase_rate:.4f} < {self.params.c_min})"
else: # not condition_A1
failure_reason = "Non-terminated"
# Dummy or partial values for FailureCase fields not readily available
# A proper implementation would track the sequence
collatz_sequence_length = -1 # Not calculated by L_step_mapping
max_value_in_sequence = -1 # Not calculated by L_step_mapping
result = {
"r": r, "k": k, "V0": V0, "V_L": V_L,
"terminated": condition_A1, "increase_rate": increase_rate,
"partial_sum": partial_sum,
"partial_sum_binary_bound": partial_sum_binary_bound,
"p_values": p_values,
"condition_A_satisfied": condition_A, "failure_reason": failure_reason,
"collatz_sequence_length": collatz_sequence_length,
"max_value_in_sequence": max_value_in_sequence
}
return result
except Exception as e:
logging.error(f"Error processing r={r}, k={k}, V0={V0}: {e}")
return {
"r": r, "k": k, "V0": V0, "V_L": -1,
"terminated": False, "increase_rate": 0.0,
"partial_sum": 0.0, "partial_sum_binary_bound": 0.0,
"p_values": [],
"condition_A_satisfied": False, "failure_reason": f"Processing error: {e}",
"collatz_sequence_length": -1, "max_value_in_sequence": -1
}
def _calculate_synthesis_condition_C(self, table_A: Dict[int, List[Dict[str, Any]]]) -> SynthesisConditionCReport:
"""
Verifies Synthesis Condition C from Inspection Table A results and calculates S* (new spec support)
Gradual method: First a rough filter with a Bernoulli-type upper bound -> Apply a Binary Rational Bound only if necessary
"""
self.logger.log(LINE_60_DASH)
self.logger.log("Starting verification of Synthesis Condition C (gradual method)")
# === Stage 1: Rough pass judgment using a Bernoulli-type upper bound ===
self.logger.log("Stage 1: Early pass judgment using Bernoulli-type upper bound")
# Calculate S* precisely (using partial_sum)
max_sums_precise_per_r = {}
for r in self.target_classes:
r_results = table_A.get(r, [])
# Target non-terminated cases only and find the maximum partial_sum for each residue class
non_terminated_sums = [row.get('partial_sum', 0.0) for row in r_results if not row.get('terminated', True)]
max_sums_precise_per_r[r] = max(non_terminated_sums) if non_terminated_sums else 0.0
S_star_precise = sum(max_sums_precise_per_r.values())
# Value used for judgment with Bernoulli-type bound (precise S* / (1-e_max))
inequality_value_bernoulli = S_star_precise / (1 - self.params.e_max)
ln2_threshold = math.log(2)
passed_bernoulli = inequality_value_bernoulli < ln2_threshold
self.logger.log(f"Bernoulli-type upper bound applied value: S*={S_star_precise:.8f}, (1/(1-e_max))S*={inequality_value_bernoulli:.8f}")
# Early pass judgment
if self.params.enable_bernoulli_bound and passed_bernoulli:
self.logger.log("✅ Passed with Bernoulli-type upper bound → Skipping binary rational bound calculation")
return SynthesisConditionCReport(
S_star=S_star_precise,
inequality_value=inequality_value_bernoulli,
ln2_threshold=ln2_threshold,
passed=True,
method="bernoulli_early_pass",
binary_bound=None,
bernoulli_bound_used=True
)
# === Stage 2: Precise evaluation using Binary Rational Bound ===
self.logger.log("⚠️ Failed with Bernoulli-type upper bound, or Bernoulli-type bound disabled → Stage 2: Precise evaluation using binary rational bound")
# Calculate and judge with binary rational bound only if enabled
if self.params.s_star_method == 'binary_bound':
# Aggregate partial_sum_binary_bound needed for binary rational bound calculation
max_sums_binary_per_r = {}
all_p_values = [] # Collect p_values for binary bound calculation
for r in self.target_classes:
r_results = table_A.get(r, [])
non_terminated_cases = [row for row in r_results if not row.get('terminated', True)]
if non_terminated_cases:
# Find the max partial_sum_binary_bound for this r
max_sums_binary_per_r[r] = max(row.get('partial_sum_binary_bound', 0.0) for row in non_terminated_cases)
# Collect p_values from non-terminated cases
for row in non_terminated_cases:
if 'p_values' in row and isinstance(row['p_values'], list):
all_p_values.extend(row['p_values'])
else:
max_sums_binary_per_r[r] = 0.0
S_star_binary_sum_of_max = sum(max_sums_binary_per_r.values())
# Calculate the binary rational bound based on *all* p_values from non-terminated cases
# Note: The definition of the binary rational bound M_S/2^B_S is based on the *set* of p-values
# observed across *all* non-terminating paths, not just the maximum partial sum path for each r.
# The formula is M_S = sum_{p in P} c_p * 2^(B_S-p), where P is the set of all observed p-values > 0,
# c_p is the total count of p, and B_S >= max(P).
# This differs slightly from the sum of max partial_sum_binary_bound per r.
# The correct S* based on the binary rational bound is M_S/2^B_S.
if not all_p_values:
# If no non-terminated cases or no p_values collected, S* binary bound is 0
binary_bound = BinaryRationalBound(M_S=0, B_S=0, distribution={}, max_p=0)
S_star_binary = 0.0
self.logger.log("Binary rational bound: No non-terminated cases or p-values → S* = 0")
else:
distribution = Counter(p for p in all_p_values if p > 0) # Only count p > 0
max_p = max(distribution.keys()) if distribution else 0
B_S = max(max_p, 1) # B_S must be at least 1 if p > 0 exists
M_S = sum(count * (2 ** (B_S - p)) for p, count in distribution.items())
binary_bound = BinaryRationalBound(M_S=M_S, B_S=B_S, distribution=dict(distribution), max_p=max_p)
S_star_binary = binary_bound.value # This is the correct S* for the binary bound
self.logger.log(f"Binary rational bound: M_S={binary_bound.M_S}, B_S={binary_bound.B_S}")
self.logger.log(f"S* by binary rational bound={S_star_binary:.8f}")
# Judgment with binary rational bound
inequality_value_binary = S_star_binary / (1 - self.params.e_max)
passed_binary = inequality_value_binary < ln2_threshold
# Determine final result
# In the gradual method, if the Bernoulli bound fails, we proceed to the binary rational bound.
# If the binary rational bound passes, that's the final result.
# If both fail, the overall result is a failure, but for reporting, we use the precise S* (the basis for the Bernoulli bound calculation).
# The spec says "gradual method," so if the binary rational bound passes, the result is Yes; if both fail, the result is No.
# For the S* report value, if a binary rational bound was calculated, use that as the final reported value.
final_passed = passed_binary # The condition passes if the binary bound test passes
final_method = f"binary_bound ({'pass' if final_passed else 'fail'})"
final_S_star = S_star_binary
final_inequality = inequality_value_binary
else: # self.params.s_star_method == 'precise' (or other value if added)
# If the binary rational bound is disabled, the precise calculation result is the final result
self.logger.log("Binary rational bound is disabled → Final adoption of precise calculation results")
final_method = "precise_only"
final_S_star = S_star_precise
final_inequality = inequality_value_bernoulli
final_passed = passed_bernoulli
binary_bound = None # No binary bound calculated
self.logger.log(f"Final judgment: S*={final_S_star:.8f}, (1/(1-e_max))S*={final_inequality:.8f}")
self.logger.log(f"Synthesis Condition C {'Passed' if final_passed else 'Failed'} (method: {final_method})")
return SynthesisConditionCReport(
S_star=final_S_star,
inequality_value=final_inequality,
ln2_threshold=ln2_threshold,
passed=final_passed,
method=final_method,
binary_bound=binary_bound if self.params.s_star_method == 'binary_bound' else None, # Only include if method was binary_bound
bernoulli_bound_used=True # Bernoulli bound calculation is always the first step
)
def build_inspection_tables(self) -> Tuple[Dict[int, List[Dict[str, Any]]], SummaryReport]:
"""Builds Inspection Table A and B and generates a summary report"""
start_time = time.time()
# --- Build Inspection Table A ---
self.logger.log("Starting construction of Inspection Table A")
tasks = [(r, k) for r in self.target_classes for k in range(self.params.K + 1)]
if self.params.use_multiprocessing and self.params.processes > 1:
self.logger.log(f"Using multiprocessing: {self.params.processes} processes")
with Pool(processes=self.params.processes) as pool:
# Using imap_unordered for potentially better memory usage with large results
results_A = list(pool.imap_unordered(self._inspect_one_r_k, tasks))
else:
self.logger.log("Running in single process mode")
results_A = [self._inspect_one_r_k(t) for t in tasks]
table_A = {}
valid_results_A = [] # Filter out invalid or error cases before processing
first_failure_V0 = None # 💡 This is a variable for the first abnormal case of V0
for row in results_A:
if row.get('V0', -1) > 0 and row.get('V_L', -1) != -1: # Check V0 > 0 and V_L is not error indicator
table_A.setdefault(row['r'], []).append(row)
valid_results_A.append(row)
# 💡 Finding the first abnormal case for V0
if not row.get("condition_A_satisfied", True) and first_failure_V0 is None:
first_failure_V0 = row["V0"]
else:
logging.warning(f"Skipped adding invalid/error result for r={row.get('r')}, k={row.get('k')}: {row.get('failure_reason', 'Unknown Error')}")
self.logger.log("Completed construction of Inspection Table A")
# --- Verify Synthesis Condition C ---
synthesis_report = self._calculate_synthesis_condition_C(table_A)
# --- Build Inspection Table B ---
table_B_summary = None
if self.params.enable_table_B:
self.logger.log(LINE_60_DASH)
self.logger.log("Starting construction of Inspection Table B")
b_start = time.time()
b_tasks = self.target_classes # Table B is built for each residue class
if self.params.use_multiprocessing and self.params.processes > 1:
with Pool(processes=self.params.processes) as pool:
# Using imap_unordered for potentially better memory usage
results_B = list(pool.imap_unordered(self.build_table_B_for_residue, b_tasks))
else:
results_B = [self.build_table_B_for_residue(r) for r in b_tasks]
# Store results_B as instance variable for CSV export
self.results_B = results_B
# Calculate detailed statistics for Inspection Table B
total_verified = sum(1 for res in results_B if res.quotient_reduction_verified)
failed_classes = [res.r for res in results_B if not res.quotient_reduction_verified]
# Get details of the first failure
first_failure_details = None
for res in results_B:
if hasattr(res, 'first_failure_details') and res.first_failure_details:
first_failure_details = res.first_failure_details
break # Get details of the first residue class that failed
# Calculate verification statistics
total_tests = sum(res.total_tests for res in results_B)
total_successful = sum(res.successful_reductions for res in results_B)
total_early_term = sum(res.early_terminations for res in results_B)
total_max_steps = sum(res.max_steps_reached_count for res in results_B)
verification_stats = {
"total_tests_performed": total_tests,
"total_successful_reductions": total_successful,
"total_early_terminations": total_early_term,
"total_max_steps_reached_count": total_max_steps,
"success_rate": total_successful / total_tests if total_tests > 0 else 0.0
}
# Instantiate TableBSummary explicitly providing verification_statistics
table_B_summary = TableBSummary(
execution_time=time.time() - b_start,
total_classes=len(self.target_classes),
verified_classes=total_verified,
verification_rate=total_verified / len(self.target_classes) if self.target_classes else 0.0,
failed_classes=failed_classes,
first_failure_details=first_failure_details,
verification_statistics=verification_stats # Explicitly provide the calculated stats
)
self.logger.log("Completed construction of Inspection Table B")
# --- Generate Summary ---
total_cases = len(valid_results_A) # Base total cases on valid results
satisfied = sum(1 for row in valid_results_A if row["condition_A_satisfied"])
terminated = sum(1 for row in valid_results_A if row["terminated"])
# 💡 apply timezone to the execution_timestamp
execution_timestamp = datetime.now(pytz.timezone(self.params.timezone)).isoformat()
summary = SummaryReport(
execution_time=time.time() - start_time,
total_cases=total_cases,
satisfied_cases=satisfied,
satisfaction_rate=satisfied / total_cases if total_cases > 0 else 0.0,
terminated_cases=terminated,
termination_rate=terminated / total_cases if total_cases > 0 else 0.0,
target_classes_count=len(self.target_classes),
parameters=self.params,
execution_timestamp = execution_timestamp, # using timestamp applied timezone
failure_analysis = FailureAnalysis( # 💡 initialize FailureAnalysis
total_failures=(total_cases - satisfied),
failure_rate=(total_cases - satisfied) / total_cases if total_cases > 0 else 0.0,
failures_by_reason={}, # Other fields omitted for brevity
failures_by_residue_class={},
smallest_failing_V0 = first_failure_V0 if first_failure_V0 is not None else -1, # 💡 the first abnormal case of V0
largest_failing_V0 = -1,
failure_cases=[]
),
table_B_summary=table_B_summary,
synthesis_condition_C_report=synthesis_report
)
return table_A, summary # Return table_A (including all data) and the summary
def build_inspection_tables(self) -> Tuple[Dict[int, List[Dict[str, Any]]], SummaryReport]:
"""Builds Inspection Table A and B and generates a summary report"""
start_time = time.time()
# --- Build Inspection Table A ---
self.logger.log("Starting construction of Inspection Table A")
tasks = [(r, k) for r in self.target_classes for k in range(self.params.K + 1)]
if self.params.use_multiprocessing and self.params.processes > 1:
self.logger.log(f"Using multiprocessing: {self.params.processes} processes")
with Pool(processes=self.params.processes) as pool:
# Using imap_unordered for potentially better memory usage with large results
results_A = list(pool.imap_unordered(self._inspect_one_r_k, tasks))
else:
self.logger.log("Running in single process mode")
results_A = [self._inspect_one_r_k(t) for t in tasks]
table_A = {}
valid_results_A = [] # Filter out invalid or error cases before processing
first_failure_V0 = None # 💡 the first abnormal case of V0
for row in results_A:
if row.get('V0', -1) > 0 and row.get('V_L', -1) != -1: # Check V0 > 0 and V_L is not error indicator
table_A.setdefault(row['r'], []).append(row)
valid_results_A.append(row)
# 💡 Finding the first abnormal case of V0
if not row.get("condition_A_satisfied", True) and first_failure_V0 is None:
first_failure_V0 = row["V0"]
else:
logging.warning(f"Skipped adding invalid/error result for r={row.get('r')}, k={row.get('k')}: {row.get('failure_reason', 'Unknown Error')}")
# Store valid_results_A as instance variable for CSV export
self.valid_results_A = valid_results_A
self.logger.log("Completed construction of Inspection Table A")
# --- Verify Synthesis Condition C ---
synthesis_report = self._calculate_synthesis_condition_C(table_A)
# --- Build Inspection Table B ---
table_B_summary = None
if self.params.enable_table_B:
self.logger.log(LINE_60_DASH)
self.logger.log("Starting construction of Inspection Table B")
b_start = time.time()
b_tasks = self.target_classes # Table B is built for each residue class
if self.params.use_multiprocessing and self.params.processes > 1:
with Pool(processes=self.params.processes) as pool:
# Using imap_unordered for potentially better memory usage
results_B = list(pool.imap_unordered(self.build_table_B_for_residue, b_tasks))
else:
results_B = [self.build_table_B_for_residue(r) for r in b_tasks]
# set results_B as an instance variable
self.results_B = results_B
# Calculate detailed statistics for Inspection Table B
total_verified = sum(1 for res in results_B if res.quotient_reduction_verified)
failed_classes = [res.r for res in results_B if not res.quotient_reduction_verified]
# Get details of the first failure
first_failure_details = None
for res in results_B:
if hasattr(res, 'first_failure_details') and res.first_failure_details:
first_failure_details = res.first_failure_details
break # Get details of the first residue class that failed
# Calculate verification statistics
total_tests = sum(res.total_tests for res in results_B)
total_successful = sum(res.successful_reductions for res in results_B)
total_early_term = sum(res.early_terminations for res in results_B)
total_max_steps = sum(res.max_steps_reached_count for res in results_B)
verification_stats = {
"total_tests_performed": total_tests,
"total_successful_reductions": total_successful,
"total_early_terminations": total_early_term,
"total_max_steps_reached_count": total_max_steps,
"success_rate": total_successful / total_tests if total_tests > 0 else 0.0
}
# Instantiate TableBSummary explicitly providing verification_statistics
table_B_summary = TableBSummary(
execution_time=time.time() - b_start,
total_classes=len(self.target_classes),
verified_classes=total_verified,
verification_rate=total_verified / len(self.target_classes) if self.target_classes else 0.0,
failed_classes=failed_classes,
first_failure_details=first_failure_details,
verification_statistics=verification_stats # Explicitly provide the calculated stats
)
self.logger.log("Completed construction of Inspection Table B")
# --- Generate Summary ---
total_cases = len(valid_results_A) # Base total cases on valid results
satisfied = sum(1 for row in valid_results_A if row["condition_A_satisfied"])
terminated = sum(1 for row in valid_results_A if row["terminated"])
# 💡 apply timezone to the execution_timestamp
execution_timestamp = datetime.now(pytz.timezone(self.params.timezone)).isoformat()
summary = SummaryReport(
execution_time=time.time() - start_time,
total_cases=total_cases,
satisfied_cases=satisfied,
satisfaction_rate=satisfied / total_cases if total_cases > 0 else 0.0,
terminated_cases=terminated,
termination_rate=terminated / total_cases if total_cases > 0 else 0.0,
target_classes_count=len(self.target_classes),
parameters=self.params,
execution_timestamp=execution_timestamp, # the timestamp applied timezone
failure_analysis = FailureAnalysis( # 💡 initialize FailureAnalysis
total_failures=(total_cases - satisfied),
failure_rate=(total_cases - satisfied) / total_cases if total_cases > 0 else 0.0,
failures_by_reason={}, # Other fields omitted for brevity
failures_by_residue_class={},
smallest_failing_V0=first_failure_V0 if first_failure_V0 is not None else -1, # 💡 the first abnormal case of V0
largest_failing_V0=-1,
failure_cases=[]
),
table_B_summary=table_B_summary,
synthesis_condition_C_report=synthesis_report
)
return table_A, summary # Return table_A (including all data) and the summary
def build_inspection_tableA_stream(self):
"""Generates actual data for Inspection Table A in a stream format"""
if hasattr(self, 'valid_results_A') and self.valid_results_A:
# Use pre-calculated data if available
for row in self.valid_results_A:
yield {
"r": row.get("r", ""),
"k": row.get("k", ""),
"V0": row.get("V0", ""),
"V_L": row.get("V_L", ""),
"terminated": row.get("terminated", ""),
"increase_rate": row.get("increase_rate", ""),
"partial_sum": row.get("partial_sum", ""),
"partial_sum_binary_bound": row.get("partial_sum_binary_bound", ""),
"condition_A_satisfied": row.get("condition_A_satisfied", ""),
"failure_reason": row.get("failure_reason", ""),
"collatz_sequence_length": row.get("collatz_sequence_length", ""),
"max_value_in_sequence": row.get("max_value_in_sequence", "")
}
else:
# If no data is available, return an empty generator
return
yield # This line will not be executed
def build_inspection_tableB_stream(self):
"""Generates actual data for Inspection Table B in a stream format"""
if hasattr(self, 'results_B') and self.results_B:
# Use pre-calculated data if available
for result in self.results_B:
yield {
"r": result.r,
"quotient_reduction_verified": result.quotient_reduction_verified,
"total_tests": result.total_tests,
"successful_reductions": result.successful_reductions,
"early_terminations": result.early_terminations,
"max_steps_reached_count": result.max_steps_reached_count,
"max_k_tested": result.max_k_tested,
"failed_k_count": len(result.failed_k_values),
"first_failed_k": result.failed_k_values[0] if result.failed_k_values else None,
"first_failure_details": result.first_failure_details if hasattr(result, 'first_failure_details') else None
}
else:
# If no data is available, return an empty generator
return
yield # This line will not be executed
# Stream output method (sequential writing)
def export_csv_stream(self, results_iter, filename: str, fieldnames: List[str]):
"""
Exports results to a CSV file in a stream format and reports the number of records generated
"""
record_count = 0
try:
with open(filename, "w", newline="", encoding="utf-8") as csvfile:
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writeheader()
for row in results_iter:
writer.writerow(row)
record_count += 1
self.logger.log(f"Exported streamed CSV: {filename}, total records: {record_count}.")
except Exception as e:
logging.error(f"Failed during streamed CSV export: {e}")
if record_count > 0:
self.logger.log(f"Partial export completed: {record_count} records written before error")
def export_json(self, data: Any, filename: str):
class EnhancedJSONEncoder(json.JSONEncoder):
def default(self, o):
if dataclasses.is_dataclass(o):
# Recursively convert dataclasses to dicts
return asdict(o)
# Make datetime objects JSON serializable
if isinstance(o, datetime):
return o.isoformat()
return super().default(o)
try:
with open(filename, "w", encoding="utf-8") as f:
# Use the custom encoder
json.dump(data, f, indent=2, ensure_ascii=False, cls=EnhancedJSONEncoder)
self.logger.log(f"Exported JSON data to file: {filename}")
except Exception as e:
logging.error(f"Failed to export JSON: {e}")
def export_synthesis_condition_report(self, report: SynthesisConditionCReport, filename: str):
"""Exports Synthesis Condition C report as a detailed file"""
try:
with open(filename, "w", encoding="utf-8") as f:
f.write(LINE_80_CHAR + "\n")
f.write("Synthesis Condition C Verification Report (Theorem 4.3 New Spec Support)\n")
f.write(LINE_80_CHAR + "\n\n")
f.write(f"Verification Method: {report.method}\n")
f.write(f"S* (Conservative Error Sum Upper Bound): {report.S_star:.8f}\n")
f.write(f"Inequality Evaluation Value (1/(1-e_max))S*: {report.inequality_value:.8f}\n")
f.write(f"Threshold ln(2): {report.ln2_threshold:.8f}\n")
f.write(f"Judgment: {'✅ Passed' if report.passed else '❌ Failed'}\n")
if report.bernoulli_bound_used:
f.write("Bernoulli-type upper bound: Applied\n")
# Check if binary_bound is not None and the method indicates binary bound was used
if report.binary_bound and ('binary_bound' in report.method or 'binary_bound_fallback' in report.method):
f.write("\n" + LINE_60_DASH + "\n")
f.write("Binary Rational Bound (M_S, B_S) Details:\n")
f.write(LINE_60_DASH + "\n")
f.write(f"M_S (Numerator): {report.binary_bound.M_S}\n")
f.write(f"B_S (Denominator Exponent): {report.binary_bound.B_S}\n")
f.write(f"Bound Value M_S/2^B_S: {report.binary_bound.value:.8f}\n")
f.write(f"Maximum 2-adic valuation: {report.binary_bound.max_p}\n")
f.write("\n2-adic Valuation Distribution:\n")
if report.binary_bound.distribution:
for p in sorted(report.binary_bound.distribution.keys()):
count = report.binary_bound.distribution[p]
# Add check for p>0 before calculating contribution
contribution = count * (2**(-p)) if p > 0 else 0 # Contribution only for p > 0
f.write(f" p={p}: {count} occurrences (Contribution: {contribution:.6f})\n")
else:
f.write(" (No distribution data)\n")
f.write("\n" + LINE_80_CHAR + "\n")
self.logger.log(f"Exported Synthesis Condition C report to file: {filename}")
except Exception as e:
logging.error(f"Failed to export Synthesis Condition C report: {e}")
def print_summary(self, summary: SummaryReport):
self.logger.log("\n" + LINE_70_CHAR)
self.logger.log("Collatz Conjecture Inspection Execution Summary (Theorem 4.3 New Spec Support)")
self.logger.log(LINE_70_CHAR)
# Use a timestamp with timezone applied
local_timezone = pytz.timezone(summary.parameters.timezone)
exec_datetime_local = datetime.fromisoformat(summary.execution_timestamp).astimezone(local_timezone)
self.logger.log(f"Execution Date/Time: {exec_datetime_local.strftime('%Y-%m-%d %H:%M:%S %Z')}")
self.logger.log(f"Total Execution Time: {summary.execution_time:.2f} seconds")
self.logger.log(LINE_70_DASH)
self.logger.log("[Inspection Table A Results]")
self.logger.log(f"Number of Target Congruence Classes (mod 2^{summary.parameters.t}): {summary.target_classes_count}")
self.logger.log(f"Total Inspection Cases (r, k): {summary.total_cases}")
self.logger.log(f"Cases Satisfying Condition A: {summary.satisfied_cases} ({summary.satisfaction_rate:.2%})")
self.logger.log(f"Terminated Cases (Condition A1): {summary.terminated_cases} ({summary.termination_rate:.2%})")
# 💡 **Change: Added logic to output the first anomaly V0**
if summary.failure_analysis and summary.failure_analysis.smallest_failing_V0 is not None and summary.failure_analysis.smallest_failing_V0 != -1:
self.logger.log(f"First Initial Value ($V_0$) with Anomaly Detected: {summary.failure_analysis.smallest_failing_V0}")
# Table A Judgment: Pass only if all cases satisfy Condition A
table_a_passed = (summary.satisfied_cases == summary.total_cases) and (summary.total_cases > 0)
self.logger.log(f"Judgment: {'✅ Passed' if table_a_passed else '❌ Failed'} (All cases satisfy Condition A: {table_a_passed})")
if summary.synthesis_condition_C_report:
report = summary.synthesis_condition_C_report
self.logger.log(LINE_70_CHAR)
self.logger.log(f"[Synthesis Condition C (Overall Upper Bound) Verification] (Method: {report.method})")
self.logger.log(f" Conservative Error Sum Upper Bound S*: {report.S_star:.8f}")
self.logger.log(f" Inequality Evaluation Value (1/(1-e_max))S*: {report.inequality_value:.8f}")
self.logger.log(f" Threshold ln(2): {report.ln2_threshold:.8f}")
self.logger.log(f" Judgment: {'✅ Passed' if report.passed else '❌ Failed'}")
# Check if binary_bound is not None before printing
if report.binary_bound and ('binary_bound' in report.method or 'binary_bound_fallback' in report.method):
self.logger.log(f" Binary Rational Bound: M_S={report.binary_bound.M_S}, B_S={report.binary_bound.B_S}")
if report.bernoulli_bound_used:
self.logger.log(" Bernoulli-type upper bound: Applied")
if summary.table_B_summary: # Add check here
bs = summary.table_B_summary
self.logger.log(LINE_70_DASH)
self.logger.log("[Inspection Table B Results]")
self.logger.log(f"Execution Time: {bs.execution_time:.2f} seconds") # Access attributes directly
self.logger.log(f"Successfully Verified Classes: {bs.verified_classes}/{bs.total_classes} ({bs.verification_rate:.2%})")
# Table B Judgment: Pass only if verification succeeded for all target residue classes
table_b_passed = (bs.verified_classes == bs.total_classes) and (bs.total_classes > 0)
self.logger.log(f"Judgment: {'✅ Passed' if table_b_passed else '❌ Failed'} (All cases successfully verified: {table_b_passed})")
if bs.failed_classes: # Access attributes directly
self.logger.log(f" Failed Classes: {bs.failed_classes}")
if bs.first_failure_details: # Access attributes directly
fd = bs.first_failure_details
self.logger.log(f" First Failure Details: r={fd['r']}, k={fd['k']}, Reason={fd['reason']}")
if bs.verification_statistics: # Access attributes directly
vs = bs.verification_statistics
self.logger.log(f" Total Tests: {vs['total_tests_performed']}")
self.logger.log(f" Success Rate: {vs['success_rate']:.2%}")
# Overall Judgment: Overall pass only if Table A, Table B, and Synthesis Condition C all pass
self.logger.log(LINE_70_CHAR)
self.logger.log("[Overall Result]")
# Judgment for each condition
conditions_passed = []
# Table A judgment
conditions_passed.append(table_a_passed)
# Table B judgment (only if enabled)
if summary.table_B_summary:
table_b_passed = (summary.table_B_summary.verified_classes == summary.table_B_summary.total_classes) and (summary.table_B_summary.total_classes > 0)
conditions_passed.append(table_b_passed)
# If Table B is disabled, consider this condition 'passed' for the overall check.
elif not self.params.enable_table_B:
# If Table B is not enabled, this condition is considered met for the overall pass check.
conditions_passed.append(True)
# Synthesis Condition C judgment
synthesis_c_passed = summary.synthesis_condition_C_report.passed if summary.synthesis_condition_C_report else False
conditions_passed.append(synthesis_c_passed)
# Overall pass only if all conditions pass
overall_passed = all(conditions_passed)
self.logger.log(f"Inspection Table A: {'Passed' if table_a_passed else 'Failed'}")
if summary.table_B_summary:
self.logger.log(f"Inspection Table B: {'Passed' if table_b_passed else 'Failed'}")
else:
self.logger.log("Inspection Table B: Disabled")
self.logger.log(f"Synthesis Condition C: {'Passed' if synthesis_c_passed else 'Failed'}")
self.logger.log(f"Judgment: {'✅ Passed' if overall_passed else '❌ Failed'} (All conditions met: {overall_passed})")
self.logger.log(LINE_70_CHAR)
# =================================================================
# main process
# =================================================================
def main_cli():
OUTPUT_DIR = "results" # output directory for logs and results
logging.basicConfig(level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(message)s")
# Load parameters from config file
config_file_name = "inspection_parameters.json"
params = get_inspection_parameters(config_file_name)
# --- Execution ---
inspector = CollatzInspectorEnhanced(params)
# Create logs directory if it doesn't exist
log_dir = OUTPUT_DIR
os.makedirs(log_dir, exist_ok=True)
# Determine log filename
# Generate filename with timezone applied
local_timezone = pytz.timezone(params.timezone)
timestamp = datetime.now(local_timezone).strftime('%Y%m%d_%H%M%S')
base_params_str = f"t{params.t}_L{params.L}_K{params.K}"
log_filename = os.path.join(log_dir, f"inspection_log_{base_params_str}_{timestamp}.txt")
inspector.logger.log_filename = log_filename # Set the log filename for the logger instance
start_time = time.time()
# Get start time with timezone applied
start_datetime_local = datetime.now(local_timezone)
inspector.logger.log(f"Starting time: {start_datetime_local.strftime('%Y-%m-%d %H:%M:%S %Z')}")
inspector.logger.log(f"Python Version: {sys.version} | OS Version: {platform.platform()}")
inspector.logger.log("Starting Collatz conjecture inspection")
print_and_log_parameters(params, inspector.logger) # Print and log parameters
try:
table_A, summary = inspector.build_inspection_tables()
# --- Output ---
# Generate output filenames based on parameters
output_dir = OUTPUT_DIR
os.makedirs(output_dir, exist_ok=True)
base_filename = f"t{params.t}_L{params.L}_K{params.K}_{timestamp}"
summary_filename = os.path.join(output_dir, f"summary_{base_filename}.json")
synthesis_report_filename = os.path.join(output_dir, f"synthesis_condition_C_{base_filename}.txt")
# Export results of TableA - Stream version
csv_filename_A = os.path.join(output_dir, f"tableA_{base_params_str}_{timestamp}.csv")
fieldnamesA = ["r", "k", "V0", "V_L", "terminated", "increase_rate",
"partial_sum", "partial_sum_binary_bound", "condition_A_satisfied",
"failure_reason", "collatz_sequence_length", "max_value_in_sequence"]
inspector.export_csv_stream(inspector.build_inspection_tableA_stream(), csv_filename_A, fieldnamesA)
# Export results of TableB - Stream version
if params.enable_table_B and summary.table_B_summary:
csv_filename_B = os.path.join(output_dir, f"tableB_{base_params_str}_{timestamp}.csv")
fieldnamesB = ["r", "quotient_reduction_verified", "total_tests", "successful_reductions",
"early_terminations", "max_steps_reached_count", "max_k_tested",
"failed_k_count", "first_failed_k", "first_failure_details"]
inspector.export_csv_stream(inspector.build_inspection_tableB_stream(), csv_filename_B, fieldnamesB)
inspector.export_json(summary, summary_filename)
# Export Synthesis Condition C Report
if summary.synthesis_condition_C_report:
inspector.export_synthesis_condition_report(
summary.synthesis_condition_C_report,
synthesis_report_filename
)
# Display summary
inspector.print_summary(summary)
end_time = time.time()
duration = end_time - start_time
end_datetime_local = datetime.now(local_timezone)
inspector.logger.log(f"Ending time: {end_datetime_local.strftime('%Y-%m-%d %H:%M:%S %Z')}")
inspector.logger.log(f"Total execution time: {duration:.2f} seconds")
except Exception as e:
logging.exception("An unexpected error occurred during execution:")
finally:
# Save the log file regardless of execution success
inspector.logger.save_to_file()
logging.info("Log file has been saved.")
if __name__ == '__main__':
main_cli()
付録E (定理4.3.30:無限集合を有限個の議論に帰着させる方法).
本付録は、定理4.3.30 に関する議論を補助的に簡潔かつ直感的にした
説明である。証明そのものは本文において独立して完結しており、
数学的な論証は一つの実例で十分に成立している。
ここで示す補足は、読者の理解を助ける便宜的な解説に過ぎない。
本稿の定理4.3.30 においては、無限集合を有限個の議論に
帰着させる手法が用いられている。
以下では、その要点を具体例とともに整理する。
付録E.1 (基本的枠組み).
自然数全体 $\mathbb{N}$ は無限集合なので、逐一検証することは不可能である。
そこで、合同類分解を導入する。ここで$\exists t \in \mathbb{Z}_{\gt 0}$ を基準指数とし、
法 $2^t$ による分解を考える。$\forall n \in \mathbb{N}_{odd}$ は次のように表される。
n = r + 2^t k \quad (\exists k \in \mathbb{Z}_{\ge 0})
ここで $r$ は法 $2^t$ における奇数代表元であり、
1 \le r \lt 2^t, r \equiv 1 (\mod 2)
を満たす。この候補は有限個に限られ、その数は $2^{t-1}$ である。
付録E.2 (有限検査範囲への帰着).
各代表元 $r$ に対して、有限個の $k \in {0,1,\dots,K}$ のみを検証すれば
十分である。定理4.3.30 では、$k$ が大きな値をとる場合でも、
コラッツ遷移を有限ステップ適用すると、必ずより小さい $k'$ に
帰着することが保証される。
この仕組みにより、無限に多様な $k$ を扱う必要がなくなる。
付録E.3 (有限証明書の構成).
以上の仕組みから、有限の検査結果を整理した「有限検査証明書」が
得られる。
構成要素は次の通りである。
- 有限個の代表元 $r$ の集合
- 各$r$ に対する有限個の $k$ の検査結果
- 遷移後の状態が再び有限集合に戻ることを保証する規則
この体系により、無限集合に属するすべての自然数について、
有限個の検査結果から性質を一般化できる。
付録E.4 (具体例).
例として $t = 3$ の場合を考える。法 8 における奇数代表元は
\{1,3,5,7\}
である。すべての奇数は
n = r + 8k \quad (r \in \{1,3,5,7\},\; k \ge 0)
と表される。したがって、奇数全体(無限集合)は、4つの代表元と
各代表元に属する有限個の $k$ の検査に分解できる。
さらに、大きな $k$ で始めても、遷移を有限回適用すれば、
必ず小さな範囲に押し戻される。
付録E.5 (本付録の位置付け).
本付録に述べた合同類分解と有限検査の仕組みにより、無限集合への
議論を有限個の代表系に帰着できる。この補足説明は、定理4.3.30 の
構成原理を明確化し、論証全体の一貫性を補強するものである。
なお、数学的な証明は本文で完結しており、ここで示す具体例は
理解を助ける補助資料に過ぎない。
付録G (第5章:実シーケンス確認).
本付録では、本文第5章「コラッツ遷移の基本分類体系」で定めた分類規則を、
実際の奇数コラッツ遷移列に対して機械的に再現・点検するための検証器を示す。
本文の数学的主張および閉包性の証明は第5章本文で完結しており、本付録は、
本文仕様と実シーケンスとの整合性を第三者が再現可能な形で監査するための
補助資料である。
現行の検証器は、本文第5章の次の仕様を実装する。
- 構造状態として
S3,S7,L1,M,C5を用いる。 - 実装上の
M,C5,D96は、本文の $M\text{-core}$, $C_5^{\mathrm{Norm}}$, $D_{96, 31}$ にそれぞれ対応する。 -
D9およびD96は、奇数コラッツ遷移を消費しない分枝細分化文脈
として扱う。 - exact token は、
S3[3],S3[11],S7[7],S7[15],L1[1],L1[9],
L1[17],L1[25],D55,D79[79],D79[175],D31[31],D31[223],
D31[M],Mの 15 種とする。 -
S7[31]は exact token としては用いず、外部から現れる $32k + 31$ 型を
$m \ge 6$ の新規 $M\text{-core}$ 入口として直接処理する。 -
D31[127]とD31[319]は exact tokenD31[M]に統合し、
その定義的条件を $192k + 127$ とする。 - $M\text{-core}$ の新規入口は $m \ge 6$ とする。
Mtoken は下降途中の
$m = 5, 4, 3$ を外部状態として再 token 化せず、$M_2(K)$ までを一つの
macro token 内で追跡する。$M_2(K)$ は token の終端値であり、
token 完了時に $K$ の偶奇でL1/C5へ引き渡す。 - 外部から直接現れる $m = 5$ のメルセンヌ数型 $M_5(t) = 32t + 15$ は
S7[15]として $S_7$ 側で処理する。 - C2b は exact token 列に対する後置 recognizer とし、
理論軌道および exact token 列の生成には使用しない。 - C2a は C2b の exact token 列から coarse alias により機械的に射影し、
独立した照合正本とはしない。 - 入力初期値 $1$ は、実装上
TERMINAL_1という終端 sentinel で処理する。
これは本文第5章の構造状態を追加するものではなく、数学的なL1[1]の
自明な $1 \to 1$ 反復を verifier 内で無限に token 化しないための停止規約である。
また、検証器は理論分類の照合に先立って、入力 TSV 全体の構造および
各入力行そのものが正しい実シーケンスを表していることを独立に確認する。
入力ファイルまたは入力行に異常がある場合、そのデータを理論分類によって
合格扱いにすることはない。
付録G-1 プログラム構成と利用方法.
検証器は、責務を分離した次の 4 ファイルから構成する。
-
OAI_INT__tokenizer_prototype.py:構造状態・分枝細分化文脈から exact token
列と理論奇数値列を独立生成する。 -
OAI_INT__c2b_recognizer_prototype.py:生成済み exact token 列に対して
C2b を後置照合し、C2a を射影生成する。 -
OAI_INT__full_verifier_shell_hardened.py:入力 TSV の独立検査、区間処理、
理論列との値単位比較、出力および coverage contract を管理する。 -
OAI_INT__full_verifier_slice_manifest_check.py:複数区間の summary を
機械的に集約し、重複・欠落のない全件被覆を確認する。
掲載コードは、実行結果との同一性を保持するため、検証時に
使用したファイル名および内部識別文字列を改変せずに示す。
これらのファイル名は論文草稿本体の版管理名とは独立である。
4ファイルは同一ディレクトリへ配置する。基礎 2 ファイルは SHA-256 により
固定され、full verifier は内容が変更されている場合には起動を拒否する。
上記 4 ファイルの SHA-256 は、文字として解釈した内容ではなく、
検証実行時に使用した
固定ファイルの生バイト列全体に対して計算した値である。
したがって、第三者が同一ファイルを再構成するときには、文字コードだけでなく、
BOM の有無、改行コード、ファイル末尾の改行も含めて同一である必要がある。
検証実行時の固定ファイル属性を 表G.1 に示す。
表G.1 (SHA-256 固定対象プログラムのファイル属性).
| ファイル | 文字コード | BOM | 行末 | EOF 末尾改行 | 行数 | byte 数 | SHA-256 |
|---|---|---|---|---|---|---|---|
OAI_INT__tokenizer_prototype.py |
UTF-8 | なし | LF (0x0A) |
あり(末尾 LF 1 個) | 791 | 29,917 | 23dfc3a77f0c0511a81ad6ed9b1a25a30f369f89d06aafe00f9f7a25336646a3 |
OAI_INT__c2b_recognizer_prototype.py |
UTF-8 | なし | LF (0x0A) |
あり(末尾 LF 1 個) | 517 | 19,738 | 71c8897b1e85871e77febc03b9b09bb5e0cc908c180b24c75378fd0d1b570d43 |
OAI_INT__full_verifier_shell_hardened.py |
UTF-8 | なし | LF (0x0A) |
あり(末尾 LF 1 個) | 1,051 | 46,278 | f8fe3595199bbf3aea50cfd2d385b657dd7feb4e49263188d7dd198237fc4c69 |
OAI_INT__full_verifier_slice_manifest_check.py |
UTF-8 | なし | LF (0x0A) |
あり(末尾 LF 1 個) | 95 | 6,228 | 10ecad23dcef5b7daefe1a434cef16334962dbc82c70667363e2961c4322a025 |
4 ファイルはいずれも UTF-8、BOM なし、LF 改行、EOF に末尾 LF を 1 個持つ
形式で保存されている。ここで「行数」は LF (0x0A) の個数を数えた値であり、
上記 4 ファイルはいずれも EOF が LF で終わるため、物理行数と一致する。
SHA-256 はこの属性を含む生バイト列に対する同一性判定である。
したがって、例えば LF を CRLF へ変換する、UTF-8 BOM を付加する、
EOF の末尾 LF を削除または追加する、といった変更を行った場合には、
表示上のプログラム内容が同等であっても固定正本とは別ファイルとなり、
SHA-256 不一致として扱う。
全 262,144 行を 1 回で検証できる環境では、次のように
--full-dataset-contract を使用できる。
python OAI_INT__full_verifier_shell_hardened.py \
--input-tsv CollatzTrajetry524288.tsv \
--output-dir verify_output \
--full-dataset-contract
実行環境上の都合により分割実行する場合は、各区間について対象行数、
先頭 odd index、末尾 odd index を明示的に契約する。例えば、
第 1 区間 60,000 行を検証する場合は次のようにする。
python OAI_INT__full_verifier_shell_hardened.py \
--input-tsv CollatzTrajetry524288.tsv \
--output-dir verify_slice1 \
--run-id s000001_060000 \
--start-row 1 \
--end-row 60000 \
--expected-row-count 60000 \
--expected-first-odd-index 0 \
--expected-last-odd-index 59999
残りの区間についても同一規則を用い、物理行範囲と logical odd index
範囲だけを変更する。
複数区間の検証後は、各区間の summary.json を manifest checker に渡す。
python OAI_INT__full_verifier_slice_manifest_check.py \
slice1_summary.json \
slice2_summary.json \
slice3_summary.json \
slice4_summary.json \
slice5_summary.json \
--expected-first-odd-index 0 \
--expected-last-odd-index 262143 \
--expected-row-count 262144 \
--json-out full_manifest.json
manifest checker は、入力 TSV の SHA-256、tokenizer および C2b recognizer の
SHA-256、各区間の PASS、coverage contract、論理 odd index 範囲、
区間間の gap/overlap、全行数を同時に検査する。
付録G-2 入力データファイル仕様.
検証器では、以下の仕様を満たす TSV ファイルを入力データとして扱う。
ここで TSV とは、各フィールドを TAB (0x09) で区切るテキスト形式をいう。
入力ファイルの文字コードは UTF-8、BOM なしとする。
行末は LF (0x0A) または CRLF (0x0D 0x0A) を許容し、
最終行の行末改行の有無は問わない。ただし、空の data row は許容しない。
ヘッダは次の 10 フィールドと完全一致しなければならない。
№\tv\tbaseV\tmod6\tmod8\tmod16\tmod32\tn\tmax\tsequence
ここで、上記の \t は TAB (0x09) を表す。
ヘッダの各項目の意味は次の通りである。
| 項目 | 内容 |
|---|---|
№ |
奇数インデックス。各 data row で $v = 2,№ + 1$ を満たす。 |
v |
初期値。正の奇数。 |
baseV |
BTG 基準値。下記の正規化規則で v から得られる値。 |
mod6 |
v の mod $6$ の剰余。 |
mod8 |
v の mod $8$ の剰余。 |
mod16 |
v の mod $16$ の剰余。 |
mod32 |
v の mod $32$ の剰余。 |
n |
sequence の奇数コラッツ遷移回数。 |
max |
sequence に含まれる最大値。 |
sequence |
初期値 v から終端 $1$ までの奇数コラッツ遷移列。 |
baseV は、v から開始し、現在値が $1$ ではなく
$(8k + 5)$ 型である間、
x \leftarrow \frac {x - 1}{4}.
を反復して得られる最初の値とする。
すなわち、検証器の normalize_to_base() と同じ規則である。
データ行の物理フィールド構造は、ヘッダの見かけ上の 10 項目とは異なり、
第 1~第 9 フィールドを固定メタデータ、第 10 フィールド以降を
sequence を構成する可変長フィールド列とする。
sequence の各奇数値は、1 値につき 1 フィールドとして TAB 区切りで格納する。
したがって、
n = \left\lvert \texttt{sequence} \right\rvert - 1.
であり、1 data row の物理フィールド数は
9 + (n + 1) = n + 10.
となる。
sequence 内に空フィールドを含めてはならない。
通常の初期値 $v \ne 1$ に対しては、sequence の先頭値を v、
末尾値を $1$ とし、末尾より前に $1$ を含めてはならない。
隣接する各値は、正の奇数 $x$ に対する奇数コラッツ遷移
R(x) = \frac {3x + 1}{2^{\mathrm{ord}_2(3x + 1)}}.
によって結ばれていなければならない。
初期値 $v = 1$ だけは入力形式上の例外として、
sequence = 1<TAB>1
すなわち
\texttt{sequence} = [1, 1].
とする。
この場合、
n = 1, \qquad \max = 1.
である。
これは、数学上の自明な $1 \to 1$ 反復を入力データ上で 1 遷移として表すための
検証器の入力規約である。
各 data row の № は入力ファイル全体で 1 ずつ厳密に
連続しなければならない。
開始 № 自体は任意であるが、各行では必ず
v = 2\,№ + 1.
を満たすものとする。
したがって、特定の区間だけを独立した TSV として用意する場合でも、
その区間内で № と v の対応および № の連続性を保持する必要がある。
検証器は、理論分類を適用する前に、入力コンテナ全体について次を検査する。
- TSV ヘッダが所定の 10 フィールドと完全一致すること。
- 空の data row が存在しないこと。
- 各行の
№とvが整数として読めること。 - 各行で $v = 2,№ + 1$ が成立すること。
-
№が入力ファイル全体で 1 ずつ厳密に連続すること。 - 入力 TSV 全体の SHA-256、総 data row 数、先頭/末尾
№およびvを
記録すること。
さらに各行について、少なくとも次を独立に検査する。
-
№と奇数インデックスの一致。 -
vとsequenceの始点の一致。 -
mod6,mod8,mod16,mod32とvの剰余の一致。 -
baseVと上記の正規化規則による基準値の一致。 -
nとsequenceの遷移回数の一致。 -
maxとsequenceの最大値の一致。 -
sequenceの各値が正の奇数であること。 -
sequenceの各隣接値が実際の奇数コラッツ遷移と一致すること。 - 通常の $v \ne 1$ では終端 $1$ より前に $1$ が出現せず、
終端 $1$ の後に値が続かないこと。 - $v = 1$ では
sequence=[1,1]であること。
入力側の隣接遷移検査は、tokenizer の odd_next() を利用せず、
full verifier 側の独立実装 input_odd_next() により行う。
したがって、tokenizer の理論生成と入力 trajectory の健全性検査は
実装上も分離されている。
また、分割実行では 0 行処理を既定で FAIL とし、
--expected-row-count, --expected-first-odd-index,
--expected-last-odd-index により各区間の coverage contract を検査する。
診断目的以外で空区間を PASS とすることはない。
実データ例として、付録G-5で報告する 262,144 行の検証に使用した
CollatzTrajetry524288.tsv のヘッダと先頭 8 data row を以下に示す。
以下のコードブロックでは、列間は実際の TAB (0x09) である。
特に先頭行 $v = 1$ が、上記の例外規約に従って
n=1, max=1, sequence=[1,1] となっていることに注意されたい。
№ v baseV mod6 mod8 mod16 mod32 n max sequence
0 1 1 1 1 1 1 1 1 1 1
1 3 3 3 3 3 3 2 5 3 5 1
2 5 1 5 5 5 5 1 5 5 1
3 7 7 1 7 7 7 5 17 7 11 17 13 5 1
4 9 9 3 1 9 9 6 17 9 7 11 17 13 5 1
5 11 11 5 3 11 11 4 17 11 17 13 5 1
6 13 3 1 5 13 13 2 13 13 5 1
7 15 15 3 7 15 15 5 53 15 23 35 53 5 1
この例は、付録G-5に記載した調査用正本 DB
コラッツ遷移表20260821a_managed_odd_index_BTG_V0-V1982(5).sqlite
から、本番入力 TSV と同じ生成規則で先頭行を確認したものである。
同じ規則で全 262,144 行を再構成した TSV の SHA-256 は、
付録G-5に記載した
2b7d7231c379c98a536306062cdd51ef28f1487bb0ba15a0abba8f65319d05be
と一致する。
付録G-3 第5章分類との照合.
入力 TSV 全体および対象行の実シーケンス健全性が確認された後、
検証器は次の順序で第5章の理論分類を確認する。
第1段階:独立 exact-token 化。
tokenizer は C2b を参照せず、現在値の構造状態と、必要に応じて有効となる
D9 / D96 の分枝細分化文脈のみから exact token を一意に選択する。
D9 および D96 の文脈移行そのものは奇数コラッツ遷移を消費しない。
実際の遷移は exact token が消費する。
D55, D79[79], D79[175] は D9 文脈が有効な場合にのみ選択し、
D31[31], D31[223], D31[M] は D96 文脈が有効な場合にのみ選択する。
したがって、raw residue の一致だけを理由に D 系 token
を大域的に選択することはない。
特に D96 文脈の現在値は構造分類だけを見れば新規 M 入口に該当するが、
active context を通常の M token より優先して D31 系 token を選択する。
この優先規則は本文第5章の規則5.5.3と一致する。
複数遷移 token が選択された場合には、その token の内部値を trace
として検査しつつ、登録処理先に到達するまで token 化を途中再開しない。
したがって、D79/D31 系 macro の内部値に別の構造状態が付与できる場合でも、
選択済み token の内部位置として処理する。この規則も本文第5章の規則5.5.3 および
定義5.6.1 に対応する。
$M\text{-core}$ については、新規入口判定と内部下降判定を区別する。
新規入口としては $m \ge 6$ のみを採用し、いったん入口が確定した後は
M_m(t) \to M_{m - 1}(3t + 1).
を $M_2(K)$ まで一つの M macro token 内で追跡する。したがって、
下降途中の $M_5, M_4, M_3$ は外部の S7[15] / S7[7] / S3[...] として
再 token 化しない。$M_2(K)$ は M token の終端値として同じ trace 内で
検査するが、token 完了後の構造状態は $K$ が偶数なら L1、
奇数なら C5 とする。
一方、外部から直接現れる
32k + 15 = M_5(k).
は S7[15] として処理する。また、外部から現れる $32k + 31$ については
k + 1 = 2^q(2t + 1).
と書くことにより
32k + 31 = M_{q + 6}(t).
となり、$q + 6 \ge 6$ であるため、新規 $M\text{-core}$
入口として直接処理する。S7[31] という exact token は用いない。
D96 文脈における旧 D31[127] と D31[319] は、
(384k + 127) \cup (384k + 319) = 192k + 127.
により D31[M] に統合する。さらに
R(192k + 127) = 288k + 191 = 32(9k + 5) + 31.
であるから、一様に新規 $M\text{-core}$ 入口へ転送される。
第2段階:理論奇数値列との値単位比較。
tokenizer が生成した理論奇数値列を、独立検査済みの入力 sequence と
segment ごとに値単位で比較する。不一致が一つでも存在すれば、
その行は FAIL とする。
第3段階:C2b の後置照合。
値単位比較が成立した後、C2b recognizer は exact token の各境界値について、
登録された C2b root congruence に一致する場合に、その登録 exact token
列と帰着先が独立 tokenizer の結果と一致することを検査する。
C2b は理論軌道または exact token 列を生成するためには用いない。
この C2b 検査は、登録された複合パターン合同類の健全性(soundness)
を確認するものである。C1 による局所 token 化が成立する位置のすべてに、
必ず C2b ID が割り当てられることを意味するものではない。
第4段階:C2a の射影。
各 segment の exact token 列に対して coarse alias を必ず適用し、
C2a 射影が全 token に対して定義されていることを確認する。
C2a は C2b と独立に維持する表ではなく、C2b の exact token
列から機械的に得られる比較表記である。
full verifier は、15 exact token、廃止 token、5 構造状態、2 分枝細分化文脈、
active/retired C2b ID、および coarse alias 全体を独立仕様 manifest
として保持し、起動時に tokenizer / recognizer の定義と完全一致することを
確認する。
付録G-4 プログラムの出力ファイル.
full verifier は、以下のファイルを出力として作成する。
-
{output_id}_{run_id}_run.log:実行条件、入力 hash、coverage、
foundation hash 等の経過情報。 -
{output_id}_{run_id}_summary.txt:text 形式の実行結果要約。 -
{output_id}_{run_id}_summary.json:JSON 形式の実行結果要約。
入力コンテナ検査、coverage contract、各エラー件数、token/context/C2b
集計を含む。 -
{output_id}_{run_id}_anomalies.jsonl:入力、理論、C2b、C2a、
shell の異常検出内容。 -
inspect_v_{n}_{run_id}.json:--inspect-valuesで指定した値の
詳細トレース。
複数区間を集約する場合には、manifest checker が全 summary を読み、
最終 manifest JSON を作成する。
付録G-5 hardened 版の実行結果.
今回の検証では、調査用正本 DB
コラッツ遷移表20260821a_managed_odd_index_BTG_V0-V1982(5).sqlite
から生成した 262,144 行の TSV を用いた。
DB の SHA-256 は
80c7fd8ac67bbb1716a44c9a49e440d34df10210b04c372c5bd6c6895021f537
であり、検証対象 TSV の SHA-256 は
2b7d7231c379c98a536306062cdd51ef28f1487bb0ba15a0abba8f65319d05be
である。
対象は odd index $0$ から $262143$、すなわち初期値 $1$ から $524287$
までの全奇数 262,144 個である。
実行時の数学的基礎層および shell の SHA-256 は次のとおりである。
tokenizer:
23dfc3a77f0c0511a81ad6ed9b1a25a30f369f89d06aafe00f9f7a25336646a3
C2b recognizer:
71c8897b1e85871e77febc03b9b09bb5e0cc908c180b24c75378fd0d1b570d43
hardened full verifier:
f8fe3595199bbf3aea50cfd2d385b657dd7feb4e49263188d7dd198237fc4c69
slice manifest checker:
10ecad23dcef5b7daefe1a434cef16334962dbc82c70667363e2961c4322a025
実行環境上の都合により、全 262,144 行を次の 5 区間へ分割した。
odd_index 0 .. 59999 : 60000 rows : PASS
odd_index 60000 .. 119999 : 60000 rows : PASS
odd_index 120000 .. 179999 : 60000 rows : PASS
odd_index 180000 .. 239999 : 60000 rows : PASS
odd_index 240000 .. 262143 : 22144 rows : PASS
各区間は、同一の入力 TSV hash、同一の tokenizer hash、
同一の recognizer hash を使用し、各区間固有の --expected-row-count,
--expected-first-odd-index, --expected-last-odd-index を指定して実行した。
各区間で Input Container Scan = PASS, Coverage Contract = PASS,
Shell Errors = 0, Total Anomalies = 0 を確認した。
さらに、5 区間の summary を manifest checker で集約し、
logical odd index の gap/overlap が存在せず、総行数が 262,144
行であることを機械的に確認した。最終結果は次のとおりである。
========================================================================
Input Container Rows: 262144
Input odd_index: 0 .. 262143
Slice Count: 5
Verified Rows: 262144
Total Segments: 3189225
Total Exact Tokens: 8793539
Total Context Events: 508220
Total C2b Matches: 343887
Tokenization Errors: 0
Theory Sequence Mismatches: 0
C2b Recognizer Exceptions: 0
C2b Mismatches: 0
C2a Projection Errors: 0
Shell Errors: 0
Manifest Status: PASS
========================================================================
全 15 種の exact token が少なくとも 1 回出現し、B10 を除く active C2b 15
パターンもすべて少なくとも 1 回出現した。
なお、B08 は旧 B08/B10 を統合した登録であり、
mode = 3072
residue = 871
tokens = S7[7] -> S3[11] -> L1[9] -> D31[M]
dest = M
として照合している。
shell hardening 後には、過去に確認された false PASS 経路に対する
adversarial test も再実行した。header のみ、重複行、odd index 欠落、
不正 header、header 欠落、空 data row、selected slice 外の余分な重複行、
EOF 外 start row、不整合 coverage contract、start_row > end_row、
負の limit、負の end_row はすべて拒否された。
また、S7[15] coarse alias の意図的削除、C2b kind の意図的破損、
通常行での C2a 射影の意図的失敗もすべて検出された。
以上より、本付録掲載の実装基準では、入力コンテナ、各実シーケンス、
独立 exact-token 化、理論列との値単位一致、C2b 登録形、C2a 射影、
および分割実行時の全件被覆を、それぞれ分離した検査義務として確認している。
付録G-6 実シーケンス確認プログラム.
以下に、今回の全件検証で使用したプログラム・コードを示す。
実行結果との追跡可能性を優先し、検証時のファイル内容をそのまま掲載する。
付録G-6.1 exact-token tokenizer.
以下に、独立 exact-token 化を行う tokenizer の掲載コードを示す。
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
OAI internal prototype: Chapter-5 context-aware exact-tokenizer.
Purpose
-------
Prototype ONLY the tokenizer layer fixed in the Chapter-5 redesign:
structural state -> zero-step refinement context -> exact token.
This script deliberately contains NO C2b pattern matching and NO catalog-first dispatch.
It is intended for small-scale semantic/boundary verification before integration into
Appendix G's full verifier.
Current target semantics
------------------------
Structural states:
S3, S7, L1, M, C5
Refinement contexts:
D9, D96
Exact tokens (15):
S3[3], S3[11], S7[7], S7[15],
L1[1], L1[9], L1[17], L1[25],
D55, D79[79], D79[175],
D31[31], D31[223], D31[M], M
Notably absent:
S7[31], D31[127], D31[319]
"""
from __future__ import annotations
import argparse
import json
import sqlite3
from collections import Counter
from dataclasses import asdict, dataclass, field
from pathlib import Path
from typing import Dict, List, Optional, Sequence, Tuple
M_CORE_ENTRY_MIN_M = 6
STRUCTURAL_STATES = {"S3", "S7", "L1", "M", "C5", "TERMINAL_1"}
REFINEMENT_CONTEXTS = {"D9", "D96"}
EXACT_TOKENS = {
"S3[3]", "S3[11]",
"S7[7]", "S7[15]",
"L1[1]", "L1[9]", "L1[17]", "L1[25]",
"D55",
"D79[79]", "D79[175]",
"D31[31]", "D31[223]", "D31[M]",
"M",
}
STALE_TOKENS = {"S7[31]", "D31[127]", "D31[319]"}
class TokenizerError(RuntimeError):
pass
def ord2(n: int) -> int:
if n <= 0:
raise ValueError("ord2 requires positive n")
c = 0
while n % 2 == 0:
n //= 2
c += 1
return c
def odd_next(n: int) -> int:
if n <= 0 or n % 2 == 0:
raise ValueError(f"odd_next requires positive odd n, got {n}")
x = 3 * n + 1
return x >> ord2(x)
def is_c5(n: int) -> bool:
return n != 1 and n % 8 == 5
def detect_m_core(n: int, min_m: int = 6) -> Optional[Tuple[int, int]]:
"""Return largest (m,t) with n = 2^m t + (2^(m-1)-1), m>=min_m."""
if n <= 0 or n % 2 == 0:
return None
max_m = n.bit_length() + 2
for m in range(max_m, min_m - 1, -1):
tail = (1 << (m - 1)) - 1
rem = n - tail
if rem < 0:
continue
mod = 1 << m
if rem % mod == 0:
t = rem // mod
if t >= 0:
return m, t
return None
def classify_structural_state(n: int) -> str:
"""Classify with NO D-token residue exclusions and NO catalog lookup."""
if n == 1:
return "TERMINAL_1"
if n <= 0 or n % 2 == 0:
raise TokenizerError(f"structural classification requires positive odd n: {n}")
if is_c5(n):
return "C5"
if detect_m_core(n, min_m=M_CORE_ENTRY_MIN_M) is not None:
return "M"
r8 = n % 8
if r8 == 1:
return "L1"
if r8 == 3:
return "S3"
if r8 == 7:
return "S7"
raise TokenizerError(f"unclassifiable positive odd value: {n}")
@dataclass
class ContextEvent:
value: int
from_context: str
to_context: Optional[str] = None
to_state: Optional[str] = None
reason: str = ""
@dataclass
class TokenTrace:
token: str
start_value: int
end_value: int
values: List[int]
source_state: Optional[str]
source_context: Optional[str]
target_state: Optional[str]
target_context: Optional[str]
note: str = ""
@dataclass
class TokenizationResult:
start_value: int
end_value: int
final_state: str
theory_values: List[int]
token_traces: List[TokenTrace] = field(default_factory=list)
context_events: List[ContextEvent] = field(default_factory=list)
@property
def tokens(self) -> List[str]:
return [t.token for t in self.token_traces]
# ---------- exact-token handlers ----------
def _one_step_token(
n: int,
token: str,
source_state: Optional[str],
source_context: Optional[str],
target_state: Optional[str],
target_context: Optional[str],
root_mod: int,
root_residue: int,
endpoint_check,
note: str,
) -> TokenTrace:
if n % root_mod != root_residue % root_mod:
raise TokenizerError(f"{token} root mismatch: n={n}, expected {root_mod}k+{root_residue}")
nxt = odd_next(n)
endpoint_check(nxt)
return TokenTrace(
token=token,
start_value=n,
end_value=nxt,
values=[n, nxt],
source_state=source_state,
source_context=source_context,
target_state=target_state,
target_context=target_context,
note=note,
)
def _expect_mod(mod: int, residue: int, label: str):
def check(n: int) -> None:
if n % mod != residue % mod:
raise TokenizerError(f"endpoint must be {label}: {n}")
return check
def run_m_token(n: int) -> TokenTrace:
entry = detect_m_core(n, min_m=M_CORE_ENTRY_MIN_M)
if entry is None:
raise TokenizerError(f"M token requires external m>=6 M-core entry: {n}")
values = [n]
cur = n
notes: List[str] = []
while True:
detected = detect_m_core(cur, min_m=2)
if detected is None:
raise TokenizerError(f"M-core structure lost at {cur}")
m, t = detected
if m == 2:
if t % 2 == 0:
if cur % 8 != 1:
raise TokenizerError(f"M2 even K should be L1: {cur}")
target = "L1"
else:
if cur % 8 != 5:
raise TokenizerError(f"M2 odd K should be C5: {cur}")
target = "C5"
return TokenTrace(
token="M",
start_value=n,
end_value=cur,
values=values,
source_state="M",
source_context=None,
target_state=target,
target_context=None,
note="; ".join(notes + [f"M2({t}) -> {target}"]),
)
expected = (1 << (m - 1)) * (3 * t + 1) + ((1 << (m - 2)) - 1)
nxt = odd_next(cur)
if nxt != expected:
raise TokenizerError(
f"M recurrence mismatch at {cur}: M_{m}({t}) -> expected {expected}, actual {nxt}"
)
detected_next = detect_m_core(nxt, min_m=2)
if detected_next != (m - 1, 3 * t + 1):
raise TokenizerError(
f"M successor representation mismatch at {cur}: got {detected_next}, "
f"expected {(m - 1, 3 * t + 1)}"
)
notes.append(f"M_{m}({t}) -> M_{m-1}({3*t+1})")
values.append(nxt)
cur = nxt
def run_exact_token(
n: int,
token: str,
source_state: Optional[str],
source_context: Optional[str],
) -> TokenTrace:
if token not in EXACT_TOKENS:
raise TokenizerError(f"unknown exact token: {token}")
if token == "S3[3]":
if source_state != "S3" or source_context is not None:
raise TokenizerError(f"{token} invalid applicability")
return _one_step_token(n, token, "S3", None, "C5", None, 16, 3,
_expect_mod(8, 5, "C5"), "S3 -> C5")
if token == "S3[11]":
if source_state != "S3" or source_context is not None:
raise TokenizerError(f"{token} invalid applicability")
return _one_step_token(n, token, "S3", None, "L1", None, 16, 11,
_expect_mod(8, 1, "L1"), "S3 -> L1")
if token == "S7[7]":
if source_state != "S7" or source_context is not None:
raise TokenizerError(f"{token} invalid applicability")
return _one_step_token(n, token, "S7", None, "S3", None, 16, 7,
_expect_mod(8, 3, "S3"), "S7 -> S3")
if token == "S7[15]":
if source_state != "S7" or source_context is not None:
raise TokenizerError(f"{token} invalid applicability")
def endpoint(nxt: int) -> None:
if nxt % 8 != 7:
raise TokenizerError(f"S7[15] successor must remain S7 residue: {nxt}")
if detect_m_core(nxt, min_m=M_CORE_ENTRY_MIN_M) is not None:
raise TokenizerError(f"S7[15] successor must not be new M entry: {nxt}")
return _one_step_token(n, token, "S7", None, "S7", None, 32, 15,
endpoint, "external m=5 S7 continuation")
if token == "L1[1]":
if source_state != "L1" or source_context is not None:
raise TokenizerError(f"{token} invalid applicability")
return _one_step_token(n, token, "L1", None, "L1", None, 32, 1,
_expect_mod(8, 1, "L1"), "L1 continuation")
if token == "L1[9]":
if source_state != "L1" or source_context is not None:
raise TokenizerError(f"{token} invalid applicability")
return _one_step_token(n, token, "L1", None, None, "D9", 32, 9,
_expect_mod(24, 7, "D9-side 24k+7"), "open D9 context")
if token == "L1[17]":
if source_state != "L1" or source_context is not None:
raise TokenizerError(f"{token} invalid applicability")
return _one_step_token(n, token, "L1", None, "C5", None, 32, 17,
_expect_mod(8, 5, "C5"), "L1 -> C5")
if token == "L1[25]":
if source_state != "L1" or source_context is not None:
raise TokenizerError(f"{token} invalid applicability")
return _one_step_token(n, token, "L1", None, "S3", None, 32, 25,
_expect_mod(8, 3, "S3"), "L1 -> S3")
if token == "D55":
if source_context != "D9":
raise TokenizerError("D55 requires active D9 context")
if n % 96 != 55:
raise TokenizerError(f"D55 root mismatch: {n}")
v1 = odd_next(n)
v2 = odd_next(v1)
k = (n - 55) // 96
expected = [n, 144 * k + 83, 216 * k + 125]
if [n, v1, v2] != expected:
raise TokenizerError(f"D55 fixed path mismatch: got {[n,v1,v2]}, expected {expected}")
if not is_c5(v2):
raise TokenizerError(f"D55 must end C5: {v2}")
return TokenTrace(token, n, v2, [n, v1, v2], None, "D9", "C5", None, "D9 -> C5")
if token in {"D79[79]", "D79[175]"}:
if source_context != "D9":
raise TokenizerError(f"{token} requires active D9 context")
residue = 79 if token == "D79[79]" else 175
target = "C5" if token == "D79[79]" else "L1"
if n % 192 != residue:
raise TokenizerError(f"{token} root mismatch: {n}")
k = (n - residue) // 192
v1 = odd_next(n)
v2 = odd_next(v1)
v3 = odd_next(v2)
if token == "D79[79]":
expected = [n, 288*k+119, 432*k+179, 648*k+269]
else:
expected = [n, 288*k+263, 432*k+395, 648*k+593]
if [n, v1, v2, v3] != expected:
raise TokenizerError(f"{token} fixed path mismatch: got {[n,v1,v2,v3]}, expected {expected}")
actual_target = classify_structural_state(v3)
if actual_target != target:
raise TokenizerError(f"{token} target mismatch: expected {target}, got {actual_target}, end={v3}")
return TokenTrace(token, n, v3, expected, None, "D9", target, None, f"D9 -> {target}")
if token in {"D31[31]", "D31[223]"}:
if source_context != "D96":
raise TokenizerError(f"{token} requires active D96 context")
residue = 31 if token == "D31[31]" else 223
target = "L1" if token == "D31[31]" else "C5"
if n % 384 != residue:
raise TokenizerError(f"{token} root mismatch: {n}")
k = (n - residue) // 384
vals = [n]
for _ in range(4):
vals.append(odd_next(vals[-1]))
if token == "D31[31]":
expected = [n, 576*k+47, 864*k+71, 1296*k+107, 1944*k+161]
else:
expected = [n, 576*k+335, 864*k+503, 1296*k+755, 1944*k+1133]
if vals != expected:
raise TokenizerError(f"{token} fixed path mismatch: got {vals}, expected {expected}")
actual_target = classify_structural_state(vals[-1])
if actual_target != target:
raise TokenizerError(f"{token} target mismatch: expected {target}, got {actual_target}, end={vals[-1]}")
return TokenTrace(token, n, vals[-1], vals, None, "D96", target, None, f"D96 -> {target}")
if token == "D31[M]":
if source_context != "D96":
raise TokenizerError("D31[M] requires active D96 context")
if n % 192 != 127:
raise TokenizerError(f"D31[M] root mismatch: {n}")
k = (n - 127) // 192
nxt = odd_next(n)
expected = 288 * k + 191
if nxt != expected:
raise TokenizerError(f"D31[M] step mismatch: {n}->{nxt}, expected {expected}")
if nxt % 32 != 31:
raise TokenizerError(f"D31[M] successor must be 32k+31: {nxt}")
if detect_m_core(nxt, min_m=M_CORE_ENTRY_MIN_M) is None:
raise TokenizerError(f"D31[M] successor must be new M entry: {nxt}")
return TokenTrace(token, n, nxt, [n, nxt], None, "D96", "M", None, "D96 -> M")
if token == "M":
if source_state != "M" or source_context is not None:
raise TokenizerError("M token requires structural M state with no active context")
return run_m_token(n)
raise AssertionError(token)
# ---------- context resolution / selection ----------
def resolve_d9(n: int) -> Tuple[str, Optional[str], Optional[ContextEvent]]:
if n % 24 != 7:
raise TokenizerError(f"D9 context value must be 24k+7: {n}")
r96 = n % 96
if r96 == 7:
return "HANDOFF_STATE", "S7", ContextEvent(n, "D9", to_state="S7", reason="96k+7")
if r96 == 31:
return "HANDOFF_CONTEXT", "D96", ContextEvent(n, "D9", to_context="D96", reason="96k+31")
if r96 == 55:
return "TOKEN", "D55", None
if r96 == 79:
r192 = n % 192
if r192 == 79:
return "TOKEN", "D79[79]", None
if r192 == 175:
return "TOKEN", "D79[175]", None
raise TokenizerError(f"D9 96k+79 refinement failed at {n}")
raise TokenizerError(f"unexpected D9 residue at {n}: mod96={r96}")
def resolve_d96(n: int) -> str:
if n % 96 != 31:
raise TokenizerError(f"D96 context value must be 96k+31: {n}")
r384 = n % 384
if r384 == 31:
return "D31[31]"
if r384 == 223:
return "D31[223]"
if n % 192 == 127: # unifies old 127 and 319 mod384
return "D31[M]"
raise TokenizerError(f"unexpected D96 residue at {n}: mod384={r384}")
def token_for_state(n: int, state: str) -> str:
if state == "S3":
if n % 16 == 3:
return "S3[3]"
if n % 16 == 11:
return "S3[11]"
raise TokenizerError(f"invalid S3 residue: {n}")
if state == "S7":
if n % 16 == 7:
return "S7[7]"
if n % 32 == 15:
return "S7[15]"
if n % 32 == 31:
raise TokenizerError(f"invariant violation: 32k+31 reached S7 selector instead of M: {n}")
raise TokenizerError(f"invalid S7 residue: {n}")
if state == "L1":
r = n % 32
return {1: "L1[1]", 9: "L1[9]", 17: "L1[17]", 25: "L1[25]"}.get(r) or _bad_l1(n)
if state == "M":
return "M"
raise TokenizerError(f"state has no token selector: {state}")
def _bad_l1(n: int):
raise TokenizerError(f"invalid L1 residue: {n}")
def tokenize_until_c5(alpha: int, max_cycles: int = 100000) -> TokenizationResult:
if alpha <= 0 or alpha % 2 == 0:
raise TokenizerError(f"alpha must be positive odd: {alpha}")
cur = alpha
state = classify_structural_state(cur)
context: Optional[str] = None
theory_values = [cur]
traces: List[TokenTrace] = []
events: List[ContextEvent] = []
if state in {"C5", "TERMINAL_1"}:
return TokenizationResult(alpha, cur, state, theory_values, traces, events)
for _ in range(max_cycles):
# Zero-step refinement context is always resolved before structural token selection.
if context == "D9":
kind, payload, event = resolve_d9(cur)
if kind == "HANDOFF_STATE":
assert event is not None and payload is not None
events.append(event)
state = payload
context = None
# Verify the handoff state matches ordinary classification when M is not involved.
actual = classify_structural_state(cur)
if actual != state:
raise TokenizerError(f"D9 handoff state mismatch at {cur}: expected {state}, actual {actual}")
continue
if kind == "HANDOFF_CONTEXT":
assert event is not None and payload is not None
events.append(event)
context = payload
state = None
continue
token = payload
assert token is not None
trace = run_exact_token(cur, token, None, "D9")
elif context == "D96":
token = resolve_d96(cur)
trace = run_exact_token(cur, token, None, "D96")
else:
state = classify_structural_state(cur)
if state in {"C5", "TERMINAL_1"}:
return TokenizationResult(alpha, cur, state, theory_values, traces, events)
token = token_for_state(cur, state)
trace = run_exact_token(cur, token, state, None)
if trace.token in STALE_TOKENS:
raise TokenizerError(f"stale token emitted: {trace.token}")
if trace.values[0] != cur or trace.end_value != trace.values[-1]:
raise TokenizerError(f"malformed token trace: {trace}")
# Every edge inside a token must be a real odd Collatz transition.
for a, b in zip(trace.values, trace.values[1:]):
if odd_next(a) != b:
raise TokenizerError(f"token {trace.token} contains non-Collatz edge {a}->{b}")
traces.append(trace)
theory_values.extend(trace.values[1:])
cur = trace.end_value
state = trace.target_state
context = trace.target_context
if context is None and state is None:
state = classify_structural_state(cur)
if context is None and state in {"C5", "TERMINAL_1"}:
return TokenizationResult(alpha, cur, state, theory_values, traces, events)
raise TokenizerError(f"tokenization guard exceeded from alpha={alpha}")
def reference_until_c5(alpha: int, max_steps: int = 100000) -> List[int]:
vals = [alpha]
cur = alpha
if cur == 1 or is_c5(cur):
return vals
for _ in range(max_steps):
cur = odd_next(cur)
vals.append(cur)
if cur == 1 or is_c5(cur):
return vals
raise TokenizerError(f"reference guard exceeded from alpha={alpha}")
# ---------- tests ----------
def _assert_prefix(actual: Sequence[str], expected: Sequence[str], label: str) -> None:
if list(actual[: len(expected)]) != list(expected):
raise AssertionError(f"{label}: prefix mismatch: actual={list(actual)}, expected_prefix={list(expected)}")
def _test_targeted() -> Dict[str, object]:
cases = [
(3, ["S3[3]"], []),
(11, ["S3[11]"], []),
(7, ["S7[7]", "S3[11]"], []),
(15, ["S7[15]", "S7[7]"], []),
(33, ["L1[1]", "L1[25]"], []),
(9, ["L1[9]", "S7[7]"], [("D9", None, "S7")]),
(73, ["L1[9]", "D55"], []),
(105, ["L1[9]", "D79[79]"], []),
(233, ["L1[9]", "D79[175]"], []),
(41, ["L1[9]", "D31[31]"], [("D9", "D96", None)]),
(297, ["L1[9]", "D31[223]"], [("D9", "D96", None)]),
(169, ["L1[9]", "D31[M]", "M"], [("D9", "D96", None)]),
(425, ["L1[9]", "D31[M]", "M"], [("D9", "D96", None)]),
(31, ["M"], []),
(127, ["M"], []),
(55, ["S7[7]"], []), # raw D55 residue outside D9 context must not select D55
(79, ["S7[15]"], []), # raw D79 residue outside D9 context must not select D79
(223, ["M"], []), # raw D31 residue outside D96 context must be structural M
(871, ["S7[7]", "S3[11]", "L1[9]", "D31[M]", "M"], [("D9", "D96", None)]),
(3943, ["S7[7]", "S3[11]", "L1[9]", "D31[M]", "M"], [("D9", "D96", None)]),
(7015, ["S7[7]", "S3[11]", "L1[9]", "D31[M]", "M"], [("D9", "D96", None)]),
(10087, ["S7[7]", "S3[11]", "L1[9]", "D31[M]", "M"], [("D9", "D96", None)]),
(2407, ["S7[7]", "S3[11]", "L1[9]", "D31[223]"], [("D9", "D96", None)]),
]
details = []
for alpha, expected_tokens, expected_events in cases:
res = tokenize_until_c5(alpha)
_assert_prefix(res.tokens, expected_tokens, f"alpha={alpha}")
actual_events = [(e.from_context, e.to_context, e.to_state) for e in res.context_events]
for ev in expected_events:
if ev not in actual_events:
raise AssertionError(f"alpha={alpha}: expected context event {ev}, got {actual_events}")
if res.theory_values != reference_until_c5(alpha):
raise AssertionError(f"alpha={alpha}: reconstructed values differ from reference")
details.append({
"alpha": alpha,
"tokens": res.tokens,
"context_events": [asdict(e) for e in res.context_events],
"end_value": res.end_value,
"final_state": res.final_state,
})
return {"cases": len(cases), "details": details}
def _test_negative_applicability() -> Dict[str, object]:
checks = []
def must_fail(label, fn):
try:
fn()
except TokenizerError as e:
checks.append({"label": label, "status": "PASS", "error": str(e)})
return
raise AssertionError(f"negative test did not fail: {label}")
must_fail("D55 without D9", lambda: run_exact_token(55, "D55", "S7", None))
must_fail("D79[79] without D9", lambda: run_exact_token(79, "D79[79]", "S7", None))
must_fail("D31[31] without D96", lambda: run_exact_token(31, "D31[31]", "M", None))
must_fail("D31[M] without D96", lambda: run_exact_token(127, "D31[M]", "M", None))
must_fail("stale S7[31]", lambda: run_exact_token(31, "S7[31]", "M", None))
return {"checks": len(checks), "details": checks}
def _test_m_internal_boundary() -> Dict[str, object]:
samples = [31, 63, 127, 255, 287, 319, 511, 543, 1023]
details = []
for n in samples:
entry = detect_m_core(n, min_m=6)
if entry is None:
continue
tr = run_m_token(n)
levels = []
for v in tr.values:
levels.append(detect_m_core(v, min_m=2))
ms = [x[0] for x in levels if x is not None]
if ms[0] < 6 or ms[-1] != 2:
raise AssertionError(f"M-level boundary failure for {n}: {levels}")
if any(b != a - 1 for a, b in zip(ms, ms[1:])):
raise AssertionError(f"M levels not descending one-by-one for {n}: {ms}")
# Explicitly allow internal m=5,4,3,2. They remain inside one M token.
details.append({"start": n, "entry": entry, "levels": levels, "target": tr.target_state, "values": tr.values})
if not details:
raise AssertionError("no M samples tested")
return {"cases": len(details), "details": details}
def _test_small_exhaustive(max_alpha: int) -> Dict[str, object]:
token_counts: Counter[str] = Counter()
context_counts: Counter[str] = Counter()
final_counts: Counter[str] = Counter()
max_tokens = 0
max_values = 0
max_token_alpha = None
max_value_alpha = None
checked = 0
for alpha in range(1, max_alpha + 1, 2):
res = tokenize_until_c5(alpha)
ref = reference_until_c5(alpha)
if res.theory_values != ref:
raise AssertionError(
f"exhaustive mismatch alpha={alpha}: theory={res.theory_values}, ref={ref}"
)
if any(t in STALE_TOKENS for t in res.tokens):
raise AssertionError(f"stale token emitted alpha={alpha}: {res.tokens}")
if any(t not in EXACT_TOKENS for t in res.tokens):
raise AssertionError(f"unknown token emitted alpha={alpha}: {res.tokens}")
token_counts.update(res.tokens)
for e in res.context_events:
if e.to_context:
context_counts[f"{e.from_context}->{e.to_context}"] += 1
elif e.to_state:
context_counts[f"{e.from_context}->{e.to_state}"] += 1
final_counts[res.final_state] += 1
checked += 1
if len(res.tokens) > max_tokens:
max_tokens = len(res.tokens)
max_token_alpha = alpha
if len(res.theory_values) > max_values:
max_values = len(res.theory_values)
max_value_alpha = alpha
# All 15 tokens should appear in a modest range if coverage is healthy.
missing = sorted(EXACT_TOKENS - set(token_counts))
return {
"checked_odd_starts": checked,
"max_alpha": max_alpha,
"token_counts": dict(sorted(token_counts.items())),
"context_event_counts": dict(sorted(context_counts.items())),
"final_state_counts": dict(sorted(final_counts.items())),
"missing_tokens": missing,
"max_token_count": max_tokens,
"max_token_count_alpha": max_token_alpha,
"max_theory_values": max_values,
"max_theory_values_alpha": max_value_alpha,
}
def run_self_test(max_alpha: int = 20001) -> Dict[str, object]:
if len(EXACT_TOKENS) != 15:
raise AssertionError(f"expected exactly 15 tokens, got {len(EXACT_TOKENS)}")
if EXACT_TOKENS & STALE_TOKENS:
raise AssertionError("stale tokens overlap active token set")
targeted = _test_targeted()
negative = _test_negative_applicability()
m_boundary = _test_m_internal_boundary()
exhaustive = _test_small_exhaustive(max_alpha)
return {
"status": "PASS",
"active_exact_token_count": len(EXACT_TOKENS),
"active_exact_tokens": sorted(EXACT_TOKENS),
"targeted": targeted,
"negative_applicability": negative,
"m_internal_boundary": m_boundary,
"small_exhaustive": exhaustive,
}
def crosscheck_sqlite(db_path: str, starts: Sequence[int]) -> Dict[str, object]:
"""Compare tokenizer prefix through first C5/1 against the supplied transition DB."""
con = sqlite3.connect(db_path)
try:
cols = [row[1] for row in con.execute("pragma table_info(collatz_transitions)")]
vcols = [c for c in cols if c.startswith("V") and c[1:].isdigit()]
vcols.sort(key=lambda x: int(x[1:]))
if not vcols:
raise TokenizerError("collatz_transitions has no V0,V1,... columns")
select_cols = ",".join(vcols)
details = []
for start in starts:
row = con.execute(
f"select {select_cols} from collatz_transitions where V0=? limit 1", (start,)
).fetchone()
if row is None:
raise TokenizerError(f"DB row not found for V0={start}")
db_vals = []
for x in row:
if x is None or x == 0:
break
db_vals.append(int(x))
if x == 1 or is_c5(int(x)):
break
res = tokenize_until_c5(start)
if db_vals != res.theory_values:
raise AssertionError(
f"DB crosscheck mismatch start={start}: DB={db_vals}, tokenizer={res.theory_values}"
)
details.append({
"start": start,
"values": res.theory_values,
"tokens": res.tokens,
"context_events": [asdict(e) for e in res.context_events],
"status": "PASS",
})
return {"status": "PASS", "cases": len(details), "details": details}
finally:
con.close()
def parse_args(argv: Optional[Sequence[str]] = None) -> argparse.Namespace:
p = argparse.ArgumentParser(description="OAI internal Chapter-5 exact-tokenizer prototype")
p.add_argument("--self-test", action="store_true", help="run targeted + small exhaustive tests")
p.add_argument("--max-alpha", type=int, default=20001, help="max odd start for small exhaustive test")
p.add_argument("--inspect", type=int, nargs="*", default=[], help="tokenize specific positive odd starts")
p.add_argument("--json-out", default="", help="optional JSON output path")
p.add_argument("--db-path", default="", help="optional SQLite transition DB for selected-start crosscheck")
return p.parse_args(argv)
def main(argv: Optional[Sequence[str]] = None) -> int:
args = parse_args(argv)
output: Dict[str, object] = {}
if args.self_test:
output["self_test"] = run_self_test(args.max_alpha)
if args.inspect:
inspections = []
for n in args.inspect:
res = tokenize_until_c5(n)
inspections.append({
"start": n,
"end": res.end_value,
"final_state": res.final_state,
"values": res.theory_values,
"tokens": [asdict(t) for t in res.token_traces],
"context_events": [asdict(e) for e in res.context_events],
})
output["inspect"] = inspections
if args.db_path:
db_starts = args.inspect if args.inspect else [9, 41, 73, 105, 169, 233, 425, 31, 55, 79, 223, 871, 3943, 7015, 10087, 2407]
output["db_crosscheck"] = crosscheck_sqlite(args.db_path, db_starts)
if not output:
output["self_test"] = run_self_test(args.max_alpha)
text = json.dumps(output, ensure_ascii=False, indent=2)
print(text)
if args.json_out:
Path(args.json_out).write_text(text + "\n", encoding="utf-8")
return 0
if __name__ == "__main__":
raise SystemExit(main())
付録G-6.2 C2b recognizer.
以下に、生成済み exact token 列を後置照合する C2b recognizer
の掲載コードを示す。
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
OAI internal prototype: downstream C2b recognizer for the Chapter-5 tokenizer.
Design constraint
-----------------
This module imports and uses OAI_INT__tokenizer_prototype.py WITHOUT modifying it.
The tokenizer remains the sole theory/token-stream generator.
Pipeline
--------
independent tokenizer output -> C2b recognizer -> derived C2a projection
C2b is a recognizer only. It is never consulted by the tokenizer and never chooses
or generates an exact-token path.
Migration-stage C2b catalog
---------------------------
- B08/B10 are merged as B08:
mode 3072, residue 871,
S7[7] -> S3[11] -> L1[9] -> D31[M], destination M.
- B10 is retired.
- B11..B16 keep their historical IDs during migration.
"""
from __future__ import annotations
import argparse
import hashlib
import importlib.util
import json
import sys
import copy
from collections import Counter
from dataclasses import asdict, dataclass
from math import gcd
from pathlib import Path
from typing import Dict, Iterable, List, Optional, Sequence, Tuple
THIS_DIR = Path(__file__).resolve().parent
TOKENIZER_PATH = THIS_DIR / "OAI_INT__tokenizer_prototype.py"
EXPECTED_TOKENIZER_SHA256 = "23dfc3a77f0c0511a81ad6ed9b1a25a30f369f89d06aafe00f9f7a25336646a3"
def sha256_file(path: Path) -> str:
h = hashlib.sha256()
with path.open("rb") as f:
for chunk in iter(lambda: f.read(1024 * 1024), b""):
h.update(chunk)
return h.hexdigest()
def load_tokenizer_module():
if not TOKENIZER_PATH.exists():
raise RuntimeError(f"tokenizer prototype not found: {TOKENIZER_PATH}")
actual = sha256_file(TOKENIZER_PATH)
if actual != EXPECTED_TOKENIZER_SHA256:
raise RuntimeError(
"tokenizer prototype hash changed; downstream recognizer refuses to run: "
f"expected={EXPECTED_TOKENIZER_SHA256}, actual={actual}"
)
spec = importlib.util.spec_from_file_location("oai_int_tokenizer_prototype", TOKENIZER_PATH)
if spec is None or spec.loader is None:
raise RuntimeError(f"cannot import tokenizer prototype: {TOKENIZER_PATH}")
module = importlib.util.module_from_spec(spec)
sys.modules[spec.name] = module
spec.loader.exec_module(module)
return module
TZ = load_tokenizer_module()
class CatalogError(RuntimeError):
pass
@dataclass(frozen=True)
class C2BPattern:
id: str
mode: int
residues: Tuple[int, ...]
tokens: Tuple[str, ...]
dest: str
kind: str
@dataclass
class CatalogMatch:
pattern_id: str
token_index: int
start_value: int
mode: int
matched_residue: int
expected_tokens: List[str]
actual_tokens: List[str]
expected_destination: str
actual_destination: Optional[str]
ok: bool
reason: str = ""
# Authoritative migration-stage C2b definitions.
C2B_DEFS: Tuple[C2BPattern, ...] = (
C2BPattern("B13", 24576, (967,),
("S7[7]", "S3[11]", "L1[1]", "L1[1]", "L1[9]", "D55"), "C5", "終了型"),
C2BPattern("B12", 49152, (1351,),
("S7[7]", "S3[11]", "L1[1]", "L1[9]", "D79[175]"), "L1", "転送型"),
C2BPattern("B07", 24576, (679,),
("S7[7]", "S3[11]", "L1[25]", "S3[11]", "L1[25]", "S3[11]", "L1[17]"), "C5", "終了型"),
C2BPattern("B02", 12288, (487, 2023, 3559, 5095, 6631, 8167, 9703, 11239),
("S7[7]", "S3[11]", "L1[9]", "D55"), "C5", "終了型"),
C2BPattern("B06", 12288, (4327, 10471),
("S7[7]", "S3[11]", "L1[9]", "S7[7]", "S3[11]", "L1[17]"), "C5", "終了型"),
C2BPattern("B08", 3072, (871,),
("S7[7]", "S3[11]", "L1[9]", "D31[M]"), "M", "転送型"),
C2BPattern("B09", 12288, (2407, 8551),
("S7[7]", "S3[11]", "L1[9]", "D31[223]"), "C5", "終了型"),
C2BPattern("B11", 12288, (5479, 11623),
("S7[7]", "S3[11]", "L1[9]", "D31[31]"), "L1", "転送型"),
C2BPattern("B14", 12288, (1639, 4711, 7783, 10855),
("S7[7]", "S3[11]", "L1[9]", "D79[79]"), "C5", "終了型"),
C2BPattern("B16", 12288, (103,),
("S7[7]", "S3[11]", "L1[9]", "D79[175]"), "L1", "転送型"),
C2BPattern("B15", 12288, (12007,),
("S7[7]", "S3[11]", "L1[9]", "S7[7]", "S3[11]", "L1[25]", "S3[3]"), "C5", "終了型"),
C2BPattern("B05", 3072, (583,),
("S7[7]", "S3[11]", "L1[1]", "L1[25]", "S3[3]"), "C5", "終了型"),
C2BPattern("B03", 768, (295,),
("S7[7]", "S3[11]", "L1[25]", "S3[3]"), "C5", "終了型"),
C2BPattern("B04", 1536, (199,),
("S7[7]", "S3[11]", "L1[1]", "L1[17]"), "C5", "終了型"),
C2BPattern("B01", 384, (7,),
("S7[7]", "S3[11]", "L1[17]"), "C5", "終了型"),
)
C2B_BY_ID: Dict[str, C2BPattern] = {p.id: p for p in C2B_DEFS}
ACTIVE_PATTERN_IDS = frozenset(C2B_BY_ID)
RETIRED_PATTERN_IDS = frozenset({"B10"})
COARSE_ALIAS = {
"S3[3]": "S3", "S3[11]": "S3",
"S7[7]": "S7", "S7[15]": "S7",
"L1[1]": "L1", "L1[9]": "L1", "L1[17]": "L1", "L1[25]": "L1",
"D55": "D55",
"D79[79]": "D79[79]", "D79[175]": "D79[175]",
"D31[31]": "D31[31]", "D31[223]": "D31[223]", "D31[M]": "D31[M]",
"M": "M",
}
VALID_DESTINATIONS = {"S3", "S7", "L1", "M", "C5"}
def project_tokens(tokens: Iterable[str]) -> List[str]:
out: List[str] = []
for tok in tokens:
if tok not in COARSE_ALIAS:
raise CatalogError(f"no coarse alias for token {tok}")
out.append(COARSE_ALIAS[tok])
return out
def congruence_classes_overlap(m1: int, r1: int, m2: int, r2: int) -> bool:
return (r1 - r2) % gcd(m1, m2) == 0
def validate_catalog_static() -> Dict[str, object]:
errors: List[str] = []
ids = [p.id for p in C2B_DEFS]
if len(ids) != len(set(ids)):
errors.append("duplicate active pattern IDs")
if "B10" in ids:
errors.append("retired B10 remains active")
for p in C2B_DEFS:
if p.mode <= 0:
errors.append(f"{p.id}: nonpositive mode")
if not p.residues:
errors.append(f"{p.id}: empty residue list")
norm = [r % p.mode for r in p.residues]
if len(norm) != len(set(norm)):
errors.append(f"{p.id}: duplicate residues modulo mode")
if p.dest not in VALID_DESTINATIONS:
errors.append(f"{p.id}: invalid destination {p.dest}")
for tok in p.tokens:
if tok not in TZ.EXACT_TOKENS:
errors.append(f"{p.id}: unknown/noncurrent token {tok}")
if any(tok in TZ.STALE_TOKENS for tok in p.tokens):
errors.append(f"{p.id}: stale token in active pattern")
# Projection must be total.
try:
project_tokens(p.tokens)
except CatalogError as e:
errors.append(f"{p.id}: {e}")
overlaps: List[Dict[str, object]] = []
for i, p in enumerate(C2B_DEFS):
for q in C2B_DEFS[i + 1:]:
found: Optional[Tuple[int, int]] = None
for rp in p.residues:
for rq in q.residues:
if congruence_classes_overlap(p.mode, rp, q.mode, rq):
found = (rp, rq)
break
if found:
break
if found:
overlaps.append({
"pattern1": p.id, "pattern2": q.id,
"mode1": p.mode, "mode2": q.mode,
"residue1": found[0], "residue2": found[1],
"gcd": gcd(p.mode, q.mode),
})
if overlaps:
errors.append(f"active root congruence overlaps: {overlaps}")
return {
"status": "PASS" if not errors else "FAIL",
"active_pattern_count": len(C2B_DEFS),
"active_pattern_ids": sorted(ACTIVE_PATTERN_IDS),
"retired_pattern_ids": sorted(RETIRED_PATTERN_IDS),
"root_overlap_count": len(overlaps),
"root_overlaps": overlaps,
"errors": errors,
}
def matching_patterns(root_value: int) -> List[Tuple[C2BPattern, int]]:
matches: List[Tuple[C2BPattern, int]] = []
for p in C2B_DEFS:
r = root_value % p.mode
if r in {x % p.mode for x in p.residues}:
matches.append((p, r))
return matches
def structural_destination_after_slice(result, start_index: int, length: int) -> Optional[str]:
if length <= 0:
raise ValueError("pattern token length must be positive")
end_index = start_index + length - 1
if end_index >= len(result.token_traces):
return None
tr = result.token_traces[end_index]
return tr.target_state
def verify_c2b_against_tokenization(result) -> List[CatalogMatch]:
"""Recognize C2b at every exact-token boundary without influencing tokenization."""
matches_out: List[CatalogMatch] = []
for i, tr in enumerate(result.token_traces):
root = tr.start_value
candidates = matching_patterns(root)
if len(candidates) > 1:
raise CatalogError(
f"runtime ambiguous C2b root at value {root}, token_index={i}: "
f"{[p.id for p, _ in candidates]}"
)
if not candidates:
continue
p, matched_residue = candidates[0]
expected = list(p.tokens)
actual = result.tokens[i:i + len(expected)]
actual_dest = structural_destination_after_slice(result, i, len(expected))
reasons: List[str] = []
if actual != expected:
reasons.append(f"token mismatch expected={expected} actual={actual}")
if actual_dest != p.dest:
reasons.append(f"destination mismatch expected={p.dest} actual={actual_dest}")
matches_out.append(CatalogMatch(
pattern_id=p.id,
token_index=i,
start_value=root,
mode=p.mode,
matched_residue=matched_residue,
expected_tokens=expected,
actual_tokens=actual,
expected_destination=p.dest,
actual_destination=actual_dest,
ok=not reasons,
reason="; ".join(reasons),
))
return matches_out
def verify_one(alpha: int) -> Tuple[object, List[CatalogMatch]]:
result = TZ.tokenize_until_c5(alpha)
matches = verify_c2b_against_tokenization(result)
bad = [m for m in matches if not m.ok]
if bad:
raise CatalogError(f"C2b mismatch for alpha={alpha}: {[asdict(x) for x in bad]}")
return result, matches
def _representative_values(p: C2BPattern) -> List[int]:
# The stored residues are positive in the current catalog. If a future residue is zero,
# use one positive lift to keep tokenizer input positive.
return [r if r > 0 else p.mode for r in p.residues]
def test_all_catalog_representatives() -> Dict[str, object]:
details: List[Dict[str, object]] = []
seen = Counter()
for p in C2B_DEFS:
for n in _representative_values(p):
result, matches = verify_one(n)
start_matches = [m for m in matches if m.token_index == 0]
if len(start_matches) != 1:
raise AssertionError(
f"{p.id} representative {n}: expected one root match at token 0, "
f"got {[asdict(m) for m in start_matches]}"
)
m = start_matches[0]
if m.pattern_id != p.id or not m.ok:
raise AssertionError(f"{p.id} representative {n}: wrong match {asdict(m)}")
seen[p.id] += 1
details.append({
"pattern_id": p.id,
"start_value": n,
"tokens": result.tokens,
"root_match": asdict(m),
"coarse_pattern": project_tokens(p.tokens),
})
missing = sorted(ACTIVE_PATTERN_IDS - set(seen))
if missing:
raise AssertionError(f"patterns not covered by representative tests: {missing}")
return {
"status": "PASS",
"representative_case_count": len(details),
"pattern_case_counts": dict(sorted(seen.items())),
"details": details,
}
def test_b08_merge() -> Dict[str, object]:
values = [871, 3943, 7015, 10087]
details = []
for n in values:
result, matches = verify_one(n)
root_matches = [m for m in matches if m.token_index == 0]
if len(root_matches) != 1 or root_matches[0].pattern_id != "B08" or not root_matches[0].ok:
raise AssertionError(f"merged B08 failed for {n}: {[asdict(m) for m in root_matches]}")
details.append({"value": n, "tokens": result.tokens, "match": asdict(root_matches[0])})
# 2407 is the key counterclass that would be mixed by mode 1536; it must stay B09/C5.
result_2407, matches_2407 = verify_one(2407)
root_2407 = [m for m in matches_2407 if m.token_index == 0]
if len(root_2407) != 1 or root_2407[0].pattern_id != "B09" or not root_2407[0].ok:
raise AssertionError(f"2407 must remain B09: {[asdict(m) for m in root_2407]}")
return {
"status": "PASS",
"merged_values": details,
"counterclass_2407": {
"tokens": result_2407.tokens,
"match": asdict(root_2407[0]),
},
}
def test_recognizer_negative_detection() -> Dict[str, object]:
"""Intentionally corrupt tokenizer outputs to prove the recognizer detects mismatches."""
checks: List[Dict[str, object]] = []
# Token mismatch: B08 root is still 871 mod3072, but corrupt D31[M] to D31[223].
good = TZ.tokenize_until_c5(871)
bad_token = copy.deepcopy(good)
bad_token.token_traces[3].token = "D31[223]"
token_matches = verify_c2b_against_tokenization(bad_token)
root = [m for m in token_matches if m.token_index == 0 and m.pattern_id == "B08"]
if len(root) != 1 or root[0].ok or "token mismatch" not in root[0].reason:
raise AssertionError(f"recognizer failed to detect token corruption: {[asdict(m) for m in root]}")
checks.append({"case": "B08 token corruption", "status": "PASS", "detected": asdict(root[0])})
# Destination mismatch: keep tokens, corrupt D31[M] target state from M to C5.
bad_dest = copy.deepcopy(good)
bad_dest.token_traces[3].target_state = "C5"
dest_matches = verify_c2b_against_tokenization(bad_dest)
root = [m for m in dest_matches if m.token_index == 0 and m.pattern_id == "B08"]
if len(root) != 1 or root[0].ok or "destination mismatch" not in root[0].reason:
raise AssertionError(f"recognizer failed to detect destination corruption: {[asdict(m) for m in root]}")
checks.append({"case": "B08 destination corruption", "status": "PASS", "detected": asdict(root[0])})
# No false B08 recognition on the key 2407 counterclass.
result_2407 = TZ.tokenize_until_c5(2407)
matches_2407 = verify_c2b_against_tokenization(result_2407)
root_ids = [m.pattern_id for m in matches_2407 if m.token_index == 0]
if root_ids != ["B09"]:
raise AssertionError(f"2407 false-positive pattern recognition: {root_ids}")
checks.append({"case": "2407 excludes B08", "status": "PASS", "root_pattern_ids": root_ids})
return {"status": "PASS", "check_count": len(checks), "details": checks}
def test_small_exhaustive(max_odd: int = 20001) -> Dict[str, object]:
if max_odd < 1:
raise ValueError("max_odd must be positive")
if max_odd % 2 == 0:
max_odd -= 1
match_counts = Counter()
root_match_counts = Counter()
token_boundary_count = 0
total_match_count = 0
starts_with_match = 0
alpha_count = 0
examples: Dict[str, Dict[str, object]] = {}
for alpha in range(1, max_odd + 1, 2):
alpha_count += 1
result, matches = verify_one(alpha)
token_boundary_count += len(result.token_traces)
if any(m.token_index == 0 for m in matches):
starts_with_match += 1
for m in matches:
if not m.ok:
raise AssertionError(f"unexpected mismatch: {asdict(m)}")
total_match_count += 1
match_counts[m.pattern_id] += 1
if m.token_index == 0:
root_match_counts[m.pattern_id] += 1
if m.pattern_id not in examples:
examples[m.pattern_id] = {
"alpha": alpha,
"match": asdict(m),
"tokens_from_boundary": result.tokens[m.token_index:m.token_index+len(m.expected_tokens)+2],
}
unseen = sorted(ACTIVE_PATTERN_IDS - set(match_counts))
if unseen:
raise AssertionError(f"active patterns unseen in exhaustive range <= {max_odd}: {unseen}")
return {
"status": "PASS",
"max_odd": max_odd,
"alpha_count": alpha_count,
"token_boundary_count": token_boundary_count,
"total_c2b_matches": total_match_count,
"alphas_with_root_match": starts_with_match,
"c2b_match_counts_all_boundaries": dict(sorted(match_counts.items())),
"c2b_match_counts_at_alpha_root": dict(sorted(root_match_counts.items())),
"all_active_patterns_seen": True,
"examples": dict(sorted(examples.items())),
}
def run_selftest(max_odd: int = 20001) -> Dict[str, object]:
static = validate_catalog_static()
if static["status"] != "PASS":
raise AssertionError(f"static catalog validation failed: {static}")
representatives = test_all_catalog_representatives()
b08 = test_b08_merge()
negative = test_recognizer_negative_detection()
exhaustive = test_small_exhaustive(max_odd=max_odd)
return {
"status": "PASS",
"tokenizer_path": str(TOKENIZER_PATH),
"tokenizer_sha256": sha256_file(TOKENIZER_PATH),
"tokenizer_expected_sha256": EXPECTED_TOKENIZER_SHA256,
"tokenizer_unchanged": sha256_file(TOKENIZER_PATH) == EXPECTED_TOKENIZER_SHA256,
"catalog_static": static,
"catalog_representatives": representatives,
"b08_merge": b08,
"recognizer_negative_detection": negative,
"small_exhaustive": exhaustive,
"c2a_derived_rows": [
{
"id": p.id,
"coarse_tokens": project_tokens(p.tokens),
"mode": p.mode,
"residues": list(p.residues),
"dest": p.dest,
}
for p in C2B_DEFS
],
}
def parse_args(argv: Optional[Sequence[str]] = None) -> argparse.Namespace:
p = argparse.ArgumentParser(description="OAI internal downstream C2b recognizer prototype")
p.add_argument("--selftest", action="store_true")
p.add_argument("--max-odd", type=int, default=20001)
p.add_argument("--inspect", type=int, default=0, help="Inspect one positive odd start value")
p.add_argument("--json-out", default="")
return p.parse_args(argv)
def main(argv: Optional[Sequence[str]] = None) -> int:
args = parse_args(argv)
payload: Dict[str, object]
if args.inspect:
result, matches = verify_one(args.inspect)
payload = {
"status": "PASS",
"alpha": args.inspect,
"tokens": result.tokens,
"context_events": [asdict(e) for e in result.context_events],
"matches": [asdict(m) for m in matches],
"theory_values": result.theory_values,
"derived_coarse_tokens": project_tokens(result.tokens),
"tokenizer_sha256": sha256_file(TOKENIZER_PATH),
}
else:
payload = run_selftest(max_odd=args.max_odd)
text = json.dumps(payload, ensure_ascii=False, indent=2)
print(text)
if args.json_out:
Path(args.json_out).write_text(text + "\n", encoding="utf-8")
return 0
if __name__ == "__main__":
raise SystemExit(main())
付録G-6.3 hardened full verifier.
以下に、入力検査と全体照合を統括する hardened full verifier
の掲載コードを示す。
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
OAI internal candidate: Chapter-5 full verifier.
Architecture
------------
Phase 0 Independently validate the TSV row and every odd Collatz edge.
Phase 1 Use the frozen tokenizer prototype to generate theory values + exact tokens.
Phase 2 Compare theory values to the validated input sequence segment-by-segment.
Phase 3 Apply the frozen downstream C2b recognizer to the already-generated token stream.
Phase 4 Derive C2a through the recognizer projection and emit auditable summaries.
This candidate deliberately imports the frozen tokenizer + C2b recognizer prototypes by
hash. It refuses to run if either foundation file changes.
"""
from __future__ import annotations
import argparse
import csv
import hashlib
import importlib.util
import json
import sys
import time
from collections import Counter
from dataclasses import asdict, dataclass, field
from datetime import datetime
from pathlib import Path
from typing import Any, Dict, Iterable, List, Optional, Sequence, Tuple
from zoneinfo import ZoneInfo
JST = ZoneInfo("Asia/Tokyo")
PROGRAM_VERSION = "oai_int_full_verifier_shell_hardened_independent_tokenizer_c2b"
OUTPUT_ID = "oai_int_full_verifier_shell_hardened"
SCRIPT_DIR = Path(__file__).resolve().parent
TOKENIZER_PATH = SCRIPT_DIR / "OAI_INT__tokenizer_prototype.py"
RECOGNIZER_PATH = SCRIPT_DIR / "OAI_INT__c2b_recognizer_prototype.py"
EXPECTED_TOKENIZER_SHA256 = "23dfc3a77f0c0511a81ad6ed9b1a25a30f369f89d06aafe00f9f7a25336646a3"
EXPECTED_RECOGNIZER_SHA256 = "71c8897b1e85871e77febc03b9b09bb5e0cc908c180b24c75378fd0d1b570d43"
EXPECTED_HEADER = ["№", "v", "baseV", "mod6", "mod8", "mod16", "mod32", "n", "max", "sequence"]
EXPECTED_EXACT_TOKENS = frozenset({
"S3[3]", "S3[11]", "S7[7]", "S7[15]",
"L1[1]", "L1[9]", "L1[17]", "L1[25]",
"D55", "D79[79]", "D79[175]",
"D31[31]", "D31[223]", "D31[M]", "M",
})
EXPECTED_STALE_TOKENS = frozenset({"S7[31]", "D31[127]", "D31[319]"})
EXPECTED_STRUCTURAL_STATES = frozenset({"S3", "S7", "L1", "M", "C5", "TERMINAL_1"})
EXPECTED_REFINEMENT_CONTEXTS = frozenset({"D9", "D96"})
EXPECTED_ACTIVE_PATTERN_IDS = frozenset({
"B01", "B02", "B03", "B04", "B05", "B06", "B07", "B08",
"B09", "B11", "B12", "B13", "B14", "B15", "B16",
})
EXPECTED_RETIRED_PATTERN_IDS = frozenset({"B10"})
EXPECTED_COARSE_ALIAS = {
"S3[3]": "S3", "S3[11]": "S3",
"S7[7]": "S7", "S7[15]": "S7",
"L1[1]": "L1", "L1[9]": "L1", "L1[17]": "L1", "L1[25]": "L1",
"D55": "D55",
"D79[79]": "D79[79]", "D79[175]": "D79[175]",
"D31[31]": "D31[31]", "D31[223]": "D31[223]", "D31[M]": "D31[M]",
"M": "M",
}
EXPECTED_PATTERN_KINDS = frozenset({"終了型", "転送型"})
def sha256_file(path: Path) -> str:
h = hashlib.sha256()
with path.open("rb") as f:
for chunk in iter(lambda: f.read(1024 * 1024), b""):
h.update(chunk)
return h.hexdigest()
def load_frozen_module(path: Path, expected_sha256: str, module_name: str):
if not path.exists():
raise RuntimeError(f"foundation module not found: {path}")
actual = sha256_file(path)
if actual != expected_sha256:
raise RuntimeError(
f"foundation module hash changed: {path.name}: "
f"expected={expected_sha256}, actual={actual}"
)
spec = importlib.util.spec_from_file_location(module_name, path)
if spec is None or spec.loader is None:
raise RuntimeError(f"cannot import foundation module: {path}")
module = importlib.util.module_from_spec(spec)
sys.modules[spec.name] = module
spec.loader.exec_module(module)
return module
# The recognizer itself loads and hash-checks the tokenizer. We separately hash-check both
# so the full verifier's foundation contract is explicit in its own output.
TZ = load_frozen_module(TOKENIZER_PATH, EXPECTED_TOKENIZER_SHA256, "oai_int_full_tz")
RZ = load_frozen_module(RECOGNIZER_PATH, EXPECTED_RECOGNIZER_SHA256, "oai_int_full_rz")
# Defensive cross-module agreement.
if sha256_file(TOKENIZER_PATH) != RZ.EXPECTED_TOKENIZER_SHA256:
raise RuntimeError("recognizer/tokenizer foundation hash contract disagrees")
class FullVerifierError(RuntimeError):
pass
# -----------------------------------------------------------------------------
# Phase 0: independent input helpers.
# Do NOT call TZ.odd_next here; the input trajectory check is intentionally separate.
# -----------------------------------------------------------------------------
def input_odd_next(n: int) -> int:
if n <= 0 or n % 2 == 0:
raise ValueError(f"input_odd_next requires positive odd n, got {n}")
x = 3 * n + 1
while x % 2 == 0:
x //= 2
return x
def normalize_to_base(n: int) -> int:
cur = n
while cur != 1 and cur % 8 == 5:
cur = (cur - 1) // 4
return cur
def is_c5(n: int) -> bool:
return n != 1 and n % 8 == 5
def now_jst() -> datetime:
return datetime.now(tz=JST)
def fmt_jst(dt: datetime) -> str:
return dt.astimezone(JST).strftime("%Y-%m-%d %H:%M:%S JST")
def format_elapsed(seconds: float) -> str:
h = int(seconds // 3600)
m = int((seconds % 3600) // 60)
s = seconds % 60
return f"{h}時間 {m}分 {s:.2f}秒"
def scan_input_container(path: Path) -> Dict[str, Any]:
"""Strict whole-file container scan: schema, blank rows, and logical key continuity."""
errors: List[Dict[str, Any]] = []
data_rows = 0
first_odd_index: Optional[int] = None
last_odd_index: Optional[int] = None
first_v: Optional[int] = None
last_v: Optional[int] = None
prev_odd_index: Optional[int] = None
with path.open("r", encoding="utf-8", newline="") as fin:
reader = csv.reader(fin, delimiter="\t")
header = next(reader, None)
if header is None:
errors.append({"reason": "missing_header", "detail": "input TSV has no header"})
return {
"status": "FAIL", "header": None, "data_rows": 0,
"first_odd_index": None, "last_odd_index": None,
"first_v": None, "last_v": None, "errors": errors,
}
if header != EXPECTED_HEADER:
errors.append({
"reason": "header_mismatch",
"detail": f"actual={header!r}, expected={EXPECTED_HEADER!r}",
})
return {
"status": "FAIL", "header": header, "data_rows": 0,
"first_odd_index": None, "last_odd_index": None,
"first_v": None, "last_v": None, "errors": errors,
}
for file_row, fields in enumerate(reader, start=1):
if not fields or all(x == "" for x in fields):
errors.append({
"reason": "blank_data_row",
"detail": f"blank physical data row at file_row={file_row}",
"file_row": file_row,
})
continue
data_rows += 1
if len(fields) < 2:
errors.append({
"reason": "container_key_parse_error",
"detail": f"file_row={file_row}: expected at least № and v",
"file_row": file_row,
})
continue
try:
odd_index = int(fields[0])
v = int(fields[1])
except Exception as e:
errors.append({
"reason": "container_key_parse_error",
"detail": f"file_row={file_row}: {e}",
"file_row": file_row,
})
continue
if v != 2 * odd_index + 1:
errors.append({
"reason": "container_key_relation_mismatch",
"detail": f"file_row={file_row}: odd_index={odd_index}, v={v}, expected_v={2*odd_index+1}",
"file_row": file_row,
})
if prev_odd_index is not None and odd_index != prev_odd_index + 1:
errors.append({
"reason": "container_odd_index_not_contiguous",
"detail": (
f"file_row={file_row}: previous={prev_odd_index}, current={odd_index}, "
f"expected={prev_odd_index + 1}"
),
"file_row": file_row,
})
prev_odd_index = odd_index
if first_odd_index is None:
first_odd_index = odd_index
first_v = v
last_odd_index = odd_index
last_v = v
return {
"status": "PASS" if not errors else "FAIL",
"header": EXPECTED_HEADER,
"data_rows": data_rows,
"first_odd_index": first_odd_index,
"last_odd_index": last_odd_index,
"first_v": first_v,
"last_v": last_v,
"errors": errors,
}
@dataclass
class SegmentAudit:
segment_index: int
actual_start_index: int
actual_start_value: int
normalized_base: int
endpoint_value: int
endpoint_index: int
final_state: str
exact_tokens: List[str]
context_events: List[Dict[str, Any]]
c2b_matches: List[Dict[str, Any]]
theory_values: Optional[List[int]] = None
actual_values: Optional[List[int]] = None
derived_c2a_tokens: Optional[List[str]] = None
@dataclass
class RowAudit:
row_no: int
initial_value: int
ok: bool
anomaly_count: int
segment_count: int
token_count: int
context_event_count: int
c2b_match_count: int
token_hist: Dict[str, int] = field(default_factory=dict)
context_hist: Dict[str, int] = field(default_factory=dict)
c2b_hist: Dict[str, int] = field(default_factory=dict)
anomalies: List[Dict[str, Any]] = field(default_factory=list)
segments: List[SegmentAudit] = field(default_factory=list)
def anomaly(row_no: int, initial_value: int, reason: str, detail: str, **extra) -> Dict[str, Any]:
out: Dict[str, Any] = {
"row_no": row_no,
"initial_value": initial_value,
"reason": reason,
"detail": detail,
}
out.update(extra)
return out
def context_event_label(ev) -> str:
if ev.to_context is not None:
return f"{ev.from_context}->{ev.to_context}"
if ev.to_state is not None:
return f"{ev.from_context}->{ev.to_state}"
return f"{ev.from_context}->?"
class FullVerifierCandidate:
def __init__(self) -> None:
static = RZ.validate_catalog_static()
if static["status"] != "PASS":
raise FullVerifierError(f"C2b static catalog validation failed: {static}")
self.catalog_static = static
self.spec_contract = self._validate_specification_contract()
def _validate_specification_contract(self) -> Dict[str, Any]:
errors: List[str] = []
if frozenset(TZ.EXACT_TOKENS) != EXPECTED_EXACT_TOKENS:
errors.append(f"exact-token vocabulary mismatch: actual={sorted(TZ.EXACT_TOKENS)}")
if frozenset(TZ.STALE_TOKENS) != EXPECTED_STALE_TOKENS:
errors.append(f"stale-token vocabulary mismatch: actual={sorted(TZ.STALE_TOKENS)}")
if frozenset(TZ.STRUCTURAL_STATES) != EXPECTED_STRUCTURAL_STATES:
errors.append(f"structural-state vocabulary mismatch: actual={sorted(TZ.STRUCTURAL_STATES)}")
if frozenset(TZ.REFINEMENT_CONTEXTS) != EXPECTED_REFINEMENT_CONTEXTS:
errors.append(f"refinement-context vocabulary mismatch: actual={sorted(TZ.REFINEMENT_CONTEXTS)}")
if frozenset(RZ.ACTIVE_PATTERN_IDS) != EXPECTED_ACTIVE_PATTERN_IDS:
errors.append(f"active C2b ID mismatch: actual={sorted(RZ.ACTIVE_PATTERN_IDS)}")
if frozenset(RZ.RETIRED_PATTERN_IDS) != EXPECTED_RETIRED_PATTERN_IDS:
errors.append(f"retired C2b ID mismatch: actual={sorted(RZ.RETIRED_PATTERN_IDS)}")
if dict(RZ.COARSE_ALIAS) != EXPECTED_COARSE_ALIAS:
errors.append(f"coarse-alias manifest mismatch: actual={dict(RZ.COARSE_ALIAS)}")
if set(RZ.COARSE_ALIAS) != set(EXPECTED_EXACT_TOKENS):
errors.append("coarse-alias domain is not exactly the 15-token vocabulary")
for tok, alias in EXPECTED_COARSE_ALIAS.items():
try:
projected = RZ.project_tokens([tok])
except Exception as e:
errors.append(f"coarse projection function failed for {tok}: {e}")
else:
if projected != [alias]:
errors.append(f"coarse projection function mismatch for {tok}: actual={projected}, expected={[alias]}")
def_ids = [pat.id for pat in RZ.C2B_DEFS]
if frozenset(def_ids) != EXPECTED_ACTIVE_PATTERN_IDS or len(def_ids) != len(EXPECTED_ACTIVE_PATTERN_IDS):
errors.append(f"C2B_DEFS ID set mismatch: actual={def_ids}")
if frozenset(RZ.C2B_BY_ID) != EXPECTED_ACTIVE_PATTERN_IDS:
errors.append(f"C2B_BY_ID ID set mismatch: actual={sorted(RZ.C2B_BY_ID)}")
for pat in RZ.C2B_DEFS:
if RZ.C2B_BY_ID.get(pat.id) != pat:
errors.append(f"C2B_BY_ID registry mismatch for {pat.id}")
canonical: Dict[Tuple[Tuple[str, ...], str], str] = {}
for pat in RZ.C2B_DEFS:
if pat.kind not in EXPECTED_PATTERN_KINDS:
errors.append(f"{pat.id}: invalid kind {pat.kind!r}")
expected_kind = "終了型" if pat.dest == "C5" else "転送型"
if pat.kind != expected_kind:
errors.append(
f"{pat.id}: kind/destination mismatch: kind={pat.kind!r}, dest={pat.dest!r}, "
f"expected_kind={expected_kind!r}"
)
key = (tuple(pat.tokens), pat.dest)
if key in canonical:
errors.append(
f"duplicate canonical C2b exact-form+destination: {canonical[key]} and {pat.id}"
)
else:
canonical[key] = pat.id
if errors:
raise FullVerifierError("independent specification contract failed: " + "; ".join(errors))
return {
"status": "PASS",
"expected_exact_token_count": len(EXPECTED_EXACT_TOKENS),
"expected_active_pattern_count": len(EXPECTED_ACTIVE_PATTERN_IDS),
"coarse_alias_domain_complete": True,
"kind_destination_consistency": True,
"canonical_form_destination_unique": True,
}
def _parse_and_validate_input(
self, row_no: int, fields: List[str]
) -> Tuple[Optional[Dict[str, Any]], List[Dict[str, Any]]]:
errs: List[Dict[str, Any]] = []
if len(fields) < 10:
errs.append(anomaly(row_no, 0, "input_column_count", f"expected at least 10 fields, got {len(fields)}"))
return None, errs
try:
no = int(fields[0])
v = int(fields[1])
baseV_tsv = int(fields[2])
mod6_tsv = int(fields[3])
mod8_tsv = int(fields[4])
mod16_tsv = int(fields[5])
mod32_tsv = int(fields[6])
n_tsv = int(fields[7])
max_tsv = int(fields[8])
except Exception as e:
errs.append(anomaly(row_no, 0, "input_metadata_parse_error", str(e)))
return None, errs
raw_seq = fields[9:]
if not raw_seq or any(x == "" for x in raw_seq):
errs.append(anomaly(row_no, v, "input_sequence_blank_field", "sequence is empty or contains blank field"))
seq: List[int] = []
else:
try:
seq = [int(x) for x in raw_seq]
except Exception as e:
seq = []
errs.append(anomaly(row_no, v, "input_sequence_parse_error", str(e)))
if v <= 0 or v % 2 == 0:
errs.append(anomaly(row_no, v, "input_initial_value_not_positive_odd", f"v={v}"))
else:
expected_no = (v - 1) // 2
if no != expected_no:
errs.append(anomaly(row_no, v, "odd_index_mismatch", f"tsv={no}, expected={expected_no}"))
for modulus, tsv_value in ((6, mod6_tsv), (8, mod8_tsv), (16, mod16_tsv), (32, mod32_tsv)):
calc = v % modulus
if calc != tsv_value:
errs.append(anomaly(row_no, v, f"mod{modulus}_mismatch", f"tsv={tsv_value}, calc={calc}"))
if seq:
if seq[0] != v:
errs.append(anomaly(row_no, v, "sequence_initial_value_mismatch", f"sequence[0]={seq[0]}"))
n_calc = len(seq) - 1
if n_tsv != n_calc:
errs.append(anomaly(row_no, v, "n_mismatch", f"tsv={n_tsv}, calc={n_calc}"))
max_calc = max(seq)
if max_tsv != max_calc:
errs.append(anomaly(row_no, v, "max_mismatch", f"tsv={max_tsv}, calc={max_calc}"))
bad_pos = next((i for i, x in enumerate(seq) if x <= 0 or x % 2 == 0), None)
if bad_pos is not None:
errs.append(anomaly(row_no, v, "sequence_contains_nonpositive_or_even", f"position={bad_pos}, value={seq[bad_pos]}"))
if seq[-1] != 1:
errs.append(anomaly(row_no, v, "sequence_not_terminated_at_1", f"last={seq[-1]}"))
if v == 1:
if seq != [1, 1]:
errs.append(anomaly(row_no, v, "root_sequence_format_mismatch", f"expected [1,1], got {seq}"))
elif 1 in seq[:-1]:
first_one = seq.index(1)
errs.append(anomaly(row_no, v, "sequence_has_values_after_first_1", f"first_1_position={first_one}"))
if bad_pos is None:
for i in range(len(seq) - 1):
try:
expected = input_odd_next(seq[i])
except Exception as e:
errs.append(anomaly(row_no, v, "input_edge_evaluation_error", str(e), position=i))
break
if seq[i + 1] != expected:
errs.append(anomaly(
row_no, v, "odd_transition_mismatch",
f"position={i}, current={seq[i]}, actual_next={seq[i+1]}, expected_next={expected}",
))
break
baseV_calc = normalize_to_base(v) if v > 0 and v % 2 == 1 else 0
if baseV_calc != baseV_tsv:
errs.append(anomaly(row_no, v, "baseV_mismatch", f"tsv={baseV_tsv}, calc={baseV_calc}"))
data = {
"no": no,
"v": v,
"baseV_tsv": baseV_tsv,
"baseV_calc": baseV_calc,
"n_tsv": n_tsv,
"max_tsv": max_tsv,
"seq": seq,
}
return data, errs
def verify_row(self, row_no: int, fields: List[str], capture_detail: bool = False) -> RowAudit:
data, errs = self._parse_and_validate_input(row_no, fields)
if data is None:
return RowAudit(row_no, 0, False, len(errs), 0, 0, 0, 0, anomalies=errs)
v = data["v"]
seq: List[int] = data["seq"]
if errs:
return RowAudit(row_no, v, False, len(errs), 0, 0, 0, 0, anomalies=errs)
segments: List[SegmentAudit] = []
token_count = 0
context_count = 0
c2b_count = 0
token_hist: Counter[str] = Counter()
context_hist: Counter[str] = Counter()
c2b_hist: Counter[str] = Counter()
successful_segment_count = 0
idx = 0
prev_endpoint: Optional[int] = None
seg_index = 0
guard = 0
while idx < len(seq):
guard += 1
if guard > 100000:
errs.append(anomaly(row_no, v, "segment_guard_exceeded", "segment loop exceeded guard"))
break
# Preserve the input format convention for v=1 and later terminal 1.
if seq[idx] == 1:
successful_segment_count += 1
if capture_detail:
segments.append(SegmentAudit(
segment_index=seg_index,
actual_start_index=idx,
actual_start_value=1,
normalized_base=1,
endpoint_value=1,
endpoint_index=idx,
final_state="TERMINAL_1",
exact_tokens=[],
context_events=[],
c2b_matches=[],
theory_values=[1],
actual_values=[1],
derived_c2a_tokens=[],
))
break
# If the original row itself begins at C5, the first actual odd step is after this
# endpoint. Its normalized base will seed the next theory segment.
if idx == 0 and is_c5(seq[idx]):
if idx == len(seq) - 1:
break
prev_endpoint = seq[idx]
idx += 1
seg_index += 1
continue
alpha = normalize_to_base(seq[idx] if prev_endpoint is None else prev_endpoint)
try:
result = TZ.tokenize_until_c5(alpha)
except Exception as e:
errs.append(anomaly(
row_no, v, "tokenization_error", str(e),
segment_index=seg_index, actual_start_index=idx,
actual_start_value=seq[idx], normalized_base=alpha,
))
break
# Foundation integrity checks at runtime.
stale = [t for t in result.tokens if t in TZ.STALE_TOKENS]
if stale:
errs.append(anomaly(row_no, v, "stale_token_emitted", repr(stale), segment_index=seg_index))
break
unknown = [t for t in result.tokens if t not in TZ.EXACT_TOKENS]
if unknown:
errs.append(anomaly(row_no, v, "unknown_token_emitted", repr(unknown), segment_index=seg_index))
break
theory_full = list(result.theory_values)
expected_actual = theory_full if seq[idx] == alpha else theory_full[1:]
actual_slice = seq[idx: idx + len(expected_actual)]
if expected_actual != actual_slice:
mismatch_pos = None
for p, (a, b) in enumerate(zip(expected_actual, actual_slice)):
if a != b:
mismatch_pos = p
break
if mismatch_pos is None and len(expected_actual) != len(actual_slice):
mismatch_pos = min(len(expected_actual), len(actual_slice))
errs.append(anomaly(
row_no, v, "theory_sequence_mismatch",
f"relative_position={mismatch_pos}",
segment_index=seg_index,
actual_start_index=idx,
actual_start_value=seq[idx],
normalized_base=alpha,
expected_sequence=expected_actual,
actual_sequence=actual_slice,
))
break
try:
derived_c2a = RZ.project_tokens(result.tokens)
except Exception as e:
errs.append(anomaly(row_no, v, "c2a_projection_error", str(e), segment_index=seg_index))
break
try:
cat_matches = RZ.verify_c2b_against_tokenization(result)
except Exception as e:
errs.append(anomaly(row_no, v, "c2b_recognizer_exception", str(e), segment_index=seg_index))
break
bad_matches = [m for m in cat_matches if not m.ok]
if bad_matches:
errs.append(anomaly(
row_no, v, "c2b_mismatch",
json.dumps([asdict(m) for m in bad_matches], ensure_ascii=False),
segment_index=seg_index,
))
break
token_count += len(result.token_traces)
context_count += len(result.context_events)
c2b_count += len(cat_matches)
token_hist.update(result.tokens)
for ev in result.context_events:
context_hist[context_event_label(ev)] += 1
for cm in cat_matches:
if cm.ok:
c2b_hist[cm.pattern_id] += 1
if not expected_actual:
errs.append(anomaly(row_no, v, "empty_theory_segment", f"alpha={alpha}", segment_index=seg_index))
break
endpoint_value = expected_actual[-1]
endpoint_index = idx + len(expected_actual) - 1
successful_segment_count += 1
if capture_detail:
segments.append(SegmentAudit(
segment_index=seg_index,
actual_start_index=idx,
actual_start_value=seq[idx],
normalized_base=alpha,
endpoint_value=endpoint_value,
endpoint_index=endpoint_index,
final_state=result.final_state,
exact_tokens=list(result.tokens),
context_events=[asdict(e) for e in result.context_events],
c2b_matches=[asdict(m) for m in cat_matches],
theory_values=theory_full,
actual_values=actual_slice,
derived_c2a_tokens=list(derived_c2a),
))
# The tokenizer is designed to stop at C5/1. The actual row continues; normalize
# the C5 endpoint exactly as the current Appendix-G segment convention does.
if endpoint_value == 1:
break
prev_endpoint = endpoint_value
idx = endpoint_index + 1
seg_index += 1
if idx >= len(seq):
break
return RowAudit(
row_no=row_no,
initial_value=v,
ok=(len(errs) == 0),
anomaly_count=len(errs),
segment_count=successful_segment_count,
token_count=token_count,
context_event_count=context_count,
c2b_match_count=c2b_count,
token_hist=dict(token_hist),
context_hist=dict(context_hist),
c2b_hist=dict(c2b_hist),
anomalies=errs,
segments=segments,
)
def parse_args(argv: Optional[Sequence[str]] = None) -> argparse.Namespace:
p = argparse.ArgumentParser(description="OAI internal Chapter-5 full verifier candidate")
p.add_argument("--input-tsv", required=True)
p.add_argument("--output-dir", default=str(SCRIPT_DIR / f"{OUTPUT_ID}_output"))
p.add_argument("--output-id", default=OUTPUT_ID)
p.add_argument("--run-id", default="")
p.add_argument("--limit", type=int, default=0)
p.add_argument("--start-row", type=int, default=1)
p.add_argument("--end-row", type=int, default=0)
p.add_argument("--inspect-values", default="", help="comma-separated odd initial values")
p.add_argument("--progress-every", type=int, default=10000)
p.add_argument("--allow-empty", action="store_true", help="diagnostic only: permit a selected range with zero data rows")
p.add_argument("--expected-row-count", type=int, default=-1, help="strict processed-row contract; -1 disables")
p.add_argument("--expected-first-odd-index", type=int, default=-1, help="strict first odd_index contract; -1 disables")
p.add_argument("--expected-last-odd-index", type=int, default=-1, help="strict last odd_index contract; -1 disables")
p.add_argument("--full-dataset-contract", action="store_true", help="require exactly odd_index 0..262143 (262144 rows)")
return p.parse_args(argv)
def main(argv: Optional[Sequence[str]] = None) -> int:
args = parse_args(argv)
input_path = Path(args.input_tsv)
if not input_path.exists():
raise SystemExit(f"input TSV not found: {input_path}")
if args.start_row < 1:
raise SystemExit("--start-row must be >= 1")
if args.end_row < 0:
raise SystemExit("--end-row must be >= 0 (0 means no explicit end)")
if args.end_row and args.end_row < args.start_row:
raise SystemExit("--end-row must be >= --start-row")
if args.limit < 0:
raise SystemExit("--limit must be >= 0")
if args.progress_every < 0:
raise SystemExit("--progress-every must be >= 0")
contract_values = [args.expected_row_count, args.expected_first_odd_index, args.expected_last_odd_index]
enabled_contract_fields = [x >= 0 for x in contract_values]
if any(enabled_contract_fields) and not all(enabled_contract_fields):
raise SystemExit(
"--expected-row-count, --expected-first-odd-index, and --expected-last-odd-index "
"must be supplied together"
)
if args.full_dataset_contract:
if args.start_row != 1 or args.end_row != 0 or args.limit != 0:
raise SystemExit("--full-dataset-contract requires --start-row 1, --end-row 0, --limit 0")
args.expected_row_count = 262144
args.expected_first_odd_index = 0
args.expected_last_odd_index = 262143
input_sha256 = sha256_file(input_path)
outdir = Path(args.output_dir)
outdir.mkdir(parents=True, exist_ok=True)
start_dt = now_jst()
start_perf = time.perf_counter()
run_id = args.run_id.strip() or start_dt.strftime("%Y%m%d_%H%M%S")
stem = f"{args.output_id}_{run_id}"
inspect_values = {int(x) for x in args.inspect_values.split(",") if x.strip()} if args.inspect_values else set()
verifier = FullVerifierCandidate()
anomalies_path = outdir / f"{stem}_anomalies.jsonl"
token_counts: Counter[str] = Counter()
context_counts: Counter[str] = Counter()
c2b_counts: Counter[str] = Counter()
processed = 0
ok_rows = 0
anomaly_rows = 0
total_anomalies = 0
total_segments = 0
total_tokens = 0
total_context_events = 0
total_c2b_matches = 0
tokenization_error_count = 0
c2b_mismatch_count = 0
stale_symbol_count = 0
input_validation_error_count = 0
theory_sequence_mismatch_count = 0
c2b_recognizer_exception_count = 0
c2a_projection_error_count = 0
unknown_token_error_count = 0
input_container_scan = scan_input_container(input_path)
shell_errors: List[Dict[str, Any]] = list(input_container_scan["errors"])
reason_counts: Counter[str] = Counter()
inspect_details: Dict[int, Dict[str, Any]] = {}
previous_odd_index: Optional[int] = None
first_odd_index: Optional[int] = None
last_odd_index: Optional[int] = None
first_v: Optional[int] = None
last_v: Optional[int] = None
first_file_row: Optional[int] = None
last_file_row: Optional[int] = None
with anomalies_path.open("w", encoding="utf-8") as fanom, input_path.open("r", encoding="utf-8", newline="") as fin:
reader = csv.reader(fin, delimiter="\t")
header = next(reader, None)
if not shell_errors and header != EXPECTED_HEADER:
shell_errors.append({
"reason": "header_changed_after_preflight",
"detail": f"actual={header!r}, expected={EXPECTED_HEADER!r}",
})
if not shell_errors:
for file_row, fields in enumerate(reader, start=1):
if file_row < args.start_row:
continue
if args.end_row and file_row > args.end_row:
break
if args.limit and processed >= args.limit:
break
if not fields or all(x == "" for x in fields):
shell_errors.append({
"reason": "blank_data_row",
"detail": f"blank physical data row selected at file_row={file_row}",
"file_row": file_row,
})
continue
v_hint: Optional[int] = None
if len(fields) > 1:
try:
v_hint = int(fields[1])
except Exception:
pass
capture = v_hint in inspect_values if v_hint is not None else False
audit = verifier.verify_row(file_row, fields, capture_detail=capture)
current_odd_index: Optional[int] = None
current_v: Optional[int] = None
try:
current_odd_index = int(fields[0])
current_v = int(fields[1])
except Exception:
pass
if current_odd_index is not None:
if previous_odd_index is not None and current_odd_index != previous_odd_index + 1:
shell_errors.append({
"reason": "odd_index_not_contiguous",
"detail": (
f"file_row={file_row}, previous={previous_odd_index}, "
f"current={current_odd_index}, expected={previous_odd_index + 1}"
),
"file_row": file_row,
})
previous_odd_index = current_odd_index
if first_odd_index is None:
first_odd_index = current_odd_index
last_odd_index = current_odd_index
if current_v is not None:
if first_v is None:
first_v = current_v
last_v = current_v
if first_file_row is None:
first_file_row = file_row
last_file_row = file_row
processed += 1
total_segments += audit.segment_count
total_tokens += audit.token_count
total_context_events += audit.context_event_count
total_c2b_matches += audit.c2b_match_count
if audit.ok:
ok_rows += 1
else:
anomaly_rows += 1
total_anomalies += audit.anomaly_count
for a in audit.anomalies:
fanom.write(json.dumps(a, ensure_ascii=False) + "\n")
reason = a["reason"]
reason_counts[reason] += 1
if reason in {
"input_column_count", "input_metadata_parse_error", "input_sequence_blank_field",
"input_sequence_parse_error", "input_initial_value_not_positive_odd", "odd_index_mismatch",
"mod6_mismatch", "mod8_mismatch", "mod16_mismatch", "mod32_mismatch",
"sequence_initial_value_mismatch", "n_mismatch", "max_mismatch",
"sequence_contains_nonpositive_or_even", "sequence_not_terminated_at_1",
"root_sequence_format_mismatch", "sequence_has_values_after_first_1",
"input_edge_evaluation_error", "odd_transition_mismatch", "baseV_mismatch",
}:
input_validation_error_count += 1
if reason in {"tokenization_error", "unknown_token_emitted", "stale_token_emitted"}:
tokenization_error_count += 1
if reason == "unknown_token_emitted":
unknown_token_error_count += 1
if reason == "theory_sequence_mismatch":
theory_sequence_mismatch_count += 1
if reason == "c2b_recognizer_exception":
c2b_recognizer_exception_count += 1
if reason == "c2b_mismatch":
c2b_mismatch_count += 1
if reason == "c2a_projection_error":
c2a_projection_error_count += 1
if reason == "stale_token_emitted":
stale_symbol_count += 1
token_counts.update(audit.token_hist)
context_counts.update(audit.context_hist)
c2b_counts.update(audit.c2b_hist)
if capture:
inspect_details[audit.initial_value] = asdict(audit)
if args.progress_every > 0 and processed % args.progress_every == 0:
print(f"{fmt_jst(now_jst())} Processed rows: {processed}")
if processed == 0 and not args.allow_empty:
shell_errors.append({"reason": "zero_rows_processed", "detail": "selected run processed zero data rows"})
expected_contract_enabled = args.expected_row_count >= 0
coverage_contract_errors: List[str] = []
if expected_contract_enabled:
if processed != args.expected_row_count:
coverage_contract_errors.append(
f"processed-row mismatch: actual={processed}, expected={args.expected_row_count}"
)
if first_odd_index != args.expected_first_odd_index:
coverage_contract_errors.append(
f"first odd_index mismatch: actual={first_odd_index}, expected={args.expected_first_odd_index}"
)
if last_odd_index != args.expected_last_odd_index:
coverage_contract_errors.append(
f"last odd_index mismatch: actual={last_odd_index}, expected={args.expected_last_odd_index}"
)
expected_span = args.expected_last_odd_index - args.expected_first_odd_index + 1
if expected_span != args.expected_row_count:
coverage_contract_errors.append(
f"invalid expected contract span: first={args.expected_first_odd_index}, "
f"last={args.expected_last_odd_index}, count={args.expected_row_count}"
)
for detail in coverage_contract_errors:
shell_errors.append({"reason": "coverage_contract_mismatch", "detail": detail})
if shell_errors:
with anomalies_path.open("a", encoding="utf-8") as fanom_shell:
for se in shell_errors:
fanom_line = dict(se)
fanom_line.setdefault("row_no", 0)
fanom_line.setdefault("initial_value", 0)
fanom_shell.write(json.dumps(fanom_line, ensure_ascii=False) + "\n")
end_dt = now_jst()
elapsed = time.perf_counter() - start_perf
total_anomalies += len(shell_errors)
status = "PASS" if anomaly_rows == 0 and not shell_errors else "FAIL"
# Write inspect files separately.
for v, detail in inspect_details.items():
p = outdir / f"inspect_v_{v}_{run_id}.json"
p.write_text(json.dumps(detail, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
summary = {
"program_version": PROGRAM_VERSION,
"status": status,
"input_tsv": str(input_path),
"run_id": run_id,
"started_at": fmt_jst(start_dt),
"ended_at": fmt_jst(end_dt),
"elapsed_seconds": elapsed,
"elapsed_formatted": format_elapsed(elapsed),
"input_tsv_sha256": input_sha256,
"input_container_scan": input_container_scan,
"requested_selection": {
"start_row": args.start_row,
"end_row": args.end_row,
"limit": args.limit,
"allow_empty": args.allow_empty,
"full_dataset_contract": args.full_dataset_contract,
},
"coverage": {
"first_file_row": first_file_row,
"last_file_row": last_file_row,
"first_odd_index": first_odd_index,
"last_odd_index": last_odd_index,
"first_v": first_v,
"last_v": last_v,
"contiguous_within_processed_selection": not any(e.get("reason") == "odd_index_not_contiguous" for e in shell_errors),
"expected_contract_enabled": expected_contract_enabled,
"expected_row_count": args.expected_row_count if expected_contract_enabled else None,
"expected_first_odd_index": args.expected_first_odd_index if expected_contract_enabled else None,
"expected_last_odd_index": args.expected_last_odd_index if expected_contract_enabled else None,
"contract_status": "PASS" if expected_contract_enabled and not coverage_contract_errors else ("FAIL" if expected_contract_enabled else "NOT_REQUESTED"),
},
"shell_error_count": len(shell_errors),
"shell_errors": shell_errors,
"foundation": {
"tokenizer_path": str(TOKENIZER_PATH),
"tokenizer_sha256": sha256_file(TOKENIZER_PATH),
"tokenizer_expected_sha256": EXPECTED_TOKENIZER_SHA256,
"recognizer_path": str(RECOGNIZER_PATH),
"recognizer_sha256": sha256_file(RECOGNIZER_PATH),
"recognizer_expected_sha256": EXPECTED_RECOGNIZER_SHA256,
},
"catalog_static_validation": verifier.catalog_static,
"independent_specification_contract": verifier.spec_contract,
"verified_rows": processed,
"ok_rows": ok_rows,
"rows_with_anomalies": anomaly_rows,
"total_anomalies": total_anomalies,
"total_segments": total_segments,
"total_exact_tokens": total_tokens,
"total_context_events": total_context_events,
"total_c2b_matches": total_c2b_matches,
"tokenization_error_count": tokenization_error_count,
"c2b_mismatch_count": c2b_mismatch_count,
"stale_symbol_count": stale_symbol_count,
"input_validation_error_count": input_validation_error_count,
"theory_sequence_mismatch_count": theory_sequence_mismatch_count,
"c2b_recognizer_exception_count": c2b_recognizer_exception_count,
"c2a_projection_error_count": c2a_projection_error_count,
"unknown_token_error_count": unknown_token_error_count,
"anomaly_reason_counts": dict(sorted(reason_counts.items())),
"exact_token_counts": dict(sorted(token_counts.items())),
"context_event_counts": dict(sorted(context_counts.items())),
"c2b_match_counts": dict(sorted(c2b_counts.items())),
}
summary_json = outdir / f"{stem}_summary.json"
summary_txt = outdir / f"{stem}_summary.txt"
run_log = outdir / f"{stem}_run.log"
summary_json.write_text(json.dumps(summary, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
summary_txt.write_text(
"\n".join([
"=" * 72,
f"Program Version: {PROGRAM_VERSION}",
"Verification Mode: validated TSV -> frozen tokenizer -> frozen downstream C2b recognizer",
f"Tokenizer SHA-256: {summary['foundation']['tokenizer_sha256']}",
f"Recognizer SHA-256: {summary['foundation']['recognizer_sha256']}",
f"Input TSV SHA-256: {input_sha256}",
f"Input Container Scan: {input_container_scan['status']}",
f"Input Container Data Rows: {input_container_scan['data_rows']}",
f"Catalog Static Validation: {verifier.catalog_static['status']}",
f"Independent Specification Contract: {verifier.spec_contract['status']}",
f"Coverage Contract: {summary['coverage']['contract_status']}",
f"First/Last odd_index: {first_odd_index} / {last_odd_index}",
f"Shell Errors: {len(shell_errors)}",
f"Verified Rows: {processed}",
f"OK Rows: {ok_rows}",
f"Rows With Anomalies: {anomaly_rows}",
f"Total Anomalies: {total_anomalies}",
f"Total Segments: {total_segments}",
f"Total Exact Tokens: {total_tokens}",
f"Total Context Events: {total_context_events}",
f"Total C2b Matches: {total_c2b_matches}",
f"Tokenization Errors: {tokenization_error_count}",
f"C2b Mismatches: {c2b_mismatch_count}",
f"Stale Symbol Count: {stale_symbol_count}",
f"Input Validation Errors: {input_validation_error_count}",
f"Theory Sequence Mismatches: {theory_sequence_mismatch_count}",
f"C2b Recognizer Exceptions: {c2b_recognizer_exception_count}",
f"C2a Projection Errors: {c2a_projection_error_count}",
f"Unknown Token Errors: {unknown_token_error_count}",
f"Elapsed: {format_elapsed(elapsed)}",
f"Status: {status}",
"=" * 72,
"",
]) + "\n",
encoding="utf-8",
)
run_log.write_text(
"\n".join([
f"PROGRAM_VERSION: {PROGRAM_VERSION}",
f"RUN_ID: {run_id}",
f"STARTED_AT: {fmt_jst(start_dt)}",
f"ENDED_AT: {fmt_jst(end_dt)}",
f"INPUT_TSV: {input_path}",
f"INPUT_TSV_SHA256: {input_sha256}",
f"INPUT_CONTAINER_SCAN_STATUS: {input_container_scan['status']}",
f"INPUT_CONTAINER_DATA_ROWS: {input_container_scan['data_rows']}",
f"INPUT_CONTAINER_FIRST_ODD_INDEX: {input_container_scan['first_odd_index']}",
f"INPUT_CONTAINER_LAST_ODD_INDEX: {input_container_scan['last_odd_index']}",
f"REQUESTED_START_ROW: {args.start_row}",
f"REQUESTED_END_ROW: {args.end_row}",
f"REQUESTED_LIMIT: {args.limit}",
f"FIRST_ODD_INDEX: {first_odd_index}",
f"LAST_ODD_INDEX: {last_odd_index}",
f"COVERAGE_CONTRACT_STATUS: {summary['coverage']['contract_status']}",
f"SHELL_ERROR_COUNT: {len(shell_errors)}",
f"TOKENIZER_SHA256: {summary['foundation']['tokenizer_sha256']}",
f"RECOGNIZER_SHA256: {summary['foundation']['recognizer_sha256']}",
f"CATALOG_STATIC_VALIDATION: {verifier.catalog_static['status']}",
f"VERIFIED_ROWS: {processed}",
f"OK_ROWS: {ok_rows}",
f"ROWS_WITH_ANOMALIES: {anomaly_rows}",
f"TOTAL_ANOMALIES: {total_anomalies}",
f"STATUS: {status}",
]) + "\n",
encoding="utf-8",
)
print(summary_txt.read_text(encoding="utf-8"), end="")
return 0 if status == "PASS" else 1
if __name__ == "__main__":
raise SystemExit(main())
付録G-6.4 slice manifest checker.
以下に、分割実行結果の全件被覆を確認する slice manifest checker
の掲載コードを示す。
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""OAI internal shell utility: machine-check a set of hardened-verifier slice summaries."""
from __future__ import annotations
import argparse, hashlib, json
from pathlib import Path
from typing import Optional, Sequence
def sha256_file(path: Path) -> str:
h=hashlib.sha256()
with path.open('rb') as f:
for chunk in iter(lambda:f.read(1024*1024), b''):
h.update(chunk)
return h.hexdigest()
def parse_args(argv: Optional[Sequence[str]]=None):
p=argparse.ArgumentParser()
p.add_argument('summaries', nargs='+')
p.add_argument('--expected-first-odd-index', type=int, required=True)
p.add_argument('--expected-last-odd-index', type=int, required=True)
p.add_argument('--expected-row-count', type=int, required=True)
p.add_argument('--json-out', default='')
return p.parse_args(argv)
def main(argv: Optional[Sequence[str]]=None)->int:
a=parse_args(argv)
paths=[Path(x) for x in a.summaries]
rows=[]; errors=[]
for p in paths:
d=json.loads(p.read_text(encoding='utf-8'))
c=d.get('coverage',{})
rows.append({
'path':str(p), 'sha256':sha256_file(p),
'status':d.get('status'), 'input_tsv_sha256':d.get('input_tsv_sha256'),
'tokenizer_sha256':d.get('foundation',{}).get('tokenizer_sha256'),
'recognizer_sha256':d.get('foundation',{}).get('recognizer_sha256'),
'verified_rows':d.get('verified_rows'),
'first_odd_index':c.get('first_odd_index'), 'last_odd_index':c.get('last_odd_index'),
'contract_status':c.get('contract_status'), 'shell_error_count':d.get('shell_error_count'),
'container_scan_status':d.get('input_container_scan',{}).get('status'),
'container_data_rows':d.get('input_container_scan',{}).get('data_rows'),
'container_first_odd_index':d.get('input_container_scan',{}).get('first_odd_index'),
'container_last_odd_index':d.get('input_container_scan',{}).get('last_odd_index'),
'rows_with_anomalies':d.get('rows_with_anomalies'), 'total_anomalies':d.get('total_anomalies'),
'total_segments':d.get('total_segments'), 'total_exact_tokens':d.get('total_exact_tokens'),
'total_context_events':d.get('total_context_events'), 'total_c2b_matches':d.get('total_c2b_matches'),
'tokenization_error_count':d.get('tokenization_error_count'), 'c2b_mismatch_count':d.get('c2b_mismatch_count'),
'c2a_projection_error_count':d.get('c2a_projection_error_count'),
})
rows.sort(key=lambda x:(x['first_odd_index'] if x['first_odd_index'] is not None else -1))
if not rows:
errors.append('no summaries')
input_hashes={x['input_tsv_sha256'] for x in rows}
if len(input_hashes)!=1: errors.append(f'input hash mismatch: {input_hashes}')
tok_hashes={x['tokenizer_sha256'] for x in rows}
if len(tok_hashes)!=1: errors.append(f'tokenizer hash mismatch: {tok_hashes}')
rec_hashes={x['recognizer_sha256'] for x in rows}
if len(rec_hashes)!=1: errors.append(f'recognizer hash mismatch: {rec_hashes}')
for x in rows:
if x['status']!='PASS': errors.append(f"non-PASS slice: {x['path']}")
if x['contract_status']!='PASS': errors.append(f"coverage contract non-PASS: {x['path']}")
if x['container_scan_status']!='PASS': errors.append(f"input-container scan non-PASS: {x['path']}")
if x['container_data_rows']!=a.expected_row_count:
errors.append(f"input-container row-count mismatch in {x['path']}: {x['container_data_rows']} != {a.expected_row_count}")
if x['container_first_odd_index']!=a.expected_first_odd_index or x['container_last_odd_index']!=a.expected_last_odd_index:
errors.append(
f"input-container boundary mismatch in {x['path']}: "
f"{x['container_first_odd_index']}..{x['container_last_odd_index']} != "
f"{a.expected_first_odd_index}..{a.expected_last_odd_index}"
)
if x['shell_error_count']!=0: errors.append(f"shell errors in slice: {x['path']}")
if x['rows_with_anomalies']!=0 or x['total_anomalies']!=0: errors.append(f"anomalies in slice: {x['path']}")
if rows:
if rows[0]['first_odd_index']!=a.expected_first_odd_index:
errors.append(f"first boundary mismatch: {rows[0]['first_odd_index']} != {a.expected_first_odd_index}")
if rows[-1]['last_odd_index']!=a.expected_last_odd_index:
errors.append(f"last boundary mismatch: {rows[-1]['last_odd_index']} != {a.expected_last_odd_index}")
for p,q in zip(rows,rows[1:]):
if q['first_odd_index'] != p['last_odd_index']+1:
errors.append(f"gap/overlap between {p['path']} and {q['path']}: {p['last_odd_index']} -> {q['first_odd_index']}")
total_rows=sum(int(x['verified_rows'] or 0) for x in rows)
if total_rows!=a.expected_row_count: errors.append(f'row total mismatch: {total_rows} != {a.expected_row_count}')
expected_span=a.expected_last_odd_index-a.expected_first_odd_index+1
if expected_span!=a.expected_row_count: errors.append(f'expected span/count mismatch: {expected_span} != {a.expected_row_count}')
totals={k:sum(int(x[k] or 0) for x in rows) for k in ['verified_rows','total_segments','total_exact_tokens','total_context_events','total_c2b_matches','tokenization_error_count','c2b_mismatch_count','c2a_projection_error_count']}
result={'status':'PASS' if not errors else 'FAIL','expected':{'first_odd_index':a.expected_first_odd_index,'last_odd_index':a.expected_last_odd_index,'row_count':a.expected_row_count},'input_tsv_sha256':next(iter(input_hashes)) if len(input_hashes)==1 else None,'tokenizer_sha256':next(iter(tok_hashes)) if len(tok_hashes)==1 else None,'recognizer_sha256':next(iter(rec_hashes)) if len(rec_hashes)==1 else None,'slice_count':len(rows),'slices':rows,'totals':totals,'errors':errors}
text=json.dumps(result,ensure_ascii=False,indent=2)
print(text)
if a.json_out: Path(a.json_out).write_text(text+'\n',encoding='utf-8')
return 0 if not errors else 1
if __name__=='__main__': raise SystemExit(main())
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////