{"id":1310,"date":"2017-11-08T12:28:28","date_gmt":"2017-11-08T11:28:28","guid":{"rendered":"https:\/\/projects.lsv.ens-paris-saclay.fr\/topology\/?page_id=1310"},"modified":"2022-11-19T15:20:22","modified_gmt":"2022-11-19T14:20:22","slug":"full-abstraction-for-languages-with-demonic-and-probabilistic-choice","status":"publish","type":"page","link":"https:\/\/projects.lsv.ens-paris-saclay.fr\/topology\/?page_id=1310","title":{"rendered":"Full Abstraction for Languages with Demonic and Probabilistic Choice"},"content":{"rendered":"<p><strong>Last minute update.<\/strong>\u00a0 This problem was solved, in a call-by-push-value language instead of a variant of PCF: see this <a href=\"https:\/\/arxiv.org\/abs\/1812.11573\">arxiv paper<\/a>.<\/p>\n<p>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<\/p>\n<p>There is an incredible amount of papers on subjects of the form: consider a programming language <strong>L<\/strong>, with two semantics, one operational (a virtual machine), one denotational (a map \u27e6_\u27e7 from terms of <strong>L<\/strong> to elements of certains dcpos), then the two semantics compute (or no not compute) the same thing in the two semantics.<\/p>\n<p>I am going to be extremely vague about certain things, and experts might tell me: shouldn&#8217;t the semantics map \u27e6_\u27e7 also take an environment as argument? or similar, true, observations.\u00a0 I will keep away from such questions for the sake of simplicity.<\/p>\n<h2>Gordon Plotkin and PCF<\/h2>\n<p>One early paper on that subject is Gordon Plotkin&#8217;s &#8220;LCF considered as a programming language&#8221; [1].\u00a0 This is a remarkable paper, which I recommend to anybody interested in such questions.\u00a0 Gordon is a true genius.\u00a0 Consider that he asked the basic question, and solved it (almost) completely.\u00a0 The only question that he left open is whether LCF (or, as we call it today, the language PCF) has a, necessarily different, fully abstract denotational semantics.\u00a0 That is considered solved today, using so-called game semantics.<\/p>\n<p>Thomas Streicher&#8217;s book [2] is a very good book on the subject, and I have also learned quite a lot from it.<\/p>\n<p>What does it mean for those two semantics to compute the same thing?\u00a0 The weakest notion is <em>soundness<\/em>: if the machine terminates on the term &#8217;42&#8217;, then its denotational value is 42.\u00a0 More generally, soundness says that denotational semantics is an invariant of computation: if the machine can go from configuration <em>C<\/em> to configuration <em>C&#8217;<\/em>, then<br \/>\n\u27e6<em>C<\/em>\u27e7=\u27e6<em>C&#8217;<\/em>\u27e7.\u00a0 The former is a consequence because, in all reasonable semantics, \u27e6&#8217;42&#8217;\u27e7=42.\u00a0 PCF, notably, is sound.<\/p>\n<p>A more elaborate notion is <em>adequacy<\/em>, and that is a kind of converse.\u00a0 That says that if \u27e6<em>C<\/em>\u27e7=42, then starting from <em>C<\/em>, your machine will eventually terminate on &#8217;42&#8217;.\u00a0 The difficult part is not to show that the end result is &#8217;42&#8217;, it is that <em>C<\/em> will terminate at all.\u00a0 Gordon invented the notion of <em>logical relation<\/em> for that, explaining that it is inspired from reducibility in the study of the typed lambda-calculus, and proved that PCF is adequate.\u00a0 By the way, adequacy only works at ground types (int, bool), but not at function types.\u00a0 In fact, it does not even make sense to say that if \u27e6<em>C<\/em>\u27e7=the function that maps every list to a sorted version of that list, then the machine started on <em>C<\/em> should terminate on some canonical sorting procedure.\u00a0 That is all the more absurd as there are many sorting procedures (bubble sort, insertion sort, radix sort, merge sort, quick sort, quicker sort, etc.), and none is more canonical than the others.<\/p>\n<p>Once you have all that, you can look at <em>full abstraction<\/em>.\u00a0 There is a notion of context, which is in a sence a configuration <em>C<\/em> with a hole, where you can plug other programs.\u00a0 The result of plugging program <em>M<\/em> is written <em>C<\/em>[<em>M<\/em>].\u00a0 A nice thing about denotational semantics is that it is compositional, namely that \u27e6<em>C<\/em>[<em>M<\/em>]\u27e7 can be defined solely from \u27e6<em>C<\/em>\u27e7 and from \u27e6<em>M<\/em>\u27e7; in particular, if \u27e6<em>M<\/em>\u27e7=\u27e6<em>N<\/em>\u27e7, then\u00a0\u27e6<em>C<\/em>[<em>M<\/em>]\u27e7=\u27e6<em>C<\/em>[<em>N<\/em>]\u27e7. That has the following consequence: if \u27e6<em>M<\/em>\u27e7=\u27e6<em>N<\/em>\u27e7, then for every context <em>C<\/em> returning an object of ground type (int, bool, but not functions for example), then \u27e6<em>C<\/em>[<em>M<\/em>]\u27e7=\u27e6<em>C<\/em>[<em>N<\/em>]\u27e7 hence by adequacy the machine will return the same results when started with <em>C<\/em>[<em>M<\/em>] or with <em>C<\/em>[<em>N<\/em>]\u2014precisely, if the machine terminates when started with <em>C<\/em>[<em>M<\/em>], then it will also terminate when started with <em>C<\/em>[<em>N<\/em>], with the same value, and symmetrically.\u00a0 (That they terminate with the same value is not really important.\u00a0 What is important is that they terminate in exactly the same contexts.\u00a0 It will then follow that they must terminate with the same values.)<\/p>\n<p>One says that <em>M<\/em> and <em>N<\/em> are <em>observationally equivalent<\/em> if and only if the machine returns the same results when started with <em>C<\/em>[<em>M<\/em>] or with <em>C<\/em>[<em>N<\/em>] (in this sense), for every context <em>C<\/em> of ground type.\u00a0 Hence adequacy implies that two programs with the same denotation semantics are observationally equivalent.<\/p>\n<p>Full abstraction is the converse: a language (or rather, a pair of semantics for that language) is <em>fully abstract<\/em> if and only if, for every two terms <em>M<\/em> and <em>N<\/em>, \u27e6<em>M<\/em>\u27e7=\u27e6<em>N<\/em>\u27e7 if and only if <em>M<\/em> and <em>N<\/em> are observationally equivalent.<\/p>\n<p>Gordon Plotkin showed that PCF is <em>not<\/em> fully abstract.\u00a0 There is a funny function, among the values of the denotational semantics, called <em>parallel or<\/em>, which cannot be defined in PCF, and that is the source of several oddities, which culminate in two PCF programs that are observationally equivalent, although they have different semantics.<\/p>\n<p>Then Gordon showed that PCF extended with a parallel or operation <em>is<\/em> fully abstract\u2014by a proof which still seems to be magical but also rather ad hoc to me\u2014and many other things.<\/p>\n<h2>PCF with choice<\/h2>\n<p>I have been interested in semantics for probabilistic, non-deterministic, and mixed probabilistic and non-deterministic choice, for a long time.\u00a0 The long-term goal of my papers on the subject was to apply that to full abstraction results of languages based on PCF, with various forms of choice as above.<\/p>\n<p>I have finally presented my findings at the Domains XI workshop (Gordon was uttely uninterested, too bad), then at Pierre-Louis Curien&#8217;s Festschrift in Venice, Italy (Gordon was absent, and later reiterated his total absence of interest), but that would not stop me.<\/p>\n<p>I published most of what I could do in a special issue of the Domains XI workshop [3], and that somehow rounds up everything that can be said in case non-determinism is angelic.\u00a0 In a nutshell: if you just have PCF + angelic non-deterministic choice (modeled through the <a href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/topology\/?page_id=789\">Hoare powerdomain<\/a>), then that is fully abstract\u2014period; and PCF + probabilistic + angelic non-deterministic choice is not fully abstract, but becomes fully abstract if you add what I call a <em>statistical termination tester<\/em> primitive.<\/p>\n<p>The interesting thing is that my proofs of full abstraction are, in my opinion, simpler than Gordon&#8217;s (although the two kinds of proofs do not apply to the same languages), or at least rest on clearer topological facts.\u00a0 Here is what I do in my case.\u00a0 Consider any two terms <em>M<\/em> and <em>N<\/em> that do not have the same denotational semantics.\u00a0 Becauses dcpos are T<sub>0<\/sub>, there must be an open set <em>U<\/em> that contains \u27e6<em>M<\/em>\u27e7 but not \u27e6<em>N<\/em>\u27e7 (or conversely).\u00a0 We can even take <em>U<\/em> from a subbase of the topology.\u00a0 Now, contexts <em>C<\/em> (with unit type) have semantics which are Scott-continuous maps into Sierpi\u0144ski space <strong>S<\/strong>, namely, they denote opens.\u00a0 If you can show that the denotations \u27e6<em>C<\/em>\u27e7 of contexts with unit type for a subbase for the Scott topology, then \u27e6C[<em>M<\/em>]\u27e7 will be equal to \u22a4 (&#8220;in <em>U<\/em>&#8220;) while\u00a0\u27e6C[N]\u27e7 will be equal to \u22a5 (&#8220;not in <em>U<\/em>&#8220;).\u00a0 All that has to be verified, of course, and I am only trying to given you a general contour of the proof.<\/p>\n<p>In the end, full abstraction follows from theorems about coincidence of topologies, such as: if <em>X<\/em> and <em>Y<\/em> are bc-domains, then the Scott topology on [<em>X<\/em> \u2192 <em>Y<\/em>] coincides with the topology of pointwise convergence (see [3]).<\/p>\n<p>The paper [3] does much more, and I am sorry that, as a result, it is too long.\u00a0 However, that paper establishes soundness and adequacy for all possible variants of choice, mixed or not, not just the angelic forms.<\/p>\n<h2>The proposal<\/h2>\n<p>Hence it might seem that full abstraction should be almost free for all the remaining variants.\u00a0 That is not true, and I strongly suspect that PCF + demonic choice (i.e., with the Smyth powerdomain, see Proposition 8.3.25 in the <a href=\"https:\/\/www.cambridge.org\/gb\/knowledge\/isbn\/item7069109\/Non-Hausdorff%20Topology%20and%20Domain%20Theory\/?site_locale=en_GB\">book<\/a>) is not fully abstract.<\/p>\n<p>Can you prove that conjecture?<\/p>\n<p>In a second step, you would have to examine the following other conjectures, which I presume have a positive answer:<\/p>\n<ul>\n<li>Is PCF + demonic choice + parallel or, fully abstract?<\/li>\n<li>Is PCF + demonic choice + probabilistic choice + statistical termination testers + parallel or, fully abstract?<\/li>\n<\/ul>\n<p>Once that is done, we can start exploring erratic choice.\u00a0 That should be simple consequences of the angelic and demonic cases.<\/p>\n<ol>\n<li>Gordon Plotkin. <a href=\"https:\/\/homepages.inf.ed.ac.uk\/gdp\/publications\/LCF.pdf\">LCF considered as a programming language<\/a>. <span class=\"size-xl\"><a class=\"publication-title-link\" title=\"Go to Theoretical Computer Science on ScienceDirect\" href=\"https:\/\/www.sciencedirect.com\/science\/journal\/03043975\">Theoretical Computer Science<\/a><\/span><span class=\"size-m\"><a title=\"Go to table of contents for this volume\/issue\" href=\"https:\/\/www.sciencedirect.com\/science\/journal\/03043975\/5\/3\"> 5(3)<\/a>:223-255, 1977.<\/span><\/li>\n<li>Thomas Streicher. <a href=\"https:\/\/www.worldscientific.com\/worldscibooks\/10.1142\/6284\">Domain-Theoretic Foundations of Functional Programming<\/a>.<br \/>\nWorld Scientific, 132 pages, 2006.<\/li>\n<li>Jean Goubault-Larrecq. <span class=\"titre\"><a href=\"https:\/\/www.lsv.ens-paris-saclay.fr\/Publis\/PAPERS\/PDF\/jgl-jlap14.pdf\">Full Abstraction for Non-Deterministic and Probabilistic Extensions of PCF\u00a0I: the\u00a0Angelic Cases<\/a><\/span>.\u00a0 <a class=\"DOIinentry\" href=\"https:\/\/dx.doi.org\/10.1016\/j.jlamp.2014.09.003\"><span class=\"journal\">Journal of Logic and Algebraic Methods in Programming<\/span>\u00a084(1):155-184<\/a>, <span class=\"year\">2015<\/span>.<\/li>\n<\/ol>\n<p style=\"text-align: right;\">\u2014 <a href=\"https:\/\/www.lsv.ens-paris-saclay.fr\/~goubault\/?l=en\" rel=\"attachment wp-att-993\">Jean Goubault-Larrecq<\/a>\u00a0(November 8th, 2017<img loading=\"lazy\" decoding=\"async\" class=\"wp-image-993 alignright\" src=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/topology\/wp-content\/uploads\/2016\/08\/jgl-2011.png\" alt=\"jgl-2011\" width=\"32\" height=\"44\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last minute update.\u00a0 This problem was solved, in a call-by-push-value language instead of a variant of PCF: see this arxiv paper. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There is an incredible amount of papers on subjects of the form: consider a programming language L, with &hellip; <a href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/topology\/?page_id=1310\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","footnotes":""},"class_list":["post-1310","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/topology\/index.php?rest_route=\/wp\/v2\/pages\/1310","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/topology\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/topology\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/topology\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/topology\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1310"}],"version-history":[{"count":6,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/topology\/index.php?rest_route=\/wp\/v2\/pages\/1310\/revisions"}],"predecessor-version":[{"id":5933,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/topology\/index.php?rest_route=\/wp\/v2\/pages\/1310\/revisions\/5933"}],"wp:attachment":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/topology\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}