Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
interfacing Ocaml with Mathematica
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-09-10 (12:54)
From: Frederic Chyzak <frederic.chyzak@i...>
Subject: Re: [Caml-list] interfacing Ocaml with Mathematica

On Fri, 2010-09-03 at 16:49 +0100, zaid al-zobaidi wrote:
> I am writing an Ocaml code and part of it I need to do the following job:
> * I want to find out if two arithmetic or logical expressions  are equal
>   like "a + b" and "2 * a + b - a" or "a and b or a" and "a", and Ocaml

It is not clear to me what power of symbolic computation you really

If you really need to be able to interface a computer-algebra system
with ocaml (whether Mathematica or Maple or ...), you might be
interested to hear that we are developing a tool [1] named DynaMoW
(for Dynamic Mathematics on the Web) for this purpose.  (Well, beyond
this, our purpose is to generate web pages with dynamic mathematical
content).  We cannot unfortunately point you to a public release as we
expect our first release only later this fall.

Concerning the test you were asking for, it could be coded as follows
using DynaMoW's quotations and antiquotations, and Mathematica's

  let s1 = <:symb< a + b >> and s1 = <:symb< 2 * a + b - a >> in
  let b = <:bool< If[ $(symb:s1) == $(symb:s2), True, False, False ] >>
  if b then "equal" else "different" ;;

If this really is the route you have to go, we are ready to discuss it

Best regards,
Frédéric Chyzak and Alexis Darrasse