[Skip Navigation] [CSUSB] >> [CNS] >> [Comp Sci ] >> [R J Botting] >> [MATHS] >> notn_7_OO_vs_Algebra
[Contents] || [Source] || [Notation] || [Copyright] || [Contact] [Search ]
Tue Apr 12 08:13:54 PDT 2005

# Object-oriented vs algebraic documentation

There are two ways to define a set of objects by setting up rules relating the objects, or by specifying the 'contents' of the objects themselves.

1. Example::=following
Net
1. Two ways of defining the complex numbers: c1 and c2.

2. C1::=
Net{
rp,ip::Real.
1. arg::angle= /tan(ip/rp).
2. abs::Real~Negative= /(_^2)(rp^2+ip^2).
}.
3. c1::=\$ C1.

4. C2::=
Net{
1. c2::Sets. rp,ip::c2->Real
2. arg::c2->angle= /tan((ip)/(rp)).
3. abs::c2->Real~Negative= /(_^2)((rp)^2+(ip)^2).
}.

First, note that c2 satisfies C:

5. |-c2 in \$ C.

Consider the category of classes that satisfy C It might be thought that c1---c2. However, by definition of "\$", c1 is the initial class satisfying C. Class c2 can be any class that satisfies C. Because c1 is initial, c1->c2.

Consider

6. C3::=C2 and Net{for z:c2, z.abs=1}.

Clearly if c3=\$ C3 then c1->c2<==c3<-<c1.

The C1 kind of description is "object-oriented" and the C2 form "algebraic".

(End of Net)

In any case many would argue that one a class of objects in not really a class unless there is a set of operations defined that operate on the objects: object = structure+constraint+operations.

## Notes on MATHS Notation

Special characters are defined in [ intro_characters.html ] that also outlines the syntax of expressions and a document.

Proofs follow a natural deduction style that start with assumptions ("Let") and continue to a consequence ("Close Let") and then discard the assumptions and deduce a conclusion. Look here [ Block%20Structure in logic_2_Proofs ] for more on the structure and rules.

The notation also allows you to create a new network of variables and constraints, and give them a name. The schema, formal system, or an elementary piece of documentation starts with "Net" and finishes "End of Net". For more, see [ notn_13_Docn_Syntax.html ] for these ways of defining and reusing pieces of logic and algebra in your documents.