Patch introducing ComparableRepresentation

8 views
Skip to first unread message

Waldek Hebisch

unread,
Jul 29, 2026, 9:18:10 PM (6 days ago) Jul 29
to fricas...@googlegroups.com
We have previously disscussed Comparable and proposal for
ComparableRepresentation. I have now a patch that introduces
ComparableRepresentation and uses it for Expression. Attached
is a small patch that defines ComparableRepresentation and
a text giving background and theory. In short, Comparable
as it is now is unsound. ComparableRepresentation asserts
weaker property, but can be sound.

I have the second, much bigger patch that is needed to compile
algebra when argument to Expression only have ComparableRepresentation.
Actually, this covers majority of current uses of Comparable.
But Comparable is kept for cases where we need mathematical
linear order but do not want to assert OrderedSet. FYI,
in my patched tree there are 42 use of Comparable and 104 uses
of ComparableRepresentation.

The second patch is mostly machanical, so in this sense
non interesting. In attached 'compar.txt' at the end I
indicate some possible changes to make ComparableRepresentation
really sound. My second patch compiles, but currently keeps
unchanged code of 'smaller?', which even with new documentation
probably still fails to deliver what is promised in obscure
corner cases. But small changes to code should make it
sound.

--
Waldek Hebisch
compar.txt
sum6a1a.diff

Qian Yun

unread,
Jul 29, 2026, 9:45:38 PM (6 days ago) Jul 29
to fricas...@googlegroups.com
On 7/30/26 9:18 AM, Waldek Hebisch wrote:
> Argument to Expression
> will have ComparableRepresentation and Expression will
> have Expression.

^^ typo?

-Qian

Waldek Hebisch

unread,
Jul 29, 2026, 9:58:04 PM (6 days ago) Jul 29
to fricas...@googlegroups.com
I meant Expression will have ComparableRepresentation.

--
Waldek Hebisch

Qian Yun

unread,
Aug 1, 2026, 7:48:34 PM (3 days ago) Aug 1
to fricas...@googlegroups.com
Now that Comparable is a proper order, shall we change
OrderedSet back to Comparable in IDPO?

- Qian

On 7/30/26 9:18 AM, Waldek Hebisch wrote:

Waldek Hebisch

unread,
Aug 1, 2026, 8:05:55 PM (3 days ago) Aug 1
to fricas...@googlegroups.com
On Sun, Aug 02, 2026 at 07:48:28AM +0800, Qian Yun wrote:
> Now that Comparable is a proper order, shall we change
> OrderedSet back to Comparable in IDPO?

Yes.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages