File: forall2.doc

package info (click to toggle)
hol-light 20170109-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 36,568 kB
  • ctags: 8,549
  • sloc: ml: 540,018; cpp: 439; lisp: 286; java: 279; makefile: 262; sh: 229; yacc: 108; perl: 78; ansic: 57; sed: 39
file content (33 lines) | stat: -rw-r--r-- 727 bytes parent folder | download | duplicates (4)
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