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 QAA18996; Fri, 17 Sep 2004 16:55:21 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA17698 for ; Fri, 17 Sep 2004 16:55:20 +0200 (MET DST) Received: from izanagi.macs.hw.ac.uk (izanagi.macs.hw.ac.uk [137.195.13.5]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i8HEtJN1014552 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 17 Sep 2004 16:55:20 +0200 Received: from lcflavio.macs.hw.ac.uk ([137.195.27.203]) by izanagi.macs.hw.ac.uk with esmtp (Exim 4.34) id 1C8K8t-00019q-KD for caml-list@inria.fr; Fri, 17 Sep 2004 15:55:19 +0100 From: =?ISO-8859-1?Q?Fl=E1vio?= Leonardo Cavalcanti de Moura To: caml-list@inria.fr Message-Id: <1095432814.6857.19.camel@lcflavio.macs.hw.ac.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Fri, 17 Sep 2004 15:53:34 +0100 X-SA-Exim-Connect-IP: 137.195.27.203 X-SA-Exim-Mail-From: flavio@macs.hw.ac.uk Subject: [Caml-list] type matching Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on izanagi X-Spam-Status: No, hits=0.0 required=7.0 tests=NO_RDNS2 autolearn=no version=2.63 X-SA-Exim-Version: 4.0 (built Thu, 13 May 2004 14:06:08 +0100) X-Miltered: at concorde with ID 414AFAD7.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; bytecodes:01 val:01 ,0,:01 ,0,:01 dout:01 cmo:01 ocaml:01 int:01 int:01 match:02 string:03 string:03 cma:03 types:03 let:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi there, I am trying to build a normalisation function for lambda terms which uses the leftmost strategy. Since the function is not working properly, I decided to try it at the top level. So after loading some cmo and cma bytecodes I got: # let beta_normout l_upl = let new_l_upl = ref l_upl in let exp = ref (Common.first(List.hd !new_l_upl)) in while (Common.pos_leftBR !exp <> [3]) do new_l_upl := reduce_pure !exp 1 (Common.pos_leftBR !exp) !new_l_upl; exp := (left_normal_lse !exp (Common.pos_leftBR !exp)) done; !new_l_upl;; val beta_normout : (Setypes.exlambda * int * int list * string) list -> (Setypes.exlambda * int * int list * string) list = Then, when I try to run an example, I get: # beta_normout [((A(L(DB 1),DB 2)),0,[],"")];; Characters 14-41: beta_normout [((A(L(DB 1),DB 2)),0,[],"")];; ^^^^^^^^^^^^^^^^^^^^^^^^^^^ This expression has type exlambda * int * 'a list * string but is here used with type Setypes.exlambda * int * int list * string My dout is: shouldn't the type exlambda match with the type Setypes.exlambda as well as 'a list with int list in the two last line above? Why Ocaml differ between the types Setypes.exlambda and exlambda? I will be very happy if someone could help me. best regards, Flavio. ------------------- 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