QESamplePointStructure.mesa
Last Edited by: January 28, 1988 2:33:42 pm PST
Algebraic points as they occur as cad sample points.
DIRECTORY
Rope,
IO,
AlgebraClasses,
ASAtomicFormulaOps,
Variables,
Polynomials;
QESamplePointStructure: CEDAR DEFINITIONS
= BEGIN
New Element Representation
SamplePoint: TYPE = AlgebraClasses.Object;
SamplePointData: TYPE = REF SamplePointDataRec;
SamplePointDataRec: TYPE ~
RECORD [
cell: CellIndex, -- cell to which this sample point belongs
SELECT type:* FROM
null => [
],
extended => [
basePoint: PTS.Point, -- an (r-1)-tuple of elements of baseNumberField; this should be a pointer to a cell sample point in one lower dimension
definingPolynomial: POL.Polynomial, -- a univariate algebraic polynomial over baseNumberField.
isolatingInterval: RI.RatInterval ← NIL, -- for root of definingPolynomial
],
primitive => [
point: PTS.Point -- an r-tuple of elements of primitiveNumberField
],
ENDCASE
];
Old SamplePoint Representation
SamplePoint: TYPE = AC.Object;
SamplePointData: TYPE = REF SamplePointDataRec;
SamplePointDataRec: TYPE = RECORD [
cell: AC.Object ← NIL, -- cell to which this sample point belongs
Next three fields are nonNIL iff we have an extended sample point
basePoint: Vectors.Vector ← NIL, -- an (r-1)-tuple of elements of baseNumberField.
definingPolynomial: POL.Polynomial ← NIL, -- a univariate algebraic polynomial over baseNumberField.
isolatingInterval: RI.RatInterval ← NIL, -- for root of definingPolynomial
Next field nonNIL iff we have a primitive sample point
point: Vectors.Vector ← NIL -- an r-tuple of elements of primitiveNumberField
All four of the above fields are NIL iff we have a NIL sample point
];
Instance Data for SamplePoint Structures
SamplePointStructureData: TYPE = REF SamplePointStructureDataRec;
SamplePointStructureDataRec: TYPE = RECORD [
variable: Variables.Variable, -- variable in terms of which the minimal polynomials of sample point primitive elements will be expressed; need to know it to be able to instantiate a Real Algeraic Numbers structure to read such primtive elements
dimension: Ints.Int -- for primitive sample points, implies a vector of this length of elements of some ExtensionField; for extended sample points, implies a vector of length one less of elements of some ExtensionField, a defining polynomial with coefficients over that field, and an isolating interval.
];
SamplePoint Structure Ops
MakeSamplePointStructure: AC.BinaryOp;
arguments are variable: Variables.Variable and dimension: Ints.Int
PrintName: AC.ToRopeOp;
ShortPrintName: AC.ToRopeOp;
Variable: AC.UnaryOp;
selector: return the variable characterizing this particular Sample Point Structure
Dimension: AC.UnaryOp;
selector: return the dimension characterizing this particular Sample Point Structure
IsSamplePointStructure: AC.UnaryPredicate;
I/O and Conversion
Recast: AC.BinaryOp;
CanRecast: AC.BinaryPredicate;
ToExpr: AC.ToExprOp;
LegalFirstChar: AC.LegalFirstCharOp;
Read: AC.ReadOp;
FromRope: AC.FromRopeOp;
ToRope: AC.ToRopeOp;
Write: AC.WriteOp;
Constructors
MakePrimitiveSamplePoint: AC.BinaryImbedOp;
Make primitive or NIL sample point.
first arg is the Cell to which this Sample Point belongs. Second arg is the point, i.e. Vectors.Vector, of elements of some ExtensionField which correspond to some primitive sample point. Third arg is the Sample Point Structure to imbed in.
We get a NIL sample point iff second arg = NIL.
MakePrimitiveSamplePointFromData: AC.BinaryOp;
Make primitive or NIL sample point.
first arg is the Cell to which this Sample Point belongs. Second arg is the point, i.e. Vectors.Vector, of elements of some ExtensionField which correspond to some primitive sample point.
Instantiates the Sample Point Structure defined by the variable of the minimal polynomial of the primitive element of the point elements, and the point dimension, then calls MakePrimitiveSamplePoint with the appropriate arguments. Checks if supplied Cell argument is in fact a Cell; if not, passes NIL for that arg in the call to MakePrimitiveSamplePoint.
The purpose of this routine is to be able to create a Sample Point "on the fly", i.e. without being given a structure. Intended to be registered as method "samplePoint", invokable by Evaluator.
This is an example of a Method which is really Structure-independent, i.e. it should be available in the system without requiring any particular structure to have been instantiated, it can know a priori exactly how to check its arguments for validity, and of course, it is not naturally associable with any of the Structures of its arguments.
Selectors
Cell: AC.UnaryOp;
BasePoint: AC.UnaryOp;
DefiningPolynomial: AC.UnaryOp;
IsolatingInterval: AC.UnaryOp;
Point: AC.UnaryOp;
Operations
SetCell: AC.BinaryOp;
Args are a SamplePoint and a Cell. Assigns Cell to SamplePoint's cell field.
Comparison
Equal: AC.EqualityOp;
END.