autocheck of dist.test ====================== In[1]:= (* DISTRIBUTION *) In[2]:= (x // distribution[1][][3]) === x Out[2]= True In[3]:= (a (u+v+w) // distribution[][][]) === a u + a v + a w Out[3]= True In[4]:= (a b (u+v+w) c d // distribution[][][]) === a b c d u + a b c d v + a b c d w Out[4]= True In[5]:= (a b (u+v+w)(x+y) // distribution[][][]) === a b u (x + y) + a b v (x + y) + a b w (x + y) Out[5]= True In[6]:= (a b (u+v+w)(x+y) // distribution[][][-1]) === a b x (u + v + w) + a b y (u + v + w) Out[6]= True In[7]:= (a b (u+v+w) // distribution[1][][]) === b (a u + a v + a w) Out[7]= True In[8]:= (a b (u+v+w) // distribution[1][][]) === b (a u + a v + a w) Out[8]= True In[9]:= (a b (u+v+w) // distribution[2][][]) === a (b u + b v + b w) Out[9]= True In[10]:= (a b (u+v+w) // distribution[-3][][]) === b (a u + a v + a w) Out[10]= True In[11]:= (a b (u+v+w) // distribution[-2][][]) === a (b u + b v + b w) Out[11]= True In[12]:= (a b (u+v+w) // distribution[2][1][]) === a (b u + b (v + w)) Out[12]= True In[13]:= (a b c d (e+f+g+h)// distribution[containingAny[a, c]][ containingAny[f, h]][containing[f]]) === b d (a c f + a c (e + g) + a c h) Out[13]= True In[14]:= (a b ( u + v + w) // distribution[b][v][]) === a (b v + b (u + w)) Out[14]= True In[15]:= Clear[s] In[16]:= s = x1 (x21 + x22) (x31 + x32 + x33 + x34) * (x41 + x45) (x51 + x52 + x53 + x54); In[17]:= (s // distribution[1][2][3]) === (x21 + x22)*(x1*x32 + x1*(x31 + x33 + x34))*(x41 + x45)* (x51 + x52 + x53 + x54) Out[17]= True In[18]:= (s // distribution[2,3][1,3][5]) === x1*(x41 + x45)*((x21 + x22)*(x31 + x32 + x33 + x34)*x51 + (x21 + x22)*(x31 + x32 + x33 + x34)*x53 + (x21 + x22)*(x31 + x32 + x33 + x34)*(x52 + x54)) Out[18]= True In[19]:= (s // distribution[1][][3]) === (x21 + x22)*(x1*x31 + x1*x32 + x1*x33 + x1*x34)*(x41 + x45)* (x51 + x52 + x53 + x54) Out[19]= True In[20]:= (s // leftDistribution) === (x1 x21 + x1 x22) (x31 + x32 + x33 + x34) (x41 + x45) * (x51 + x52 + x53 + x54) Out[20]= True In[21]:= (s // rightDistribution) === x1 (x21 + x22) (x31 + x32 + x33 + x34) * (x41 (x51 + x52 + x53 + x54) + x45 (x51 + x52 + x53 + x54)) Out[21]= True In[22]:= Clear[s] In[23]:= (a (x1 + x2 + x3) // leftDistribution) === a x1 + a x2 + a x3 Out[23]= True In[24]:= (a b (x1 + x2 + x3) // leftDistribution) === b (a x1 + a x2 + a x3) Out[24]= True In[25]:= (a (x1 + x2 + x3)(y1 + y2) // leftDistribution) === (a x1 + a x2 + a x3)(y1 + y2) Out[25]= True In[26]:= (a b (x1 + x2 + x3)(y1 + y2) // leftDistribution) === b (a x1 + a x2 + a x3)(y1 + y2) Out[26]= True In[27]:= ((a1 + a2) (x1 + x2 + x3) // leftDistribution) === (a1 + a2) x1 + (a1 + a2) x2 + (a1 + a2) x3 Out[27]= True In[28]:= (b (a1 + a2) (x1 + x2 + x3) // leftDistribution) === b ((a1 + a2) x1 + (a1 + a2) x2 + (a1 + a2) x3) Out[28]= True In[29]:= ((a1 + a2) (x1 + x2 + x3)(y1 + y2) // leftDistribution) === ((a1 + a2) x1 + (a1 + a2) x2 + (a1 + a2) x3)(y1 + y2) Out[29]= True In[30]:= ((a1 + a2) b (x1 + x2 + x3)(y1 + y2) // leftDistribution) === b ((a1 + a2) x1 + (a1 + a2) x2 + (a1 + a2) x3)(y1 + y2) Out[30]= True In[31]:= (f[a] (g[x1] + g[x2] + g[x3]) // leftDistribution) === f[a] g[x1] + f[a] g[x2] + f[a] g[x3] Out[31]= True In[32]:= (a f[x1+ x2] // leftDistribution) === a f[x1+ x2] Out[32]= True In[33]:= (a f[x1+ x2](f[y1] + f[y2]) // leftDistribution) === f[x1+ x2] (a f[y1] + a f[y2]) Out[33]= True In[34]:= ((x1 + x2 + x3) y // rightDistribution) === x1 y + x2 y + x3 y Out[34]= True In[35]:= (a (x1 + x2 + x3) y z // rightDistribution) === a y (x1 z + x2 z + x3 z) Out[35]= True In[36]:= (a (x1 + x2 + x3)(y1 + y2) // rightDistribution) === a(x1 (y1 + y2) + x2 (y1 + y2) + x3 (y1 + y2)) Out[36]= True In[37]:= (a b (x1 + x2 + x3)(y1 + y2) // rightDistribution) === a b(x1 (y1 + y2) + x2 (y1 + y2) + x3 (y1 + y2)) Out[37]= True In[38]:= ((a1 + a2) (b1 + b2) (c1 + c2) // rightDistribution) === (a1 + a2) (b1 (c1 + c2) + b2 (c1 + c2)) Out[38]= True In[39]:= (f[a] (x1 + x2 + x3) // rightDistribution) === f[a] x1 + f[a] x2 + f[a] x3 Out[39]= True In[40]:= (a f[x1+ x2] // rightDistribution) === a f[x1+ x2] Out[40]= True In[41]:= (a f[x1+ x2](g[y1] + g[y2]) // rightDistribution) === a f[x1+ x2](g[y1] + g[y2]) Out[41]= True In[42]:= (a (b1 + b2) f[x1 + x2] (g[1] + g[2]) // rightDistribution) === a (b1 (g[1] + g[2]) + b2 (g[1] + g[2]) ) f[x1 + x2] Out[42]= True In[43]:= (a (b1 + b2) (c1 + c2) f[d1 + d2] z[w] // rightDistribution) === a (b1 + b2) (c1 z[w] + c2 z[w]) f[d1 + d2] Out[43]= True In[44]:= ((1 +3x)/((1-x)(2+3x)) // topDistribution) === 1/((1 - x)*(2 + 3*x)) + (3*x)/((1 - x)*(2 + 3*x)) Out[44]= True In[45]:= ((1 +3x)/((1-x)(2+3x)) // Apart) === -4/(5*(-1 + x)) - 3/(5*(2 + 3*x)) Out[45]= True In[46]:= ((1 +3x)/((1-x)(2+3x)) // Apart // Together) === ( -1 - 3*x)/((-1 + x)*(2 + 3*x)) Out[46]= True In[47]:= ((1 +3x + f[z])/((1-x)(2+3x)) // topDistribution) === 1/((1 - x)*(2 + 3*x)) + (3*x)/((1 - x)*(2 + 3*x)) + f[z]/((1 - x)*(2 + 3*x)) Out[47]= True In[48]:= s = x1 (x21 + x22) (x31 + x32 + x33 + x34) * (x41 + x45) (x51 + x52 + x53 + x54); In[49]:= (s // expandLeft) === x1*x21*(x31 + x32 + x33 + x34)*(x41 + x45)* (x51 + x52 + x53 + x54) + x1*x22*(x31 + x32 + x33 + x34)*(x41 + x45)* (x51 + x52 + x53 + x54) Out[49]= True In[50]:= (s // expandLeft) === ((s // collectivelyToFactors[{1,3,4,5}][hold] // rightDistribution) /. hold -> Identity) Out[50]= True In[51]:= ((a+b) (c+d) x y // expandLeft) === a (c + d) x y + b (c + d) x y Out[51]= True In[52]:= (s // expandRight) === x1*(x21 + x22)*(x31 + x32 + x33 + x34)*(x41 + x45)*x51 + x1*(x21 + x22)*(x31 + x32 + x33 + x34)*(x41 + x45)*x52 + x1*(x21 + x22)*(x31 + x32 + x33 + x34)*(x41 + x45)*x53 + x1*(x21 + x22)*(x31 + x32 + x33 + x34)*(x41 + x45)*x54 Out[52]= True In[53]:= ((a+b) (c+d) x y // expandRight) === (a + b) c x y + (a + b) d x y Out[53]= True In[54]:= (* ======================================================= *) In[55]:= (* *) In[56]:= opc = Identity; In[57]:= {Length[checkList], Union[checkList], Plus @@ checkList} Out[57]= {55, {Null, True}, 7*Null + 48*True} In[58]:= Complement[Range[Length[checkList]], Position[checkList, #, 1]& /@ {True, Null, shown} // Flatten] Out[58]= {} In[59]:= localList[localName] = checkList;