(redirected from Tuples)
Also found in: Dictionary.


(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 ?
Cleaning rules can specify the classification conditions, then according to these conditions, the strategy model could classify each influent RFID data tuples and find its cleaning method, thus to achieve the cleaning strategy with the minimum costs.
The support of a tuple s in S, denoted by sup(s), is the count of the tuples in R that have the same values for attributes [A.
Each relation consists of a set of attributes and stores a large set of tuples.
The scalable data generator produces edge tuples containing the start and end vertex for each edge.
Because a server may not trust clients (they are running on a user workstation and can thus be corrupted), a second step must always be added: every data access request submitted to the server is filtered by SAM through a component checking whether the request is legitimate or not and blurring those attribute values of retrieved tuples which the user is not allowed to see.
One possible way of doing this is by combining concepts from graph theory to build linkages between database tuples based on attribute similarities, and then to explicitly visualize (and query) these linkages within the STC environment.
v - 1} such that there exists a pair of columns (one necessarily the last) not containing all of the v value tuples having x in the last column, add a row to the matrix which has x in the last column and each earlier column has a value such that the 2-tuple composed of this value with x has not been covered, or if there is no such value, has ([theta]).
One of the options to preserve referential integrity is to delete tuples that reference the tuple being deleted; we avoid cascade deletes by setting the foreign keys to null.
L is the function from set of arcs F to the power set over collection of tuples w [unit] ,,, [unit] [w.
The WHERE clause applies a filter to the tuples, retaining only those tuples that satisfy a given search condition.
chemical structures); more precisely, each example is represented as a set of tuples in multiple relations].