autocheck of pred.test ====================== In[1]:= (* PREDICATES FOR TARGETING FUNCTIONS *) In[2]:= Clear[x, y] In[3]:= {ValueQ[x], actually[ValueQ, x], valueQ[x]} === {False, Null, Null} Out[3]= True In[4]:= x = 3; In[5]:= {ValueQ[x], actually[ValueQ, x], valueQ[x]} === {True, True, True} Out[5]= True In[6]:= x =. In[7]:= Map[{#[[1]][#[[2]]], actually[#[[1]] ,#[[2]]]}&, {{IntegerQ, 3}, {IntegerQ, 3.5}, {ValueQ, x}}] === {{True, True}, {False, Null}, {True, True}} Out[7]= True In[8]:= {ValueQ[x], actually[ValueQ, x]} === {False, Null} Out[8]= True In[9]:= testList = {0, 2, 3, 3.5, 1/2, -5, x, x+y}; In[10]:= Map[integerQ, testList] === {True, True, True, False, False, True, Null, Null} Out[10]= True In[11]:= Map[evenQ, testList] === {True, True, False, False, False, False, Null, Null} Out[11]= True In[12]:= Map[oddQ, testList] === {False, False, True, False, False, True, Null, Null} Out[12]= True In[13]:= Map[notNumberQ, {1, 1/2, x, f[1], x+y}] === {False, False, True, True, True} Out[13]= True In[14]:= Map[containing[x], {x, x^2, f[x], f[x][y], x[1], y}] === {True, True, True, True, True, False} Out[14]= True In[15]:= Map[containing[1+x], {x, 1+x, f[1+x], 1+a+x, 1+x+y}] === {False, True, True, False, False} Out[15]= True In[16]:= Map[containing[1 + x_], {x, 1+z, f[1+u+v], y}] === {False, True, True, False} Out[16]= True In[17]:= Map[containing[_^_], {x, f[x]^2, z^n, 1/z}] === {False, True, True, True} Out[17]= True In[18]:= Map[containing[x^_.], {1, x, x^n, 1/x, y}] === {False, True, True, True, False} Out[18]= True In[19]:= Map[containing[f_[x]], {x, a[x], a[y], b[x], a[b[x]], a[x][y], a[y][x]}] === {False, True, False, True, True, True, True} Out[19]= True In[20]:= Map[containingAny[x, y], {x, y, x y, f[x], f[y], x[y], z}] === {True, True, True, True, True, True, False} Out[20]= True In[21]:= Map[containingAny[x_^_, f[x_]], {x, 1+z, (1+z)^2, f[1+u+v]}] === {False, False, True, True} Out[21]= True In[22]:= Map[containingAll[x, y], {f[a, x], f[x, y], f[y, b]}] === {False, True, False} Out[22]= True In[23]:= Map[matching[x+y], {x, x+y, f[x+y]}] === {False, True, False} Out[23]= True In[24]:= Map[matching[f_[a___][b_]], {x, f[x], g[][1], a[x, y][c]}] === {False, False, True, True} Out[24]= True In[25]:= Map[headedBy[f], {f[x], f[x][y], f[g[x]], g[f]}] === {True, False, True, False} Out[25]= True In[26]:= Map[headedBy[f|g], {f[x], g[x], a[x]}] === {True, True, False} Out[26]= True In[27]:= Map[headedBy[f,g], {f[x], g[x], a[x]}] === {True, True, False} Out[27]= True In[28]:= Map[notContaining[x], {x, x^2, f[x], f[x][y], x[1], y}] === Map[Not, Map[containing[x], {x, x^2, f[x], f[x][y], x[1], y}]] Out[28]= True In[29]:= Map[notContaining[1+x], {x, 1+x, f[1+x], 1+a+x, 1+x+y}] === Map[Not, Map[containing[1+x], {x, 1+x, f[1+x], 1+a+x, 1+x+y}]] Out[29]= True In[30]:= Map[notContaining[1 + x_], {x, 1+z, f[1+u+v], y}] === Map[Not, Map[containing[1 + x_], {x, 1+z, f[1+u+v], y}]] Out[30]= True In[31]:= Map[notContaining[_^_], {x, f[x]^2, z^n, 1/z}] === Map[Not, Map[containing[_^_], {x, f[x]^2, z^n, 1/z}]] Out[31]= True In[32]:= Map[notContaining[x^_.], {1, x, x^n, 1/x, y}] === Map[Not, Map[containing[x^_.], {1, x, x^n, 1/x, y}]] Out[32]= True In[33]:= Map[notContaining[f_[x]], {x, a[x], a[y], b[x], a[b[x]], a[x][y], a[y][x]}] === Map[Not, Map[containing[f_[x]], {x, a[x], a[y], b[x], a[b[x]], a[x][y], a[y][x]}]] Out[33]= True In[34]:= Map[notContainingAny[x, y], {x, y, x y, f[x], f[y], x[y], z}] === Map[Not, Map[containingAny[x, y], {x, y, x y, f[x], f[y], x[y], z}]] Out[34]= True In[35]:= Map[notContainingAny[x_^_, f[x_]], {x, 1+z, (1+z)^2, f[1+u+v]}] === Map[Not, Map[containingAny[x_^_, f[x_]], {x, 1+z, (1+z)^2, f[1+u+v]}]] Out[35]= True In[36]:= Map[notContainingAll[x, y], {f[a, x], f[x, y], f[y, b]}] === Map[Not, Map[containingAll[x, y], {f[a, x], f[x, y], f[y, b]}]] Out[36]= True In[37]:= Map[notMatching[x+y], {x, x+y, f[x+y]}] === Map[Not, Map[matching[x+y], {x, x+y, f[x+y]}]] Out[37]= True In[38]:= Map[notMatching[f_[a___][b_]], {x, f[x], g[][1], a[x, y][c]}] === Map[Not, Map[matching[f_[a___][b_]], {x, f[x], g[][1], a[x, y][c]}]] Out[38]= True In[39]:= Map[notHeadedBy[f], {f[x], f[x][y], f[g[x]], g[f]}] === Map[Not, Map[headedBy[f], {f[x], f[x][y], f[g[x]], g[f]}]] Out[39]= True In[40]:= Map[notHeadedBy[f|g], {f[x], g[x], a[x]}] === Map[Not, Map[headedBy[f|g], {f[x], g[x], a[x]}]] Out[40]= True In[41]:= Map[nonNullListQ, {{}, {,}, {x}, {x, y}, {,x,}}] === {False, True, True, True, True} Out[41]= True In[42]:= Map[deleteNullElements, {{}, {,}, {x}, {x, y}, {,x,}}] === {{}, {}, {x}, {x, y}, {x}} Out[42]= True In[43]:= Map[isOrderless, {Plus, Times, List, f}] === {True, True, False, False} Out[43]= True In[44]:= ({containing, contain, contains} // Union) === {containing} Out[44]= True In[45]:= ({containingAny, containAny, containsAny} // Union) === {containingAny} Out[45]= True In[46]:= ({containingAll, containAll, containsAll} // Union) === {containingAll} Out[46]= True In[47]:= ({headedBy, areHeadedBy, isHeadedBy} // Union) === {headedBy} Out[47]= True In[48]:= ({matching, match, matches} // Union) === {matching} Out[48]= True In[49]:= ({notContaining, doesNotContain, doNotContain} // Union) === {notContaining} Out[49]= True In[50]:= ({notContainingAny, doesNotContainAny, doNotContainAny} // Union) === {notContainingAny} Out[50]= True In[51]:= ({notContainingAll, doesNotContainAll, doNotContainAll} // Union) === {notContainingAll} Out[51]= True In[52]:= ({notHeadedBy, isNotHeadedBy, areNotHeadedBy} // Union) === {notHeadedBy} Out[52]= True In[53]:= ({notMatching, doNotMatch, doesNotMatch} // Union)" ==={notMatching} 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;