# Functions introduction

Set functions are used to inspect and manipulate sets of domains.

Some functions return new sets, others return Boolean values. For example, the `CLONE` function returns a new set that is an exact copy of an existing set:

``````var copyOfAll;

copyOfAll = CLONE(ALL);
``````

Meanwhile, the `EMPTY` function checks if a set is empty, returning a Boolean value.

``````var copyOfAll;

copyOfAll = CLONE(ALL);

if (EMPTY(copyOfAll)) {
...
}
``````

Set functions can be used:

• To give a value to set variables.
• As arguments of other functions.
• In complex expressions.

The available functions are listed in the following table and are described in the next pages of this section.

Function Use
`CLAN` Get domains from the project's taxonomy
`CLEAN` Filter domains based on their score
`CLONE` Copy a set
`DIFFERENCE` Subtract a set from another
`DIMENSIONS` Check the size of a set
`EMPTY` Check if a set is empty
`EXIST` Check if a set contains a domain
`EXTRACT` Check if a set contains domains in a list
`EXTRACT2` Get a portion of a set based on position
`FAMILY` Get a portion of a set based on project's taxonomy
`FILTER` Get a portion of a set based on relative ranking
`FIRST` Get the top ranking domain
`INSERT` Add domains to a set
`INTERSECTION` Get the domains that two sets have in common
`MULTIPLY` Change the score of domains
`RATIO` Compare the score of two domains or two sets
`RATIO2` Compare the score of a domain or set with a fraction of the score of another domain/set
`REMOVE` Remove a domain from a set
`SCORED` Get a domain based on its ranking
`SECOND` Return the domain with the second highest score
`SET` Create a new set from scratch
`THRESHOLD` Filter set domains based on a comparison with the score of a given domain
`THRESHOLD2` Filter set domains based on a comparison with a fraction of the score of a given domain
`TRANSFORM` Transfer scores and rule information among domains
`UNION` Add a set to another