blob: 68bd05863dd0d4c0c8f3aef140c7e973c0ded1fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
===============================
Types and Operators
===============================
The careful definition of abstract types and the manipulation and handling of
instances by operators is the heart of any computational algebra system
(or indeed any data-driven symbolic system).
The [R5R2] defines a simple "tower" of number subtypes (p.19):
number
complex
real
rational
integer
Each subtype is a subset of the subtype above it, so that each rational is
a complex but not every real is an integer. Additionally, every Scheme
number is either exact or inexact. The selection of the appropriate
implementation of operations like addition, exponentiation, or rounding for
arbitrary combinations of numbers and their return types is usually called
*operator dispatch*. For an operator of N arguments of M possible types, one
can imagine an M**N cell table defining the appropriate procedure (or
built-in hardware instruction) and return type for each combination of types.
Such a table would be come unmanagably large for systems with even a modest
number of operators and types: for example each of the basic binary operators
(*, /, -, +, exp) would require it's own 2**(2*5)=1024 element table for the
basic types described above. Procedural operator dispatch and coersion allow
for more natural handling of type heirarchies.
More rigorously defined algebras do not necessarily follow the simple strict
ordering of types like the Scheme number tower, or even a proper tree
structure:
[figure: geometrical spaces from Merseve Geometry]
[figure: number types from Merseve Algebra]
[figure: math object hierarchy from Tegmark?]
Types and Operators for Differential Geometry and Field Theories
------------------------------------------------------------------------
[topics: disjointness,
Implementation
------------------------------------------------------------------------
|