caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* paralell assignment problem
@ 2005-02-08  3:07 skaller
  2005-02-08 14:34 ` Stefan Monnier
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: skaller @ 2005-02-08  3:07 UTC (permalink / raw)
  To: caml-list

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




^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2005-02-09 13:53 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-08  3:07 paralell assignment problem skaller
2005-02-08 14:34 ` Stefan Monnier
2005-02-08 16:02   ` [Caml-list] " skaller
2005-02-08 18:20     ` Stefan Monnier
2005-02-08 17:08   ` skaller
2005-02-08 18:33     ` Radu Grigore
2005-02-09  7:48       ` Radu Grigore
2005-02-09 10:11         ` skaller
2005-02-09  9:43       ` Radu Grigore
2005-02-09 11:19         ` Radu Grigore
2005-02-09 11:34         ` Pascal Zimmer
2005-02-09 13:53           ` skaller
2005-02-08 16:03 ` [Caml-list] " Florian Hars
2005-02-08 17:38   ` skaller
2005-02-08 16:29 ` Marcin 'Qrczak' Kowalczyk
2005-02-08 17:55   ` skaller
2005-02-08 18:32     ` Marcin 'Qrczak' Kowalczyk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).