Also found in: Dictionary, Thesaurus, Medical, Legal, Acronyms, Wikipedia.


(computer science)
A horizontal row of data items in a relational data structure; corresponds to a record or segment in other types of data structures.




In functional languages, a data object containing two or more components. Also known as a product type or pair, triple, quad, etc. Tuples of different sizes have different types, in contrast to lists where the type is independent of the length. The components of a tuple may be of different types whereas all elements of a list have the same type. Examples of tuples in Haskell notation are (1,2), ("Tuple",True), (w,(x,y),z). The degenerate tuple with zero components, written (), is known as the unit type since it has only one possible value which is also written ().

The implementation of tuples in a language may be either "lifted" or not. If tuples are lifted then (bottom,bottom) /= bottom and the evaluation of a tuple may fail to terminate. E.g. in Haskell:

f (x,y) = 1 --> f bottom = bottom f (bottom,bottom) = 1

With lifted tuples, a tuple pattern is refutable. Thus in Haskell, pattern matching on tuples is the same as pattern matching on types with multiple constructors (algebraic data types) - the expression being matched is evaluated as far as the top level constructor, even though, in the case of tuples, there is only one possible constructor for a given type.

If tuples are unlifted then (bottom, bottom) = bottom and evaluation of a tuple will never fail to terminate though any of the components may. E.g. in Miranda:

f (x,y) = 1 --> f bottom = 1 f (bottom,bottom) = 1

Thus in Miranda, any object whose type is compatible with a tuple pattern is assumed to match at the top level without evaluation - it is an irrefutable pattern. This also applies to user defined data types with only one constructor. In Haskell, patterns can be made irrefutable by adding a "~" as in

f ~(x,y) = 1.

If tuple constructor functions were strict in all their arguments then (bottom,x) = (x,bottom) = bottom for any x so matching a refutable pattern would fail to terminate if any component was bottom.


(1) In a relational database, a tuple is one record (one row). See record and relational database.

(2) A set of values passed from one programming language to another application program or to a system program such as the operating system. Typically separated by commas, the values may be parameters for a function call or a set of data values for a database. See function.
References in periodicals archive ?
We also use the easily verified fact that tuples of ribbons in TR([mu]/[rho]) have diameter less than or equal to three if and only if [mu]/[rho] does not contain (3,3) or (4) as a subdiagram.
If there exists a tuple <<M, R, h>, f'> in the F-list with f [not equal to] f', B reports failure and terminates.
Times are given for when the first, tenth, hundredth and so on tuple was received.
In step 2), the schema of outlier table S is (T, A, V M), where T is a tuple ID on an ant traversed path, A is the target attribute name, V is the target attribute value of the tuple, and M is the O-measure of A for the tuple.
By virtual join, tuple ids are propagated from the target relation to the non-target relations.
Cov[[LAMBDA], v] is a boolean array indexed by the column tuple [LAMBDA] and value tuple v and entries indicate whether the t-tuple ([LAMBDA], v) is covered.
One way of relating individual fragments of a tuple is by duplicating primary key in all the fragments or by using tuple-identifiers.
These are first rewritten in tuple relational calculus using both kinds of quantification and using implication with universal quantifiers.
The WHERE clause retains only those tuples of bindings in which the author is Crockett Johnson, and the RETURN clause uses the resulting values of $b to generate a list of books.
i] (time, tag_id, location), where location indicates the position of the tag, with uncertainty which can usually be represented by a tuple [(x, y, z).
Many methods for color matching have been proposed, including color histograms, color moments, color constants, color signatures, color tuple histograms.
They are all based on the mathematical concept of relation where a relation is defined as a set of tuples with a fixed length, with each tuple being built from given sets.