Here are explained the concepts behind the aggregate objects in Magma.
Sets, sequences, lists and tuples are the four main types of aggregates, and each has its own specific purpose. Sets are used to collect objects that are elements of some common structure, and the most important operation is to test element membership. Sequences also contain objects of a common structure, but here the emphasis is on the ordering of the objects, and the most important operation is that of accessing (or modifying) elements at given positions. Sets will contain at most one copy of any element, whereas sequences may contain arbitrarily many copies of the same object. Enumerated sets and sequences are of arbitrary but finite length and will store all elements explicitly (with the exception of arithmetic progressions), while formal sets and sequences may be infinite, and use a Boolean function to test element membership. Indexed sets are a hybrid form of sets allowing indexing like sequences. Lists are arbitrary finite collections of objects of any type, and are mainly provided to the user to store assorted data to which access is not critical (note that lists are not available in the current release of Magma). Elements of Cartesian products of structures in Magma will be called tuples; they are of fixed length, and each coefficient must be in the corresponding structure of the defining Cartesian product.