Under consideration for publication in J. Functional Programming 1 Non-determinism Analyses in a Parallel-Functional Language RICARDO PE ˜ NA and CLARA SEGURA Facultad de Inform´ atica, Universidad Complutense de Madrid C/Juan del Rosal, n 8, 28040 Madrid, Spain (e-mail: ricardo@sip.ucm.es,csegura@sip.ucm.es) Abstract The parallel-functional language Eden has a non-deterministic construct, the process ab- straction merge, which interleaves a set of input lists to produce a single non-deterministic list. Its non-deterministic behaviour is a consequence of its reactivity: it immediately copies to the output list any value appearing at any of the input lists. This feature is essential in reactive systems and very useful in some deterministic parallel algorithms. The presence of non-determinism creates some problems such that some internal trans- formations in the compiler must be disallowed. The paper describes several non-determi- nism analyses developed for Eden aimed at detecting the parts of the program that, even in the presence of a process merge, still exhibit a deterministic behaviour. A polynomial cost algorithm which annotates Eden expressions is described in detail. A denotational semantics is described for Eden and the correctness of all the analyses is proved with respect to this semantics. 1 Introduction The parallel-functional language Eden (Breitinger et al., 1998b; Breitinger et al., 1997; Breitinger et al., 1998a) extends the lazy functional language Haskell by syn- tactic constructs to explicitly define processes and the communications between them. It is implemented by modifying the Glasgow Haskell Compiler (GHC) (Pey- ton Jones et al., 1993). The three main new concepts are process abstractions, process instantiations and a non-deterministic process abstraction called merge. Process abstractions of type Process a b can be compared to functions of type a -> b, and process instantiations can be compared to function applications. An instantiation is achieved by using the predefined infix operator (#) :: Process a b -> a -> b. Each time an instantiation e1 # e2 is evaluated, a new parallel process is created. Non-determinism is introduced in Eden by means of a predefined process ab- straction merge :: Process [[a]] [a], which interleaves a set of input lists in a fair way to produce a single non-deterministic list. Its non-deterministic behaviour is a consequence of its reactivity: it immediately copies to the output list any value appearing at any of the input lists. In this way, merge can profitably be used to quickly react to requests coming in an unpredictable order from a set of processes.