Content deleted Content added
Added tags to the page using Page Curation (technical) |
→The canonical structure: The example moved to the beginning of the section and made more commented. Separate section Primary objects. The class map diagrammatized. |
||
Line 60:
as a canonical structure <i>(<u>O</u>,</i> ϵ<i>)</i>
with subsequently introduced notation, terminology and axioms.
For convenience, an example structure is provided first.
=== Example ===
The following diagram shows an example of the canonical structure
<i>(<u>O</u></i>, ϵ<i>)</i>,
together with corresponding Python code.
<table border="0" style="margin:2ex auto;"><tr>
<td>
[[File:Eigenclass-model-sample-a.svg|
Eigenclass model - A sample canonical structure|
450px
]]
</td>
<td style="padding-left: 3ex;">
<code>
<pre style="font-family:'Lucida Console',monospace; color:brown;">
r = object
c = type
class M(c): pass
class A(metaclass=M): pass
class B(A): pass
b = B()</pre>
</code>
</td>
</tr></table>
The structure contains 6 [[#Primary_objects|primary objects]]:
2 [[#Helix|helix]] classes
(the [[#Inheritance_root|inheritance root]] <i><u>r</u></i> and the [[#Instance_root|instance root]] / metaclass root <i><u>c</u></i>),
3 other [[#Classes|classes]] (<code>M</code>, <code>A</code> and <code>B</code>),
and 1 [[#Terminal_objects|terminal object]] (<code>b</code>).
Right-directed arrows (in gray) show the eigenclass map,
up-directed arrows (in green) show the child-parent relation of [[#Inheritance|inheritance]].
The <i style="color:green">∫</i>-shaped arrows are the [[#Twist_links|twist links]].
[[#Eigenclasses|Eigenclasses]] are shown as unnamed nodes in gray.
Each eigenclass chain is infinite – the diagram displays just an initial part, without descendants of the fourth eigenclass of <i><u>r</u></i>.
The structure contains 2 explicit [[#Metaclasses|metaclasses]]:
the metaclass root <i><u>c</u></i> and the user-created metaclass <code>M</code>.
The remaining inheritance descendants of <i><u>c</u></i>
(i.e. all eigenclasses except the eigenclass of <code>b</code>) are implicit metaclasses.
=== Objects ===
Line 116 ⟶ 160:
corresponds to the [[powerset]] operator.
The <i>i</i>-th application of <i>.ec</i> to <i>x</i> is denoted <i>x.ec(i)</i>.
By further axioms, each component of the eigenclass map is an infinite chain
<i>x = x.ec(0)</i>, <i>x.ec = x.ec(1)</i>, <i>x.ec.ec = x.ec(2)</i>, … starting in a primary object <i>x</i>.
An <em>eigenclass</em> is an object that belongs to <i><u>O</u>.ec</i>, the [[Image_(mathematics)|image]] of <i>.ec</i>.
=== Primary objects ===
Objects that are not eigenclasses are <em>primary</em>.
Axiom (6) asserts that the set of all primary objects forms a closure system in inheritance, i.e. the set appears as the image of a (necessarily unique) [[closure operator]], denoted <i>.c</i>, in inheritance.
For each object <i>x</i>, the primary object <i>x.c</i> is the
least primary ancestor of <i>x</i>.
Primary objects are further divided into
<em>
:<i><u>O</u>.c = <u>T</u></i> ⊎ <i><u>C</u></i>.
=== Classes ===
Line 149 ⟶ 202:
=== Class map ===
[[File:Eigenclass-model-class-map.svg|
Eigenclass model - The class map|
right|
250px
]]
The <em>class-of</em> an object <i>x</i>, denoted <i>x.class</i>, is the smallest container of <i>x</i> that is a class.
Axiom (6) asserts that <i>x.class</i> is defined for every <i>x</i>.
Equivalently, the <i>.class</i> map can be written as <i>.ec.c</i> where
<i>.c</i> is
<i><u>O</u>.c</i>
As a consequence, <i>.class</i> is a [[Monotone_map#Monotonicity_in_order_theory|monotone map]].
Axiom (8) asserts that the <i>.class</i> map forms a tree
– the <em>instance tree</em>.
The diagram on the right shows the class map for the [[#Example|example]] structure, in the restriction to primary objects.
To illustrate the <i>.ec.c</i> composition, the arrows are drawn along eigenclass paths.
=== Instance of ===
Line 334 ⟶ 394:
is uniquely determined by inheritance and class map between primary objects,
<i>(<u>O</u>.c, ≤, .class)</i>, up to isomorphism.
== Specializations ==
Line 721 ⟶ 747:
[[Category:Object-oriented programming]]
[[Category:Object models]]
[[Category:Mathematical structures]]
|