From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 5F024BC88 for ; Tue, 8 Feb 2005 04:07:21 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j1837KaG028430 for ; Tue, 8 Feb 2005 04:07:21 +0100 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 EAA32532 for ; Tue, 8 Feb 2005 04:07:20 +0100 (MET) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1837IV9011117 for ; Tue, 8 Feb 2005 04:07:19 +0100 Received: from [192.168.1.200] (ppp212-197.lns2.syd3.internode.on.net [203.122.212.197]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id j18376gZ023709 for ; Tue, 8 Feb 2005 13:37:16 +1030 (CST) Subject: paralell assignment problem From: skaller Reply-To: skaller@users.sourceforge.net To: caml-list Content-Type: text/plain Message-Id: <1107832025.13571.260.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 08 Feb 2005 14:07:06 +1100 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 42082CE9.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42082CE6.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; sourceforge:01 confuses:01 glebe:01 061:98 nsw:01 precisely:01 snail:02 2037:02 variables:02 expressions:03 programming:03 dependence:03 parallel:04 problem:05 problem:05 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: Does anyone know how to solve the parallel assignment problem? Name invented by me to describe this problem: x1,x2,x3..xn = e1,e2,e3 .. en where ei might contain the variables xj. (Note = here is assignment). The solution is a sequence of assignments involving only xi, ei, and ti, where ti are temporaries introduced to save the values of the expressions. For example, a solution to x,y = y,x is t = x; x = y; y = t I seek a solution which minimises the number of assignments. Note that the relation i < j == ej doesn't depend on xi is not transitive. This (a) confuses me enough I can't see the solution, and (b) is precisely what allows a temporary to remove a dependence. -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net