autocheck of ssk.test ===================== In[1]:= (* SORTING AND SKELETALIZING *) In[2]:= (* INFRA-STRUCTURE *) In[3]:= criterialThrough[a][s] === a[s] Out[3]= True In[4]:= criterialThrough[a && b][s] === (a[s] && b[s]) Out[4]= True In[5]:= criterialThrough[a && b || c][s] === (a[s] && b[s] || c[s]) Out[5]= True In[6]:= criterialThrough[Not[c]][s] === (!c[s]) Out[6]= True In[7]:= partByCriteria[containing[x]][{x^2, y^2, log[x], z, x y}] === {{x^2, log[x], x*y}, {y^2, z}} Out[7]= True In[8]:= Clear[t, x, f, g] In[9]:= t = Array[x, 20]; In[10]:= applyAtAndAroundPositions[{3, 7, 8, 12, -5, -1}][f, g][t] === {g[x[1], x[2]], f[x[3]], g[x[4], x[5], x[6]], f[x[7]], f[x[8]], g[x[9], x[10], x[11]], f[x[12]], g[x[13], x[14], x[15]], f[x[16]], g[x[17], x[18], x[19]], f[x[20]]} Out[10]= True In[11]:= Clear[t, a, b, c, d, e] In[12]:= t = {a, b, c, d, e}; In[13]:= (t // partInTwo[1]) === {{a}, {b, c, d, e}} Out[13]= True In[14]:= (t // partInTwo[{1, 3}]) === {{a, c}, {b, d, e}} Out[14]= True In[15]:= (t // partInTwo[containingAny[b, e]]) === {{b, e}, {a, c, d}} Out[15]= True In[16]:= ({a, b, c, d, e} // partByPresence[d,a,c]) === {{d}, {a}, {c}, {b, e}} Out[16]= True In[17]:= (* SORTING *) In[18]:= (x y // sortByPresence[y]) === HoldForm[y x] Out[18]= True In[19]:= (y // sortByPresence[y]) === y Out[19]= True In[20]:= (x // sortByPresence[y]) === x Out[20]= True In[21]:= ss = f[a] f[b] f[c]; In[22]:= (ss // sortByCriteria[notContaining[a]]) === (f[b] f[c] f[a] // HoldForm) Out[22]= True In[23]:= ({a, b, c, d, e} // partByPresence[d,a,c]) === {{d}, {a}, {c}, {b, e}} Out[23]= True In[24]:= ({a, b, c, d} // sortByCriteria[containing[c], notContaining[b]]) === {c, a, d, b} Out[24]= True In[25]:= (f[a]f[b]f[c]f[d]// sortByCriteria[containing[c], notContaining[b]]) === (f[c] f[a] f[d] f[b] // HoldForm) Out[25]= True In[26]:= (3 + x - y/2 // sortByAbsence[x]) === HoldForm[Plus[3, Times[Rational[-1, 2], y], x]] Out[26]= True In[27]:= (3 - x y + z // sortByAbsence[x]) === HoldForm[Plus[3, z, Times[-1, x, y]]] Out[27]= True In[28]:= eqn[pek, 5] = D$[r1, 2][psi] + (2/r1) D$[r1][psi] + D$[r2, 2][psi] + (2/r2) D$[r2][psi] + 2 D$[r12, 2][psi] + (4/r12) D$[r12][psi] + ((r1^2 - r2^2 + r12^2)/(r1 r12)) D$[r1, r12][psi] + ((r2^2 - r1^2 + r12^2)/(r2 r12)) D$[r2, r12][psi] + (2(Eig + Z/r1 + Z/r2 - 1/r12)) psi == 0; In[29]:= format[pek, 5] = toTheLhs[ toEach[Times][ toTheDenominator[sortByAbsence[r12]]], toEach[r12^2 + _][sortByAbsence[r12, -_]], toThe[Eig + _][sortByAbsence[r12]], toThe[psi _][sortByAbsence[psi]], toTheCoefficientOfEach[D$][Apply[HoldForm, {#}]&], sortByPresence[D$[r1, 2], D$[r1], D$[r2, 2], D$[r2], D$[r12, 2], D$[___, r12] ]]; In[30]:= (eqn[pek, 5] // format[pek, 5]) === (Equal[HoldForm[Plus[D$[r1, 2][psi], Times[HoldForm[Times[2, Power[r1, -1]]], D$[r1][psi]], D$[r2, 2][psi], Times[HoldForm[Times[2, Power[r2, -1]]], D$[r2][psi]], Times[HoldForm[2], D$[r12, 2][psi]], Times[HoldForm[Times[4, Power[r12, -1]]], D$[r12][psi]], Times[HoldForm[Times[Power[HoldForm[Times[r1, r12]], -1], HoldForm[Plus[Power[r1, 2], Times[-1, Power[r2, 2]], Power[r12, 2]]]]], D$[r1, r12][psi]], Times[HoldForm[Times[Power[HoldForm[Times[r2, r12]], -1], HoldForm[Plus[Power[r2, 2], Times[-1, Power[r1, 2]], Power[r12, 2]]]]], D$[r2, r12][psi]], HoldForm[Times[2, HoldForm[Plus[Eig, Times[Power[r1, -1], Z], Times[Power[r2, -1], Z], Times[-1, Power[r12, -1]]]], psi]]]], 0]) Out[30]= True In[31]:= t = Array[x, 20]; In[32]:= skeletalizer["term"][1,2,3,4,5] === "<< 5 terms >>" Out[32]= True In[33]:= (t // showElements[{3, 7}]) === {"<< 2 elements >>", x[3], "<< 3 elements >>", x[7], "<< 13 elements >>"} Out[33]= True In[34]:= Clear[t] In[35]:= (* ============================================================ *) In[36]:= (* *) In[37]:= opc = Identity; In[38]:= {Length[checkList], Union[checkList], Plus @@ checkList} Out[38]= {36, {Null, True}, 14*Null + 22*True} In[39]:= Complement[Range[Length[checkList]], Position[checkList, #, 1]& /@ {True, Null, shown} // Flatten] Out[39]= {} In[40]:= localList[localName] = checkList;