Oyts   
Winter '07

Notation Reference

$include( zweibieren.txt)

$include( menu.txt)

OytSpaces are defined in terms of
A symbol summary follows.

Objects

An object is a thing, an entity, a being, an item, a doohickey, ... As with any fundamental concept, there is no way to be precise. For objects, we can give examples: persons, hills, computer files, or even words. An object is delimited, that is, one can distinguish the object from all other objects. Some questions can arise. Is a representation the same as the object? Is a name the same as the person? Is a picture the person? Does the concept of a particular person extend beyond his or her death? Which form of a computer file is the file object itself: a listing on paper? the bits on a disk? or bits in memory? One may also question where one object ends and another begins. What divides a hill from its valleys? To avoid distracting descent into didactic sophistry, we must agree that an object is what we say it is and promise not to look too closely at the representation or the edges.

Classes

One way to comprehend objects is to describe a class to which one or more objects may belong. A class description distinguishes its objects from those in other classes and it gives a set of operations applicable to its objects. Classes are named with capitalized words: Person, Hill, File, Word, Integer. Operations may be synthetic--producing new objects, selective--finding existing objects, analytic--providing information about an object, or nullary--providing no value, but possibly affecting the internals of one or more objects. More about describing operations appears below.

Variables are typically written as a single italic lowercase letter; sometimes words are used instead.  Each variable refers to an object. It may be modified to refer to another object, but both must be in the same class. Often the first letter of the class is used for a variable referring to objects of that class: i for an Integer. In other cases a variable's class is specified with the is-an-element-of operator, ∈. Example: o, p ∈ Oyt says that o and p will refer to Oyt objects.

References

A reference to an object is a value that can be followed to get to the object itself. It is like a person's address or the disk location of a computer file. A reference can be thought of as a dotted line leading to the object. References are usually the values of variables. Thus the value of the variable is not a thing, but a dotted line leading to the thing. (Other terms for reference are link, pointer, name, and address.) A reference that does not lead to an object is written as a fat dash, empty oyt.

Sets

A set is, in non-technical terms, a bunch of things. More usually, the things are called the elements of the set. A set value is constructed by writing curly braces around a list of the elements: {a, b, c} constructs a set with three elements, the letters a, b, and c. When the elements are variables, the set is composed of the items that those variables represent. Thus if a equals 5 and b is a house then {a, b} is a set consisting of two elements, the value 5 and a house. (Sets are not required to make sense.)

The elements of a set are in no particular order. The set {a, b, c} is the same as the set {a, c, b}. If the equality is defined for the elements, a set will have only one copy of any particular element. Thus {a, a, b} produces the same set as {a, b} or {b, a}. A set with no elements, called the empty set, is written as {}.

The union operation combines two sets to make another. It is written as a stylized U:  {a, c, b} {d} produces a set equivalent to {c, a, d, b}.

To get the elements out of a set for computation, we can write:
    dissect s into {p, q}
This notation is non-standard and says that two elements from set s are selected and assigned to variables p and q. To reinforce the notion that set elements are not ordered, the two elements are chosen at random, but are not both the same element.

Operations


An operation defined on the objects of a class is some sort or mechanism that accepts zero or more operand objects of specified classes and produces a result object in some specified class. The operation must be called with respect to a specific object of the class; this object is an implicit extra operand to the operation. The description of operand and result classes is an operation's signature. In the describing oyts, signatures are indicated with a table for each class. The table for the Oyt class look like this:

Oyt operations

Oyt.new(Engine)
Oyt
Creates a new Oyt with the given Engine and an empty set of references.

engine()
Engine
Returns this Oyt's engine.

nub()
Set
Returns this Oyt's set of references to Oyts. Since Oyts cannot be tested for equality, the nub() set will have two values unless both are a fat dash.

renub(Oyt, Oyt)
void
Replaces this Oyt's nub with a set containing the two given Oyt references. Either or both arguments can be a fat dash.

begin()
void
Starts this Oyt. Hereafter the Oyt repeatedly calls
self.engine().cycle(self)

Column 1 lists the operation's name, and then a parenthesized list of the classes of the argument(s).

Column 2 shows the class of objects returned by the operation. The nub() operation returns a Set. If the operation doesn't return a value, the symbol void is shown instead. Neither renub() nor begin() returns a value.

Column 3 describes what the operation does and the value it returns. The special variable self refers to the object for which this operation has been called. That is, the object before the dot in the call to the operation.

The first operation is usually the new operation, always written with a preceding class name. A call to this operation is how another operation creates an instance of this class. The statement o = Oyt.new(e) assigns to o a reference to a new Oyt whose engine is that in variable e.

To call operations other than new(), one writes
an expression producing an object,
a dot,
the name of the operation, and
a parenthesized list of operand expressions.
Each operand must be of the class required by the operation's signature. If o is a reference to an Oyt, its Engine can be retrieved with
    o.engine()
and its nub can be replaced with
    o.renub(p, q)


Symbol Summary

These symbols appear in the notation:

element of Tests if an object is an element of a set. a S is true if a is one of the elements of S.
subset of
Q S is true if Q is a subset of S. That is, every e such that eQ also satisfies eS. (S often has elements that are not in Q.)
union
PS is a new set having as elements all objects that are in P or in S.  That is, for all eP, we also have e(PS), and similarly for the elements of S.
a fat dash  empty oyt
empty oytdenotes a reference from an oyt's nub to no oyt. When an oyt has only one element in its nub, the other is shown as empty oyt in diagrams. Similarly, if an oyt has no elements in a nub, it is pictured with two links to empty oyt.
? any
In a the pattern of a rule, a nub value of ? will match the empty oyt or any oyt in the oyt space.
.
dot
In calling an operation, the dot separates an expression for an object from the name of an applicable operation. The object will be self with the operation.

Dot may also separate an expression for an obect from a field selector. Then the dot selects from its left operand the portion denoted by the right operand.
produces
in illustrations, a right arrow separates an expression on its left from the resulting value shown to its right.
Λ barren
Denotes an oyt with no oyts in its nub.
{...}
set
Denotes the set consisting of the members listed between the braces. With no contents, braces represent the empty set.

Braces are also used to delimit a segment of an operation description, as for if and while. See below.
:=
assign
The expression v := expr evaluates the expression  expr and makes v have that value.
if
decide
Make a test and evaluate operations depending on the result:
if test then { ... }
else { ... }
When the test is true, all the operations in the following braces are performed. If the test is false, then the operations in the braces after else are perfomed.
while repeat Repeatedly evaluate a test and perform operations:
while test do { ... }
When the test is true, all the operations in the following braces are performed and control returns to the while. If the test is false, control bypasses the operations within the braces.
for
iterate
Perform some operations for each element of a set:
for each Class v in value do { ... }
The value must be a compound value like a list or a tree whose elements are in the named Class. For each one of the elements, the variable is given the the element as its value and the operations are performed.