RAQ/lib/structure.gd
Glen Whitney be82518697 Organize raq into standard GAP package file tree
In preparation for a beta release of the raq package, it's important for it to
be conformant to current GAP package conventions. Therefore, I have rearranged
the file tree to match the Example package quite thoroughly. In so doing, this
laid the foundation for the following aspects of the package:

  - Package documentation. Added makedoc.g at the top level to generate
  AutoDoc/GAPDoc documentation for raq. Currently the documentation is empty;
  future development will bring the documentation to cover all existing code.

  - Package tests. The basic structure to add .tst files in the tst
  subdirectory of the package is in place. The coverage of tests provided in
  this commit is minimal; again, further development will extend the test
  coverage.

In addition, PackageInfo.g has been elaborated to include much more complete
information about raq and where it will (initially) be posted on line.

Resolves: #1
2018-08-16 21:12:38 -07:00

100 lines
4.1 KiB
GDScript3

## structure.gd RAQ Definitions, generation, and elementary ops and props.
## GAP Categories and representations
## Info class for RAQ
DeclareInfoClass("InfoRAQ");
## Self-distributivity
# Note these are properties that can and therefore should be defined just at
# the level of MultiplicativeElements and Magmas, hence although the LOOPS
# package defines IsLDistributive and IsRDistributive for quasigroups, they
# would be ambiguous in the case of something like a semiring whose
# multiplicative structure was a quasigroup
# (cf. https://arxiv.org/abs/0910.4760). Hence, we implement them in RAQ with
# new, non-conflicting terms.
# An element that knows that multiplication in its family is left
# self-distributive:
DeclareCategory("IsLSelfDistElement", IsMultiplicativeElement);
DeclareCategoryCollections("IsLSelfDistElement");
# An element that knows that multiplication in its family is right
# self-distributive:
DeclareCategory("IsRSelfDistElement", IsMultiplicativeElement);
DeclareCategoryCollections("IsRSelfDistElement");
# Left self-distributive collections of elements:
DeclareProperty("IsLSelfDistributive", IsMultiplicativeElementCollection);
InstallTrueMethod(IsLSelfDistributive, IsLSelfDistElementCollection);
# Right self-distributive collections of elements:
DeclareProperty("IsRSelfDistributive", IsMultiplicativeElementCollection);
InstallTrueMethod(IsRSelfDistributive, IsRSelfDistElementCollection);
## Idempotence
# There is already a property IsIdempotent on elements, but to definw
# structures which will automatically be quandles we need a corresponding
# collections category:
DeclareCategoryCollections("IsIdempotent");
# Collections in which every element is idempotent
DeclareProperty("IsElementwiseIdempotent", IsMultiplicativeElementCollection);
InstallTrueMethod(IsElementwiseIdempotent, IsIdempotentCollection);
## Left and right racks and quandles
DeclareSynonym("IsLeftRack", IsLeftQuasigroup and IsLSelfDistributive);
DeclareSynonym("IsRightRack", IsRightQuasigroup and IsRSelfDistributive);
DeclareSynonym("IsLeftQuandle", IsLeftRack and IsElementwiseIdempotent);
DeclareSynonym("IsRightQuandle", IsRightRack and IsElementwiseIdempotent);
## One-sided quasigroups and racks and quandles by generators
# Returns the closure of <gens> under * and LeftQuotient;
# the family of elements of M may be specified, and must be if <gens>
# is empty (in which case M will be empty as well).
DeclareGlobalFunction("LeftQuasigroup");
DeclareGlobalFunction("LeftQuasigroupNC");
DeclareGlobalFunction("RightQuasigroup");
DeclareGlobalFunction("RightQuasigroupNC");
DeclareGlobalFunction("LeftRack");
DeclareGlobalFunction("LeftRackNC");
DeclareGlobalFunction("RightRack");
DeclareGlobalFunction("RightRackNC");
DeclareGlobalFunction("LeftQuandle");
DeclareGlobalFunction("LeftQuandleNC");
DeclareGlobalFunction("RightQuandle");
DeclareGlobalFunction("RightQuandleNC");
# Underlying operation
DeclareGlobalFunction("CloneOfTypeByGenerators");
## Opposite structures
DeclareCategory("IsOppositeObject", IsMultiplicativeElement);
DeclareCategoryCollections("IsOppositeObject");
DeclareAttribute("OppositeFamily", IsFamily);
DeclareAttribute("OppositeType", IsFamily);
DeclareSynonym("IsDefaultOppositeObject",
IsOppositeObject and IsPositionalObjectOneSlotRep);
DeclareAttribute("OppositeObj", IsMultiplicativeElement);
DeclareAttribute("UnderlyingMultiplicativeElement", IsOppositeObject);
# Attributes for the generators
# Generates the structure by \* and LeftQuotient. Note that for finite
# structures, these are the same as the GeneratorsOfMagma but in general more
# elements might be required to generate the structure just under *
DeclareAttribute("GeneratorsOfLeftQuasigroup", IsLeftQuasigroup);
# Generates the structure by \* and \/, same considerations as above
DeclareAttribute("GeneratorsOfRightQuasigroup", IsRightQuasigroup);
## Conversions into quasigroup/rack/quandle
DeclareAttribute("AsLeftQuasigroup", IsCollection);
DeclareAttribute("AsLeftRack", IsCollection);
DeclareAttribute("AsLeftQuandle", IsCollection);
DeclareAttribute("AsRightQuasigroup", IsCollection);
DeclareAttribute("AsRightRack", IsCollection);
DeclareAttribute("AsRightQuandle", IsCollection);