Type Relation Comparison

This is an analogy or structural comparison of types and relations.

It is intended to make the concept and application of types clear if you are already familiar with relations (data-base wise).

If a type corresponds to ("<->") a relation, then (quoted parts from Wikipedia):

See http://en.wikipedia.org/wiki/Relational_model, http://en.wikipedia.org/wiki/Type_system

I don't see how the above is intended to clarify types for Top, given that it's unlikely to make much sense to anyone else. I'm very familiar with "relations (data-base wise)" and "the concept and application of types", having implemented both the RelationalModel and DateAndDarwensTypeSystem in the RelProject, but I find the above baffling. For example, a relation is not a type -- a relation is a value. A relation's heading, however, is a type. A tuple is also a value (and a tuple's heading is a type), but I don't see why tuples are chosen in particular to illustrate some "corresponds to" relationship with values. "TypeSystem <-> DataBase Schema", I don't get at all.

Interesting. I thought the analogy quite obvious. Especially after looking up the wikipedia entries. I assume that 'relation's heading' is usually meant when talking about relations and what you call 'relation' is simply the table. And I chose the tuple because it is the obvious kind of value on that side. I intentionally left out the comment that a relation is a special kind of type to avoid bias.

But if you cannot see the analogy on that level, probably Top cannot see it either. So if you think this page doesn't help. Please feel free to delete it again.

{Let's not delete it. It's an example of differences in the perception of "types", and limits of Wikipedia. -t}

I suspect my interpretation of types, and the original poster's, are essentially the same. So I don't think it's an example of the differences in the perception of "types", nor does it highlight limits of WikiPedia. I simply think that whatever the original poster's intent, it's very, very poorly expressed via nothing more than WikiPedia extracts and excerpts. Far, far, far better would be a clear and lucid explanation for each "corresponds to" relationship, in the author's own words and supported by examples, and (perhaps) including (but not relying upon) citations from WikiPedia for support.


EditHint: eventually move this section below because it's not about relations. Perhaps back to DefinitionOfTypeTag.

Re: "A type constrains the possible values of a variable"

No, it doesn't necessarily do such. For example, two sequential bytes can be made to represent both a string (or character set) or an integer. It doesn't have to constrain the content of those two bytes in any way. Types may govern how they are interpreted, but that's another matter. - top

Yes. If you do disagree with that, then I cannot help. I didn't cite wikipedia for nothing to make this analogy as clear as possible. But I hope you agree that relations constrain something. Please consider a constraint on the same level of abstraction.

I refute the idea that types are about "constraints", and instances of usage by others suggests this is the case, especially in dynamic environments.

But that's the core of the concept of types! You seem to be more interested in the usage of types (e.g. for dynamic exection), where the consequence of an expression having a specific type 'causes' specific interpretations. But to have these specific consequences one needs to understand the conditions for it first, or?

Re: "a value is an expression which cannot be evaluated any further."

So if I store (dynamic) expressions in strings, they are no longer strings?

Again I cited Wikipedia for clarity. What is a value for you?

If the def has flaws, it has flaws.


Contributors: GunnarZarncke


CategoryComparisons


EditText of this page (last edited December 10, 2014) or FindPage with title or text search