From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA16051; Fri, 6 Aug 2004 17:08:05 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA15351 for ; Fri, 6 Aug 2004 17:08:04 +0200 (MET DST) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i76F84mL032646 for ; Fri, 6 Aug 2004 17:08:04 +0200 Received: from ibm3.cicrp.jussieu.fr (ibm3.cicrp.jussieu.fr [134.157.15.3]) by shiva.jussieu.fr (8.12.11/jtpda-5.4) with ESMTP id i76F7M4i006574 for ; Fri, 6 Aug 2004 17:07:22 +0200 (CEST) X-Ids: 168 Received: from ibm1.cicrp.jussieu.fr (ibm1.cicrp.jussieu.fr [134.157.15.1]) by ibm3.cicrp.jussieu.fr (8.8.8/jtpda/mob-V8) with ESMTP id RAA22696 for ; Fri, 6 Aug 2004 17:06:01 +0200 Received: from localhost (fernande@localhost) by ibm1.cicrp.jussieu.fr (8.8.8/jtpda/mob-v8) with ESMTP id RAA450712 for ; Fri, 6 Aug 2004 17:05:29 +0200 X-Authentication-Warning: ibm1.cicrp.jussieu.fr: fernande owned process doing -bs Date: Fri, 6 Aug 2004 17:05:28 +0200 (DST) From: Diego Olivier Fernandez Pons X-X-Sender: fernande@ibm1 To: caml-list@inria.fr Subject: [Caml-list] getting the type of a polymorphic data ? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at nez-perce with ID 41139ED4.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at shiva.jussieu.fr with ID 41139EAA.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Antivirus: scanned by sophie at shiva.jussieu.fr X-Loop: caml-list@inria.fr X-Spam: no; 0.00; pons:01 pons:01 etu:99 generic:01 floats:01 intset:01 fernandez:01 fernandez:01 int:01 raises:01 polymorphic:01 polymorphic:01 olivier:02 olivier:02 match:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Bonjour, In a branch and bound program I give the user a generic polymorphic data structure to represent decision variables, namely a set of intervals - (domains decrease monotonically) x = [0 .. 1] U [2 .. 3[ y = [3,5 14,8] As usual in branch and bound, a value is tried (x = 1) and removed of the domain if the corresponding branch raises a 'No solution' exception (x = [0 .. 1[ U [2 .. 3[) In a preprocessing phase I would like to change the representation of the decision variables according to their type to avoid degenerancies like [0 .. 1[ U ]2 .. 3[ U ]4 .. 5[ -> [0] in the integer case but not with floats The problem is that I don't know how to catch the type of a polymorphic data structure (is this even possible with some magic ?) to be able to write something like let x' = match (somemagic.type_of x) with | INT -> IntSet.from_poly x | FLOAT -> FloatIntervalSet.from_poly x | _ -> x Any hints ? Diego Olivier ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners