A Rehabilitation of Message-Passing Concurrency

Size: px
Start display at page:

Download "A Rehabilitation of Message-Passing Concurrency"

Transcription

1 A Rehabilitation of Message-Passing Concurrency Frank Pfenning Carnegie Mellon University PWLConf 2018, St. Louis

2 A Paper I Love Types for Dyadic Interaction, Kohei Honda, CONCUR 1993 With some newer developments Session Types as Intuitionistic Linear Propositions, Luís Caires & Pf., CONCUR 2010 Manifest Sharing with Session Types, Stephanie Balzer & Pf., ICFP 2017

3 The Activity of Programming Every programmer, all the time, reasons Operationally (how) Logically (what) The effectiveness of a programming language depends critically on sort(a); x = A[0]; hd(sort(a)) How programs execute What they achieve Which reasoning principles connect the operational and logical meaning of a program

4 Why is Functional Programming So Effective? Functions are a universal and fundamental abstraction Intuitionistic Logic Logic Type Theory Types Simple Types (,,+,α) Computation β-reduction

5 What about Concurrency? Concurrent Separation Logic Logic Is Shared Memory a Fundamental Abstraction? Types? Computation Read/Write Shared Memory

6 What about Concurrency? Processes and Channels are a Fundamental Abstraction!? Logic Linear Logic! [Caires & Pf 10] Concurrent Type Theory? Session Types! [Honda 93] Types? π-calculus Computation Communication

7 There is Hope Previous talk! Do not communicate by sharing memory; instead, share memory by communicating. Effective Go From the language point of view: Go Goroutines (threads/processes) as a fundamental abstraction Channels (chan τ) as a fundamental abstraction Connection to logic is missing Types are not expressive enough

8 Example: A Store (Stack or Queue) Protocol Client: ins; x; recurse Provider Client s choice (external) Client: del $c : A Typed dyadic channel Client Provider: none; close. Provider s choice (internal) Provider: some; x; recurse Protocol should be expressed by a type!

