from fractions import Fraction as F def run(load,check): pairs=load('C286_DATA.json')['source_pairs'];regular={x['i']:x for x in load('C344_DATA.json')['rows']};rows=[] def point(role,state,index): key='S' if role=='Shem' else 'F';vals={z[key] for z in pairs if z[role+'_Cainan']==state and z[role+'_index']==index};assert len(vals)==1 return {'mode':'cumulative','tradition':'LXX','Cainan':state,'role':role,'annual_index':index,'coordinate':vals.pop(),'regular_Gear':None} for x in load('C287_DATA.json')['rows']: if not x['complete']:continue i=x['i'];S=point('Shem',1,i+2);P=point('Shem',0,i+2);q=point('Flood',0,i);Ps=point('Shem',0,i);qs=point('Flood',0,i+2);s,p,f,ps,fs=[z['coordinate'] for z in [S,P,q,Ps,qs]] check(f'i{i} inherited triple',s==x['S'] and f==x['F'] and [p-s,f-p,f-s]==[460,598,1058]) check(f'i{i} held Flood600',ps==f-F(300,299)*(f-p) and [ps-s,f-ps,f-s]==[458,600,1058]) check(f'i{i} held Shem600',fs==p+F(300,299)*(f-p) and [p-s,fs-p,fs-s]==[460,600,1060]) N,R=x['Noah_required'],x['R'];check(f'i{i} outer17K unchanged',R-s==N-f==8993) both=regular[i]['rail']=='primary';reg600=[z for z in load('C345_DATA.json')['rows'] if z['i']==i and z['keep2K']] check(f'i{i} simultaneous regular support',bool(reg600)==both) if both:check(f'i{i} dual458600',reg600[0]['parts_N_M_D_R'][0]==458 and sum(reg600[0]['parts_N_M_D_R'][1:])==600) for e in [F(-1,4),F(1,4)]:check(f'i{i}/{e} exact components',(f+e)-F(300,299)*((f+e)-(p+e))==ps+e and (p+e)+F(300,299)*((f+e)-(p+e))==fs+e) rows.append({'i':i,'S_ON':S,'P_OFF':P,'q_OFF':q,'P_repaired_OFF':Ps,'q_repaired_OFF':qs,'original_parts':[460,598],'outer_preserving_parts':[458,600],'interior_Shem_preserving_parts':[460,600],'outer_preserving_2K':1058,'other_outer':1060,'regular_primary_counterpart':both,'Cainan_lifespan_redefined':False}) return {'step':'C351','rows':rows,'cumulative_success_i':[x['i'] for x in rows],'simultaneous_primary_i':[x['i'] for x in rows if x['regular_primary_counterpart']],'claim':'Endpoint comparison of existing annual members.458 crosses Cainan state and annual index; it is not a revised460 Cainan lifespan. No cumulative Gear or joint source prescription is adopted.'}