1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
\DOC forall2
\TYPE {forall2 : ('a -> 'b -> bool) -> 'a list -> 'b list -> bool}
\SYNOPSIS
Tests if corresponding elements of two lists all satisfy a relation.
\DESCRIBE
{forall p [x1;...;xn] [y1;...;yn]} returns {true} if {(p xi yi)} is true for
all corresponding {xi} and {yi} in the list. Otherwise, or if the lengths of
the lists are different, it returns {false}.
\FAILURE
Never fails.
\EXAMPLE
Here we check whether all elements of the first list are less than the
corresponding element of the second:
{
# forall2 (<) [1;2;3] [2;3;4];;
val it : bool = true
# forall2 (<) [1;2;3;4] [5;4;3;2];;
val it : bool = false
# forall2 (<) [1] [2;3];;
val it : bool = false
}
\SEEALSO
exists, forall.
\ENDDOC
|