Re: General semantics

From: Erwin <e.smout_at_myonline.be>
Date: Fri, 21 May 2010 06:12:18 -0700 (PDT)
Message-ID: <f1cf69f7-4837-417e-97ca-315c53f6ddd5_at_m4g2000vbl.googlegroups.com>


On 21 mei, 12:41, Nilone <rea..._at_gmail.com> wrote:
> On May 20, 10:51 pm, Erwin <e.sm..._at_myonline.be> wrote:
>
>
>
> We can describe deterministic methods as binary relations over the
> possible states of a set of variables.  We can say that OOP classes
> embed these methods as RVAs in the class or subclass.

This is only true of read-only operators. Update operators are not relations/functions, and read operators with side-effects are "still a bit more" than just the relation/function on the arguments that determines the return value.

If your aim is to "better understand OOP, and/or why it has the problems it has", then you can't narrow down the discussion to just read-only operators.

> Why not?  I can write object classes that correspond to that
> relation.  Here's one, somewhat unconventional, in C#:
>
> class Man
> {
>     static Man Erwin = new Man();
>     static Man Nilone = new Man();
>     static Man Bob = new Man();
>
>     private Man() { }
>
> }

(a) There are probably hundreds of distinct ways to find correspondences between this class and relational concepts. A tuple of degree three with the attributes all being of type 'Man' and named 'Erwin', 'Nilone' and 'Bob', respectively, is one of them. And what about this : a relation is a set. Where is the set in your class ? How can I intersect that set with another one ? (b) The fact that a certain class can be fabricated that may seem to resemble a relation, does not warrant the conclusion that relation corresponds to class (and vice-versa), in general. (c) Wouldn't you agree that "static Man Erwin" is the declaration of a variable named 'Erwin' which' type is 'Man' (making abstraction here of the issue about pointers) ? Wouldn't you agree that " = new Man()" is an assignment of a value of type Man (once again making abstraction of the issue of 'pointer to Man') to that newly declared variable ? Wouldn't you agree that all of this very very strongly points toward 'Man' being a _type_ ?

> Keith described the binding relation of a variable over time in the
> "On Formal IS-A definition" thread.  AFAIK, we can express any
> mechanism of OOP in relational terms.  OOP programs get compiled every
> day.  Trivially, each compiler corresponds to its own model of OOP.
> However, class-based languages share many similarities, so we can
> generalize some.  I believe any model can be described as a relational
> model.

Yes, the RM is sufficiently complete to also be able to describe the entire state history of a running program.

> Therefore, there must exist a mapping from OOP to RM (I don't
> think anyone could invert that mapping, though).

I disagree with "therefore". I do not see what kind of axiom makes this a necessary consequence of the foregoing.

The fact of being able to use relations to describe/define (e.g.) the existance of some variable in some running OO program, does not imply that the programming constructs used in that running program also "map" to the relational constructs used to describe it (and do so universally). It should be a well-known fact that no single relational structure is ever "THE" single unique possible solution to any given modeling problem. That holds too if the modeling problem is about running programs.

It feels to me like you're seriously mixing up distinct levels here. Received on Fri May 21 2010 - 15:12:18 CEST

Original text of this message