From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id BC820BC50 for ; Tue, 3 Oct 2006 14:54:28 +0200 (CEST) Received: from net.univ-savoie.fr (net.univ-savoie.fr [193.48.120.75]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id k93CsSln031178 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 3 Oct 2006 14:54:28 +0200 Received: from post.bourget.univ-savoie.fr (post.bourget.univ-savoie.fr [193.48.120.73]) by net.univ-savoie.fr (8.12.3/jtpda-5.4) with ESMTP id k93CsIxE008774 for ; Tue, 3 Oct 2006 14:54:18 +0200 Received: from [193.48.123.45] (d45.lama.univ-savoie.fr [193.48.123.45]) by post.bourget.univ-savoie.fr (8.12.3/jtpda-5.4) with ESMTP id k93CsESR030025 ; Tue, 3 Oct 2006 14:54:14 +0200 Message-ID: <45225D7B.9010300@univ-savoie.fr> Date: Tue, 03 Oct 2006 14:54:19 +0200 From: Christophe Raffalli User-Agent: Mozilla Thunderbird 1.0.6-7.1.20060mdk (X11/20050322) X-Accept-Language: fr, en MIME-Version: 1.0 To: caml-list Subject: Announce: Bindlib 3.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) X-Miltered: at discorde with ID 45225D84.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; christophe:01 raffalli:01 christophe:01 raffalli:01 univ-savoie:01 lama:01 univ-savoie:01 camlp:01 syntax:01 ocaml:01 ocaml:01 cvs:01 camlp:01 fvar:01 fvar:01 I am pleased to announce the 3.0 version of Bindlib: http://www.lama.univ-savoie.fr/~raffalli/bindlib.html bindlib is a library and a camlp4 syntax extension for the OCaml language. It proposes a set of tools to manage data structures with bound and free variables. It includes fast substitution and management of variables names including renaming. As an exemple here is a piece of code to print and normalize (efficiently) lambda-terms: Warning: it does not work with ocaml 3.10(cvs) due to the camlp4 revision. A new version is planned when 3.10 is officially out. ----------------8<----------------------- type term = App of term * term | Abs of (term,term) binder | FVar of term variable let fVar (x:term variable) = FVar(x) (* simple printing of term *) let rec print_term = function App(t1,t2) -> print_string "("; print_term t1; print_string " "; print_term t2; print_string ")" | Abs f -> match f with bind fVar x in t -> print_string "fun "; print_string (name_of x); print_string " "; print_term t | FVar(v) -> print_string (name_of v) (* weak head normal form *) let rec whnf = function App(t1,t2) as t0 -> ( match (whnf t1) with Abs f -> whnf (subst f t2) | t1' -> if t1' != t1 then App(t1', t2) else t0) | t -> t (* call by name normalisation *) let norm t = let rec fn t = match whnf t with Abs f -> match f with bind fVar x in u -> Abs(^ bindvar x in fn u ^) | t -> let rec unwind = function FVar(x) -> bindbox_of x | App(t1,t2) -> App(^unwind t1,fn t2^) | t -> assert false in unwind t in unbox (fn t) ----------------8<----------------------- -- Christophe Raffalli Université de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tél: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI --------------------------------------------- IMPORTANT: this mail is signed using PGP/MIME At least Enigmail/Mozilla, mutt or evolution can check this signature. The public key is stored on www.keyserver.net ---------------------------------------------