|
 |
Orchid XP v8 wrote:
> I'd be rather surprised if that's what I said, given that I have no clue
> what the hell an abstract data type actually is.
As I said, I obviously misremembered, because looking at the definition of
algebraic data type, you obviously wouldn't confuse those two.
An ADT is a type whose operations are defined algebraically. So instead of
saying "Push adds a value to the stack. Top tells you what's on top. Etc"
you say something like
For all X, push(X, empty) does not equal Empty.
For all X and all S, top(push(X,S))==X
For all X and all S, pop(push(X,S))==S
(And of course you add the type signatues just like in Haskell)
It says absolutely nothing about what you have to do to implement it. Yet
you can prove you've specified every possible combination.
Peano arithmetic is a sort of abstract data type for the integers.
--
Darren New, San Diego CA, USA (PST)
Serving Suggestion:
"Don't serve this any more. It's awful."
Post a reply to this message
|
 |