> Another way to look at this "use NIL to represent empty tree" > problem:
> We disallow the existence of empty tree. > > 1. Empty tree is not required by the definition of tree. > 2. You can not construct an empty tree from existing > and future operations of Tree: > > For example, "delete a node from tree" is not well defined: > you can not delete the root node (you can delete a child though). > > So for the domain Tree, we can avoid this problem by > > empty() == error "There is no empty aggregate in domain Tree" > empty? t == false > > Can I commit the patch that uses this approach? Somehow I have the tendency to believe that the empty tree is a tree, but on the other hand, there is also the problem whether 0 is a natural number or not. The empty tree does indeed look very special. An empty doubly linked list is probably more common. Although the name doesn't sound too attractive, what about NonEmptyTree? Ralf -- 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 fricas-devel+unsubscr...@googlegroups.com. To post to this group, send email to fricas-devel@googlegroups.com. Visit this group at https://groups.google.com/group/fricas-devel. For more options, visit https://groups.google.com/d/optout.