Ralf Hemmecke wrote:
> 
> On 11/18/2013 04:37 AM, Waldek Hebisch wrote:
> 
> > Attached is a patch implementing missing functions.
> 
> I'm not completely satisfied. The reason lies here:
> 
> ++ A dequeue is a doubly ended stack, that is, a bag where first items
> ++ inserted are the first items extracted, at either the front or the
> ++ back end of the data structure.
> DequeueAggregate(S : Type):
>   Category == Join(StackAggregate S, QueueAggregate S) with
> 
> It shouldn't inherit from StackAggregate, because that would violate the
> specification. Compare with
> 
> ++ A stack is a bag where the last item inserted is the first item
> ++ extracted.
> StackAggregate(S : Type) : Category ==
>   Join(BagAggregate S, finiteAggregate) wit
> 
> Stack is LIFO, but Dequeue is FIFO.

It make little sense to say that Dequeue is FIFO, because there
are _two_ ends.  Each end is LIFO, but if you add at one end and
extract at other end you get effect of FIFO.
The 'Join(StackAggregate S, QueueAggregate S)' should make it
clear that inherited signatures implement interface of stack
and queue.  If you use stack interface you get LIFO, if you
use queue interface you get FIFO.  And added signatures
'insertBottom!' and 'extractBottom!' give you another LIFO at
the other end.

-- 
                              Waldek Hebisch
[email protected] 

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to