# PFL Examples

 home  Bib  Algorithms  Bioinfo  FP  Logic  MML  Prog.Lang and the  mmlist

FP
PFL (code)
Syntax
Examples

Also see:
λ ex'
• [buffer] -- bounded buffer process
• [factorial] -- in parallel ||
• [server] -- and clients
• [merge sort]
• [Prime numbers] -- || sieve
• [Hamming numbers] -- by || processes
• [pass actions] -- etc. down channels
 ```let ch1=chan, ch2=chan in ch1!1 -> ch2!2 -> stop || ch2?x -> ch1?y -> output!x+y -> stop { Deadlock. } ```
-- one process wants to interact on ch1 and then (->) on ch2, the other one v.v..--(
|| factorial:
 let fact = lambda n. let rec f = lambda lo. lambda hi. lambda opch. if lo = hi then opch!hi -> stop else {lo < hi} let mid = (lo+hi)/2, ch = chan in {parallel divide and conquer} f lo mid ch || {small numbers's} f (mid+1) hi ch || {big numbers's} ch?x -> ch?y -> opch!x*y {combine} -> stop in f 1 n output in fact 10 {\fB Parallel Factorial Program. \fP}
window on the wide world:
 The Darwin Awards V: Next Evolution

 Linux  Ubuntu free op. sys. OpenOffice free office suite, ver 3.4+ The GIMP ~ free photoshop Firefox web browser FlashBlock like it says!

pfl...
 | || choice parallel sequence input act output act new channel

 © L. Allison   http://www.allisons.org/ll/   (or as otherwise indicated), Faculty of Information Technology (Clayton), Monash University, Australia 3800 (6/'05 was School of Computer Science and Software Engineering, Fac. Info. Tech., Monash University, was Department of Computer Science, Fac. Comp. & Info. Tech., '89 was Department of Computer Science, Fac. Sci., '68-'71 was Department of Information Science, Fac. Sci.) Created with "vi (Linux + Solaris)",  charset=iso-8859-1,  fetched Wednesday, 27-May-2020 22:38:08 AEST.