The same set of elements can have different operational structures. For example, it may happen that a monoid M does in fact contain the inverses of all of its elements; if M has not been constructed as a group (see Domain Categories) then it is reasonable to ask for the group that is equal to M.
AsStruct( [info, ]D ) O
If D is a domain that is closed under the operational structure
given by Struct then AsStruct returns a domain E that consists
of the same elements (that is, D = E) and that has this
operational structure (that is, IsStruct( E ) is true);
if D is not closed under the structure given by Struct then
AsStruct returns fail.
If additional information besides generators are necessary to define D
then the argument info describes the value of this information for the
desired domain.
For example, if we want to view D as a vector space over the field
with two elements then we may call AsVectorSpace( GF(2), D );
this allows us to change the underlying field of scalars,
for example if D is a vector space over the field with four elements.
Again, if D is not equal to a domain with the desired structure and
additional information then fail is returned.
In the case that no additional information info is related to the
structure given by Struct,
the operation AsStruct is in fact an attribute.
[Top] [Previous] [Up] [Next] [Index]
GAP 4 manual