From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id C6E18BC57 for ; Fri, 10 Sep 2010 14:54:17 +0200 (CEST) X-IronPort-AV: E=Sophos;i="4.56,346,1280700000"; d="scan'208";a="59016625" Received: from temple.msr-inria.inria.fr (HELO [193.55.250.89]) ([193.55.250.89]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-CAMELLIA256-SHA; 10 Sep 2010 14:54:17 +0200 Subject: Re: [Caml-list] interfacing Ocaml with Mathematica From: Frederic Chyzak To: zaid al-zobaidi Cc: caml-list@yquem.inria.fr In-Reply-To: <4C811912.8000106@cs.bham.ac.uk> References: <4C811912.8000106@cs.bham.ac.uk> Content-Type: text/plain; charset="UTF-8" Organization: INRIA Date: Fri, 10 Sep 2010 14:54:17 +0200 Message-ID: <1284123257.19151.64.camel@temple.msr-inria.inria.fr> Mime-Version: 1.0 X-Mailer: Evolution 2.30.1.2 Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; interfacing:01 ocaml:01 0100,:01 ocaml:01 syntax:01 bool:01 ric:98 wrote:01 symbolic:01 caml-list:01 computation:01 arithmetic:01 quotations:03 frederic:03 frederic:03 Hi, 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 need. 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 syntax: let s1 = <:symb< a + b >> and s1 = <:symb< 2 * a + b - a >> in let b = <:bool< If[ $(symb:s1) == $(symb:s2), True, False, False ] >> in if b then "equal" else "different" ;; If this really is the route you have to go, we are ready to discuss it further. Best regards, Frédéric Chyzak and Alexis Darrasse [1] http://ddmf.msr-inria.inria.fr/DynaMoW/