Last active
November 25, 2024 17:26
-
-
Save lastforkbender/6fe37d3c0f3ad5b4a162cd26dee159ce to your computer and use it in GitHub Desktop.
Transitional angular codex for palindrome signatures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # QOP-ANGULAR s24 (QOPAS24) | |
| # Version: 1.1.283 | |
| # ○●○○○○○○ ○○○○○○●○ | |
| # ○○○○○○○○ ○○○○○○○○ | |
| # ○○○◒○○○○ ○○○○◒○○○ | |
| # ○○○○◒○○○ ○○○◒○○○○ | |
| # ○○○○○◒○○ ○○◒○○○○○ | |
| # ○○○○○○◒○ ○◒○○○○○○ | |
| # ○○○○○○○◑ ◐○○○○○○○ | |
| # ○○○○○○○● ○●●●●●●● | |
| # ○○○○○○○◐ ◑○○○○○○○ | |
| # ○○○○○○○◐ ◑○○○○○○○ | |
| # ●●●●●●●○ ●○○○○○○○ | |
| # ○○○○○○○◑ ◐○○○○○○○ | |
| # ○○○○○○◒○ ○◒○○○○○○ | |
| # ○○○○○◒○○ ○○◒○○○○○ | |
| # ○○○○◒○○○ ○○○◒○○○○ | |
| # ○○○◒○○○○ ○○○○◒○○○ | |
| # ○○○○○○○○ ○○○○○○○○ | |
| # ○●○○○○○○ ○○○○○○●○ | |
| import re | |
| import math | |
| import random | |
| # See test() function comments for proper use of this encoder. | |
| __MNAV = [515,131,777,141,525,787,535,151,797,545,161,555,171,565,181, | |
| 575,191,707,585,717,595,727,737,101,747,111,757,505,767] | |
| __MSYM = ['○','◓','◑','◒','◐','●','⇄','⇆','→','←','⇉','⇇','⍆', | |
| '⍅','↔','↻','↺','⋉','⋊','⧔','⧕','⌲','⏀','⏅'] | |
| # ====================================================================================== | |
| def qop_angular(l: list) -> list: | |
| rl = len(l) | |
| qa = [] | |
| for t in l: | |
| p = 0 | |
| if t < 11: | |
| n = t+p-1 | |
| elif t > rl: | |
| n = t+1 | |
| else: | |
| n = t-1 | |
| # define the elapse surface begin c | |
| c = (1-(math.tan(t+n))*math.pi/n)+1 | |
| x = [c]*t | |
| r = len(x) | |
| o = x | |
| q = 1 | |
| k = c | |
| while p < r: | |
| t = r-p+1 | |
| if t+p/t <= r and (x[p] < r or x[p] == 1): | |
| h = c-1 | |
| if h >= 1: | |
| # pole cnd = 1-r◐⍆x◑ or a palindrome extract loop rate | |
| # for a lattice mapping is searchable within t+p/t <= r | |
| # consisting of upper angular ranges as set r elements | |
| o[p] = math.floor(((k+h/p)+math.sqrt(x[p]))*r) | |
| else: | |
| q = x[p]+t-1 | |
| if x[p]+r/2 <= q: | |
| # t is both post positions @p, aka framed | |
| # .......q+? >= ((h*t/r)-x[p])-(t+x[p]) | |
| if x[p]+r <= h+t: | |
| o[p] = 0 | |
| else: | |
| # is an favorable semi-spherical node | |
| if p+1 < r: | |
| o[p] = (math.ceil(math.cos(x[p]+r))*2)/h | |
| else: | |
| o[p] = (math.ceil(math.cos(x[p]-r))*2)/h | |
| k = o[p] | |
| else: | |
| # t isn't a regional cosine-r, aka renown | |
| # this should always be greater c*c when | |
| # palindrome sectionals wrap back to a r | |
| # field if the previous else x[p] - r | |
| # example: r◓⇉◑<t+p⋉t◑ where h+t+1 | |
| o[p] = math.ceil(((q+p)*math.sqrt(math.sin(x[p]))/t)+1) | |
| else: | |
| # manifold indice bound x for x, is the non-escape duality span | |
| o[p] = f'MIB:{math.floor(x[p])}' | |
| p+=1 | |
| qa.append(set(o)) | |
| n = t | |
| return qa | |
| # ====================================================================================== | |
| def qop_montage(l: list, qa: list, k: int): | |
| # get the filtered pivot-range list for __MNAV node replacements | |
| mrt = qop_get_mrate(l) | |
| mrtI = [_.split(',') for _ in mrt] | |
| mrtI = [int(_[0]) for _ in mrtI] | |
| lr = len(l) | |
| # get the palindromes from pList | |
| srp = qop_get_plndrm(l, lr, 1) | |
| slp = qop_get_plndrm(l, lr, 0) | |
| spx = len(srp) | |
| # get the authorized prenode-keys list @[?/h^t] - terminators | |
| pnkL = qop_get_prenode_keys(l, 5, 2, 42) | |
| # get a list of probable sub-prime-palindromes, these as major half-loops @[?/h^t] | |
| rl = 10**(lr//2-1) | |
| rr = 10**(lr//2)-1 | |
| pp = {int(str(x)+str(x)[-2::-1]) for x in (random.randint(rl,rr) for _ in range(k-1)) if (int(str(x)[-2::-1])%6 in {1,5}) and (int(str(x)+str(x)[-2::-1])**0.5%1 != 0)} | |
| crp = 0 | |
| vCnt = -1 | |
| clp = len(slp)-1 | |
| eslRslt = None | |
| esnRslt = None | |
| sp = ['.', 0] | |
| asan = None | |
| etx = False | |
| hls = [] | |
| sto = 1 | |
| lr = [] | |
| for vp in qa: | |
| vCnt+=1 | |
| vp = list(vp) | |
| for t in vp: | |
| if isinstance(t, int): | |
| if math.floor(math.sin((math.pi*t)/math.tan(t))-1) == -2: | |
| # encoded shift /--> locality[-2] | |
| eslRslt = qop_esl_qring(sto, l[vCnt], t, crp, srp, spx) | |
| if len(eslRslt) > 0: | |
| crp = eslRslt[0] | |
| if len(eslRslt) > 1: | |
| lr.append(eslRslt[1]) | |
| sto == -2 | |
| else: | |
| # encoded anti-shift /--> non-locality[-1] | |
| if not etx: | |
| etx = 1 | |
| asan = qop_esn_etx_map(l) | |
| esnRslt = qop_esn_qring(sto, l[vCnt], t, sp, clp, slp, asan, hls, spx) | |
| if len(esnRslt) > 0: | |
| clp = esnRslt[0] | |
| if len(esnRslt) > 1: | |
| if esnRslt[1] == '<' or esnRslt[1] == '>': | |
| sp = [esnRslt[1], esnRslt[2], esnRslt[3]] | |
| #lr.append(esnRslt[4]) | |
| elif esnRslt[1] == '.': | |
| sp = ['.', esnRslt[2], esnRslt[3], esnRslt[4]] | |
| hls = esnRslt[5] | |
| if len(hls) == 1 and isinstance(hls[0], str): | |
| lr.append(hls[0]) | |
| sp = ['.', 0] | |
| hls = [] | |
| else: | |
| sp = ['.', 0] | |
| lr.append(esnRslt[1]) | |
| else: | |
| # a esn __MNAV probable, not applied for this version | |
| pass | |
| sto = -1 | |
| else: | |
| #print('reserved & secure calculation') | |
| pass | |
| qop_enc_info(l, ''.join(lr), srp, slp, spx) | |
| # ====================================================================================== | |
| def qop_esn_qring(sto: int, s: int, t: int, sp: list, clp: int, slp: str, etx: str, hls: list, slpLen: int) -> list: | |
| rtrn = None | |
| ocVp = int(slp[math.floor((clp+s)%((slpLen/2)+1))]) | |
| if t in __MNAV: | |
| # rm = max(min([[(int(math.tan((r*r)+m)), int(math.sqrt(math.pi*m*r))) for r in range(m, min(l)+m)] for m in l])) | |
| return [] | |
| else: | |
| esnR = qop_es_range("esn", s, t, clp, slpLen) | |
| #print(f'ESN RANGE: {esnR}') | |
| ri = esnR[0] | |
| nwClp = esnR[1] | |
| clp = esnR[2] | |
| if nwClp <= slpLen-clp+1: | |
| nwClp+=1 | |
| else: | |
| # double-halves reverse to esl; or any xy√y-tan(y)+x√y+cos(x)+1 dec depth | |
| nwClp = slpLen-clp-clp+1 | |
| if nwClp <= 0 or nwClp >= slpLen-1: | |
| # is an etx opposed range conversion from @clp | |
| rtrn = [clp+nwClp] | |
| rli = (((nwClp+(clp*2))/2)/(clp*2))+nwClp | |
| if rli <= len(etx)*2 and sto == -1: | |
| clp = math.floor((clp+rli)%len(etx)) | |
| rtrn.append(qop_esn_etx_enc(etx[clp], sto, s, t, ri, rli, clp, nwClp, ocVp, slpLen)) | |
| else: | |
| # @pList is of a rookie length or attempts to crack the above @rli | |
| if sto == -2: | |
| print('[[ ETX, STO=-2: ... ]]') | |
| else: | |
| print('[[ ETX, STO=-1: ... ]]') | |
| else: | |
| if ri == ocVp: | |
| if s == clp: | |
| raise Exception(f'QOPAS24-ERR-505: Non-locality encoding failed, qa-set timer position matches current set @clp position') | |
| else: | |
| rtrn = [clp+nwClp] | |
| if s > clp: | |
| rtrn.append('>') | |
| if sp[0] == '.' or sp[0] == '<': | |
| #print(f's({s}) is greater than clp({clp})') | |
| rtrn.append(1) | |
| rtrn.append(s) | |
| else: | |
| sp[1]+=1 | |
| rtrn.append(sp[1]) | |
| rtrn.append(s) | |
| if sp[1] > 1: | |
| if s == sp[2]: | |
| # if this is happening later in the encoding process | |
| # then will take much longer @ Solace-XN to decipher | |
| #print(f's({s}) is greater than clp({clp}) and PAIRED') | |
| pass | |
| else: | |
| raise Exception('QOPAS24-ERR-909: Illegal non-locality symmetry comparison') | |
| else: | |
| #print(f's({s}) is greater than clp({clp})') | |
| pass | |
| else: | |
| rtrn.append('<') | |
| if sp[0] == '.' or sp[0] == '>': | |
| #print(f's({s}) is lesser than clp({clp})') | |
| rtrn.append(1) | |
| rtrn.append(s) | |
| else: | |
| sp[1]+=1 | |
| rtrn.append(sp[1]) | |
| rtrn.append(s) | |
| if sp[1] > 1: | |
| if s == sp[2]: | |
| #print(f's({s}) is lesser than clp({clp}) and PAIRED') | |
| pass | |
| else: | |
| raise Exception('QOPAS24-ERR-909: Illegal non-locality symmetry comparison') | |
| else: | |
| #print(f's({s}) is lesser than clp({clp})') | |
| pass | |
| else: | |
| if len(sp) > 3: | |
| if ri != sp[1] and ocVp != sp[3]: | |
| hls = qop_esn_hls_bridge(1, ri, clp, nwClp, ocVp, hls, None) | |
| else: | |
| #print(f'■FRAME IN VIEW --> ri={ri}, clp={clp}, nwClp={nwClp}, ocVp={ocVp}') | |
| hls = qop_esn_hls_bridge(2, ri, clp, nwClp, ocVp, hls, slpLen) | |
| rtrn = [clp+nwClp, '.', ri, clp, ocVp, hls] | |
| return rtrn | |
| # ====================================================================================== | |
| def qop_esn_hls_bridge(mode: int, ri: int, clp: int, nwClp: int, ocVp: int, hls: list, slpLen: int) -> list: | |
| if mode == 1: | |
| hls.append([ri, clp, nwClp, ocVp]) | |
| return hls | |
| elif mode == 2: | |
| if len(hls) > 0: | |
| hlr = [] | |
| hli = None | |
| hll = None | |
| for hsi in hls: | |
| hli = hsi[1] | |
| hll = hsi[2] | |
| if hsi[0]+1 == hsi[2]: | |
| if hsi[0]+hsi[2]+1 >= hsi[1]: | |
| # has absolute phasing to current frame @ri < [9,9-1,etc] | |
| hli = hli+ri+1 | |
| hll = hll+hsi[3]+1 | |
| else: | |
| # is less continuous if next sim frame @ri[hsi[0]] > 0, | |
| # simply @nwClp as extension of any tangent mapping but | |
| # if __MNAV used with probable sub-primes to @nwClp NO | |
| hli = hli+ri-1 | |
| if hsi[3] > 5: | |
| if hsi[3] != 9: | |
| hll = hll+hsi[1]-hsi[3]+1 | |
| else: | |
| hll = hll+hsi[3]-1 | |
| else: | |
| hll = hll+hli-hsi[3]+1 | |
| else: | |
| raise Exception('QOPAS24-ERR-909: Illegal non-locality symmetry comparison') | |
| if hli <= 1: | |
| raise Exception('QOPAS24-ERR-909: Illegal non-locality symmetry comparison') | |
| else: | |
| if hli > hll: | |
| hlr.append((hli+hll)%slpLen) | |
| elif hli == hll: | |
| hlr.append(math.floor((hli/2))%slpLen) | |
| else: | |
| hlr.append((hll-hli)%slpLen) | |
| # not a lock however hlr must be deciphered LtoR and are p-index constant(s) | |
| # these as total appended to enc vs the total non-locality anti-shifts close | |
| # TODO: has no check if ending hls set is there and no ending frame in view | |
| if len(hlr) < 2: | |
| hlr.append(f'({ri},{ri+ocVp},{math.ceil(math.sqrt(clp+nwClp+slpLen)/nwClp)})') | |
| hlr = str(hlr).replace("'", '').replace(' ', '') | |
| if clp == ocVp: | |
| return [f'|{__MSYM[17]}{__MSYM[0]}{__MSYM[8]}{hlr}'] | |
| else: | |
| if nwClp >= ri+ocVp: | |
| return [f'|{__MSYM[17]}{__MSYM[3]}{__MSYM[9]}{hlr}'] | |
| else: | |
| return [f'|{__MSYM[17]}{__MSYM[1]}{__MSYM[8]}{hlr}'] | |
| else: | |
| # TODO: a frame in view however empty hls bridge | |
| pass | |
| return [] | |
| # ====================================================================================== | |
| def qop_esn_etx_enc(etxS: str, sto: int, s: int, t: int, ri, rli, clp: int, nwClp: int, ocVp: int, slpLen: int) -> str: | |
| if etxS == '|<': | |
| if s+clp >= slpLen and clp < slpLen: | |
| if t-s > clp: | |
| return f'{__MSYM[14]}{nwClp}{__MSYM[5]}{__MSYM[13]}' | |
| else: | |
| if s+t >= slpLen: | |
| return f'{__MSYM[14]}{nwClp}{__MSYM[5]}{__MSYM[8]}' | |
| else: | |
| return f'{__MSYM[14]}{nwClp}{__MSYM[5]}{__MSYM[12]}' | |
| else: | |
| return f'{__MSYM[19]}{nwClp}{__MSYM[0]}{__MSYM[10]}' | |
| elif etxS == '>|': | |
| if s+clp < slpLen and nwClp >= slpLen: | |
| if s+t < nwClp: | |
| return f'{__MSYM[14]}{nwClp}{__MSYM[3]}{__MSYM[16]}' | |
| else: | |
| if t-s >= slpLen and nwClp <= t: | |
| return f'{__MSYM[14]}{nwClp}{__MSYM[3]}{__MSYM[10]}' | |
| else: | |
| return f'{__MSYM[14]}{nwClp}{__MSYM[3]}{__MSYM[11]}' | |
| else: | |
| if s >= t and nwClp < clp: | |
| return f'{__MSYM[19]}{nwClp}{__MSYM[1]}{__MSYM[7]}{__MSYM[3]}{__MSYM[16]}' | |
| else: | |
| return f'{__MSYM[19]}{nwClp}{__MSYM[1]}{__MSYM[16]}{__MSYM[9]}' | |
| else: | |
| cvlR = [[(math.floor((math.sin(rli/(clp-nwClp+x-1)))), math.floor(math.tan(rli*(nwClp-y+1)))) for y in range(2)] for x in range(2)] | |
| cvlR = [_ for r in cvlR for _ in r] | |
| cvlR = [cvlR.count((1,1)), cvlR.count((-1,-1)), cvlR.count((1,-1)), cvlR.count((-1,1))] | |
| cvlM = max(cvlR) | |
| if sto == -1: | |
| if etxS == ':<': | |
| if cvlM == 2: | |
| if cvlR[1] == 2 and cvlR[3] == 2: | |
| return f'{qop_esn_etx_rm_clp("rl", ri, nwClp, clp)}' | |
| else: | |
| if math.floor(slpLen/2)-1 >= ri: | |
| return f'~□{__MSYM[16]}{__MSYM[9]}{ri-ocVp}{__MSYM[9]}{ri}' | |
| else: | |
| return f'~□{__MSYM[15]}{__MSYM[9]}{ri+ocVp}{__MSYM[9]}{ri}' | |
| else: | |
| if math.ceil(rli) < -99: | |
| raise Exception(f'RLI range has exceeded max limit, cannot apply proper non-locality sets @ "{slp}"') | |
| else: | |
| if (rli-(math.floor(((slpLen/2)-(rli*clp))-rli)/math.ceil(rli)))-10 > rli+10: | |
| if rli > -75: | |
| return f'~{__MSYM[12]}{__MSYM[6]}{math.ceil(rli)}{__MSYM[3]}{__MSYM[16]}' | |
| else: | |
| return f'~{__MSYM[12]}{__MSYM[6]}{math.ceil(rli)}{__MSYM[1]}{__MSYM[16]}' | |
| else: | |
| # an intact gap @clp, is quasi-compatible with mid-rli lengths LtoR | |
| return f'~{__MSYM[13]}{__MSYM[7]}{math.ceil(rli)}{__MSYM[0]}{__MSYM[15]}' | |
| else: | |
| if cvlM == 2: | |
| if cvlR[1] == 2 and cvlR[3] == 2: | |
| return f'{qop_esn_etx_rm_clp("lr", ri, nwClp, clp)}' | |
| else: | |
| if math.floor(slpLen/2)-1 <= ri: | |
| return f'~□{__MSYM[15]}{__MSYM[8]}{ri-ocVp}{__MSYM[8]}{ri}' | |
| else: | |
| return f'~□{__MSYM[16]}{__MSYM[8]}{ri+ocVp}{__MSYM[8]}{ri}' | |
| else: | |
| if math.ceil(rli) < -99: | |
| raise Exception(f'RLI range has exceeded max limit, cannot apply proper non-locality sets @ "{slp}"') | |
| else: | |
| if (rli-(math.floor(((slpLen/2)-(rli*clp))-rli)/math.ceil(rli)))-10 > rli+10: | |
| if rli > -75: | |
| return f'~{__MSYM[13]}{__MSYM[7]}{math.ceil(rli)}{__MSYM[1]}{__MSYM[15]}' | |
| else: | |
| return f'~{__MSYM[13]}{__MSYM[7]}{math.ceil(rli)}{__MSYM[3]}{__MSYM[15]}' | |
| else: | |
| return f'~{__MSYM[12]}{__MSYM[6]}{math.ceil(rli)}{__MSYM[5]}{__MSYM[16]}' | |
| else: | |
| raise Exception('Cannot perform non-locality encodings, a valid balance between normal locality sets has failed') | |
| # ====================================================================================== | |
| def qop_esn_etx_rm_clp(encP: str, ri: int, nwClp: int, clp: int) -> str: | |
| rmGde = [clp+ri, clp+ri-nwClp, clp-ri, clp-ri+nwClp] | |
| rmGde = [(math.floor(rmGde[r%len(rmGde)]+math.cos(ri+clp)), math.floor(rmGde[m%len(rmGde)]+clp-1)) for r in range(ri//2) for m in range(len(rmGde))] | |
| rmGde = str(min(rmGde)) | |
| if encP == 'rl': | |
| rmGde = f'~{__MSYM[23]}{rmGde.replace("-", __MSYM[9]).replace(",", __MSYM[16]).replace("(", "").replace(")", "").replace(" ", "")}' | |
| else: | |
| rmGde = f'~{__MSYM[23]}{rmGde.replace("-", __MSYM[8]).replace(",", __MSYM[15]).replace("(", "").replace(")", "").replace(" ", "")}' | |
| return rmGde | |
| # ====================================================================================== | |
| def qop_esn_etx_map(l: list) -> list: | |
| if len(l) > 2: | |
| rtrn = [] | |
| etxL = None | |
| etxCm = None | |
| etxM = len(l) | |
| etxR = int(etxM/2) | |
| for asan in range(1, etxM): | |
| if asan+1 < etxM: | |
| etxL = [l[asan-1], l[asan], l[asan+1]] | |
| etxCm = {math.floor(math.atan(max(etxL[e:f])))-math.floor(math.cos(min(etxL[e:f]))) for e in range(3) for f in range(e+1, 4)} | |
| if len(etxCm) > 1: | |
| if asan >= etxR: | |
| rtrn.append('|<') | |
| else: | |
| rtrn.append(':<') | |
| else: | |
| etxCm = list(etxCm) | |
| if etxCm[0] == 1: | |
| rtrn.append('>|') | |
| else: | |
| rtrn.append('>:') | |
| else: | |
| return rtrn | |
| else: | |
| raise Exception(f'Cannot assign non-locality encodings, @pList is of a insufficient length({len(l)})') | |
| # ====================================================================================== | |
| def qop_esl_qring(sto: int, s: int, t: int, crp: int, srp: str, srpLen: int) -> list: | |
| rtrn = [] | |
| if t in __MNAV: | |
| # rm = max(min([[(int(math.tan((r*r)+m)), int(math.sqrt(math.pi*m*r))) for r in range(m, min(l)+m)] for m in l])) | |
| pass | |
| else: | |
| eslR = qop_es_range('esl', s, t, crp, srpLen) | |
| #print(f'ESL RANGE: {eslR}') | |
| ri = eslR[0] | |
| nwCrp = eslR[1] | |
| crp = eslR[2] | |
| # *stability for mnav-probables...yet set order is still in determinable | |
| # here even if both crp & nwCrp match the previous ri outward range @qa | |
| if sto == -2 and crp > 0: | |
| crp-=1 | |
| else: | |
| if sto == -1: | |
| if crp+nwCrp > srpLen: | |
| nwCrp-=1 | |
| else: | |
| crp+=1 | |
| rtrn.append(crp+nwCrp) | |
| if crp != nwCrp: | |
| if srp[(crp-1)%srpLen] == srp[(nwCrp+1)%srpLen]: | |
| # crp & nwCrp are toroidal | |
| rtrn.append(qop_esl_toroidal_enc(s, t, ri, crp, nwCrp, srp, srpLen)) | |
| else: | |
| # crp & nwCrp are non-toroidal | |
| crp = int(srp[crp]) | |
| nwCrp = int(srp[nwCrp]) | |
| rtrn.append(qop_esl_nontoroidal_enc(s, t, crp, nwCrp, srpLen)) | |
| else: | |
| # crp & nwCrp are singularity | |
| rtrn.append(qop_esl_singularity_enc(s, t, ri, crp, nwCrp, srp, srpLen)) | |
| return rtrn | |
| # ====================================================================================== | |
| def qop_esl_singularity_enc(s: int, t: int, ri: int, crp: int, nwCrp: int, srp: str, srpLen: int) -> str: | |
| # crp & nwCrp same index @srp, get total remaining indices LtoR & RtoL | |
| # of palindrome @srp, from those multiple determine the nearest limit | |
| # range @ ~srp[crp+?] as a half-loop to be uniform if .../s repeats | |
| # from the normal toroidal or non-toroidal method calls then used | |
| # whereof the raise exception here should be extreme rare | |
| if crp+1 == srpLen: | |
| crpR = 0 | |
| elif crp == 0: | |
| crpR = srpLen-1 | |
| else: | |
| crpR = srpLen-crp-1 | |
| # ...genesis doesn't begin on verse zero :) | |
| if crp < 1: | |
| crp = srpLen-1 | |
| crpR = int(srpLen/2)+1 | |
| if crpR < 1: | |
| crp = int(srpLen/2)-1 | |
| crpR = srpLen-1 | |
| # reset the esl indices range with the ri regress equation | |
| crp = (crp*crpR)%srpLen | |
| eslR = qop_es_range('esl', s, t, crp, srpLen) | |
| #print(f'ESL RANGE: {eslR}') | |
| ri = eslR[0] | |
| nwCrp = eslR[1] | |
| crp = eslR[2] | |
| # do the same toroidal or non-toroidal local esl enc | |
| if crp != nwCrp: | |
| if srp[(crp-1)%srpLen] == srp[(nwCrp+1)%srpLen]: | |
| return qop_esl_toroidal_enc(s, t, ri, crp, nwCrp, srp, srpLen) | |
| else: | |
| crp = int(srp[crp]) | |
| nwCrp = int(srp[nwCrp]) | |
| return qop_esl_nontoroidal_enc(s, t, crp, nwCrp, srpLen) | |
| else: | |
| raise Exception(f'Cannot perform double singularity calculations @ "{srp}"') | |
| # ====================================================================================== | |
| def qop_esl_toroidal_enc(s: int, t: int, ri: int, crp: int, nwCrp: int, srp: str, srpLen: int) -> str: | |
| # get directional bounds array for a toroidal match & set the esl-local encodings | |
| zvn = math.sqrt(crp+nwCrp+srpLen) | |
| ptr = [math.cos(zvn+int(n))*ri//2 for n in srp] | |
| zvn = int(max(ptr)-min(ptr)) | |
| if (zvn >= srpLen and zvn+t > s) or zvn+1 >= crp+nwCrp-zvn: | |
| if s >= t: | |
| if t > int(srp[nwCrp]): | |
| return f'{__MSYM[4]}{__MSYM[13]}{zvn}::' | |
| else: | |
| return f'{__MSYM[2]}{__MSYM[12]}{zvn}::' | |
| else: | |
| if s == t: | |
| return f'{__MSYM[2]}{__MSYM[11]}{__MSYM[0]}{__MSYM[13]}{zvn}::' | |
| else: | |
| return f'{__MSYM[2]}{__MSYM[10]}{__MSYM[0]}{__MSYM[13]}{zvn}::' | |
| elif zvn < 2: | |
| return f'{__MSYM[5]}{__MSYM[20]}{zvn}::' | |
| else: | |
| if s > t and nwCrp-crp > 0: | |
| return f'{__MSYM[4]}{__MSYM[7]}{__MSYM[2]}{__MSYM[18]}{zvn}::' | |
| elif s < t and nwCrp+crp < zvn: | |
| return f'{__MSYM[2]}{__MSYM[6]}{__MSYM[4]}{__MSYM[20]}{zvn}::' | |
| else: | |
| if max(ptr)*s <= s+t+1: | |
| return f'{__MSYM[4]}{__MSYM[18]}{zvn}::' | |
| else: | |
| return f'{__MSYM[4]}{__MSYM[20]}{zvn}::' | |
| # ====================================================================================== | |
| def qop_esl_nontoroidal_enc(s: int, t: int, crp: int, nwCrp: int, srpLen: int) -> str: | |
| # do sqi-ring calculation & set the esl-local encodings | |
| sqi = math.ceil((crp+s)%(crp+(math.sin(t*nwCrp)))+(nwCrp+s)%(nwCrp+(math.atan(t*crp)))) | |
| if sqi < 0: | |
| if s+crp >= t+nwCrp+1: | |
| return f'{__MSYM[5]}{__MSYM[11]}{__MSYM[0]}{__MYSM[20]}' | |
| else: | |
| return f'{__MSYM[5]}{__MSYM[13]}{__MSYM[0]}{__MSYM[18]}' | |
| elif sqi == 0: | |
| if t < s+nwCrp and crp+t+s < nwCrp+t+1: | |
| return f'{__MSYM[8]}{__MSYM[0]}{__MSYM[13]}' | |
| else: | |
| return f'{__MSYM[9]}{__MSYM[0]}{__MSYM[12]}' | |
| elif sqi == 1: | |
| if crp+s <= nwCrp+1 and crp > nwCrp-1: | |
| return f'{__MSYM[17]}{__MSYM[1]}{__MSYM[9]}' | |
| elif nwCrp+t == nwCrp+s and crp < nwCrp: | |
| return f'{__MSYM[17]}{__MSYM[3]}{__MSYM[8]}' | |
| elif crp+t-1 >= nwCrp+t+1: | |
| return f'{__MSYM[19]}{__MSYM[3]}{__MSYM[11]}' | |
| else: | |
| return f'{__MSYM[1]}{__MSYM[20]}{__MSYM[8]}' | |
| elif sqi > nwCrp: | |
| if crp+nwCrp-1 < s+t+nwCrp: | |
| return f'{__MSYM[21]}{sqi}{__MSYM[3]}{__MSYM[16]}' | |
| elif s+crp == t+nwCrp: | |
| return f'{__MSYM[21]}{sqi}{__MSYM[1]}{__MSYM[15]}' | |
| else: | |
| return f'{__MSYM[21]}{sqi}{__MSYM[1]}{__MSYM[20]}' | |
| elif sqi < nwCrp: | |
| if crp+s+t >= crp+nwCrp+1: | |
| return f'{__MSYM[21]}{sqi}{__MSYM[1]}{__MSYM[18]}' | |
| else: | |
| return f'{__MSYM[21]}{sqi}{__MSYM[3]}{__MSYM[6]}' | |
| elif sqi == nwCrp: | |
| if s+crp+1 > t+nwCrp-1 and nwCrp < crp: | |
| return f'{__MSYM[22]}{sqi}{__MSYM[3]}{__MSYM[15]}' | |
| elif s+t+nwCrp == crp+s+1 or nwCrp > crp+s+1: | |
| return f'{__MSYM[10]}{sqi}{__MSYM[3]}{__MSYM[20]}' | |
| else: | |
| return f'{__MSYM[6]}{sqi}{__MSYM[1]}{__MSYM[18]}' | |
| elif sqi >= srpLen: | |
| return f'{__MSYM[14]}{sqi}{__MSYM[5]}{__MSYM[12]}' | |
| # ====================================================================================== | |
| def qop_es_range(dsg: str, s: int, t: int, cpx: int, spx: int): | |
| if dsg == 'esl': | |
| # setting the next esl regress-index(++crp range) @srp | |
| ri = math.floor(math.sqrt(((s+cpx)/s)*t)) | |
| return [ri, ri%spx, cpx%spx] | |
| elif dsg == 'esn': | |
| # setting the next esn regress-index(--clp range to s separation) @slp | |
| ri = math.floor(math.sqrt((((spx+cpx+s)*t)/s))) | |
| # @slp steps secondary @pList, qa calculations balanced to ri @ RtoL | |
| if math.floor((ri/2)-1) >= math.floor(spx/2): | |
| ri-=2 | |
| else: | |
| ri-=1 | |
| return [ri, ri%spx, cpx%spx] | |
| # ====================================================================================== | |
| def qop_get_mrate(l: list) -> list: | |
| h = 1 | |
| c = 0 | |
| rtrn = [] | |
| for t in l: | |
| # return set m-pivot distinctions from pList, from only 3-digit number(s) | |
| # as bonded median values when __MNAV as index occurence n(c**t-1|c**t+1) | |
| # sine(t+h+1) isn't an exact filtered range for all pi*h when more than 3 | |
| # for instance: ht◓⍆h○⍅y?-1 as a limited frequency rotation of y then h | |
| # remains chaim regardless of the dual ⍆Iy outer half-loop in LtoR shift | |
| n = math.ceil((t*((math.pi*h)-(h*math.cos(h-t)+(t*math.sin(t+h+1)))))-(t+h)) | |
| if n > 0: | |
| if len(str(n)) == 3: | |
| rtrn.append(f'{c},{n}') | |
| h = t | |
| c+=1 | |
| return rtrn | |
| # ====================================================================================== | |
| def qop_get_plndrm(l: list, lr: int, i: int) -> str: | |
| # returns the L~[R] or [R]~L palindrome number from pList | |
| rtrn = [str(_)[i] for _ in l] | |
| rtrn = ''.join(rtrn) | |
| if i == 1: | |
| return f'{rtrn[::-1]}{rtrn[1:lr]}' | |
| else: | |
| return f'{rtrn[:lr-1]}{rtrn[::-1]}' | |
| # ====================================================================================== | |
| def qop_get_prenode_keys(l, r, k, t): | |
| ecskR = None | |
| ecskL = None | |
| ecskS = None | |
| ecskV = [] | |
| s = True | |
| cnt = 1 | |
| while 1: | |
| if s: | |
| # <./---> p, sk, df, si | |
| ecskR = [random.randint(3,9),random.randint(11,99),random.randint(11,99),random.randint(0,1)] | |
| ecskL = qop_prenode_key_sim(l, r, k, ecskR[0], ecskR[1], ecskR[2], ecskR[3]) | |
| ecskS = [str(e) for e in ecskR] | |
| s = -1 | |
| # <---/.> sk, df, si, p | |
| ecskR = [str(random.randint(11,99)),str(random.randint(11,99)),str(random.randint(0,1)),str(random.randint(3,9))] | |
| if qop_prenode_key_val(int(''.join(ecskR)), ecskL, l, r, k): | |
| ecskV.append(f'{"".join(ecskS)}-{"".join(ecskR)}') | |
| if len(ecskV) == t: | |
| return ecskV | |
| cnt+=1 | |
| if cnt > 999999: | |
| raise Exception('Prenode key generator exceeded max-loop limit(999,999)') | |
| # ====================================================================================== | |
| def qop_prenode_key_val(key, ee, l, r, k): | |
| key = str(key) | |
| sk = None | |
| df = None | |
| si = None | |
| p = None | |
| if len(key) == 6: | |
| sk = int(f'{key[0]}{key[1]}') | |
| df = int(f'{key[2]}{key[3]}') | |
| si = int(f'{key[5]}') | |
| p = int(f'{4}') | |
| else: | |
| raise Exception(f'Unauthorized prenode-key configuration') | |
| s = 0 | |
| nl = [] | |
| for _ in range(r): | |
| nl.append(l[s:s+k]) | |
| s+=k | |
| dd = [] | |
| for i, n in enumerate(nl): | |
| dn = [qop_prenode_key_dec(ev, i, ov, p, sk, df, si) for ev, ov in zip(ee[i*len(n):(i+1)*len(n)], n)] | |
| dd.extend(dn) | |
| ee = [math.ceil(math.cos(math.tan(_*_+_)+_-_/_)) for _ in ee] | |
| dd = [math.ceil(math.sin(math.cos(_*_)/_-_+_+_)) for _ in dd] | |
| nCntD = 0 | |
| oCntE = 0 | |
| nCntE = 0 | |
| oCntD = 0 | |
| for c in ee: | |
| if c < 1: oCntE+=1 | |
| else: nCntE+=1 | |
| for c in dd: | |
| if c < 1: oCntD+=1 | |
| else: nCntD+=1 | |
| if oCntD == oCntE and nCntE == nCntD: | |
| return True | |
| else: | |
| return False | |
| # ====================================================================================== | |
| def qop_prenode_key_dec(ev, i, on, p, sk, df, si): | |
| p = ev%10 | |
| if si == 0: | |
| return (ev/(math.sin(i*sk)+math.cos(on*df)))-p | |
| else: | |
| return (ev/(math.tan(i*sk+p)+math.cos((on+p)*df)))-p | |
| # ====================================================================================== | |
| def qop_prenode_key_sim(l, r, k, p, sk, df, si): | |
| e = [] | |
| n = [] | |
| s = 0 | |
| for _ in range(r): | |
| n.append(l[s:s+k]) | |
| s+=k | |
| for i, d in enumerate(n): | |
| en = [qop_prenode_key_enc(v, i, p, sk, df, si) for v in d] | |
| e.extend(en) | |
| return e | |
| # ====================================================================================== | |
| def qop_prenode_key_enc(n, i, p, sk, df, si): | |
| if si == 0: | |
| return (n+p)*(math.sin(i*sk)+math.cos(n*df)) | |
| else: | |
| return (n+p)*(math.tan(i*sk+p)+math.cos((n+p)*df)) | |
| # ====================================================================================== | |
| def qop_enc_info(l: list, qop_enc: str, srp: str, slp: str, spx: int): | |
| srch = None | |
| ccnd = None | |
| tst = None | |
| nlt = None | |
| print('\n\nQOP-s24 unsigned encoding:\n') | |
| print(qop_enc) | |
| print('\n\nStats:') | |
| print(' _______________________________________________________________________') | |
| print(f" {spx} palindromes' lengths") | |
| srch = re.findall(r'9', srp) | |
| print(f" {len(srch)} digit 9s in RtoL palindrome") | |
| srch = re.findall(r'9', slp) | |
| print(f" {len(srch)} digit 9s in LtoR palindrome") | |
| print(f' {len(qop_enc)} raw encryption size') | |
| print(' _______________________________________________________________________') | |
| srch = re.findall(__MSYM[21], qop_enc) | |
| print(f' {len(srch)} boundary node(s)') | |
| srch = re.findall(r'\:\:', qop_enc) | |
| tst = len(srch) | |
| print(f' {tst} toroidal separation(s)') | |
| srch = re.findall(__MSYM[20], qop_enc) | |
| print(f' {len(srch)} RtoL closed half-loop lock(s)') | |
| srch = re.findall(__MSYM[18], qop_enc) | |
| print(f' {len(srch)} RtoL open half-loop lock(s)') | |
| srch = re.findall(__MSYM[19], qop_enc) | |
| print(f' {len(srch)} LtoR closed half-loop lock(s)') | |
| srch = re.findall(__MSYM[17], qop_enc) | |
| print(f' {len(srch)} LtoR open half-loop lock(s)') | |
| srch = re.findall(r'\-', qop_enc) | |
| nlt = len(srch) | |
| print(f' {nlt} non-locality anti-shift(s)') | |
| print(' _______________________________________________________________________') | |
| srch = str(max(min([[(int(math.tan((r*r)+m)), int(math.sqrt(math.pi*m*r))) for r in range(m, min(l)+m)] for m in l]))) | |
| print(f' {srch.replace(" ","").replace("(","").replace(")","").replace(",",":")} max/min hl-ratio qop limits') | |
| srch = [[(int(math.sqrt(max(l)*math.atan(x+y))), int(math.sqrt(min(l)*y-x))) for x in range(y)] for y in l] | |
| print(f' {str(max(max(srch))).replace(" ","").replace("(","").replace(")","").replace(",",":")} max qa-ratio node collapse') | |
| srch = [math.sqrt(x*max(l)+(x+min(l))) for x in l] | |
| print(f' {max(srch)} max corner arch') | |
| srch = [x-(math.tan((x+min(l))*math.cos(x))) for x in l] | |
| print(f' {min(srch)} min inverted s/t') | |
| print(' _______________________________________________________________________') | |
| srch = 'No' | |
| if qop_enc.find('□') > -1: srch = 'Yes' | |
| print(f' Has 2D non-locality constant(s): {srch}') | |
| srch = 'No' | |
| if qop_enc.find(__MSYM[23]) > -1: srch = 'Yes' | |
| print(f' Has 4D non-locality constant(s): {srch}') | |
| srch = 'No' | |
| if qop_enc.find(__MSYM[15]) > -1: srch = 'Yes' | |
| print(f' Has clockwise rotational ciphers: {srch}') | |
| srch = 'No' | |
| if qop_enc.find(__MSYM[16]) > -1: srch = 'Yes' | |
| print(f' Has counter-clockwise rotational ciphers: {srch}') | |
| if tst == nlt: | |
| print(f' Encoded sequence stability: invalid, total toroidals match non-locality') | |
| if tst > nlt: | |
| ccnd = tst-nlt | |
| if ccnd < 15: | |
| print(f' Encoded sequence stability: valid, toroidals > non-locality: diff={ccnd}') | |
| else: | |
| print(f' Encoded sequence stability: invalid, toroidals > non-locality: diff={ccnd}') | |
| if tst < nlt: | |
| ccnd = nlt-tst | |
| if ccnd < 15: | |
| print(f' Encoded sequence stability: valid, non-locality > toroidals: diff={ccnd}') | |
| else: | |
| print(f' Encoded sequence stability: invalid, non-locality > toroidals: diff={ccnd}') | |
| if ccnd != None: | |
| if ccnd < 4: | |
| print(f' Encoded sequence quality: very accurate') | |
| elif ccnd > 3 and ccnd < 8: | |
| print(f' Encoded sequence quality: accurate') | |
| elif ccnd > 7 and ccnd < 12: | |
| print(f' Encoded sequence quality: normal') | |
| else: | |
| print(f' Encoded sequence quality: off') | |
| else: | |
| print(f' Encoded sequence quality: N/A') | |
| # ====================================================================================== | |
| # ====================================================================================== | |
| def test(): | |
| # Occuring float returns in pList will be pivot control to any palindrome sectional | |
| # ***** Division by zero error ***** | |
| # pList = [10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37] | |
| # ***** No division by zero error ***** | |
| # pList = [37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10] | |
| # ***** Does not encode well with many zeros or @pList's length being greater than 49. Avoiding any use of zeros is ideal. ***** | |
| # ***** QOP-s24 is a versatile rotational/anti-rotational half-loops mirroring(menorah) palindrome encoder, @pList list will be those, RtoL & LtoR ***** | |
| pList = [55,23,99,86,35,98,23,12,11,45,12,99,32,99,17,93,45,18,99,14,76,99,11,73,65,98,23,47,45,76,13,24,18,72,33,19,55,42,49,28,39,24,82,95,45,71,63,55,11] | |
| qop_montage(pList, qop_angular(pList), len(pList)*256) | |
| test() | |
| # ====================================================================================== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment