Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 4183461[1X12 [33X[0;0YObjects and Elements[133X[101X23[33X[0;0YAn [13Xobject[113X is anything in [5XGAP[105X that can be assigned to a variable, so nearly4everything in [5XGAP[105X is an object.[133X56[33X[0;0YDifferent objects can be regarded as equal with respect to the equivalence7relation [21X[10X=[110X[121X, in this case we say that the objects describe the same [13Xelement[113X.[133X8910[1X12.1 [33X[0;0YObjects[133X[101X1112[33X[0;0YNearly all things one deals with in [5XGAP[105X are [13Xobjects[113X. For example, an integer13is an object, as is a list of integers, a matrix, a permutation, a function,14a list of functions, a record, a group, a coset or a conjugacy class in a15group.[133X1617[33X[0;0YExamples of things that are not objects are comments which are only lexical18constructs, [9Xwhile[109X loops which are only syntactical constructs, and19expressions, such as [10X1 + 1[110X; but note that the value of an expression, in20this case the integer [10X2[110X, is an object.[133X2122[33X[0;0YObjects can be assigned to variables, and everything that can be assigned to23a variable is an object. Analogously, objects can be used as arguments of24functions, and can be returned by functions.[133X2526[1X12.1-1 IsObject[101X2728[33X[1;0Y[29X[2XIsObject[102X( [3Xobj[103X ) [32X Category[133X2930[33X[0;0Y[2XIsObject[102X returns [9Xtrue[109X if the object [3Xobj[103X is an object. Obviously it can never31return [9Xfalse[109X.[133X3233[33X[0;0YIt can be used as a filter in [2XInstallMethod[102X ([14X78.2-1[114X) when one of the34arguments can be anything.[133X353637[1X12.2 [33X[0;0YElements as equivalence classes[133X[101X3839[33X[0;0YThe equality operation [21X[10X=[110X[121X defines an equivalence relation on all [5XGAP[105X objects.40The equivalence classes are called [13Xelements[113X.[133X4142[33X[0;0YThere are basically three reasons to regard different objects as equal.43Firstly the same information may be stored in different places. Secondly the44same information may be stored in different ways; for example, a polynomial45can be stored sparsely or densely. Thirdly different information may be46equal modulo a mathematical equivalence relation. For example, in a finitely47presented group with the relation [22Xa^2 = 1[122X the different objects [22Xa[122X and [22Xa^3[122X48describe the same element.[133X4950[33X[0;0YAs an example of all three reasons, consider the possibility of storing an51integer in several places of the memory, of representing it as a fraction52with denominator 1, or of representing it as a fraction with any53denominator, and numerator a suitable multiple of the denominator.[133X545556[1X12.3 [33X[0;0YSets[133X[101X5758[33X[0;0YIn [5XGAP[105X there is no category whose definition corresponds to the mathematical59property of being a set, however in the manual we will often refer to an60object as a [13Xset[113X in order to convey the fact that mathematically, we are61thinking of it as a set. In particular, two sets [22XA[122X and [22XB[122X are equal if and62only if, [22Xx ∈ A <=> x ∈ B[122X.[133X6364[33X[0;0YThere are two types of object in [5XGAP[105X which exhibit this kind of behaviour65with respect to equality, namely domains (see Section [14X12.4[114X) and lists whose66elements are strictly sorted see [2XIsSSortedList[102X ([14X21.17-4[114X). In general, [13Xset[113X in67this manual will mean an object of one of these types.[133X6869[33X[0;0YMore precisely: two domains can be compared with [21X{[10X=[110X}[121X, the answer being [9Xtrue[109X70if and only if the sets of elements are equal (regardless of any additional71structure) and; a domain and a list can be compared with [21X[10X=[110X[121X, the answer being72[9Xtrue[109X if and only if the list is equal to the strictly sorted list of73elements of the domain.[133X7475[33X[0;0YA discussion about sorted lists and sets can be found in Section [14X21.19[114X.[133X767778[1X12.4 [33X[0;0YDomains[133X[101X7980[33X[0;0YAn especially important class of objects in [5XGAP[105X are those whose underlying81mathematical abstraction is that of a structured set, for example a group, a82conjugacy class, or a vector space. Such objects are called [13Xdomains[113X. The83equality relation between domains is always equality [13Xas sets[113X, so that two84domains are equal if and only if they contain the same elements.[133X8586[33X[0;0YDomains play a central role in [5XGAP[105X. In a sense, the only reason that [5XGAP[105X87supports objects such as integers and permutations is the wish to form88domains of them and compute the properties of those domains.[133X8990[33X[0;0YDomains are described in Chapter [14X31[114X.[133X919293[1X12.5 [33X[0;0YIdentical Objects[133X[101X9495[33X[0;0YTwo objects that are equal [13Xas objects[113X (that is they actually refer to the96same area of computer memory) and not only w.r.t. the equality relation [21X[10X=[110X[121X97are called [13Xidentical[113X. Identical objects do of course describe the same98element.[133X99100[1X12.5-1 IsIdenticalObj[101X101102[33X[1;0Y[29X[2XIsIdenticalObj[102X( [3Xobj1[103X, [3Xobj2[103X ) [32X function[133X103104[33X[0;0Y[2XIsIdenticalObj[102X tests whether the objects [3Xobj1[103X and [3Xobj2[103X are identical (that105is they are either equal immediate objects or are both stored at the same106location in memory.[133X107108[33X[0;0YIf two copies of a simple constant object (see section [14X12.6[114X) are created, it109is not defined whether [5XGAP[105X will actually store two equal but non-identical110objects, or just a single object. For mutable objects, however, it is111important to know whether two values refer to identical or non-identical112objects, and the documentation of operations that return mutable values113should make clear whether the values returned are new, or may be identical114to values stored elsewhere.[133X115116[4X[32X Example [32X[104X117[4X[25Xgap>[125X [27XIsIdenticalObj( 10^6, 10^6);[127X[104X118[4X[28Xtrue[128X[104X119[4X[25Xgap>[125X [27XIsIdenticalObj( 10^30, 10^30);[127X[104X120[4X[28Xfalse[128X[104X121[4X[25Xgap>[125X [27XIsIdenticalObj( true, true);[127X[104X122[4X[28Xtrue[128X[104X123[4X[32X[104X124125[33X[0;0YGenerally, one may compute with objects but think of the results in terms of126the underlying elements because one is not interested in locations in127memory, data formats or information beyond underlying equivalence relations.128But there are cases where it is important to distinguish the relations129identity and equality. This is best illustrated with an example. (The reader130who is not familiar with lists in [5XGAP[105X, in particular element access and131assignment, is referred to Chapter [14X21[114X.)[133X132133[4X[32X Example [32X[104X134[4X[25Xgap>[125X [27Xl1:= [ 1, 2, 3 ];; l2:= [ 1, 2, 3 ];;[127X[104X135[4X[25Xgap>[125X [27Xl1 = l2;[127X[104X136[4X[28Xtrue[128X[104X137[4X[25Xgap>[125X [27XIsIdenticalObj( l1, l2 );[127X[104X138[4X[28Xfalse[128X[104X139[4X[25Xgap>[125X [27Xl1[3]:= 4;; l1; l2;[127X[104X140[4X[28X[ 1, 2, 4 ][128X[104X141[4X[28X[ 1, 2, 3 ][128X[104X142[4X[25Xgap>[125X [27Xl1 = l2;[127X[104X143[4X[28Xfalse[128X[104X144[4X[32X[104X145146[33X[0;0YThe two lists [10Xl1[110X and [10Xl2[110X are equal but not identical. Thus a change in [10Xl1[110X147does not affect [10Xl2[110X.[133X148149[4X[32X Example [32X[104X150[4X[25Xgap>[125X [27Xl1:= [ 1, 2, 3 ];; l2:= l1;;[127X[104X151[4X[25Xgap>[125X [27Xl1 = l2;[127X[104X152[4X[28Xtrue[128X[104X153[4X[25Xgap>[125X [27XIsIdenticalObj( l1, l2 );[127X[104X154[4X[28Xtrue[128X[104X155[4X[25Xgap>[125X [27Xl1[3]:= 4;; l1; l2;[127X[104X156[4X[28X[ 1, 2, 4 ][128X[104X157[4X[28X[ 1, 2, 4 ][128X[104X158[4X[25Xgap>[125X [27Xl1 = l2;[127X[104X159[4X[28Xtrue[128X[104X160[4X[32X[104X161162[33X[0;0YHere, [10Xl1[110X and [10Xl2[110X are identical objects, so changing [10Xl1[110X means a change to [10Xl2[110X163as well.[133X164165[1X12.5-2 IsNotIdenticalObj[101X166167[33X[1;0Y[29X[2XIsNotIdenticalObj[102X( [3Xobj1[103X, [3Xobj2[103X ) [32X function[133X168169[33X[0;0Ytests whether the objects [3Xobj1[103X and [3Xobj2[103X are not identical.[133X170171172[1X12.6 [33X[0;0YMutability and Copyability[133X[101X173174[33X[0;0YAn object in [5XGAP[105X is said to be [13Ximmutable[113X if its mathematical value (as175defined by [22X=[122X) does not change under any operation. More explicitly, suppose176[22Xa[122X is immutable and [22XO[122X is some operation on [22Xa[122X, then if [22Xa = b[122X evaluates to [9Xtrue[109X177before executing [22XO(a)[122X, [22Xa = b[122X also evaluates to [9Xtrue[109X afterwards. (Examples178for operations [22XO[122X that change mutable objects are [2XAdd[102X ([14X21.4-2[114X) and [2XUnbind[102X179([14X21.5-2[114X) which are used to change list objects, see Chapter [14X21[114X.) An180immutable object [13Xmay[113X change, for example to store new information, or to181adopt a more efficient representation, but this does not affect its182behaviour under [22X=[122X.[133X183184[33X[0;0YThere are two points here to note. Firstly, [21Xoperation[121X above refers to the185functions and methods which can legitimately be applied to the object, and186not the [10X!.[110X operation whereby virtually any aspect of any [5XGAP[105X level object187may be changed. The second point which follows from this, is that when188implementing new types of objects, it is the programmer's responsibility to189ensure that the functions and methods they write never change immutable190objects mathematically.[133X191192[33X[0;0YIn fact, most objects with which one deals in [5XGAP[105X are immutable. For193instance, the permutation [10X(1,2)[110X will never become a different permutation or194a non-permutation (although a variable which previously had [10X(1,2)[110X stored in195it may subsequently have some other value).[133X196197[33X[0;0YFor many purposes, however, [13Xmutable[113X objects are useful. These objects may be198changed to represent different mathematical objects during their life. For199example, mutable lists can be changed by assigning values to positions or by200unbinding values at certain positions. Similarly, one can assign values to201components of a mutable record, or unbind them.[133X202203[1X12.6-1 IsCopyable[101X204205[33X[1;0Y[29X[2XIsCopyable[102X( [3Xobj[103X ) [32X Category[133X206207[33X[0;0YIf a mutable form of an object [3Xobj[103X can be made in [5XGAP[105X, the object is called208[13Xcopyable[113X. Examples of copyable objects are of course lists and records. A209new mutable version of the object can always be obtained by the operation210[2XShallowCopy[102X ([14X12.7-1[114X).[133X211212[33X[0;0YObjects for which only an immutable form exists in [5XGAP[105X are called [13Xconstants[113X.213Examples of constants are integers, permutations, and domains. Called with a214constant as argument, [2XImmutable[102X ([14X12.6-3[114X) and [2XShallowCopy[102X ([14X12.7-1[114X) return215this argument.[133X216217[1X12.6-2 IsMutable[101X218219[33X[1;0Y[29X[2XIsMutable[102X( [3Xobj[103X ) [32X Category[133X220221[33X[0;0Ytests whether [3Xobj[103X is mutable.[133X222223[33X[0;0YIf an object is mutable then it is also copyable (see [2XIsCopyable[102X ([14X12.6-1[114X)),224and a [2XShallowCopy[102X ([14X12.7-1[114X) method should be supplied for it. Note that225[2XIsMutable[102X must not be implied by another filter, since otherwise [2XImmutable[102X226([14X12.6-3[114X) would be able to create paradoxical objects in the sense that227[2XIsMutable[102X for such an object is [9Xfalse[109X but the filter that implies [2XIsMutable[102X228is [9Xtrue[109X.[133X229230[33X[0;0YIn many situations, however, one wants to ensure that objects are [13Ximmutable[113X.231For example, take the identity of a matrix group. Since this matrix may be232referred to as the identity of the group in several places, it would be233fatal to modify its entries, or add or unbind rows. We can obtain an234immutable copy of an object with [2XImmutable[102X ([14X12.6-3[114X).[133X235236[1X12.6-3 Immutable[101X237238[33X[1;0Y[29X[2XImmutable[102X( [3Xobj[103X ) [32X function[133X239240[33X[0;0Yreturns an immutable structural copy (see [2XStructuralCopy[102X ([14X12.7-2[114X)) of [3Xobj[103X in241which the subobjects are immutable [13Xcopies[113X of the subobjects of [3Xobj[103X. If [3Xobj[103X242is immutable then [2XImmutable[102X returns [3Xobj[103X itself.[133X243244[33X[0;0Y[5XGAP[105X will complain with an error if one tries to change an immutable object.[133X245246[1X12.6-4 MakeImmutable[101X247248[33X[1;0Y[29X[2XMakeImmutable[102X( [3Xobj[103X ) [32X function[133X249250[33X[0;0YOne can turn the (mutable or immutable) object [3Xobj[103X into an immutable one251with [2XMakeImmutable[102X; note that this also makes all subobjects of [3Xobj[103X252immutable, so one should call [2XMakeImmutable[102X only if [3Xobj[103X and its mutable253subobjects are newly created. If one is not sure about this, [2XImmutable[102X254([14X12.6-3[114X) should be used.[133X255256[33X[0;0YNote that it is [13Xnot[113X possible to turn an immutable object into a mutable one;257only mutable copies can be made (see [14X12.7[114X).[133X258259[33X[0;0YUsing [2XImmutable[102X ([14X12.6-3[114X), it is possible to store an immutable identity260matrix or an immutable list of generators, and to pass around references to261this immutable object safely. Only when a mutable copy is really needed does262the actual object have to be duplicated. Compared to the situation without263immutable objects, much unnecessary copying is avoided this way. Another264advantage of immutability is that lists of immutable objects may remember265whether they are sorted (see [14X21.19[114X), which is not possible for lists of266mutable objects.[133X267268[33X[0;0YSince the operation [2XImmutable[102X ([14X12.6-3[114X) must work for any object in [5XGAP[105X, it269follows that an immutable form of every object must be possible, even if it270is not sensible, and user-defined objects must allow for the possibility of271becoming immutable without notice.[133X272273274[1X12.6-5 [33X[0;0YMutability of Iterators[133X[101X275276[33X[0;0YAn interesting example of mutable (and thus copyable) objects is provided by277[13Xiterators[113X, see [14X30.8[114X. (Of course an immutable form of an iterator is not very278useful, but clearly [2XImmutable[102X ([14X12.6-3[114X) will yield such an object.) Every279call of [2XNextIterator[102X ([14X30.8-5[114X) changes a mutable iterator until it is280exhausted, and this is the only way to change an iterator. [2XShallowCopy[102X281([14X12.7-1[114X) for an iterator [3Xiter[103X is defined so as to return a mutable iterator282that has no mutable data in common with [3Xiter[103X, and that behaves equally to283[3Xiter[103X w.r.t. [2XIsDoneIterator[102X ([14X30.8-4[114X) and (if [3Xiter[103X is mutable) [2XNextIterator[102X284([14X30.8-5[114X). Note that this meaning of the [21Xshallow copy[121X of an iterator that is285returned by [2XShallowCopy[102X ([14X12.7-1[114X) is not as obvious as for lists and records,286and must be explicitly defined.[133X287288289[1X12.6-6 [33X[0;0YMutability of Results of Arithmetic Operations[133X[101X290291[33X[0;0YMany operations return immutable results, among those in particular292attributes (see [14X13.5[114X). Examples of attributes are [2XSize[102X ([14X30.4-6[114X), [2XZero[102X293([14X31.10-3[114X), [2XAdditiveInverse[102X ([14X31.10-9[114X), [2XOne[102X ([14X31.10-2[114X), and [2XInverse[102X ([14X31.10-8[114X).294Arithmetic operations, such as the binary infix operations [10X+[110X, [10X-[110X, [10X*[110X, [10X/[110X, [10X^[110X,295[9Xmod[109X, the unary [10X-[110X, and operations such as [2XComm[102X ([14X31.12-3[114X) and [2XLeftQuotient[102X296([14X31.12-2[114X), return [13Xmutable[113X results, [13Xexcept[113X if all arguments are immutable. So297the product of two matrices or of a vector and a matrix is immutable if and298only if the two matrices or both the vector and the matrix are immutable299(see also [14X21.11[114X). There is one exception to this rule, which arises where300the result is less deeply nested than at least one of the argument, where301mutable arguments may sometimes lead to an immutable result. For instance, a302mutable matrix with immutable rows, multiplied by an immutable vector gives303an immutable vector result. The exact rules are given in [14X21.11[114X.[133X304305[33X[0;0YIt should be noted that [10X0 * [3Xobj[103X[10X[110X is equivalent to [10XZeroSM( [3Xobj[103X[10X )[110X, [10X-[3Xobj[103X[10X[110X is306equivalent to [10XAdditiveInverseSM( [3Xobj[103X[10X )[110X, [10X[3Xobj[103X[10X^0[110X is equivalent to [10XOneSM( [3Xobj[103X[10X)[110X,307and [10X[3Xobj[103X[10X^-1[110X is equivalent to [10XInverseSM( [3Xobj[103X[10X )[110X. The [21XSM[121X stands for [21Xsame308mutability[121X, and indicates that the result is mutable if and only if the309argument is mutable.[133X310311[33X[0;0YThe operations [2XZeroOp[102X ([14X31.10-3[114X), [2XAdditiveInverseOp[102X ([14X31.10-9[114X), [2XOneOp[102X312([14X31.10-2[114X), and [2XInverseOp[102X ([14X31.10-8[114X) return [13Xmutable[113X results whenever a mutable313version of the result exists, contrary to the attributes [2XZero[102X ([14X31.10-3[114X),314[2XAdditiveInverse[102X ([14X31.10-9[114X), [2XOne[102X ([14X31.10-2[114X), and [2XInverse[102X ([14X31.10-8[114X).[133X315316[33X[0;0YIf one introduces new arithmetic objects then one need not install methods317for the attributes [2XOne[102X ([14X31.10-2[114X), [2XZero[102X ([14X31.10-3[114X), etc. The methods for the318associated operations [2XOneOp[102X ([14X31.10-2[114X) and [2XZeroOp[102X ([14X31.10-3[114X) will be called,319and then the results made immutable.[133X320321[33X[0;0YAll methods installed for the arithmetic operations must obey the rule about322the mutability of the result. This means that one may try to avoid the323perhaps expensive creation of a new object if both operands are immutable,324and of course no problems of this kind arise at all in the (usual) case that325the objects in question do not admit a mutable form, i.e., that these326objects are not copyable.[133X327328[33X[0;0YIn a few, relatively low-level algorithms, one wishes to treat a matrix329partly as a data structure, and manipulate and change its entries. For this,330the matrix needs to be mutable, and the rule that attribute values are331immutable is an obstacle. For these situations, a number of additional332operations are provided, for example [2XTransposedMatMutable[102X ([14X24.5-6[114X)333constructs a mutable matrix (contrary to the attribute [2XTransposedMat[102X334([14X24.5-6[114X)), while [2XTriangulizeMat[102X ([14X24.7-3[114X) modifies a mutable matrix (in335place) into upper triangular form.[133X336337[33X[0;0YNote that being immutable does not forbid an object to store knowledge. For338example, if it is found out that an immutable list is strictly sorted then339the list may store this information. More precisely, an immutable object may340change in any way, provided that it continues to represent the same341mathematical object.[133X342343344[1X12.7 [33X[0;0YDuplication of Objects[133X[101X345346[1X12.7-1 ShallowCopy[101X347348[33X[1;0Y[29X[2XShallowCopy[102X( [3Xobj[103X ) [32X operation[133X349350[33X[0;0Y[2XShallowCopy[102X returns a [13Xnew mutable[113X object [13Xequal[113X to its argument, if this is351possible. The subobjects of [10XShallowCopy( [3Xobj[103X[10X )[110X are [13Xidentical[113X to the352subobjects of [3Xobj[103X.[133X353354[33X[0;0YIf [5XGAP[105X does not support a mutable form of the immutable object [3Xobj[103X355(see [14X12.6[114X) then [2XShallowCopy[102X returns [3Xobj[103X itself.[133X356357[33X[0;0YSince [2XShallowCopy[102X is an operation, the concrete meaning of [21Xsubobject[121X depends358on the type of [3Xobj[103X. But for any copyable object [3Xobj[103X, the definition should359reflect the idea of [21Xfirst level copying[121X.[133X360361[33X[0;0YThe definition of [2XShallowCopy[102X for lists (in particular for matrices) can be362found in [14X21.7[114X.[133X363364[1X12.7-2 StructuralCopy[101X365366[33X[1;0Y[29X[2XStructuralCopy[102X( [3Xobj[103X ) [32X function[133X367368[33X[0;0YIn a few situations, one wants to make a [13Xstructural copy[113X [10Xscp[110X of an object369[3Xobj[103X. This is defined as follows. [10Xscp[110X and [3Xobj[103X are identical if [3Xobj[103X is370immutable. Otherwise, [10Xscp[110X is a mutable copy of [3Xobj[103X such that each subobject371of [10Xscp[110X is a structural copy of the corresponding subobject of [3Xobj[103X.372Furthermore, if two subobjects of [3Xobj[103X are identical then also the373corresponding subobjects of [10Xscp[110X are identical.[133X374375[4X[32X Example [32X[104X376[4X[25Xgap>[125X [27Xobj:= [ [ 0, 1 ] ];;[127X[104X377[4X[25Xgap>[125X [27Xobj[2]:= obj[1];;[127X[104X378[4X[25Xgap>[125X [27Xobj[3]:= Immutable( obj[1] );;[127X[104X379[4X[25Xgap>[125X [27Xscp:= StructuralCopy( obj );;[127X[104X380[4X[25Xgap>[125X [27Xscp = obj; IsIdenticalObj( scp, obj );[127X[104X381[4X[28Xtrue[128X[104X382[4X[28Xfalse[128X[104X383[4X[25Xgap>[125X [27XIsIdenticalObj( scp[1], obj[1] );[127X[104X384[4X[28Xfalse[128X[104X385[4X[25Xgap>[125X [27XIsIdenticalObj( scp[3], obj[3] );[127X[104X386[4X[28Xtrue[128X[104X387[4X[25Xgap>[125X [27XIsIdenticalObj( scp[1], scp[2] );[127X[104X388[4X[28Xtrue[128X[104X389[4X[32X[104X390391[33X[0;0YThat both [2XShallowCopy[102X ([14X12.7-1[114X) and [2XStructuralCopy[102X return the argument [3Xobj[103X392itself if it is not copyable is consistent with this definition, since there393is no way to change [3Xobj[103X by modifying the result of any of the two functions,394because in fact there is no way to change this result at all.[133X395396397[1X12.8 [33X[0;0YOther Operations Applicable to any Object[133X[101X398399[33X[0;0YThere are a number of general operations which can be applied, in principle,400to any object in [5XGAP[105X. Some of these are documented elsewhere –see [2XString[102X401([14X27.7-6[114X), [2XPrintObj[102X ([14X6.3-5[114X) and [2XDisplay[102X ([14X6.3-6[114X). Others are mainly somewhat402technical.[133X403404[1X12.8-1 SetName[101X405406[33X[1;0Y[29X[2XSetName[102X( [3Xobj[103X, [3Xname[103X ) [32X operation[133X407408[33X[0;0Yfor a suitable object [3Xobj[103X sets that object to have name [3Xname[103X (a string).[133X409410[1X12.8-2 Name[101X411412[33X[1;0Y[29X[2XName[102X( [3Xobj[103X ) [32X attribute[133X413414[33X[0;0Yreturns the name, a string, previously assigned to [3Xobj[103X via a call to [2XSetName[102X415([14X12.8-1[114X). The name of an object is used [13Xonly[113X for viewing the object via this416name.[133X417418[33X[0;0YThere are no methods installed for computing names of objects, but the name419may be set for suitable objects, using [2XSetName[102X ([14X12.8-1[114X).[133X420421[4X[32X Example [32X[104X422[4X[25Xgap>[125X [27XR := PolynomialRing(Integers,2);[127X[104X423[4X[28XIntegers[x_1,x_2][128X[104X424[4X[25Xgap>[125X [27XSetName(R,"Z[x,y]");[127X[104X425[4X[25Xgap>[125X [27XR;[127X[104X426[4X[28XZ[x,y][128X[104X427[4X[25Xgap>[125X [27XName(R);[127X[104X428[4X[28X"Z[x,y]"[128X[104X429[4X[32X[104X430431[1X12.8-3 InfoText[101X432433[33X[1;0Y[29X[2XInfoText[102X( [3Xobj[103X ) [32X attribute[133X434435[33X[0;0Yis a mutable string with information about the object [3Xobj[103X. There is no436default method to create an info text.[133X437438[1X12.8-4 IsInternallyConsistent[101X439440[33X[1;0Y[29X[2XIsInternallyConsistent[102X( [3Xobj[103X ) [32X operation[133X441442[33X[0;0YFor debugging purposes, it may be useful to check the consistency of an443object [3Xobj[103X that is composed from other (composed) objects.[133X444445[33X[0;0YThere is a default method of [2XIsInternallyConsistent[102X, with rank zero, that446returns [9Xtrue[109X. So it is possible (and recommended) to check the consistency447of subobjects of [3Xobj[103X recursively by [2XIsInternallyConsistent[102X.[133X448449[33X[0;0Y(Note that [2XIsInternallyConsistent[102X is not an attribute.)[133X450451[1X12.8-5 MemoryUsage[101X452453[33X[1;0Y[29X[2XMemoryUsage[102X( [3Xobj[103X ) [32X operation[133X454455[33X[0;0Yreturns the amount of memory in bytes used by the object [3Xobj[103X and its456subobjects. Note that in general, objects can reference each other in very457difficult ways such that determining the memory usage is a recursive458procedure. In particular, computing the memory usage of a complicated459structure itself uses some additional memory, which is however no longer460used after completion of this operation. This procedure descends into lists461and records, positional and component objects, however it does not take into462account the type and family objects! For functions, it only takes the memory463usage of the function body, not of the local context the function was464created in, although the function keeps a reference to that as well![133X465466467468