ExtensionFields.mesa
Last Edited by: Arnon, March 5, 1986 10:49:31 am PST
DIRECTORY
Rope USING [ROPE],
Basics,
IO USING [STREAM],
AlgebraClasses,
Polynomials,
AlgebraicNumbers;
ExtensionFields: CEDAR DEFINITIONS
~ BEGIN OPEN AC: AlgebraClasses, POL: Polynomials, AN: AlgebraicNumbers;
ExtensionField Representation
ExtensionFieldElement: TYPE = POL.Polynomial;
wrt primitiveElement of the field: an element of minPolyRing, of degree less than the degree of minimalPolynomial.
Classes for ExtensionFields
generalExtensionFieldClass: AC.StructureClass;
realExtensionFieldClass: AC.StructureClass;
Instance Data for ExtensionFields
ExtensionFieldData: TYPE = REF ExtensionFieldDataRec;
ExtensionFieldDataRec: TYPE = RECORD [
groundField: AC.Structure,
primitiveElement: AN.AlgebraicNumber
];
Operations unique to ExtensionFields
ExtensionField Constructors
MakeExtensionField: PROC [primitiveElement: AN.AlgebraicNumber] RETURNS [extensionField: AC.Structure];
extensionField is a structure of flavor divisionAlgebra, with properties depending on whether primitiveElement is a general or real algebraic number.
Check Properties
IsGeneralExtensionField: PROC [structure: AC.Structure] RETURNS [BOOL];
IsRealField: PROC [structure: AC.Structure] RETURNS [BOOL];
check that has flavor field or divisionAlgebra, and is realField; may or may not be an extension field
IsRealExtensionField: PROC [structure: AC.Structure] RETURNS [BOOL];
Conversion and IO
ReadExtensionFieldElement: PROC [in: IO.STREAM, algebraicNumber: AN.AlgebraicNumber, reduced: BOOLFALSE] RETURNS [out: ExtensionFieldElement];
If not reduced, then reduce mod the minimal polynomial
ExtensionFieldElementFromRope: PROC [in: Rope.ROPE, algebraicNumber: AN.AlgebraicNumber, reduced: BOOLFALSE] RETURNS [out: ExtensionFieldElement];
ExtensionFieldElementToRope: PROC [in: ExtensionFieldElement, algebraicNumber: AN.AlgebraicNumber] RETURNS [out: Rope.ROPE];
WriteExtensionFieldElement: PROC [in: ExtensionFieldElement, algebraicNumber: AN.AlgebraicNumber, out: IO.STREAM];
Arithmetic
Add: PROC [in1, in2: ExtensionFieldElement, groundField: AC.Structure] RETURNS [out: ExtensionFieldElement];
Negate: PROC [in: ExtensionFieldElement, groundField: AC.Structure] RETURNS [out: ExtensionFieldElement];
Subtract: PROC [in1, in2: ExtensionFieldElement, groundField: AC.Structure] RETURNS [ExtensionFieldElement];
Multiply: PROC [in1, in2: ExtensionFieldElement, extensionField: AC.Structure] RETURNS [out: ExtensionFieldElement];
Note final argument is extensionField, not groundField
Invert: PROC [in: ExtensionFieldElement, algebraicNumber: AN.AlgebraicNumber] RETURNS [out: ExtensionFieldElement];
Divide: PROC [in1, in2: ExtensionFieldElement, algebraicNumber: AN.AlgebraicNumber] RETURNS [out: ExtensionFieldElement];
ScalarMultiply: PROC [scalar: REF, in: ExtensionFieldElement, extensionField: AC.Structure] RETURNS [out: ExtensionFieldElement];
Comparison
Sign: PROC [in: ExtensionFieldElement, realExtensionField: AC.Structure] RETURNS [Basics.Comparison];
Abs: PROC [in: ExtensionFieldElement, realExtensionField: AC.Structure] RETURNS [out: ExtensionFieldElement];
Compare: PROC [in1, in2: ExtensionFieldElement, realExtensionField: AC.Structure] RETURNS [Basics.Comparison];
Miscellaneous
Equal: PROC [in1, in2: ExtensionFieldElement, groundField: AC.Structure] RETURNS [BOOL];
END.