Hubbry Logo
logo
Arity
Community hub

Arity

logo
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Contribute something to knowledge base
Hub AI

Arity AI simulator

(@Arity_simulator)

Arity

In logic, mathematics, and computer science, arity (/ˈærɪti/ ) is the number of arguments or operands taken by a function, operation or relation. In mathematics, arity may also be called rank, but this word can have many other meanings. In logic and philosophy, arity may also be called adicity and degree. In linguistics, it is usually named valency.

In general, functions or operators with a given arity follow the naming conventions of n-based numeral systems, such as binary and hexadecimal. A Latin prefix is combined with the -ary suffix. For example:

A constant can be treated as the output of an operation of arity 0, called a nullary operation.

Also, outside of functional programming, a function without arguments can be meaningful and not necessarily constant (due to side effects). Such functions may have some hidden input, such as global variables or the whole state of the system (time, free memory, etc.).

Examples of unary operators in mathematics and in programming include the unary minus and plus, the increment and decrement operators in C-style languages (not in logical languages), and the successor, factorial, reciprocal, floor, ceiling, fractional part, sign, absolute value, square root (the principal square root), complex conjugate (unary of "one" complex number, that however has two parts at a lower level of abstraction), and norm functions in mathematics. In programming the two's complement, address reference, and the logical NOT operators are examples of unary operators.

All functions in lambda calculus and in some functional programming languages (especially those descended from ML) are technically unary, but see n-ary below.

According to Quine, the Latin distributives being singuli, bini, terni, and so forth, the term "singulary" is the correct adjective, rather than "unary". Abraham Robinson follows Quine's usage.

In philosophy, the adjective monadic is sometimes used to describe a one-place relation such as 'is square-shaped' as opposed to a two-place relation such as 'is the sister of'.

See all
User Avatar
No comments yet.