9 A Simple Client, in CC0 $s : stack int main() { int n = 10; stack $s = empty(); for (int i = 0; i < n; i++) { $s.ins; send($s, i); print_stack($s); return 0; empty() $s : stack provider of $s $s : stack provider of $s main() main() main() main()

10 A Simple Provider, in CC0 stack $s elem(int x, stack $t) { switch ($s) { case ins: { $t : stack $s : stack int y = recv($s); stack $r = elem(x, $t); $s = elem(y, $r); elem(x, $t) $t : stack ins ; y case del: { elem(x, $t) $s.some; send($s, x); $s = $t; $t : stack $r : stack $s : stack elem(x, $t) elem(y, $r)

11 stack $s elem(int x, stack $t) { switch ($s) { case ins: { int y = recv($s); stack $r = elem(x, $t); $s = elem(y, $r); case del: { $s.some; send($s, x); $s = $t; Forwarding (or channel identification) is not part of the π-calculus $t : stack $s : stack elem(x, $t) $t : stack del elem(x, $t) $t : stack some ; x elem(x, $t) $s = $t : stack

12 stack $s empty() { switch ($s) { case ins: { int x = recv($s); stack $e = empty(); $s = elem(x, $e); case del: { $s.none; close($s); $s : stack empty() ins ; x empty() $e : stack $s : stack empty() elem(x, $e)

13 stack $s empty() { switch ($s) { case ins: { int x = recv($s); stack $e = empty(); $s = elem(x, $e); case del: { $s.none; close($s); $s : stack empty() del empty() none ; close

14 Summary So Far Processes provide one channel and are clients to other channels Spawning a process returns a fresh channel $c, with two endpoints New process provides $c Spawning process is client of $c Processes can terminate by forwarding Communication is bidirectional Processes send and receive labels or integers

15 Typing Channels Channel types should encode protocol of communication Provider and client must execute complementary actions External choice: Provider branches on label / Client sends label Internal choice: Provider sends label / Client branches on label Termination: Provider terminates / Client waits for termination Basic data: sending or receiving atomic values

16 Session Types, Abstractly Type Provider action Continuation <latexit sha1_base64="1u1jtsh/u4h5hig1kbeteycwfao=">aaae3hicjvnnbxmxehxsacv8txdkytgaokamquhukzca9tjdd0u0bau4ri53nrhitve2n0207i0b4sop48y/4cjsbmmbbqsotkvxvjk3mx7pkfbs+vbrv6w6vrtz9976/fqdh48ep9nyfhritgif9irrxp6nuamlnfs89aroygs8gik4hu33c/x0btzjo4/9iozbxmdahljwj6bhznxkrjcwouxw8kwwkqguyuou5rut/ywamxl6jmhz5enimpkmwfiucp4ryn9ol3xcsytj/tzea6troken8wh/ktuxfpkxlifsteo7w1xh2ba0mknp4rwfbqfybtszcghjwsknho8o8ctqf2uuqcftypw425i70metmbuukaouphsrpykj1xoubyg8ycgw9694d9oze42gsh+ragy0xiz5sjhu3f8bb5oeavtjvindyzl2pk87gfm82wzvilkst9cyyficlvl3z835oltkbxn8j+4/veuzoc8nmjpd4oj1dte2wtutquiq0r5qtnb18rdkcdkablbowgbeeoh2qnhn+u1w7adi56vqknvz4idmysrh0edv8wjcic3wiqmv0rjqvad8tkef9xpeyipnfteipspuj+4mlhv/itkfcbuwayl53nfllrllsvynd3cgqdrxgnmxztfhoqg3nn9dgki8fk8wqhbhjfatpwwl+4tbupqttsae2kod3g499hmctw7bhmlqt1mzz+m72c9drdrsowrphnhtczv1zfhccapd9k5trzjnukyos2jfvplv5ettdhv1jziua1lkonloxpdxpe3ek11yqi5ij4jqz+rvtcpatfa59rx2rfa9dk1wlmkekswp/fgdnmeftg==</latexit> sha1_base64="ene0ycw0blcs87wovdku3+deb9y=">aaae3hicjvpbbhmxen1sa5rqaathlhynianqshusvsskpr300emrtvspdphjnu2seo2v7u0tlxvjhrjyydz4e47mbkrbnexqslsaz5t5m+pxdbiprgs2f1f8leqdh49wh9eerd19tr6x+fzu6trw6hatttkfmatskog44sscjwzypjbwnhgffpjzbiwvwp24wqk9ma2viarndk39tx9mbzaukmpgsfmess6lzgse5q2z/2k80npsbipzq9ox0rmrgigmfzzxwifwtqiuza2udgoie0jxro9w6yp+m3oh3cingqupsyu0+4vc8/7cqiuir9d8bjiicrcryyd18ryuf3i7jyda+1ejcetuncju3pfcggrvydwmvgopbdlfko2pmfigsz0xcuug/bvihsirzq2cmv29oqlwcbxmwmrcmxdjhfq4otanx46mtghy+trr5dsxdju+k2ex2ej9gsklumzfntsmvfyyfuzxpdr/ujxnfdy3agougcvx1d/yam43syhlsncpbo2pk69kbd0/7m9wzmmoerqdclwya7tbm3e9phocs8hrnlwqmd5mq+iiqlgmtpeva5gt12gjcv4afsqr0nozimoxtbn4gj4xcyn7gyumd2lwxczmtihgsxfmekmhgi9w46ldxizukulc+byykjxeavlsiqkfxr6tm1qynwl7kz6cwx3cbv3ilhiti2zvam63grorjltfyi4w9eexsplsfeiwrijrdcyynkkk4zgc20zyiblwubdbkdfm0zav4syc2ze/rjzubaeof8khhhpzwfveeq+8t17gffd2vepv2ot43p/l/1mprpjvl9vv1e/vh3nxv3iz88jbkorpv2rahdm=</latexit> sha1_base64="6wt34bj6xdtlynfm54v5dntxjmc=">aaae3hicjvnnb9naehxsacv8nxdksqibcubnjjcoiie17awhhopo2krzek3x42sv9a61u04twb5xq1z5ydz4jxwzo6ftmij1jfuz82bezozsbiku1rxbvyvvjdq9+w82h9yfpx7y9nlw4/mp1anh0onaanmematskog54sscjwzyheg4cyyhbx42bwofvidunsagzimlisgzq9owuz3qaezczcwyns8zyawuez2gvcglp40dpctomdi/pb0bpruhgmj4wxmfhgjlherzwkpp34d4ghrd9oh0pue/oxfcjxoauzcsdeh3wcg0hy4mvchydmvngioyare6btkclobmgxehekl1fzwksotwiuztxcktqpcozf1cpzzskp210viykqwsnhmrsgtyvy3egblaxcmo098pmmofl2eotcwuc9fgqyujcn3y9chig4adz7joth1ld+i7charltsnmlyay/z9aws26k5twqzfo/0pvdlmwxodpk4rwl6u4dz2e6ddcllx/kwy7s3lenionnnq8zqg5bhk1vb9duigsocel5dxawohyxzcrtbhvbey7car1yinr9eserwa/jqjpfv6rmzia+dxgj4xc2n7eyumt2lwxczmtyhgsxfmeklhgq9w46ldqszukulc+akykjxeavlsiqkfxr6tc1qynwl7kz6cwx3cbv3jlhiti2zvam63grkxjltfyi4w9zejsplsq+jwrijr9syytkkk5zic2fzyiblwkb/bkjfm0zav4yz8mze/rpy+3/fr/9ze3jtctmxte+m98t56vvfr2/movwov5/hqr+qfjcpgtfa19q32vfzj4vqtlgneects+/kxkoqega==</latexit> A ::= N{` : A``2L receive some k 2 L A k {` : A``2L send some k 2 L A k A ( B receive channel c : A B A B send channel c : A B 1 terminate none 8x:.A receive v : [v/x]a 9x:.A send v : [v/x]a stack A = N{ ins : A ( stack A, del : { none : 1, some : A stack A <latexit sha1_base64="8uq0s6a0uxb6duix33+jrhacyia=">aaadnxicbvlnbhmxepyuf2x5aqphlhyjehjvs1shusevtelsa4dwkdyijikv17ux4j/zxqri2uficxgidtwqv14bb7qgpguky5/mm29mponcc2zdmn6p4lu379y9t3u/efdw0ept3s6tc6tqq+iikk7momewcibpydhh6vgbikxo6uw+en/yf1+osuzjt26p6vtgsrkseeyca9b7hnjamekdznmmqyyzimg8dzgsmtkxpiqexti3b5afqhqia+uzta18c48h4opzbtcfuyekjejdkrcgva30sgle2/uuuknauijcfywdycpbu/sosqvmrn60i5r2dbjezfgv61mvn+6lk4m3qdabpujsdlytjvghsc2odirjaydzqt3uy+my4brjug2pdjvxrscbsiyonfrvvbv4ingkwibesiudxhnxfr4la5cid5ecu7m9zrxo/3lwcwywpghku1bsifcvi5vdupjggpag6zafctvmwxpofgwxdatmkhf8gqamhox3qdlhbhmxvsfgnw2uksntlq3frlzu7hgtjtufqumpc6yb/1q7jvh44ciglmnsdx3mczvul5wowwyhqy5cnwwbjowiuz75m+b8fy8l+gy/f3tsbwulpappwuuqgtfgcjyauzacjhovnuwfo0n8nf4r/4x/xyxguad5cjys/v0hhdsfjw==</latexit> <latexit sha1_base64="8uq0s6a0uxb6duix33+jrhacyia=">aaadnxicbvlnbhmxepyuf2x5aqphlhyjehjvs1shusevtelsa4dwkdyijikv17ux4j/zxqri2uficxgidtwqv14bb7qgpguky5/mm29mponcc2zdmn6p4lu379y9t3u/efdw0ept3s6tc6tqq+iikk7momewcibpydhh6vgbikxo6uw+en/yf1+osuzjt26p6vtgsrkseeyca9b7hnjamekdznmmqyyzimg8dzgsmtkxpiqexti3b5afqhqia+uzta18c48h4opzbtcfuyekjejdkrcgva30sgle2/uuuknauijcfywdycpbu/sosqvmrn60i5r2dbjezfgv61mvn+6lk4m3qdabpujsdlytjvghsc2odirjaydzqt3uy+my4brjug2pdjvxrscbsiyonfrvvbv4ingkwibesiudxhnxfr4la5cid5ecu7m9zrxo/3lwcwywpghku1bsifcvi5vdupjggpag6zafctvmwxpofgwxdatmkhf8gqamhox3qdlhbhmxvsfgnw2uksntlq3frlzu7hgtjtufqumpc6yb/1q7jvh44ciglmnsdx3mczvul5wowwyhqy5cnwwbjowiuz75m+b8fy8l+gy/f3tsbwulpappwuuqgtfgcjyauzacjhovnuwfo0n8nf4r/4x/xyxguad5cjys/v0hhdsfjw==</latexit> <latexit sha1_base64="8uq0s6a0uxb6duix33+jrhacyia=">aaadnxicbvlnbhmxepyuf2x5aqphlhyjehjvs1shusevtelsa4dwkdyijikv17ux4j/zxqri2uficxgidtwqv14bb7qgpguky5/mm29mponcc2zdmn6p4lu379y9t3u/efdw0ept3s6tc6tqq+iikk7momewcibpydhh6vgbikxo6uw+en/yf1+osuzjt26p6vtgsrkseeyca9b7hnjamekdznmmqyyzimg8dzgsmtkxpiqexti3b5afqhqia+uzta18c48h4opzbtcfuyekjejdkrcgva30sgle2/uuuknauijcfywdycpbu/sosqvmrn60i5r2dbjezfgv61mvn+6lk4m3qdabpujsdlytjvghsc2odirjaydzqt3uy+my4brjug2pdjvxrscbsiyonfrvvbv4ingkwibesiudxhnxfr4la5cid5ecu7m9zrxo/3lwcwywpghku1bsifcvi5vdupjggpag6zafctvmwxpofgwxdatmkhf8gqamhox3qdlhbhmxvsfgnw2uksntlq3frlzu7hgtjtufqumpc6yb/1q7jvh44ciglmnsdx3mczvul5wowwyhqy5cnwwbjowiuz75m+b8fy8l+gy/f3tsbwulpappwuuqgtfgcjyauzacjhovnuwfo0n8nf4r/4x/xyxguad5cjys/v0hhdsfjw==</latexit> <latexit sha1_base64="8uq0s6a0uxb6duix33+jrhacyia=">aaadnxicbvlnbhmxepyuf2x5aqphlhyjehjvs1shusevtelsa4dwkdyijikv17ux4j/zxqri2uficxgidtwqv14bb7qgpguky5/mm29mponcc2zdmn6p4lu379y9t3u/efdw0ept3s6tc6tqq+iikk7momewcibpydhh6vgbikxo6uw+en/yf1+osuzjt26p6vtgsrkseeyca9b7hnjamekdznmmqyyzimg8dzgsmtkxpiqexti3b5afqhqia+uzta18c48h4opzbtcfuyekjejdkrcgva30sgle2/uuuknauijcfywdycpbu/sosqvmrn60i5r2dbjezfgv61mvn+6lk4m3qdabpujsdlytjvghsc2odirjaydzqt3uy+my4brjug2pdjvxrscbsiyonfrvvbv4ingkwibesiudxhnxfr4la5cid5ecu7m9zrxo/3lwcwywpghku1bsifcvi5vdupjggpag6zafctvmwxpofgwxdatmkhf8gqamhox3qdlhbhmxvsfgnw2uksntlq3frlzu7hgtjtufqumpc6yb/1q7jvh44ciglmnsdx3mczvul5wowwyhqy5cnwwbjowiuz75m+b8fy8l+gy/f3tsbwulpappwuuqgtfgcjyauzacjhovnuwfo0n8nf4r/4x/xyxguad5cjys/v0hhdsfjw==</latexit>

17 Types as Propositions These types are exactly the propositions of linear logic, except! An instance of the Curry-Howard correspondence Typing rules correspond to sequent calculus inference rules Programs correspond to process expressions Communication corresponds to cut reduction

18 <latexit sha1_base64="c5t6/mfgkpk2vrenpoypll4scc4=">aaacxhicbvfnb9naen2yrxk+ujhywvehfalq4gqjkqcijoibqxbngqmorpf6nayyx9pzl1iw+s38dv4jn670v7boeiati6309n7mzsybzeqbfjd41ynu3l13/8how+6jx0+epuvtpp+gkr3jy2akcdmmkeuh+dgll/nuog4qk/w8w35o9fnl7layfeyry2ck5lougoepvno7s0qdc5c5ylxepted0vdpfeatmrupb3sv6jwlm7rocofwqow+kpwmn0apaghymqmu6igoh3r/1sa/sxt7g8pbouhtef+dvzojvvpbcbmlu51pkhtwkq49k4b4eq+sn9xgvgcsn92krg6blwholwluodjo6vx6dx0dmjwwxownpv2z/1buobarlyvmbx6bn7ww/k+gxogrxb7e1l9wvjq5ynvt+oj4vgtts8812wxtljj6q1u/as4cz15waqbziuxd2qkc3t5czaubdcyuyvxk4yp67hd1intb3efq+uts2kz+a/2wfxv/jogxfmh7huqs+/abzeyx8xffqtdnynmnt4hvon8bti4o44c/hkockk3skjfkfdknmxlhtsgpgzexyeqn+u3+kkvoyyqjjmpnats5rnlbtil6/hc7jd/o</latexit> <latexit sha1_base64="b/yajw0pvuyv0rk5ta7m+dba74s=">aaacxhicbvfnb9naen2yrxk+ujhywvehfalqyorelvmrevtaiygmjvrh1nq9tlbzl+2msyzl/br+cp+eg1fkn2cd9ebarlrp6b2znzk3mvmscdd42ylu3b5z997o/e6dh48ep+ntpp2alt0xy26v9domgvdsidfkvglqvga6u+isw75v9bml4ufac4qvezpn5kywkjmmvno7tuqtc595xkw9smm6po/s+iamkrcib3svmjvlmrrocglosqqwuoimh5nwrkhjrc5gqud0okt7qzb5vdrbgxwo1kfvgvgk7b1pzov388en0t3onmktl7uwybudoi8hdmc18yi5ek03kue4xpdsls4dnewlmnxr9rv6mja5lawpzybds/9w1ewdvdolmzrhaq5rlflfdvazx/k8ik2/zfnl55jvt4pf0aywxpuodn8mu5skoqwt3zsxxnbuvqcmexn2oxzbgt0yrrlvzxlri7aqihbfm8dfnuhtcp8ptp6ylk6p3zjcsqlujyh80i9ch5laqt99vdyaij7qkx26wwi64rbxdedvgsnrwzjgz+eoj2qto+q5euh2suzekmnyqkzktdj5qx6r3+qy+hcpckjykxp1rmqeka2ivv0fi3/hlq==</latexit> <latexit sha1_base64="b/yajw0pvuyv0rk5ta7m+dba74s=">aaacxhicbvfnb9naen2yrxk+ujhywvehfalqyorelvmrevtaiygmjvrh1nq9tlbzl+2msyzl/br+cp+eg1fkn2cd9ebarlrp6b2znzk3mvmscdd42ylu3b5z997o/e6dh48ep+ntpp2alt0xy26v9domgvdsidfkvglqvga6u+isw75v9bml4ufac4qvezpn5kywkjmmvno7tuqtc595xkw9smm6po/s+iamkrcib3svmjvlmrrocglosqqwuoimh5nwrkhjrc5gqud0okt7qzb5vdrbgxwo1kfvgvgk7b1pzov388en0t3onmktl7uwybudoi8hdmc18yi5ek03kue4xpdsls4dnewlmnxr9rv6mja5lawpzybds/9w1ewdvdolmzrhaq5rlflfdvazx/k8ik2/zfnl55jvt4pf0aywxpuodn8mu5skoqwt3zsxxnbuvqcmexn2oxzbgt0yrrlvzxlri7aqihbfm8dfnuhtcp8ptp6ylk6p3zjcsqlujyh80i9ch5laqt99vdyaij7qkx26wwi64rbxdedvgsnrwzjgz+eoj2qto+q5euh2suzekmnyqkzktdj5qx6r3+qy+hcpckjykxp1rmqeka2ivv0fi3/hlq==</latexit> <latexit sha1_base64="336amkgtxgs2wu7lu+o4juptbfq=">aaacxhicbvfna9taef2rx6n75bthxpaaqgohlkkhwaeeqptddy6ne0nkxgq1shfvfzujxekop6z/plde21/rtendnxrg4fhezm7mm9wpcrjhpzvrvfsphj7aedx98vtz8xe93zfnycvpxzhbzf0kzycungkmepwyoc+yzpw4ybcfv/rflfagrtnd2ompzjmjs8kzbirrnawvkytppeoiwwyjhdktlnmnqsoswj5dzmznmtzr0kkcu6wgrjwg6wemnwtpeluwmnmrhq7p3nkv/c7r9eodeb30lkg2oe82mcp2o5o0slzswibxdoayir1og+zrcixablqbciwv2excbmiyfjbt1uu39g1gclpah55bumb/rwiybqh1hji1wznc1lbkfzvazxztiycu/gwekjutfhsali+mjtsuqmh4ztblpshauvkbftiljqooghevwz6uz1mwg8nvtro5b20zvgurrmhmog9saurhv4tw3xbstc17h1twnimxhf8gprsguwsyugvfrsmto4hsozufthtukdx2/i44pzxiav4a949pn1fzia/jg7jhevkbhjntmijjwskp8ov8jn+it5gkikpuuqpopuyv2yro+19vyn1a</latexit> <latexit sha1_base64="tvlvcd4dp7qqxbtvqldlrsdq/ga=">aaackhicbvhjbhnbec0pwzcbe45cwksindizerjwljhiqisqcainljkwve6psvvutd09qwbkk1/dff6fi39ceznghjjaenqvqqvq1dhk4uow/w4lt27fuxtv5377wcnhj590dvfovakdpz430rjbgd1joakfrja0si5qjsvdjgdvl/rfftkvjp4s5pagcidavijjinsow4p3qbsyqpmspgffr0utzmfhg+hlqlofhwaryddbvgh7vynvf3oacdbabq2k0vbakq5covexewbdseexbje0abe1j4t8hho6jfcjij9svqss2ivilkwylj4d2ir9t6jb5f1cjwomwjd117ul+v/nb4vu7soolr1cx6szcl49tai6w0zowwfsfd1mvuswdft6x0rhiac5jwc5e3efxqfokifo8fy364yp4qqe4kx0jeybquik3ify+vnm2exzyoytk5q07+mvawxtghlmu/tvcqorvjtkfbszv2jhw+txnb8jzo8o84g/xaocwjp24bk8hwpi4tx04btooa8cvsmp+am/kr2km5wkb9apswtt8xs2inn/f+3my90=</latexit> <latexit sha1_base64="irra77wpg8ejyyoqt2i/j2lrl9c=">aaackhicbvhjbhnbeg0ps4lznmcns4sikvnmbifh5zigdokqekhgxflgsso9nxblvam7bmrgvvi1ibv8c0f+hpzywakltft0xlvx1auruzjqlv1ujtdu3rq9tx2nfffe/qcpozu758hwxmbpwgv9fwqblttyi0kk+84j6jhci9h0zuk/+iw+sgs+0czhqmpyyeokoegno7w4aa2bf9qwqaiv3mscaz88xavph5297cbbbr8o8jxyo97/+ufkx+pmbljt6helfbvgq0jbcjd55mjqgccpfm7brr3qgzjcgc8jnkaxdjrlknp+ldilr6ypzxbfsv9wnkbdmolrznrak3bvw5d/1qjp8dnfrnhhfxiu7fikzwmo6g4aavxnamrqmkpwncxfemdl6vgqmkuawsu4dxct8caoorzrzxlrq7hqwhgrm6zju0htox8xw3+csjdvxjraskjjeyh+klyujvdtklovslht5d1u6djnhnk73ik/6vx1cp7iii/4qzzkkvvfnnvcnrj9lrnx7jidsjpwy4j9y9/zt/yr2u26yvhyepwatny1j9hgjg//aknuzse=</latexit> <latexit sha1_base64="irra77wpg8ejyyoqt2i/j2lrl9c=">aaackhicbvhjbhnbeg0ps4lznmcns4sikvnmbifh5zigdokqekhgxflgsso9nxblvam7bmrgvvi1ibv8c0f+hpzywakltft0xlvx1auruzjqlv1ujtdu3rq9tx2nfffe/qcpozu758hwxmbpwgv9fwqblttyi0kk+84j6jhci9h0zuk/+iw+sgs+0czhqmpyyeokoegno7w4aa2bf9qwqaiv3mscaz88xavph5297cbbbr8o8jxyo97/+ufkx+pmbljt6helfbvgq0jbcjd55mjqgccpfm7brr3qgzjcgc8jnkaxdjrlknp+ldilr6ypzxbfsv9wnkbdmolrznrak3bvw5d/1qjp8dnfrnhhfxiu7fikzwmo6g4aavxnamrqmkpwncxfemdl6vgqmkuawsu4dxct8caoorzrzxlrq7hqwhgrm6zju0htox8xw3+csjdvxjraskjjeyh+klyujvdtklovslht5d1u6djnhnk73ik/6vx1cp7iii/4qzzkkvvfnnvcnrj9lrnx7jidsjpwy4j9y9/zt/yr2u26yvhyepwatny1j9hgjg//aknuzse=</latexit> <latexit sha1_base64="0d9mwu0dzalk4qzbkf6vabvw6dg=">aaackhicbvfnixnbeo2mx2v8yq5hl41b9lqzi4jhl654cbhbfc1uyceemk7npel/0v2jhcfxf41x/s/+gzvzozhdcxoe71v1vb0qnzkbsuxpl7lx89bto3t3+/fup3j4alb/cbzs4wwohvxwt0oiqktbmulsoheeqzckz8vlu41+/g19knz8pzxdqybayeokoejnbrx4d1odl7sdowq8+ksxbn501anpz4nhdphtg18heqegrivt2x5vusytadqaegpcumgzr9mwpemhcn0vmoaoxbjqvijqgmywbberrpmzymx5zx18hviw/beibr3cspcxuwmtwlvtq/5xc6tbr/w8ihuvwhnlayl2p6fqng2lcq2hezfdvi3izpngoz6xhgwpvqqgviz7clead4kiwzvdnle2iqsgjbcxns3aqpok/cfy+stsunx7ytgofw06dvgxthipgvqg1h1xwpoqh6vkx242rpvxfvlv56+ds5ehecsfs+hxsxevpfaepwuvwm5es2n2wk7zman2g/1kv9jv5cazjw+st5epsa+recx2ivnwfya1ydo=</latexit> Session Typing Judgments channels used by P x 1 : A 1,...,x n : A n {z ` P :: (x : A) channel provided by P Configuration ::= (P 1 P n ) <latexit sha1_base64="qcfabh9i3zqkwt4cqzm+pljvqry=">aaaclxicbvfna9taeb2rx6n75bshhnpzgglujzjcoseqmksehapxaz0yiinwq5w8el/yhbu4wr+gv6bx9jf02h/stz1dnxrg4fhezm7mm8jk4tfjfneie/cfphy09bj75omz5y962y/pvwkc4ynmphhjgnouheyjfcj52dpovsh5rte7xuox37jzwuivold8omitrsuyxudlvd3stpgakspdi9if5injlchjxkqdfo2hux6x93asvwqv5c5ib8dooh/1zwaaw3y7m85kwxrfntjjvb9me4utljoutpjfn2s8t5tnam0va9ruct9pv/ssyg5gslizf55gsml/rwip8n6uipcpke79bw1j/lfzqkibuzkis8ooi9lugm1og9xbpbxansg1ww9tnzkgiusdsskczyjnavdmrnihscl1lggweaobdczuyvxpw1l0jdm2e7ri7lno/wum7kj9b3hdijye+fblxnkyqzz52h6xzogqpyilct2mx3tdldlbzt8f5/t7accfw1foyr1b8abeqh9s+aadoiuhjidbd/gj1/areh0drr+jk3vq1lmpequbez39bargzpo=</latexit> <latexit sha1_base64="c2zejerfka3en4y5sz8ay639fq8=">aaaclxicbvhbahrbeo0db3g9bvtwis+nibc+zgzemaqcaypmizav3wqhsww1pt2zzfan7hplhfyl8i+cr/olpvon9u7mwu0sadicu9vvdaqwunhmkt+d6nbto3fvbdzvpnj46pgt3ubtm28ax/iqgwncqadppdb8iailh1nhqrwsnxftdwv9/at3xhj9gwewjxxuwlscaqyq7+1kp4rxqpf3d2h/kkc0u6kkgssn+hue5ppv3ttodpnl0jsgvqlbh/1vfz58f94o8s3okcsnaxtxycr4f5emfsctobrm8nk3azy3wkzq84sansjux+1ynzndcuxjk+pc00ix7l8vlsjvz6oimqpw4q9rc/k/mkcfbubkic4ma0elqqvbnwarvxertg2qa7yapmokrumxbtjsom5qzgia5ktyh7ijogaybf7rzp0xvvjv83awxeokzysuudsjrt9nhz23byyuwdhgqx9+issbi8ipj+1xyyyu0r1yqtdn+hk33ck97vxncpz6nw34yzjkmvnfbtkil0mfpoqtosthzecghjfl8op8jl+if9fbdbs9x6vgnauaz2qtoto/bujopg==</latexit> <latexit sha1_base64="c2zejerfka3en4y5sz8ay639fq8=">aaaclxicbvhbahrbeo0db3g9bvtwis+nibc+zgzemaqcaypmizav3wqhsww1pt2zzfan7hplhfyl8i+cr/olpvon9u7mwu0sadicu9vvdaqwunhmkt+d6nbto3fvbdzvpnj46pgt3ubtm28ax/iqgwncqadppdb8iailh1nhqrwsnxftdwv9/at3xhj9gwewjxxuwlscaqyq7+1kp4rxqpf3d2h/kkc0u6kkgssn+hue5ppv3ttodpnl0jsgvqlbh/1vfz58f94o8s3okcsnaxtxycr4f5emfsctobrm8nk3azy3wkzq84sansjux+1ynzndcuxjk+pc00ix7l8vlsjvz6oimqpw4q9rc/k/mkcfbubkic4ma0elqqvbnwarvxertg2qa7yapmokrumxbtjsom5qzgia5ktyh7ijogaybf7rzp0xvvjv83awxeokzysuudsjrt9nhz23byyuwdhgqx9+issbi8ipj+1xyyyu0r1yqtdn+hk33ck97vxncpz6nw34yzjkmvnfbtkil0mfpoqtosthzecghjfl8op8jl+if9fbdbs9x6vgnauaz2qtoto/bujopg==</latexit> <latexit sha1_base64="rwlodfw0qhp+tvdfckzjcimotai=">aaaclxicbvhbattaef2rt9s9oe1dh/qy1atsl0gkhyzainas8lcis+veebmxwo3kxxtjd5rghl+gx9px5kvyn1lfhuqkawuhc2z2zs4uvgqpsxlbir49fvl02dbz7ouxr16/6w2/pfemcryg3ejjrgxziiwgiqqumliomcokxbttrwv94gqcf0b/wpmfswk1fpxgdaov93aymwu1o4ehr3r3kkc0u6kkgs8n+hue5ppt3usne8ky6eoqrkgfrgoqb3dgwwl4o0ajl8z7yzsxog6zq8elzltz48eypmu1xaaomqi/bpf7zoloyepagreerrpk/61omfj+poqqqrho/h1tqf5x86iym7kyiavdmkps1ijvtopvwbgv2jyimq+gqrpj0dcfgbqudjjkwqcmoxh2oxzchomybn7ozp0xvvjvqzilrnhszkjx4l6h1j+nws7bzxy3rgjjoq+/xjwnkcmpj+215ezx6uesvehm/lwbbphed/4hon/fswp+kfspt9dx2sifyeeys1lyhrytuzigq8ljb/kh/cu30fvokpownaxso8665h3ziojsduogyvc=</latexit> Configuration Typing channels used by Ω = :: 0 channels provided by Ω

19 Theoretical Properties Without recursive types and processes Session fidelity (Preservation) <latexit sha1_base64="+nuye4wnqklnzrkagmbpafp/fh8=">aaac2nicfvfnbxmxehwwrxk+ujhysugrnlrzcomqp0ockbisrza2ujekjt7zjrt/yz60ila5cenc+wfc+sncwun2qfresjae3nuesd+mnzkber2fretgzvu372zdbd+7/+dho87245ngz15gx1hl/wamazu02cdjcgfoi+ixwtpx9m1sp71ah6q1n2nuckihmrkuaihso875u5lv5g9ba+c5tgwqwpmpgivgbwd8lbzy4wckafvzuqyxyda2kniezf+anl5rp9vb7a2kxwdza7qsqeprdmuqf1bmnboscki4y3qohjv4kklhop3pajoqu6jwleidgsowxowy4m8ju/ds+ngm8rx7940adahzpy5odtqjv7ul+u8tkay/90uul6md58pwumy+hsr9ys2nmxeasx5movm8xrbcai+kr0fqhgeil+n/ujiab0fxvxvtnle2jf8nghdrkpruutql+vdx9kepdiv6laonkoq0h2kxthqpgzqg1f0qyu2z7adkx2k2lnpxf9nv5k+dk73dlokpe93do2yrw+wpe8zesoy9zofsib2zphpsb/vffrdykidfkq/jt7u1atv3nrcnsr7/acjc428=</latexit> If = :: 0 and 7! 0 then = :: 0 Deadlock freedom Termination <latexit sha1_base64="1lyrooazg3xuh/szd+abbyaowgc=">aaac4xicbvfdaxnbfj2s2tb40vqffrlmpd51d4tgqs8fh6wgwng0gw4id2fvjkpmy5lzjsz5ab6jr/4w8ccizm5smk336xdpuxpvnjmbwz1pkt+d6nbto1vbo3e79+4/eljb23t07nrlgq6zftqocnaoumkh517gyfgemqu8yoevg/7ic1rhtfrkfwbheqakl5ybd61j7/pbkg6ynyal0ezqaowj2xuju6dhx3rf7a+on6ekupbixgulr43mdovlggp7xyq+gof1+ouwvwbsaylxiv1bd9lrjwdjw/qmsnegt9z1ntnrjljcs0qi8kyac5dpyvy4bus5e7jszpvda2wou7wmuifen65bb5b0wegu7r2lvp623x8napdolwqelbl8zf3nmuz/oecl2iutatmyd5ykpevs8xpfho1rrkzlubhvmwulalcocymw3clzyheammvdfyibgqxmq2qb24zvugxfdrgivlm/qzousrtvwuqpc26w9qvjn6yo46elr8slit2iuyvnv8g0ktojwmiwtbtlk0v63fmb4pzwia34w2h/5hsdyg55qp6s5yqll8kjosvnzegy+ux+dly62xglvkxfox8radrzzzwmgxx9/as6zuvj</latexit> If = :: 0 then poised or 7! 0 for some 0 <latexit sha1_base64="tigiv844f9f9gi5fdx7/yomkdjs=">aaac0hicbvhlbhnbebwvr2betjhygwgjia7xborelfwicsbisishe0tzy3pnz+yr56wzdsbawygrh8y/8a9c4czyxisc0kdsvc10d3xhlayypj8ayzwr167f2ljzvhx7zt17rc2tk2cnnvees8r6fggbk2l4dyuq3neegy4upy0mzxf66tn3qvrzhmeodzsmjbssauzq2pr4utbo/gk0bpqflxdgnh+t+qjo/j5d8dsdimnuom0l5bpcqpvhse2murd+r7ydh0shrjyvgzfzzrdvtnfszdhliktbm9r1pnxs9ppssqnmbpmcem6y1oggao+skt5v5tpahbajjphzhay0d4nqgcwcpopmuzxhwin0yf77ogidwkwx0akbx+gitid/qwxu4ge+joiia/bu2zfk69og2btu0rgpcsnww4ipomjpintass8zqlkewlym+1a2bg8m44xwujlvryirbh4vaky4rnjpbpevyut3e+nm1voha1fu3v6iv3sf6ykosei6t4pzi7k9rtkxmw3zzrxfdjh5y+bkdyel+m1u+/covsogeuaekscki8/iitkix6rhgplofpjf5hfynvmcfem+rqxjo35zn6xv8u0peuxhrq==</latexit> If ` :: 0 then 7! 0 for 0 poised With recursion Session fidelity (Preservation) Deadlock freedom Ω is poised if all processes in Ω attempt to communicate along a channel in the external interface

20 Mode of Communication Both synchronous and asynchronous communication can be supported Asynchronous: messages still must appear in order (for session fidelity) Synchronization via polarization of the types Synchronous: messages can be coded via one-action processes Asynchronous seems to be the right default Closer to reasonable implementation Generalizes to channels with multiple endpoints

21 Session Types, in CC0 choice stack_req { <?int ;?choice stack_req> ins; <!choice stack_response> del; ; choice stack_response { < > none; <!int ;?choice stack_req> some; ;? = receive! = send ; = sequence of interaction < > session type typedef <?choice stack_req> stack;

22 Tracing the Type-Checker stack $s elem(int x, stack $t) { switch ($s) { case ins: { % $s : <?int ; stack> - $t : stack int y = recv($s); % $s : stack - $t : stack stack $r = elem(x, $t); % $s : stack - $r : stack $s = elem(y, $r); case del: { % $s : <!choice stack_response> - $s.some; % $s : <!int ; stack> - $t : stack send($s, x); % $s : stack - $t : stack $s = $t;

23 Tracing the Type-Checker stack $s empty() { switch ($s) { case ins: { % $s : <?int ; stack> -. int x = recv($s); % $s : stack -. stack $e = empty(); % $s : stack - $e : stack $s = elem(x, $e); case del: { % $s : <!stack_response> -. $s.none; % $s : < > -. close($s);

24 The Problem with Sharing #c : A Client 1 Typed shared channel If both clients can freely interact along #c Client 2 session fidelity will be violated Client 1 ins x #c : store Typed shared channel ins y Client 2

25 Linear and Shared Channels Type Provider action Continuation A ::= N{` : A``2L receive some k 2 L A k {` : A``2L send some k 2 L A k A ( B receive channel c : A B A B send channel c : A B 1 terminate none 8x:.A receive v : [v/x]a 9x:.A send v : [v/x]a #S detach from client S <latexit sha1_base64="wcboemlsvpzbwx9ttl0zlvrstcc=">aaafxnicjvtnbhmxen42tsmb/sefiytfa+kamgqhuuvcatpldz0utwkrxvhkegctk157zxvthnvegjfkxgvwdszulizpilrluxrpzpfnjgfsfisfdfx6r5xv0lp5/cng08qz55tb2zu7ly6tjg2hntdsm+s+sycfgryttsj1zicffqlx/dfxzr8ag7fcqws3jaabsoesgedmoaq3u/qh9megvmkmydm0kvxkmvyirnek+nowryfjbyltu92z0wphgygmzzwzw7fwtqiyfvpkow0iu0jxqo9m8wv+e3oj3dclcqupszo0epla016hoekr0xmfaq5idmtqeeh1vjirmb3vwx2t/mtr+dm3jmrsh0tuqfmpzg4rkrwughwtpcahtcmqpmqzgdnd0un4b8pqm0eqh38ummofdzahjhskubl2uogiqp90grlow7dysdjmqwpxpv2q92kxhooyg2fmph5nxjt0w8tummf5tp+hyovjejzpcaym3xtcvr5rhbo/oz9v4ynjfegco0pcpqdlclvhnko5q2xzldne0vwejhoi3by+vagy2u1893b26vv1fjfloxer7b26re+hnued9xzxrjfxhofixiwzttoor66lde5wcwmfxhyixkdsab0ufqvbdpp8yqbklwp8gi3at2fsmxyekbdq2mnyr8+quag9b8uud9qsc5mzgh+n2c1nhkg9ehwxgxccdbohohgnjxfjblektppsjsc+wpy7ouwbcsownmwydd5ofc8wokvg6wbltydvixq4iq6ccsccyujzkyjs5fpkfo4iqbutstscqoayhnladco5vkhjoczdjkztwsfeno6f/ljw+xg/gfjxbmqjv6wn77x3xnvvnbzp3qf34p15by+xlkrfsj9kp9d+l9flm+xtwnv15rbz0lty5vd/atgrrco=</latexit> sha1_base64="nwccuw8fekkdqrisay22lqwbere=">aaafxnicjvtnbhmxen42dzra/+ccxmwiaxfatykqqcihmvbsqw9f/zxikhk8s4kvr72yvwncai/a2/agvak3xob3yha3neltpfra1xhmvm9mpgp3iimsq9d/ls2xvsophq4+qjx+sra+sbn19nzq2ha441pqc9ljfqrqcoaek3azgwbht8jfb3iq2s9gykzq6trniuierk9eidhzqopulf+hpeglltbj2crnjjdsphwc6zup/jts6xfyiud0znds9ej4yajjgc/uckcveypmhzbsdgpcdtk10kpz/ij/hf4jn0hpqkfk0istbibqtfsoqfdkampngimyabe6bfidfuzqzm91cucr/3iufs6tixnb+5jbup49mvuesi2lipslqfebuwokqfisym6wfxfegblazbdk4e+fplrbdcybcyvibqydvdii0cddrabamkx8ndrt6li8q9/mvzgvotrc4jk5j98e1cad1iivjhee7x+o8miynkuanifx5xaxr68uoczptqzv+oayh5da6jbwkuc53fy4twluunk8zq5xnjmh4xwin4nvvsimdj3f3c3t+k49x2rrafwl23tu/eunh5s/j7tbs5eyk49dzooswdtu1cpxqtonuis0qmmleend1oc2ioqfydtjfjft8go1psew4kcwquw7i0hyao0k7kfnynza3rzlyjtt1oxmtiypxuzmm0ok7gs+n40ldjujufgmk8elzijyeqdj9hiqx2d7nzygwlgrwe82jazvnl4xc9eio3wapvra90x13qahtgvgjjd0yvbeafi+cnnhkdtolllugqjmmbzawnqluvzby7cmq4ymbvrbxjrun/yicp5up4hyz2zkovesve+f99j74zw8d96ed+gde2cel52wvps+lb6v/c4/kk+vnwrx5avrzdnvbpwf/wxtqq8+</latexit> sha1_base64="g0pr4ix/ferc6gp9zcn8wjm5rt8=">aaafxnicjvtbbhmxen02tsmb0hyusfwsghah1cqiisosutneeuihqe1bky4ixzubwphak9ubjqz2bd/jjr/gh5jddu3sfkmwdjwemfdmxjn2p5lcunr919p6aao8+wtraexz8+0xo7t7l6+sjg2hntdsm5s+sycfgryttsjnzicffqnx/dfjzr8eg7fcq0s3jaabsoesgedmoaq3t/6h9megvmkmydm0kvxkmvyirvek+nowryfjjyltu9250wphgygmzzxzw4lwtqiyfvpkow0iu0jxqo9m8yv+e3or3dclcqupszo0epla016hoekrszmfaq5idmtqeeh1vjirmb3vwx2t/mtr+dm3jmrsh0tuqfmpzg4rkrwughyvpmahtcmqpmqzgdnd8un4b8pqs0cqh38ummofdzahjhskuyv2uogiqp90frlow7dysdjmqwpxaf2y92k5hooyg2fmph5nxjt0w6tummf5tp+hyovjefzpcaym3xtcvr5vhbo/uzhx4ynjfegco0pcpqdlclvhnke5q2xzldne0uiejhoi3ak+vagy2my+e7v79yn6vsiq0jgj+95snff21m4wvx6hymyls7btqeeui3rocalphcywiszhbaadfbulwxat/gkm5b1qfiitwe9hupl2ezgw0npp2efpklmhvw/lla/arauzmrofjdnnz4ziprb8orsxhhytoaiyj48xyqsxje6t7cugvsd2ozlfgxejsj5sga3eahwvlqjfrusas7wa74sauceonaranghoi5gi0urz5jaoiqm1lblugqjmmbzzwnqruvzb47amq4ymbvrbxjtun/yqcpxpoihyt/r+0emsk1veg++t98fref+8i+/uo/fahi9dlr6xfpr+bvwub5a3yzuf6/radppkw1rl138bxu6srg==</latexit> S ::= "A accept client A!A, #"A <latexit sha1_base64="t2zuff3t2nan3q21zn9aonsskpu=">aaaclnicbvhlihnbfk20rzg+mror3jqgxyvmd4vgwidoioisxmrhzgltivrxqjtf6mxvbydq9b/4na4e/qb3/o03yszmjbekotxzn+ewtskawfank1y6foxqta3r3rs3b92+09u+exrs47kycqush5usccwngiiejuboc6zljy7l+zslf/xv+cct+qwlj8aa1uzwkjna16t3jd5sd2ixv4cxznrkfcn2acym9ts0xbnyna4/ejdp9bodbgx0isjpqp/17x8fcdpgst0zyrheaggakxbcsz45gefmqxil2m7rboeyn7nanca0tiswjqufwvoypvnawy/paf15/82itiew0cvgagazcj5bov/lbddml/wuyavizfnla8k3p4fqdxylcq0iw9fdvi2iyolsqtqvxnbqcwsme4n7ud5jnnfante6ow9thasggxcxncxiiu0l/hts/wkuxrtfoniqiqbdgfxsyqxa1dyk7lrxa6p8n1uau9nqdvew+xnll4kj5zs54g9zf/+qrg2lpccpyfosk5dknxysarkstr6r7+qn+zxct14lb5n369ckc5zzj2xymvgllwrpea==</latexit> <latexit sha1_base64="rwbzraaqkjbl+rh4zt9gr+cytwq=">aaaclnicbvhdahnbfj6sfzx+pxojcdiafc+ku1skfgq1rcreejgiaqpdem5ozjddzmfgmbmtydhl73warwr6dn77dl6ek6qxpvxamb/no7/fyy0udppkdyu6dv3gzvtrt9t37t67/6cz/vdi6doy3mdaajviwxepfo+jqmkhxnkocsmp8+m7ox98yq0twn3gmehdckolcseag2vueemfnfs028nqclcl5f+yheqzst5ttfbaz7ujh90fdbrjrriwehwkf6d79tf54z+vt897o/xwibrhdcuvmgnonasjwaehi4jj3rsz2nedbaolpwlqqcxd0c8wauil4bntqtvwfnkf998md5vzsyopkrxgxf3m5s7/cg4rsdm7durcmbbu6lkw1wmw2b56ouynxlhlmeutkwo6v5coheum5swayfaefsibgawgqeevbszqxyrvhq93usvofczuwe3h0prtvjjgbxlckclhfreqxiwjeetuxezmmq2kdduwveimxdmot0gvk38vhg1upaefjt29a7k0nfkepcevserekd1yqhqktxj5rr6th+rn9djajd5hh5ahuesi5xfzsaj3f2nx0vu=</latexit> <latexit sha1_base64="rwbzraaqkjbl+rh4zt9gr+cytwq=">aaaclnicbvhdahnbfj6sfzx+pxojcdiafc+ku1skfgq1rcreejgiaqpdem5ozjddzmfgmbmtydhl73warwr6dn77dl6ek6qxpvxamb/no7/fyy0udppkdyu6dv3gzvtrt9t37t67/6cz/vdi6doy3mdaajviwxepfo+jqmkhxnkocsmp8+m7ox98yq0twn3gmehdckolcseag2vueemfnfs028nqclcl5f+yheqzst5ttfbaz7ujh90fdbrjrriwehwkf6d79tf54z+vt897o/xwibrhdcuvmgnonasjwaehi4jj3rsz2nedbaolpwlqqcxd0c8wauil4bntqtvwfnkf998md5vzsyopkrxgxf3m5s7/cg4rsdm7durcmbbu6lkw1wmw2b56ouynxlhlmeutkwo6v5coheum5swayfaefsibgawgqeevbszqxyrvhq93usvofczuwe3h0prtvjjgbxlckclhfreqxiwjeetuxezmmq2kdduwveimxdmot0gvk38vhg1upaefjt29a7k0nfkepcevserekd1yqhqktxj5rr6th+rn9djajd5hh5ahuesi5xfzsaj3f2nx0vu=</latexit> <latexit sha1_base64="qwq0zvm63hxb74y+hbdg3+m077g=">aaaclnicbvhdahnbfj5s1db4l9ybwzvrohgh3v0pwchii4i98ckiaqpdem5ozjdd5s+zs5yw7bv4nn7qi/g2ttjcmnydw3yc7/x+p7rsemyyp51k69bto9s7d7v37j94+ki3u3fmtemyhzijjruv4lkumg9rooqj6ziouvlzcv5+yz9/584lo7/iwvkxglqlsjda6jr0xozn7qktjgp0anqt+bfiiiziai51w7worwpjr08mvx62n62m3gt5gvtj2gat3c4ofmgn4hqzbo8v8szioibdwsrvu0xjuqu2h5pfrkhbct8oq4va+ij6prqylj6ndox9nyoa8n6hyhipagf+ord0/pfzqmat3dsss8xauwlqwtanwepwhis2dxlnroapgknr0kwcdcoczygxeqbziu5d2qwcmiw6b3szzpgqrup5viuucrykosvupsxwx+bctuha4oyuir36wcwtbiog5z61l5izxewhqvsxm/ftn94iv678txd2zj+p+hpwpz5dx2whpcxpysusk7fkmjysarksrn6qn+qx+z08sd4lh5kpv6fjz53zmgxymvglpv3m+q==</latexit>

26 A Shared Queue queue A = "N{ ins : A ( #queue A, del : { none : #queue A, some : A #queue A <latexit sha1_base64="srxwwyodjuivrgqqxgx3l/1pidk=">aaadaxichvjbaxnbfn5nvnt1luil6mtgivhqmmwrleklxzc++fdrtifoclozz5mhc3nm1hcgffrvf5+/wv/gm7ppgk2jegdg45z5zndumebmuuhwr9xq37h56/bonetuvfsphna6j86skg2fevvcmxfglhamyesy4zdwbojiojxni3d1/pwlgmuu/orwgiaczcqrgcuuukadxzidgzpeksxjclylfwxyjwxzn0sooaqmx+gq4vijj5fmzsvs+wgfoj4wnklbotfoggguogci52op0rz/nxbwgt+uotnwmuox0ry0v7njjaeo/sdlk8cqay24a2mv+rcp7+kqfv0eg8z/9jlmo73h3nbtabukdehfjz1ou/e4anbsghsue2sv0qf2e0+my5rdledsgiz0qwzweaakauzer3duorfbk6miffoo6ddae5xhibb2jblwuxa3t9djtfovmesemsuth2b9bmqgrmamblbjionj2jcuw7doztffyzftqd4kldmd1pfvaiqafvpbde4mos6czoaankovovul4dtkzm09zria8z5if1wwxflx2m2mwg9gnmqzfhrgcf/ygv5yqmsrhgy4cgrkvvuu0uut3wzn+3tpwb/2e0cnzvz2omfr8+hlleavo6pojdqnrhgnp/hx+fv8vfwz3w0/at+9/nqkg87jampavd9sbbfs</latexit> <latexit sha1_base64="srxwwyodjuivrgqqxgx3l/1pidk=">aaadaxichvjbaxnbfn5nvnt1luil6mtgivhqmmwrleklxzc++fdrtifoclozz5mhc3nm1hcgffrvf5+/wv/gm7ppgk2jegdg45z5zndumebmuuhwr9xq37h56/bonetuvfsphna6j86skg2fevvcmxfglhamyesy4zdwbojiojxni3d1/pwlgmuu/orwgiaczcqrgcuuukadxzidgzpeksxjclylfwxyjwxzn0sooaqmx+gq4vijj5fmzsvs+wgfoj4wnklbotfoggguogci52op0rz/nxbwgt+uotnwmuox0ry0v7njjaeo/sdlk8cqay24a2mv+rcp7+kqfv0eg8z/9jlmo73h3nbtabukdehfjz1ou/e4anbsghsue2sv0qf2e0+my5rdledsgiz0qwzweaakauzer3duorfbk6miffoo6ddae5xhibb2jblwuxa3t9djtfovmesemsuth2b9bmqgrmamblbjionj2jcuw7doztffyzftqd4kldmd1pfvaiqafvpbde4mos6czoaankovovul4dtkzm09zria8z5if1wwxflx2m2mwg9gnmqzfhrgcf/ygv5yqmsrhgy4cgrkvvuu0uut3wzn+3tpwb/2e0cnzvz2omfr8+hlleavo6pojdqnrhgnp/hx+fv8vfwz3w0/at+9/nqkg87jampavd9sbbfs</latexit> <latexit sha1_base64="srxwwyodjuivrgqqxgx3l/1pidk=">aaadaxichvjbaxnbfn5nvnt1luil6mtgivhqmmwrleklxzc++fdrtifoclozz5mhc3nm1hcgffrvf5+/wv/gm7ppgk2jegdg45z5zndumebmuuhwr9xq37h56/bonetuvfsphna6j86skg2fevvcmxfglhamyesy4zdwbojiojxni3d1/pwlgmuu/orwgiaczcqrgcuuukadxzidgzpeksxjclylfwxyjwxzn0sooaqmx+gq4vijj5fmzsvs+wgfoj4wnklbotfoggguogci52op0rz/nxbwgt+uotnwmuox0ry0v7njjaeo/sdlk8cqay24a2mv+rcp7+kqfv0eg8z/9jlmo73h3nbtabukdehfjz1ou/e4anbsghsue2sv0qf2e0+my5rdledsgiz0qwzweaakauzer3duorfbk6miffoo6ddae5xhibb2jblwuxa3t9djtfovmesemsuth2b9bmqgrmamblbjionj2jcuw7doztffyzftqd4kldmd1pfvaiqafvpbde4mos6czoaankovovul4dtkzm09zria8z5if1wwxflx2m2mwg9gnmqzfhrgcf/ygv5yqmsrhgy4cgrkvvuu0uut3wzn+3tpwb/2e0cnzvz2omfr8+hlleavo6pojdqnrhgnp/hx+fv8vfwz3w0/at+9/nqkg87jampavd9sbbfs</latexit> <latexit sha1_base64="srxwwyodjuivrgqqxgx3l/1pidk=">aaadaxichvjbaxnbfn5nvnt1luil6mtgivhqmmwrleklxzc++fdrtifoclozz5mhc3nm1hcgffrvf5+/wv/gm7ppgk2jegdg45z5zndumebmuuhwr9xq37h56/bonetuvfsphna6j86skg2fevvcmxfglhamyesy4zdwbojiojxni3d1/pwlgmuu/orwgiaczcqrgcuuukadxzidgzpeksxjclylfwxyjwxzn0sooaqmx+gq4vijj5fmzsvs+wgfoj4wnklbotfoggguogci52op0rz/nxbwgt+uotnwmuox0ry0v7njjaeo/sdlk8cqay24a2mv+rcp7+kqfv0eg8z/9jlmo73h3nbtabukdehfjz1ou/e4anbsghsue2sv0qf2e0+my5rdledsgiz0qwzweaakauzer3duorfbk6miffoo6ddae5xhibb2jblwuxa3t9djtfovmesemsuth2b9bmqgrmamblbjionj2jcuw7doztffyzftqd4kldmd1pfvaiqafvpbde4mos6czoaankovovul4dtkzm09zria8z5if1wwxflx2m2mwg9gnmqzfhrgcf/ygv5yqmsrhgy4cgrkvvuu0uut3wzn+3tpwb/2e0cnzvz2omfr8+hlleavo6pojdqnrhgnp/hx+fv8vfwz3w0/at+9/nqkg87jampavd9sbbfs</latexit> The section describes a critical region Types must be equisynchronizing (released at the same type they are acquired to guarantee session fidelity) Certain deadlocks can now arise Sharing and critical regions are manifest in the type!

27 Why is Functional Programming So Effective? Functions are a universal and fundamental abstraction Intuitionistic Logic Logic Type Theory Types Simple Types (,,+,α) Computation β-reduction

28 What about Concurrency? Processes and Channels are a Fundamental Abstraction! Logic Linear Logic! [Caires & Pf 10] Concurrent Type Theory? Session Types! [Honda 93] Types π-calculus + fwd Computation Communication

29 Session Types at Present Scribble multiparty session types ABCD project groups.inf.ed.ac.uk/abcd/ Simon Gay, Nobuko Yoshida, Philip Wadler At CMU SILL (functional), CC0 (imperative), RSILL (time and work) Thanks to my collaborators: Coşku Acay, Stephanie Balzer, Luís Caires, William Chargin, Ankush Das, Henry DeYoung, Anna Gommerstadt, Dennis Griffith, Jan Hoffmann, Limin Jia, Jorge Pérez, Rokhini Prabhu, Klaas Pruiksma, Miguel Silva, Mário Florido, Bernardo Toninho, Max Willsey

30 A Paper I Love Types for Dyadic Interaction, Kohei Honda, CONCUR 1993 Kohei Honda,

Intersections and Unions of Session Types

Intersections and Unions of Session Types Intersections and Unions of Session Types Coşku Acay Frank Pfenning Carnegie Mellon University School of Computer Science ITRS 2016 C. Acay & F. Pfenning (CMU) Intersections and Unions of Session Types

More information

Work Analysis with Resource-Aware Session Types

Work Analysis with Resource-Aware Session Types Work Analysis with Resource-Aware Session Types Ankush Das Jan Hoffmann Frank Pfenning LICS, July 10, 2018 1 Goal for this Talk Resource Analysis for Concurrent Programs Execution Time Memory Usage 2 Why

More information

Lecture Notes on Session Types

Lecture Notes on Session Types Lecture Notes on Session Types 15-814: Types and Programming Languages Frank Pfenning Lecture 22 November 27, 2018 1 Introduction Some of the material in this lecture, specifically, the discussion of external

More information

From Linear Logic to Session- Typed Concurrent Programming

From Linear Logic to Session- Typed Concurrent Programming From Linear Logic to Session- Typed Concurrent Programming Frank Pfenning Joint work with Luís Caires, Bernardo Toninho, Dennis Griffith January 13, 2015 POPL 2015 Tutorial, Mumbai 1 Outline The Curry-

More information

Design and Implementation of Concurrent C0

Design and Implementation of Concurrent C0 Design and Implementation of Concurrent C0 Max Willsey Carnegie Mellon University mwillsey@cmu.edu Rokhini rabhu Carnegie Mellon University rokhini@gmail.com Frank fenning Carnegie Mellon University fp@cmu.edu

More information

Objects as Session-Typed Processes

Objects as Session-Typed Processes Objects as Session-Typed Processes Stephanie Balzer and Frank Pfenning Computer Science Department, Carnegie Mellon University AGERE! 2015 The essence of object-orientation 2 The essence of object-orientation

More information

Intersections and Unions of Session Types

Intersections and Unions of Session Types Intersections and Unions of Session Types Coşku Acay Carnegie Mellon University Pennsylvania, USA cacay@cmu.edu Frank Pfenning Carnegie Mellon University Pennsylvania, USA fp@cs.cmu.edu Prior work has

More information

Parallel Complexity Analysis with Temporal Session Types

Parallel Complexity Analysis with Temporal Session Types 1 Parallel Complexity Analysis with Temporal Session Types ANKUSH DAS, Carnegie Mellon University, USA JAN HOFFMANN, Carnegie Mellon University, USA FANK PFENNING, Carnegie Mellon University, USA We study

More information

Parallel Complexity Analysis with Temporal Session Types

Parallel Complexity Analysis with Temporal Session Types Parallel Complexity Analysis with Temporal Session Types ANKUSH DAS, Carnegie Mellon University, USA JAN HOFFMANN, Carnegie Mellon University, USA FANK PFENNING, Carnegie Mellon University, USA We study

More information

Type-driven Development of Communicating Systems in Idris

Type-driven Development of Communicating Systems in Idris Type-driven Development of Communicating Systems in Idris Edwin Brady (ecb10@st-andrews.ac.uk) University of St Andrews, Scotland, UK @edwinbrady Lambda World, October 1st 2016 Idris is a pure functional

More information

A Logical Foundation for Session-based Concurrent Computation

A Logical Foundation for Session-based Concurrent Computation A Logical Foundation for Session-based Concurrent Computation Bernardo Toninho [Co-advised by: Luís Caires and Frank Pfenning] Computer Science Department Carnegie Mellon University Universidade Nova de

More information

Session-Typed Concurrent Contracts HANNAH GOMMERSTADT

Session-Typed Concurrent Contracts HANNAH GOMMERSTADT Session-Typed Concurrent Contracts HANNAH GOMMERSTADT LIMIN JIA & FRANK PFENNING 1 Sorting Process 2 Sorting Process 3 3 Sorting Process 3 5 4 Sorting Process 3 5 4 5 Sorting Process 3 5 4 6 Session Types?!

More information

Objects as Session-Typed Processes

Objects as Session-Typed Processes Objects as Session-Typed Processes Stephanie Balzer and Frank Pfenning Computer Science Department Carnegie Mellon University, USA Abstract A key idea in object-oriented programming is that objects encapsulate

More information

Gay, S. J. (2016) Subtyping supports safe session substitution. Lecture Notes in Computer Science, 9600, pp (doi: / _5)

Gay, S. J. (2016) Subtyping supports safe session substitution. Lecture Notes in Computer Science, 9600, pp (doi: / _5) Gay, S. J. (2016) Subtyping supports safe session substitution. Lecture Notes in Computer Science, 9600, pp. 95-108. (doi:10.1007/978-3-319-30936-1_5) This is the author s final accepted version. There

More information

Idioms for Interaction: Functional Types, Process Types and Distributed Systems

Idioms for Interaction: Functional Types, Process Types and Distributed Systems Idioms for Interaction: Functional Types, Process Types and Distributed Systems http://mrg.doc.ic.ac.uk/ Nobuko Yoshida Imperial College London 1 Idioms for Interaction Multiparty Session Types Outline

More information

Proofs-Programs correspondance and Security

Proofs-Programs correspondance and Security Proofs-Programs correspondance and Security Jean-Baptiste Joinet Université de Lyon & Centre Cavaillès, École Normale Supérieure, Paris Third Cybersecurity Japanese-French meeting Formal methods session

More information

Static Deadlock Detection for Go by Global Session Graph Synthesis. Nicholas Ng & Nobuko Yoshida Department of Computing Imperial College London

Static Deadlock Detection for Go by Global Session Graph Synthesis. Nicholas Ng & Nobuko Yoshida Department of Computing Imperial College London Static Deadlock Detection for Go by Global Session Graph Synthesis Nicholas Ng & Nobuko Yoshida Department of Computing Imperial College London Contributions Static deadlock detection tool dingo-hunter

More information

Modal Logic: Implications for Design of a Language for Distributed Computation p.1/53

Modal Logic: Implications for Design of a Language for Distributed Computation p.1/53 Modal Logic: Implications for Design of a Language for Distributed Computation Jonathan Moody (with Frank Pfenning) Department of Computer Science Carnegie Mellon University Modal Logic: Implications for

More information

Processes as Types: A Generic Framework of Behavioral Type Systems for Concurrent Processes

Processes as Types: A Generic Framework of Behavioral Type Systems for Concurrent Processes Processes as Types: A Generic Framework of Behavioral Type Systems for Concurrent Processes Atsushi Igarashi (Kyoto Univ.) based on joint work [POPL2001, TCS2003] with Naoki Kobayashi (Tohoku Univ.) Programming

More information

CLF: A logical framework for concurrent systems

CLF: A logical framework for concurrent systems CLF: A logical framework for concurrent systems Thesis Proposal Kevin Watkins Carnegie Mellon University Committee: Frank Pfenning, CMU (Chair) Stephen Brookes, CMU Robert Harper, CMU Gordon Plotkin, University

More information

Typed Lambda Calculus for Syntacticians

Typed Lambda Calculus for Syntacticians Department of Linguistics Ohio State University January 12, 2012 The Two Sides of Typed Lambda Calculus A typed lambda calculus (TLC) can be viewed in two complementary ways: model-theoretically, as a

More information

Linear Dependent Types

Linear Dependent Types Linear Dependent Types Zhaohui Luo Royal Holloway University of London (Based on work with Yu Zhang at Chinese Academy of Sciences) Linear types and dependent types Linear types (Girard 1987): A B, Dependent

More information

Session Types for Object-Oriented Languages

Session Types for Object-Oriented Languages Introduction Basics Conditional SoS Meth Operational Semantics Connect Operational Semantics Interactions Typing Properties Future Work p. 1/1 Session Types for Object-Oriented Languages Dimitris Mostrous

More information

Type assignment for intersections and unions in call-by-value languages

Type assignment for intersections and unions in call-by-value languages Type assignment for intersections and unions in call-by-value languages Joshua Dunfield and Frank Pfenning Triple Project Carnegie Mellon University 8 April 2003 FOSSACS 03, Warsaw, Poland Type assignment

More information

Function compose, Type cut, And the Algebra of logic

Function compose, Type cut, And the Algebra of logic Function compose, Type cut, And the Algebra of logic XIE Yuheng SZDIY community xyheme@gmail.com Abstract In this paper, I demonstrate the Curry-Howard correspondence of Gentzen s sequent calculus, and

More information

Multiparty Session Types and their Applications

Multiparty Session Types and their Applications Multiparty Session Types and their Applications http://mrg.doc.ic.ac.uk/ Nobuko Yoshida, Rumyana Neykova Imperial College London University of Camerino 29th April, 2016 1 Selected Publications 2015/2016

More information

Scribble, Runtime Verification and Multiparty Session Types

Scribble, Runtime Verification and Multiparty Session Types Scribble, Runtime Verification and Multiparty Session Types http://mrg.doc.ic.ac.uk/ Nobuko Yoshida Imperial College London 1 In collaboration with: Matthew Arrott (OOI) Gary Brown (Red Hat) Stephen Henrie

More information

Typed Lambda Calculus

Typed Lambda Calculus Department of Linguistics Ohio State University Sept. 8, 2016 The Two Sides of A typed lambda calculus (TLC) can be viewed in two complementary ways: model-theoretically, as a system of notation for functions

More information

Meta-programming with Names and Necessity p.1

Meta-programming with Names and Necessity p.1 Meta-programming with Names and Necessity Aleksandar Nanevski Carnegie Mellon University ICFP, Pittsburgh, 05 October 2002 Meta-programming with Names and Necessity p.1 Meta-programming Manipulation of

More information

Type Systems for Concurrent Programs

Type Systems for Concurrent Programs Type Systems for Concurrent Programs Naoki Kobayashi Tokyo Institute of Technology Type Systems for Programming Languages Guarantee partial correctness of programs fun fact (n) = if n=0 then 1 else n fact(n-1);

More information

Functional Programming with Isabelle/HOL

Functional Programming with Isabelle/HOL Functional Programming with Isabelle/HOL = Isabelle λ β HOL α Florian Haftmann Technische Universität München January 2009 Overview Viewing Isabelle/HOL as a functional programming language: 1. Isabelle/HOL

More information

FuSe: an OCaml implementation of binary sessions

FuSe: an OCaml implementation of binary sessions FuSe: an OCaml implementation of binary sessions Luca Padovani Dipartimento di Informatica, Università di Torino Italy Contents 1 Overview 2 1.1 Introduction to binary sessions..............................

More information

Session Types and Multiparty Session Types. Nobuko Yoshida Imperial College London

Session Types and Multiparty Session Types. Nobuko Yoshida Imperial College London Session Types and Multiparty Session Types Nobuko Yoshida Imperial College London 1 Communication is Ubiquitous Internet, the WWW, Cloud Computing, the next-generation manycore chips, message-passing parallel

More information

Non-blocking Array-based Algorithms for Stacks and Queues. Niloufar Shafiei

Non-blocking Array-based Algorithms for Stacks and Queues. Niloufar Shafiei Non-blocking Array-based Algorithms for Stacks and Queues Niloufar Shafiei Outline Introduction Concurrent stacks and queues Contributions New algorithms New algorithms using bounded counter values Correctness

More information

On the Logical Foundations of Staged Computation

On the Logical Foundations of Staged Computation On the Logical Foundations of Staged Computation Frank Pfenning PEPM 00, Boston, MA January 22, 2000 1. Introduction 2. Judgments and Propositions 3. Intensional Types 4. Run-Time Code Generation 5. The

More information

Encryption as an Abstract Datatype:

Encryption as an Abstract Datatype: June 2003 1/18 Outline Encryption as an Abstract Datatype: an extended abstract Dale Miller INRIA/Futurs/Saclay and École polytechnique 1. Security protocols specified using multisets rewriting. 2. Eigenvariables

More information

CS131 Typed Lambda Calculus Worksheet Due Thursday, April 19th

CS131 Typed Lambda Calculus Worksheet Due Thursday, April 19th CS131 Typed Lambda Calculus Worksheet Due Thursday, April 19th Name: CAS ID (e.g., abc01234@pomona.edu): I encourage you to collaborate. collaborations below. Please record your Each question is worth

More information

On the Expressiveness of Polyadicity in Higher-Order Process Calculi

On the Expressiveness of Polyadicity in Higher-Order Process Calculi On the Expressiveness of Polyadicity in Higher-Order Process Calculi Ivan Lanese, Jorge A. Pérez, Davide Sangiorgi (Univ. di Bologna) Alan Schmitt (INRIA Grenoble - Rhône Alpes) ICTCS 09 Cremona, September

More information

Lecture Notes on Monadic Logic Programming

Lecture Notes on Monadic Logic Programming Lecture Notes on Monadic Logic Programming 15-816: Linear Logic Frank Pfenning Lecture 20 We have discussed both forward and backward chaining at length; in this lecture we address the question how they

More information

Session Types Use-cases. (Amazon Collaboration)

Session Types Use-cases. (Amazon Collaboration) Session Types Use-cases. (Amazon Collaboration) Dimitris Kouzapas 1 Introduction This document lists a number of session types use-cases and examples. Its purpose is to explain to our collaborates in Amazon

More information

ABCD Report: Simon Gay, Philip Wadler, Nobuko Yoshida. 7th December 2017

ABCD Report: Simon Gay, Philip Wadler, Nobuko Yoshida. 7th December 2017 ABCD Report: 2017 Simon Gay, Philip Wadler, Nobuko Yoshida 7th December 2017 We summarise this year s activity, organised into sections according to the original ABCD workplan. The report only covers 2017,

More information

Lecture Notes on Program Equivalence

Lecture Notes on Program Equivalence Lecture Notes on Program Equivalence 15-312: Foundations of Programming Languages Frank Pfenning Lecture 24 November 30, 2004 When are two programs equal? Without much reflection one might say that two

More information

CS-XXX: Graduate Programming Languages. Lecture 9 Simply Typed Lambda Calculus. Dan Grossman 2012

CS-XXX: Graduate Programming Languages. Lecture 9 Simply Typed Lambda Calculus. Dan Grossman 2012 CS-XXX: Graduate Programming Languages Lecture 9 Simply Typed Lambda Calculus Dan Grossman 2012 Types Major new topic worthy of several lectures: Type systems Continue to use (CBV) Lambda Caluclus as our

More information

Abstract Logic Programming

Abstract Logic Programming 15-819K: Logic Programming Lecture 13 Abstract Logic Programming Frank Pfenning October 10, 2006 In this lecture we discuss general criteria to judge whether a logic or a fragment of it can be considered

More information

Lecture Notes on Aggregate Data Structures

Lecture Notes on Aggregate Data Structures Lecture Notes on Aggregate Data Structures 15-312: Foundations of Programming Languages Frank Pfenning Lecture 8 September 23, 2004 In this lecture we discuss various language extensions which make MinML

More information

Multiparty Asynchronous Session Types

Multiparty Asynchronous Session Types Multiparty Asynchronous Session Types http://mrg.doc.ic.ac.uk/ Nobuko Yoshida Imperial College London 1 Selected Publications 2015/2016 [CC 16] Nicholas Ng, NY: Static Deadlock Detection for Concurrent

More information

Verifying Program Invariants with Refinement Types

Verifying Program Invariants with Refinement Types Verifying Program Invariants with Refinement Types Rowan Davies and Frank Pfenning Carnegie Mellon University Princeton and Yale Colloquium Talks February, 2001 Acknowledgments: Robert Harper 1 Overview

More information

The SPIN Model Checker

The SPIN Model Checker The SPIN Model Checker Metodi di Verifica del Software Andrea Corradini Lezione 1 2013 Slides liberamente adattate da Logic Model Checking, per gentile concessione di Gerard J. Holzmann http://spinroot.com/spin/doc/course/

More information

The three faces of homotopy type theory. Type theory and category theory. Minicourse plan. Typing judgments. Michael Shulman.

The three faces of homotopy type theory. Type theory and category theory. Minicourse plan. Typing judgments. Michael Shulman. The three faces of homotopy type theory Type theory and category theory Michael Shulman 1 A programming language. 2 A foundation for mathematics based on homotopy theory. 3 A calculus for (, 1)-category

More information

Towards Concurrent Type Theory

Towards Concurrent Type Theory Invited talk at TLDI 12 Towards Concurrent Type Theory Luís Caires Universidade Nova de Lisboa luis.caires@di.fct.unl.pt Frank Pfenning Carnegie Mellon University fp@cs.cmu.edu Bernardo Toninho Carnegie

More information

CSE-321 Programming Languages 2010 Final

CSE-321 Programming Languages 2010 Final Name: Hemos ID: CSE-321 Programming Languages 2010 Final Prob 1 Prob 2 Prob 3 Prob 4 Prob 5 Prob 6 Total Score Max 18 28 16 12 36 40 150 There are six problems on 16 pages, including two work sheets, in

More information

Linearity, Control Effects, and Behavioral Types

Linearity, Control Effects, and Behavioral Types Linearity, Control Effects, and Behavioral Types Luís Caires 1 and Jorge A. Pérez 1,2 1 NOVA LINCS and Departamento de Informática, FCT, Universidade Nova de Lisboa 2 University of Groningen & CWI, Amsterdam

More information

1.3. Conditional expressions To express case distinctions like

1.3. Conditional expressions To express case distinctions like Introduction Much of the theory developed in the underlying course Logic II can be implemented in a proof assistant. In the present setting this is interesting, since we can then machine extract from a

More information

Type Soundness and Race Freedom for Mezzo

Type Soundness and Race Freedom for Mezzo Type Soundness and Race Freedom for Mezzo Thibaut Balabonski François Pottier Jonathan Protzenko INRIA FLOPS 2014 1 / 42 Mezzo in a few words Mezzo is a high-level programming language, equipped with:

More information

A Survey of Reasoning Methods for Concurrent Systems

A Survey of Reasoning Methods for Concurrent Systems A Survey of Reasoning Methods for Concurrent Systems Chun-Kun Wang Department of Computer Science Univ. of North Carolina at Chapel Hill Chapel Hill, NC 27599, USA Email: amos@cs.unc.edu Hao Xu Data Intensive

More information

Edinburgh Research Explorer

Edinburgh Research Explorer Edinburgh Research Explorer Embedding session types in Haskell Citation for published version: Lindley, S & Morris, JG 2016, Embedding session types in Haskell. in Haskell 2016 Proceedings of the 9th International

More information

Lecture 9 Stacks & Queues

Lecture 9 Stacks & Queues Lecture 9 Stacks & Queues 15-122: Principles of Imperative Computation (Spring 2018) Frank Pfenning, André Platzer, Rob Simmons In this lecture we introduce queues and stacks as data structures, e.g.,

More information

Lecture slides & distribution files:

Lecture slides & distribution files: Type Theory Lecture slides & distribution files: http://www.cs.rhul.ac.uk/home/zhaohui/ttlectures.html Zhaohui Luo Department of Computer Science Royal Holloway, University of London April 2011 2 Type

More information

Lecture 11 Unbounded Arrays

Lecture 11 Unbounded Arrays Lecture 11 Unbounded Arrays 15-122: Principles of Imperative Computation (Spring 2018) Rob Simmons, Frank Pfenning Arrays have efficient O(1) access to elements given an index, but their size is set at

More information

Lecture 16 AVL Trees

Lecture 16 AVL Trees Lecture 16 AVL Trees 15-122: Principles of Imperative Computation (Fall 2018) Frank Pfenning Binary search trees are an excellent data structure to implement associative arrays, maps, sets, and similar

More information

MPRI course 2-4 Functional programming languages Exercises

MPRI course 2-4 Functional programming languages Exercises MPRI course 2-4 Functional programming languages Exercises Xavier Leroy October 13, 2016 Part I: Interpreters and operational semantics Exercise I.1 (**) Prove theorem 2 (the unique decomposition theorem).

More information

8.1 Polynomial-Time Reductions

8.1 Polynomial-Time Reductions 8.1 Polynomial-Time Reductions Classify Problems According to Computational Requirements Q. Which problems will we be able to solve in practice? A working definition. Those with polynomial-time algorithms.

More information

Logical Mobility and Locality Types

Logical Mobility and Locality Types Logical Mobility and Locality Types Jonathan Moody 1 jwmoody@cs.cmu.edu Computer Science Department Carnegie Mellon University 5000 Forbes Ave. Pittsburgh PA 15213-3891 (phone) 1-412-268-5942 TCS Track

More information

Course on Probabilistic Methods in Concurrency. (Concurrent Languages for Probabilistic Asynchronous Communication) Lecture 1

Course on Probabilistic Methods in Concurrency. (Concurrent Languages for Probabilistic Asynchronous Communication) Lecture 1 Course on Probabilistic Methods in Concurrency (Concurrent Languages for Probabilistic Asynchronous Communication) Lecture 1 The pi-calculus and the asynchronous pi-calculus. Catuscia Palamidessi INRIA

More information

TRELLYS and Beyond: Type Systems for Advanced Functional Programming

TRELLYS and Beyond: Type Systems for Advanced Functional Programming TRELLYS and Beyond: Type Systems for Advanced Functional Programming Aaron Stump Computer Science The University of Iowa Joint work with Tim Sheard, Vilhelm Sjöberg, and Stephanie Weirich. Supported by

More information

Conversation Types. 1 Introduction. Luís Caires and Hugo Torres Vieira

Conversation Types. 1 Introduction. Luís Caires and Hugo Torres Vieira Conversation Types Luís Caires and Hugo Torres Vieira CITI / Departamento de Informática, FCT Universidade Nova de Lisboa, Portugal Abstract. We present a type theory for analyzing concurrent multiparty

More information

The Truth about Types. Bartosz Milewski

The Truth about Types. Bartosz Milewski The Truth about Types Bartosz Milewski Truth Truth Logic Types Categories Truth intro Unit type Terminal object true I () : () Proofs Logic Types Categories Proof of proposition A Type A is inhabited Morphism

More information

Refinement Types as Proof Irrelevance. William Lovas with Frank Pfenning

Refinement Types as Proof Irrelevance. William Lovas with Frank Pfenning Refinement Types as Proof Irrelevance William Lovas with Frank Pfenning Overview Refinement types sharpen existing type systems without complicating their metatheory Subset interpretation soundly and completely

More information

Combining Programming with Theorem Proving

Combining Programming with Theorem Proving Combining Programming with Theorem Proving Chiyan Chen and Hongwei Xi Boston University Programming with Theorem Proving p.1/27 Motivation for the Research To support advanced type systems for practical

More information

Static Deadlock Detection for Concurrent Go by Global Session Graph Synthesis

Static Deadlock Detection for Concurrent Go by Global Session Graph Synthesis Static Deadlock Detection for Concurrent Go by Global Session Graph Synthesis Nicholas Ng Imperial College London, UK nickng@imperial.ac.uk Nobuko Yoshida Imperial College London, UK n.yoshida@imperial.ac.uk

More information

Supplementary Notes on Concurrent ML

Supplementary Notes on Concurrent ML Supplementary Notes on Concurrent ML 15-312: Foundations of Programmg Languages Frank Pfenng Lecture 25 November 21, 2002 In the last lecture we discussed the π-calculus, a mimal language with synchronous

More information

Manifest Safety and Security. Robert Harper Carnegie Mellon University

Manifest Safety and Security. Robert Harper Carnegie Mellon University Manifest Safety and Security Robert Harper Carnegie Mellon University Collaborators This work is, in part, joint with Lujo Bauer, Karl Crary, Peter Lee, Mike Reiter, and Frank Pfenning at Carnegie Mellon.

More information

CSE-505: Programming Languages. Lecture 20.5 Recursive Types. Zach Tatlock 2016

CSE-505: Programming Languages. Lecture 20.5 Recursive Types. Zach Tatlock 2016 CSE-505: Programming Languages Lecture 20.5 Recursive Types Zach Tatlock 2016 Where are we System F gave us type abstraction code reuse strong abstractions different from real languages (like ML), but

More information

Operational Semantics

Operational Semantics 15-819K: Logic Programming Lecture 4 Operational Semantics Frank Pfenning September 7, 2006 In this lecture we begin in the quest to formally capture the operational semantics in order to prove properties

More information

A NEW PROOF-ASSISTANT THAT REVISITS HOMOTOPY TYPE THEORY THE THEORETICAL FOUNDATIONS OF COQ USING NICOLAS TABAREAU

A NEW PROOF-ASSISTANT THAT REVISITS HOMOTOPY TYPE THEORY THE THEORETICAL FOUNDATIONS OF COQ USING NICOLAS TABAREAU COQHOTT A NEW PROOF-ASSISTANT THAT REVISITS THE THEORETICAL FOUNDATIONS OF COQ USING HOMOTOPY TYPE THEORY NICOLAS TABAREAU The CoqHoTT project Design and implement a brand-new proof assistant by revisiting

More information

Actors and Channels in Core λ-calculi. Simon Fowler Joint work with Sam Lindley and Philip Wadler

Actors and Channels in Core λ-calculi. Simon Fowler Joint work with Sam Lindley and Philip Wadler Actors and Channels in Core λ-calculi Simon Fowler Joint work with Sam Lindley and Philip Wadler ABCD Meeting, January 2016 Actors and Channels Hopac Actors and Channels Process Actor Process Process Hopac

More information

Substructural Typestates

Substructural Typestates Programming Languages meets Program Verification 2014 Substructural Typestates Filipe Militão (CMU & UNL) Jonathan Aldrich (CMU) Luís Caires (UNL) Motivation! File file = new File( out.txt );! file.write(

More information

Linear Type Systems for Communication

Linear Type Systems for Communication Linear Type Systems for Communication Tom Murphy VII 18 Dec 2001 Abstract Enhancing the type system of a programming language brings benefits on many fronts. We define and explore a simple concurrent functional

More information

CS-XXX: Graduate Programming Languages. Lecture 17 Recursive Types. Dan Grossman 2012

CS-XXX: Graduate Programming Languages. Lecture 17 Recursive Types. Dan Grossman 2012 CS-XXX: Graduate Programming Languages Lecture 17 Recursive Types Dan Grossman 2012 Where are we System F gave us type abstraction code reuse strong abstractions different from real languages (like ML),

More information

Multiparty Asynchronous Session Types

Multiparty Asynchronous Session Types Multiparty Asynchronous Session Types KOHEI HONDA, Queen Mary University of London NOBUKO YOSHIDA, Imperial College London MARCO CARBONE, IT University of Copenhagen Communication is a central elements

More information

Verifying Concurrent ML programs

Verifying Concurrent ML programs Verifying Concurrent ML programs a research proposal Gergely Buday Eszterházy Károly University Gyöngyös, Hungary Synchron 2016 Bamberg December 2016 Concurrent ML is a synchronous language a CML program

More information

AURA: A programming language for authorization and audit

AURA: A programming language for authorization and audit AURA: A programming language for authorization and audit Jeff Vaughan Limin Jia, Karl Mazurak, Jianzhou Zhao, Luke Zarko, Joseph Schorr, and Steve Zdancewic Department of Computer and Information Science

More information

Subtyping. Preciseness of Subtyping on Intersection and Union Types. Subtyping. Silvia Ghilezan. Joint work with Mariangiola Dezani-Ciancaglini

Subtyping. Preciseness of Subtyping on Intersection and Union Types. Subtyping. Silvia Ghilezan. Joint work with Mariangiola Dezani-Ciancaglini Subtyping Preciseness of Subtyping on Intersection and Union Types Silvia Ghilezan University of Novi Sad Serbia Université Paris Diderot, 21 April 2016 Joint work with Mariangiola Dezani-Ciancaglini M.

More information

Lecture 24 Search in Graphs

Lecture 24 Search in Graphs Lecture 24 Search in Graphs 15-122: Principles of Imperative Computation (Fall 2018) Frank Pfenning, André Platzer, Rob Simmons, Penny Anderson, Iliano Cervesato In this lecture, we will discuss the question

More information

Type-Based Information Flow Analysis for Low-Level Languages

Type-Based Information Flow Analysis for Low-Level Languages Type-Based Information Flow Analysis for Low-Level Languages Naoki Kobayashi and Keita Shirane Department of Computer Science, Tokyo Institute of Technology kobayasi@cs.titech.ac.jp, shirane@fuji.cs.titech.ac.jp

More information

Typed Compilation Against Non-Manifest Base Classes

Typed Compilation Against Non-Manifest Base Classes Typed Compilation Against Non-Manifest Base Classes Christopher League Long Island University christopher.league@liu.edu Stefan Monnier Université de Montréal monnier@iro.umontreal.ca FTfJP workshop 26

More information

Written Presentation: JoCaml, a Language for Concurrent Distributed and Mobile Programming

Written Presentation: JoCaml, a Language for Concurrent Distributed and Mobile Programming Written Presentation: JoCaml, a Language for Concurrent Distributed and Mobile Programming Nicolas Bettenburg 1 Universitaet des Saarlandes, D-66041 Saarbruecken, nicbet@studcs.uni-sb.de Abstract. As traditional

More information

CSE-321 Programming Languages 2012 Midterm

CSE-321 Programming Languages 2012 Midterm Name: Hemos ID: CSE-321 Programming Languages 2012 Midterm Prob 1 Prob 2 Prob 3 Prob 4 Prob 5 Prob 6 Total Score Max 14 15 29 20 7 15 100 There are six problems on 24 pages in this exam. The maximum score

More information

INF672 Protocol Safety and Verification. Karthik Bhargavan Xavier Rival Thomas Clausen

INF672 Protocol Safety and Verification. Karthik Bhargavan Xavier Rival Thomas Clausen INF672 Protocol Safety and Verication Karthik Bhargavan Xavier Rival Thomas Clausen 1 Course Outline Lecture 1 [Today, Sep 15] Introduction, Motivating Examples Lectures 2-4 [Sep 22,29, Oct 6] Network

More information

Programming Safe Agents in Blueprint. Alex Muscar University of Craiova

Programming Safe Agents in Blueprint. Alex Muscar University of Craiova Programming Safe Agents in Blueprint Alex Muscar University of Craiova Programmers are craftsmen, and, as such, they are only as productive as theirs tools allow them to be Introduction Agent Oriented

More information

ICFP: G: Curry-Howard for Callbacks

ICFP: G: Curry-Howard for Callbacks ICFP: G: Curry-Howard for Callbacks Jennifer Paykin University of Pennsylvania jpaykin@seas.upenn.edu 1 Problem and motivation Event-driven programming has become an increasingly popular programming model

More information

CSE505, Fall 2012, Midterm Examination October 30, 2012

CSE505, Fall 2012, Midterm Examination October 30, 2012 CSE505, Fall 2012, Midterm Examination October 30, 2012 Rules: The exam is closed-book, closed-notes, except for one side of one 8.5x11in piece of paper. Please stop promptly at Noon. You can rip apart

More information

Programming Languages

Programming Languages CSE 230: Winter 2008 Principles of Programming Languages Ocaml/HW #3 Q-A Session Push deadline = Mar 10 Session Mon 3pm? Lecture 15: Type Systems Ranjit Jhala UC San Diego Why Typed Languages? Development

More information

Lecture 3: Typed Lambda Calculus and Curry-Howard

Lecture 3: Typed Lambda Calculus and Curry-Howard Lecture 3: Typed Lambda Calculus and Curry-Howard H. Geuvers Radboud University Nijmegen, NL 21st Estonian Winter School in Computer Science Winter 2016 H. Geuvers - Radboud Univ. EWSCS 2016 Typed λ-calculus

More information

Integration of SMT Solvers with ITPs There and Back Again

Integration of SMT Solvers with ITPs There and Back Again Integration of SMT Solvers with ITPs There and Back Again Sascha Böhme and University of Sheffield 7 May 2010 1 2 Features: SMT-LIB vs. Yices Translation Techniques Caveats 3 4 Motivation Motivation System

More information

Lecture 15 Binary Search Trees

Lecture 15 Binary Search Trees Lecture 15 Binary Search Trees 15-122: Principles of Imperative Computation (Fall 2017) Frank Pfenning, André Platzer, Rob Simmons, Iliano Cervesato In this lecture, we will continue considering ways to

More information

Lecture 4 Searching Arrays

Lecture 4 Searching Arrays Lecture 4 Searching Arrays 15-122: Principles of Imperative Computation (Spring 2018) Frank Pfenning One of the fundamental and recurring problems in computer science is to find elements in collections,

More information

Introduction to Model Checking

Introduction to Model Checking Introduction to Model Checking René Thiemann Institute of Computer Science University of Innsbruck WS 2007/2008 RT (ICS @ UIBK) week 4 1/23 Outline Promela - Syntax and Intuitive Meaning Promela - Formal

More information

Where is ML type inference headed?

Where is ML type inference headed? 1 Constraint solving meets local shape inference September 2005 2 Types are good A type is a concise description of the behavior of a program fragment. Typechecking provides safety or security guarantees.

More information

Gradual Session Types

Gradual Session Types Gradual Session Types ATSUSHI IGARASHI, Kyoto University PETER THIEMANN, University of Freiburg VASCO T. VASCONCELOS, LaSIGE, Faculty of Sciences, University of Lisbon PHILIP WADLER, University of Edinburgh

More information