File: union.doc

package info (click to toggle)
hol-light 20230128-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 45,636 kB
  • sloc: ml: 688,681; cpp: 439; makefile: 302; lisp: 286; java: 279; sh: 251; yacc: 108; perl: 78; ansic: 57; sed: 39; python: 13
file content (30 lines) | stat: -rw-r--r-- 570 bytes parent folder | download | duplicates (3)
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
\DOC union

\TYPE {union : 'a list -> 'a list -> 'a list}

\SYNOPSIS
Computes the union of two `sets'.

\KEYWORDS
list, set.

\DESCRIBE
{union l1 l2} returns a list consisting of the elements of {l1} not already in
{l2} concatenated with {l2}. If {l1} and {l2} are initially free from
duplicates, this gives a set-theoretic union operation.

\FAILURE
Never fails.

\EXAMPLE
{
  # union [1;2;3] [1;5;4;3];;
  val it : int list = [2; 1; 5; 4; 3]
  # union [1;1;1] [1;2;3;2];;
  val it : int list = [1; 2; 3; 2]
}

\SEEALSO
setify, set_equal, intersect, subtract.

\ENDDOC