There is the interval(a,b) - interval(a,b) --> 0 problem. I didn't
look, but there are several threads about this problem and about
intervals in general in the mailing list.
To make intervals unique, you can append a gensym to the interval
argument; an example
(%i80) interval(a,b) - interval(a,b);
(%o80) interval(a,b)-interval(a,b)
(%i82) f : interval(a,b);
(%o82) interval(a,b)
(%i83) f-f;
(%o83) 0
All this can be much more elaborate. I hastily adapted this code from
an abandoned project, so be careful. It might be nicer to place the
gensym in the car of an interval object. But I'm not sure that all of
Maxima would respect this.
Barton
;; Display code for wxMaxima and Maxima's display scheme:
(defprop $interval wxxml-interval wxxml)
(setf (get '$interval 'dimension) 'dimension-interval)
(defun wxxml-interval (x l r)
(let ((a (second x))
(b (third x)))
(wxxml-function `(($interval simp) ,a ,b) l r)))
(defun dimension-interval (form result)
(let ((a (second form))
(b (third form)))
(dimension-function `(($interval) ,a ,b) result)))
(setf (get '$interval 'operators) 'simp-interval)
(setf (get 'hidden-arg 'operators) 'simp-hidden-arg)
(defun simp-hidden-arg (e yy z)
(declare (ignore yy z))
`((hidden-arg simp) ,(if (cdr e) (cadr e) (gensym))))
(defun simp-interval (e yy z)
(declare (ignore yy))
(let ((a) (b) (g))
(pop e)
(setq a (if e (simpcheck (pop e) z) (wna-err '$interval)))
(setq b (if e (simpcheck (pop e) z) (wna-err '$interval)))
(setq g
(cond ((not e) (take '(hidden-arg)))
((and (consp e) (consp (car e)) (eq (caar e) 'hidden-arg))
(simpecheck e z))
(t (wna-err '$interval))))
(if (like a b) a `(($interval simp) ,a ,b ,g))))