NoneTrue

NoneTrue[{e1,e2,},test]

yields True if test[ei] is False for all of the ei.

NoneTrue[expr,test,level]

tests parts of expr at level level.

NoneTrue[test]

represents an operator form of NoneTrue that can be applied to an expression.

Details

  • NoneTrue[list,test] and NoneTrue[expr,test,level] only evaluate as many test[ei] as are necessary to determine the result.
  • NoneTrue[list,test] is equivalent to NoneTrue[list,test,1].
  • NoneTrue[test][list] is equivalent to NoneTrue[list,test].

Examples

open allclose all

Basic Examples  (4)

Check if no element of a list satisfies a condition:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Check if no element of a matrix satisfies a condition:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Check if no value of an association satisfies a condition:

In[1]:=
Click for copyable input
Out[1]=

A symbolic result may be returned:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Even when the condition applied to some elements is symbolic, a definitive result may be deduced:

In[3]:=
Click for copyable input
Out[3]=

TrueQ may be used to avoid getting a symbolic result:

In[4]:=
Click for copyable input
Out[4]=

Scope  (3)

Generalizations & Extensions  (1)

Properties & Relations  (4)

Possible Issues  (1)

See Also

AnyTrue  AllTrue  Nor  Not  TrueQ  FreeQ

Introduced in 2014
(10.0)
| Updated in 2015
(10.1)