StructureClassRec:
TYPE =
RECORD [
Structure properties
flavor: ClassFlavor,
printName: PrintNameProc,
characteristic: StructureRankOp ← NIL, -- rings, fields, vector spaces, algebras, divisionAlgebras only
dimension: StructureRankOp ←
NIL,--
vector spaces, algebras, divisionAlgebras
only
Test whether a given item belongs to this structure (run-time typechecking)
isElementOf: ElementOfProc ← NIL,
I/O
legalFirstChar: LegalFirstCharOp,
read: ReadOp,
fromRope: FromRopeOp,
toRope: ToRopeOp,
write: WriteOp,
Addition (rings, fields, vectorSpaces, algebras, divisionAlgebras only)
add: BinaryOp ← NIL,
negate: UnaryOp ← NIL,
subtract: BinaryOp ← NIL,
zero: NullaryOp ← NIL,
Multiplication (groups, rings, fields, algebras, divisionAlgebras only)
multiply: BinaryOp, -- assumed associative; commutative or noncommutative ok
commutative: BOOL ← TRUE,
invert: UnaryOp ← NIL,
divide: BinaryOp ← NIL,
one: NullaryOp,
Scalar multiplication (vectorSpaces, algebras, divisionAlgebras only)
scalarMultiply: BinaryOp ←
NIL,
-- this is left multiplication, i.e. scalar * vector. The underlying field of a vector space may be commutative or noncommutative.
Equality testing
equal: EqualityOp,
Ordered structure ops (rings, fields, vectorSpaces, algebras, divisionAlgebras only)
ordered: BOOL ← TRUE,
sign: CompareToZeroOp ← NIL,
abs: UnaryOp ← NIL,
compare: BinaryCompareOp ← NIL,
Some common varieties of rings (and algebras)
integralDomain: BOOL ← FALSE,
gcdDomain: BOOL ← FALSE,
gcd: BinaryOp ← NIL, -- gcdDomains only
euclideanDomain: BOOL ← FALSE,
remainder: BinaryOp ← NIL, -- euclideanDomains only
degree: ElementRankOp ← NIL, -- euclideanDomains only
Some common varieties of fields (and divisionAlgebras)
completeField: BOOL ← FALSE,
realField: BOOL ← FALSE,
realClosedField: BOOL ← FALSE,
algebraicallyClosedField: BOOL ← FALSE,
Additional ops and properties go on property list, for example:
$PolynomialRing
$MatrixRing
$EuclideanDomainMod
$ExtensionField (ground field cannot be an algebraicallyClosedField)
$RealExtensionField (ground field must be a realField, not also a realClosedField)
$QuotientField
$PowerSeriesRing
propList: Atom.PropList ← NIL
];