OpenMath

14 views
Skip to first unread message

Ralf Hemmecke

unread,
May 7, 2026, 7:32:06 AM (2 days ago) May 7
to fricas-devel
Oh, there is some code for OpenMath in FriCAS, but that certainly did
never work in fricas.

OMwrite(ex : Expression R, wholeObj : Boolean) : String ==
s : String := ""
sp : None := OM_-STRINGTOSTRINGPTR(s)$Lisp
dev : OpenMathDevice := OMopenString(sp pretend String,
OMencodingXML())
OMwrite(dev, ex, wholeObj)
OMclose(dev)
s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String
s

The function OM-STRINGPTRTOSTRING is non-existing in the initial import
of the fricas git repo. Seemingly all the underlying lisp functions are
missing. Is it actually hard to put our OpenMath machinery back to work?

(No, I don't need it. Just a question about currently dead code.)

Ralf

Qian Yun

unread,
May 7, 2026, 6:41:24 PM (2 days ago) May 7
to fricas...@googlegroups.com
It was defined in csl in nag axiom era.

But now Reduce is open sourced as well. You can see this
function defined in:

https://github.com/reduce-algebra/reduce-algebra/blob/master/csl/cslbase/openmath.cpp

(Off topic: it seems that it is not far fetched to have
FriCAS, Reduce, Maxima to live in the same Lisp image,
and call each other.)

- Qian

On 5/7/26 7:32 PM, 'Ralf Hemmecke' via FriCAS - computer algebra system
wrote:

Waldek Hebisch

unread,
May 7, 2026, 7:28:15 PM (2 days ago) May 7
to fricas...@googlegroups.com
On Fri, May 08, 2026 at 06:41:20AM +0800, Qian Yun wrote:
> It was defined in csl in nag axiom era.
>
> But now Reduce is open sourced as well. You can see this
> function defined in:
>
> https://github.com/reduce-algebra/reduce-algebra/blob/master/csl/cslbase/openmath.cpp
>
> (Off topic: it seems that it is not far fetched to have
> FriCAS, Reduce, Maxima to live in the same Lisp image,
> and call each other.)

Reduce is a bit tricky. Namely, Reduce uses thing called "Standard
Lisp" which is different than Common Lisp. IIUC people made
emulation of Standard Lisp on top of Common Lisp so that Reduce
could run. But I saw no such code in public (just report that
this is possible).

--
Waldek Hebisch

Waldek Hebisch

unread,
May 7, 2026, 7:41:53 PM (2 days ago) May 7
to 'Ralf Hemmecke' via FriCAS - computer algebra system
I looked a bit at this code and AFAICS it is just some amount of work.
IMO if we want to restore Open Math support, than this code needs
restructuing because it essentially assumes dynamic typing, while
static typing would be better fit to Spad.

Main question is "do we have anybody to exchange Open Math data with"?
I saw reports that GAP and Singular have Open Math support, that is
potentially quite interesting. But I did not found documentation
detailed enough to allow connection.

More generally, IMO "basic Open Math" is underspecified: it defines
encoding of messages (basically moral equivalent of Lisp S-expressions),
but meaning is delegated to so called "content dictionaries". And
the content dictionaries that I found contain only very basic math.
It seems that anyting non trival is a nonstandard extention.

--
Waldek Hebisch

Qian Yun

unread,
May 7, 2026, 8:36:14 PM (2 days ago) May 7
to fricas...@googlegroups.com
I haven't tried to build Reduce in common lisp mode,
but the commit log of Reduce has multiple entries on
"Common Lisp", I presume the official support is good enough.

https://github.com/reduce-algebra/reduce-algebra/tree/master/common-lisp

- Qian

Andrey G. Grozin

unread,
May 7, 2026, 11:00:15 PM (2 days ago) May 7
to fricas...@googlegroups.com
On Fri, 8 May 2026, Qian Yun wrote:
> I haven't tried to build Reduce in common lisp mode,
> but the commit log of Reduce has multiple entries on
> "Common Lisp", I presume the official support is good enough.
>
> https://github.com/reduce-algebra/reduce-algebra/tree/master/common-lisp
I built Reduce successfully with sbcl. Practically everything works (with
some minor exceptions), but it is slower than the csl variant.

Andrey

Kurt Pagani

unread,
May 8, 2026, 5:36:07 AM (yesterday) May 8
to fricas...@googlegroups.com
It works fine, thanks of the sl-on-cl.lisp by Francis J. Wright.
I built red/max/fricas in one sbcl image (~70MB) already two years ago,
but due to the different licenses (max is GPL) I won't publish (*),
however, I still have the build scripts in case somebody is interested.

BTW I also have a small bootstrap version (hack) that communicates with
fricas (reduce.spad).

https://github.com/nilqed/spadlib/tree/master/reduce/src



(*) I really don't know what license the final sbcl image will/should have.

>
> https://github.com/reduce-algebra/reduce-algebra/tree/master/common-lisp
>
> - Qian
>

Waldek Hebisch

unread,
May 8, 2026, 10:28:49 AM (yesterday) May 8
to 'Andrey G. Grozin' via FriCAS - computer algebra system
Thanks, good to know.

--
Waldek Hebisch

Qian Yun

unread,
May 8, 2026, 7:06:33 PM (21 hours ago) May 8
to fricas...@googlegroups.com
On 5/8/26 5:36 PM, Kurt Pagani wrote:
>
>>>
>>
>> I haven't tried to build Reduce in common lisp mode,
>> but the commit log of Reduce has multiple entries on
>> "Common Lisp", I presume the official support is good enough.
>
> It works fine, thanks of the sl-on-cl.lisp by Francis J. Wright.
> I built red/max/fricas in one sbcl image (~70MB) already two years ago,
> but due to the different licenses (max is GPL) I won't publish (*),
> however, I still have the build scripts in case somebody is interested.
>
> BTW I also have a small bootstrap version (hack) that communicates with
> fricas (reduce.spad).
>
> https://github.com/nilqed/spadlib/tree/master/reduce/src
>

Wow, super cool. I'll check it out.

My hope is that an interface allowing data structure level
interoperability, that allows algorithms cross checking, etc.
Long way to go, one step at a time.

>
> (*) I really don't know what license the final sbcl image will/should have.
>
Well, one can always distribute the sources to generate such
combined image. Also, IIUC, GPL source code can "use"/"absorb"
BSD source code. So the result is under GPL with BSD disclaimer.

- Qian

Reply all
Reply to author
Forward
0 new messages