{"id":1843,"date":"2019-12-22T11:47:08","date_gmt":"2019-12-22T06:17:08","guid":{"rendered":"https:\/\/www.rangakrish.com\/?p=1843"},"modified":"2019-12-22T11:47:08","modified_gmt":"2019-12-22T06:17:08","slug":"distributed-computing-with-linda","status":"publish","type":"post","link":"https:\/\/www.rangakrish.com\/index.php\/2019\/12\/22\/distributed-computing-with-linda\/","title":{"rendered":"Distributed Computing with Linda"},"content":{"rendered":"<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Linda_(coordination_language)\" target=\"_blank\" rel=\"noopener\"><em><strong>Linda<\/strong><\/em><\/a>, originally proposed by Nicholas Carriero and David Gelernter, is a model of process communication using a small set of well-defined primitives, operating on a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Tuple_space\" target=\"_blank\" rel=\"noopener\"><em><strong>tuple space<\/strong><\/em><\/a>.<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>Interestingly, <a href=\"https:\/\/sicstus.sics.se\/sicstus\/docs\/latest4\/html\/sicstus.html\/lib_002dlinda.html#lib_002dlinda\" target=\"_blank\" rel=\"noopener\"><em><strong>Sicstus Prolog<\/strong><\/em><\/a>\u00a0comes with a library that implements <em><strong>Linda<\/strong><\/em> (both <em><strong>Server<\/strong><\/em> and <em><strong>Client<\/strong><\/em>).<span class=\"Apple-converted-space\">\u00a0 I played with it a little bit and really enjoyed it.\u00a0<\/span>In this article, I would like share my experience.<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>The Linda <em><strong>server<\/strong><\/em> process acts like a <em><strong>tuple space<\/strong><\/em> or <em><strong>blackboard<\/strong><\/em> on which one or more <em><strong>client<\/strong><\/em> processes can <em><strong>read<\/strong><\/em> and <em><strong>write<\/strong><\/em>. Here are the operations that the client processes can perform:<\/p>\n<blockquote><p><strong>out(X)<\/strong> =&gt; Write the tuple X to the tuple space<\/p>\n<p><strong>in(X)<\/strong> =&gt; Read and remove the tuple X from the tuple space<\/p>\n<p><strong>rd(X)<\/strong> =&gt; Read, but not remove, the tuple X from the tuple space<\/p><\/blockquote>\n<p>While <b><i>out<\/i><\/b> always succeeds, both <b><i>in<\/i><\/b> and <b><i>rd <\/i><\/b>will block until the required tuple becomes available.<\/p>\n<p>Two other predicates, <b><i>in_noblock(X)<\/i><\/b> and <b><i>rd_noblock(X)<\/i><\/b> will return with failure if the tuple is not available in the tuple space.<\/p>\n<p>The original Linda system had one more operation called <em><strong>eval<\/strong><\/em>, but that is not supported in <em><strong>Sicstus Prolog<\/strong><\/em>\u2019s implementation.<\/p>\n<p>By the way, a <em><strong>tuple<\/strong><\/em> is similar to a <em><strong>struct<\/strong><\/em> or <em><strong>record<\/strong><\/em>\u00a0found in many programming languages, and can have any number of fields.<\/p>\n<p>The overall process communication is shown in the following diagram:<\/p>\n<figure id=\"attachment_1845\" aria-describedby=\"caption-attachment-1845\" style=\"width: 616px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Overall-process.jpg?ssl=1\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" data-attachment-id=\"1845\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2019\/12\/22\/distributed-computing-with-linda\/overall-process\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Overall-process.jpg\" data-orig-size=\"616,314\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1576956212&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Linda System Overview\" data-image-description=\"&lt;p&gt;Linda System Overview&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Linda System Overview&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Overall-process.jpg\" class=\"size-full wp-image-1845\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Overall-process.jpg?resize=616%2C314&#038;ssl=1\" alt=\"Linda System Overview\" width=\"616\" height=\"314\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Overall-process.jpg?w=616&amp;ssl=1 616w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Overall-process.jpg?resize=300%2C153&amp;ssl=1 300w\" sizes=\"(max-width: 616px) 100vw, 616px\" \/><\/a><figcaption id=\"caption-attachment-1845\" class=\"wp-caption-text\"><strong>Linda System Overview<\/strong><\/figcaption><\/figure>\n<p>As you can see, processes (client processes in the diagram) do not communicate among themselves directly. A process posts one or more <em><strong>tuples<\/strong><\/em> on the <em><strong>tuple space<\/strong><\/em> and other processes respond to that by posting other <em><strong>tuples<\/strong><\/em>. This is a loosely-coupled model.<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>In the example I am going to discuss, we have the following processes:<\/p>\n<blockquote><p><strong>Server process<\/strong> =&gt; This acts as the tuple space or blackboard<\/p>\n<p><strong>Text Parser Process<\/strong> =&gt; This is a client process that parses simple English sentences and returns the corresponding parse tree<\/p>\n<p><strong>Math Process<\/strong> =&gt; Another trivial client process that can perform Sum, Product and Square root on numbers.<\/p>\n<p><strong>Simple Client<\/strong> =&gt; This client process makes use of the Parser and Math processes<\/p><\/blockquote>\n<p>Although technically the different processes could all be run on different computers (<em><strong>Windows<\/strong><\/em> machines in my case), I chose to run them on the same desktop computer for the sake of convenience.<\/p>\n<p>Let me start the Linda <em><strong>server<\/strong><\/em> process first. This serves as the <b><i>tuple space<\/i><\/b>. I use the address printed by the server process to start the remaining three client processes. You can see that the server echoes the connection established with the clients.<\/p>\n<figure id=\"attachment_1847\" aria-describedby=\"caption-attachment-1847\" style=\"width: 651px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Blackboard-server.jpg?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"1847\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2019\/12\/22\/distributed-computing-with-linda\/blackboard-server\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Blackboard-server.jpg\" data-orig-size=\"669,223\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1576859972&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"The Tuple Space Server\" data-image-description=\"&lt;p&gt;The Tuple Space Server&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;The Tuple Space Server&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Blackboard-server.jpg\" class=\"wp-image-1847\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Blackboard-server.jpg?resize=651%2C217&#038;ssl=1\" alt=\"The Tuple Space Server\" width=\"651\" height=\"217\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Blackboard-server.jpg?w=669&amp;ssl=1 669w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Blackboard-server.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"(max-width: 651px) 100vw, 651px\" \/><\/a><figcaption id=\"caption-attachment-1847\" class=\"wp-caption-text\"><strong>The Tuple Space Server<\/strong><\/figcaption><\/figure>\n<p>Here is an image showing the <em><strong>Parser<\/strong><\/em> and <em><strong>Math<\/strong><\/em> servers after the launch:<\/p>\n<figure id=\"attachment_1848\" aria-describedby=\"caption-attachment-1848\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-and-Parser-Server-clients.jpg?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"1848\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2019\/12\/22\/distributed-computing-with-linda\/math-and-parser-server-clients\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-and-Parser-Server-clients.jpg\" data-orig-size=\"670,395\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1576860067&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Math and Parser Servers\" data-image-description=\"&lt;p&gt;Math and Parser Servers&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Math and Parser Servers&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-and-Parser-Server-clients.jpg\" class=\"wp-image-1848\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-and-Parser-Server-clients.jpg?resize=650%2C383&#038;ssl=1\" alt=\"Math and Parser Servers\" width=\"650\" height=\"383\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-and-Parser-Server-clients.jpg?w=670&amp;ssl=1 670w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-and-Parser-Server-clients.jpg?resize=300%2C177&amp;ssl=1 300w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><figcaption id=\"caption-attachment-1848\" class=\"wp-caption-text\"><strong>Math and Parser Servers<\/strong><\/figcaption><\/figure>\n<p>Finally, let us start the simple client that allows us to communicate with the servers:<\/p>\n<figure id=\"attachment_1849\" aria-describedby=\"caption-attachment-1849\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Simple-client.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1849\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2019\/12\/22\/distributed-computing-with-linda\/simple-client\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Simple-client.jpg\" data-orig-size=\"669,217\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1576860200&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Simple Client\" data-image-description=\"&lt;p&gt;Simple Client&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Simple Client&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Simple-client.jpg\" class=\"wp-image-1849\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Simple-client.jpg?resize=650%2C211&#038;ssl=1\" alt=\"Simple Client\" width=\"650\" height=\"211\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Simple-client.jpg?w=669&amp;ssl=1 669w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Simple-client.jpg?resize=300%2C97&amp;ssl=1 300w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><figcaption id=\"caption-attachment-1849\" class=\"wp-caption-text\"><strong>Simple Client<\/strong><\/figcaption><\/figure>\n<p>We will use the <em><strong>Simple client<\/strong> <\/em>console to perform some parsing and math tasks. The parser process uses my <b><i>iLexicon<\/i><\/b> library and implements a simple <em><strong>DCG<\/strong><\/em>-based parser for a subset of English. Given a word, it can return its parts-of-speech (POS) and also check whether a given <em><strong>&lt;word, pos&gt;<\/strong><\/em> is valid. See this image.<\/p>\n<figure id=\"attachment_1850\" aria-describedby=\"caption-attachment-1850\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client1.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1850\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2019\/12\/22\/distributed-computing-with-linda\/client1\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client1.jpg\" data-orig-size=\"669,217\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1576862854&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Basic Parsing and POS Operations\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Basic Parsing and POS Operations&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client1.jpg\" class=\"wp-image-1850\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client1.jpg?resize=650%2C211&#038;ssl=1\" alt=\"Basic Parsing and POS Operations\" width=\"650\" height=\"211\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client1.jpg?w=669&amp;ssl=1 669w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client1.jpg?resize=300%2C97&amp;ssl=1 300w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><figcaption id=\"caption-attachment-1850\" class=\"wp-caption-text\"><strong>Basic Parsing and POS Operations<\/strong><\/figcaption><\/figure>\n<p>In the above, the client asks for the POS of the word <b><i>anger<\/i><\/b>. The parser server responds with the relevant POS, in this case, it is both <b><i>noun<\/i><\/b> and <b><i>verb<\/i><\/b>. Please note that the client process posts this request on the blackboard (tuple space) and is not directly communicating with the parser server (when you see the source code you will understand how). As explained earlier, every interaction between processes is entirely through the tuple space.<\/p>\n<p>The third command in the client process asks for the <b><i>parse tree<\/i><\/b> of the sentence <em><strong>&#8220;cats are friendly\u201d<\/strong><\/em>. Once again, the parser server responds by parsing the given sentence and sending back the parse tree. Here is the parse tree for this sentence:<\/p>\n<figure id=\"attachment_1851\" aria-describedby=\"caption-attachment-1851\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parse-Tree1.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1851\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2019\/12\/22\/distributed-computing-with-linda\/parse-tree1\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parse-Tree1.jpg\" data-orig-size=\"500,324\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1576919580&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Parse Tree\" data-image-description=\"&lt;p&gt;Parse Tree&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Parse Tree&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parse-Tree1.jpg\" class=\"size-full wp-image-1851\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parse-Tree1.jpg?resize=500%2C324&#038;ssl=1\" alt=\"Parse Tree\" width=\"500\" height=\"324\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parse-Tree1.jpg?w=500&amp;ssl=1 500w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parse-Tree1.jpg?resize=300%2C194&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parse-Tree1.jpg?resize=140%2C90&amp;ssl=1 140w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-1851\" class=\"wp-caption-text\"><strong>Parse Tree &#8211; 1<\/strong><\/figcaption><\/figure>\n<p>The above parse tree is based on the <em><strong>DCG<\/strong><\/em> rules I have implemented in the parser. There is nothing sacred about it.<\/p>\n<p>Next, let us try to parse a slightly longer sentence:<\/p>\n<figure id=\"attachment_1852\" aria-describedby=\"caption-attachment-1852\" style=\"width: 669px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client2.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1852\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2019\/12\/22\/distributed-computing-with-linda\/client2\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client2.jpg\" data-orig-size=\"669,217\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1576863042&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Parsing Another Sentence\" data-image-description=\"&lt;p&gt;Parsing Another Sentence&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Parsing Another Sentence&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client2.jpg\" class=\"size-full wp-image-1852\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client2.jpg?resize=669%2C217&#038;ssl=1\" alt=\"Parsing Another Sentence\" width=\"669\" height=\"217\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client2.jpg?w=669&amp;ssl=1 669w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client2.jpg?resize=300%2C97&amp;ssl=1 300w\" sizes=\"(max-width: 669px) 100vw, 669px\" \/><\/a><figcaption id=\"caption-attachment-1852\" class=\"wp-caption-text\"><strong>Parsing Another Sentence<\/strong><\/figcaption><\/figure>\n<p>Here is the corresponding parse tree.<\/p>\n<figure id=\"attachment_1853\" aria-describedby=\"caption-attachment-1853\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parse-Tree2.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1853\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2019\/12\/22\/distributed-computing-with-linda\/parse-tree2\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parse-Tree2.jpg\" data-orig-size=\"766,481\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1576920855&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Parse Tree &amp;#8211; 2\" data-image-description=\"&lt;p&gt;Parse Tree &amp;#8211; 2&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Parse Tree &amp;#8211; 2&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parse-Tree2.jpg\" class=\"wp-image-1853\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parse-Tree2.jpg?resize=650%2C408&#038;ssl=1\" alt=\"Parse Tree - 2\" width=\"650\" height=\"408\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parse-Tree2.jpg?w=766&amp;ssl=1 766w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parse-Tree2.jpg?resize=300%2C188&amp;ssl=1 300w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><figcaption id=\"caption-attachment-1853\" class=\"wp-caption-text\"><strong>Parse Tree &#8211; 2<\/strong><\/figcaption><\/figure>\n<p>OK, time to switch to the M<em><strong>ath<\/strong><\/em> processor. To make things slightly more interesting, let us start one more math processor and pose some math-related queries on the client.<\/p>\n<figure id=\"attachment_1854\" aria-describedby=\"caption-attachment-1854\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client3.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1854\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2019\/12\/22\/distributed-computing-with-linda\/client3\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client3.jpg\" data-orig-size=\"669,442\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1576863476&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Posing Math Queries\" data-image-description=\"&lt;p&gt;Posing Math Queries&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Posing Math Queries&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client3.jpg\" class=\"wp-image-1854\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client3.jpg?resize=650%2C429&#038;ssl=1\" alt=\"Posing Math Queries\" width=\"650\" height=\"429\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client3.jpg?w=669&amp;ssl=1 669w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/client3.jpg?resize=300%2C198&amp;ssl=1 300w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><figcaption id=\"caption-attachment-1854\" class=\"wp-caption-text\"><strong>Posing Math Queries<\/strong><\/figcaption><\/figure>\n<p>You can see that the math operations are promptly responded to by one of the math processes. Here is the image showing the three processes in action.<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<figure id=\"attachment_1855\" aria-describedby=\"caption-attachment-1855\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Servers-status.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1855\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2019\/12\/22\/distributed-computing-with-linda\/servers-status\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Servers-status.jpg\" data-orig-size=\"670,680\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1576863437&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Parser and Math Servers\" data-image-description=\"&lt;p&gt;Parser and Math Servers&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Parser and Math Servers&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Servers-status.jpg\" class=\"wp-image-1855\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Servers-status.jpg?resize=650%2C660&#038;ssl=1\" alt=\"Parser and Math Servers\" width=\"650\" height=\"660\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Servers-status.jpg?w=670&amp;ssl=1 670w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Servers-status.jpg?resize=296%2C300&amp;ssl=1 296w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><figcaption id=\"caption-attachment-1855\" class=\"wp-caption-text\"><strong>One Parser and Two Math Servers<\/strong><\/figcaption><\/figure>\n<p>Both the math processes are polling the <b><i>tuple space<\/i><\/b> for tuples that they can handle and when a matching tuple is posted by the client process, one of them non-deterministically grabs it, processes it and posts the reply back to the <b><i>tuple space<\/i><\/b>. This is then picked up by the client, which is <em><strong>waiting<\/strong><\/em> for the result.<\/p>\n<p>Nice, isn\u2019t it? We can thus add processes <em><strong>dynamically<\/strong><\/em> to scale up, or remove processes to scale down, but the client is completely unaware of this. That is the benefit of loose coupling.<\/p>\n<p>I am sure you are curious to look at the source. Let me not disappoint you. Here is the source for launching the <b><i>tuple space<\/i><\/b> server:<\/p>\n<figure id=\"attachment_1856\" aria-describedby=\"caption-attachment-1856\" style=\"width: 497px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Blackboard-server-source.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1856\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2019\/12\/22\/distributed-computing-with-linda\/blackboard-server-source\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Blackboard-server-source.jpg\" data-orig-size=\"497,196\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1577006274&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Blackboard Server\" data-image-description=\"&lt;p&gt;Blackboard Server&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Blackboard Server&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Blackboard-server-source.jpg\" class=\"size-full wp-image-1856\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Blackboard-server-source.jpg?resize=497%2C196&#038;ssl=1\" alt=\"Blackboard Server\" width=\"497\" height=\"196\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Blackboard-server-source.jpg?w=497&amp;ssl=1 497w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Blackboard-server-source.jpg?resize=300%2C118&amp;ssl=1 300w\" sizes=\"(max-width: 497px) 100vw, 497px\" \/><\/a><figcaption id=\"caption-attachment-1856\" class=\"wp-caption-text\"><strong>Blackboard Server<\/strong><\/figcaption><\/figure>\n<p>Here is the parser server source:<\/p>\n<figure id=\"attachment_1857\" aria-describedby=\"caption-attachment-1857\" style=\"width: 604px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parser-server-source.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1857\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2019\/12\/22\/distributed-computing-with-linda\/parser-server-source\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parser-server-source.jpg\" data-orig-size=\"604,780\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1576864785&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Parser Server Source\" data-image-description=\"&lt;p&gt;Parser Server Source&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Parser Server Source&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parser-server-source.jpg\" class=\"size-full wp-image-1857\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parser-server-source.jpg?resize=604%2C780&#038;ssl=1\" alt=\"Parser Server Source\" width=\"604\" height=\"780\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parser-server-source.jpg?w=604&amp;ssl=1 604w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Parser-server-source.jpg?resize=232%2C300&amp;ssl=1 232w\" sizes=\"(max-width: 604px) 100vw, 604px\" \/><\/a><figcaption id=\"caption-attachment-1857\" class=\"wp-caption-text\"><strong>Parser Server Source<\/strong><\/figcaption><\/figure>\n<p>The above does not include the code for the <strong>DCG<\/strong> and <b><i>iLexicon<\/i><\/b> functionality.<\/p>\n<p>The first part of the <em><strong>math<\/strong><\/em> server source given below shows the main predicates that interact with the tuple space.<\/p>\n<figure id=\"attachment_1858\" aria-describedby=\"caption-attachment-1858\" style=\"width: 478px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-server-source-1.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1858\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2019\/12\/22\/distributed-computing-with-linda\/math-server-source-1\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-server-source-1.jpg\" data-orig-size=\"478,767\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1576864867&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Math Server (Part 1)\" data-image-description=\"&lt;p&gt;Math Server (Part 1)&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Math Server (Part 1)&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-server-source-1.jpg\" class=\"size-full wp-image-1858\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-server-source-1.jpg?resize=478%2C767&#038;ssl=1\" alt=\"Math Server (Part 1)\" width=\"478\" height=\"767\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-server-source-1.jpg?w=478&amp;ssl=1 478w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-server-source-1.jpg?resize=187%2C300&amp;ssl=1 187w\" sizes=\"(max-width: 478px) 100vw, 478px\" \/><\/a><figcaption id=\"caption-attachment-1858\" class=\"wp-caption-text\"><strong>Math Server (Part 1)<\/strong><\/figcaption><\/figure>\n<p>The actual computation of the math operations is shown below. No magic here.<\/p>\n<figure id=\"attachment_1859\" aria-describedby=\"caption-attachment-1859\" style=\"width: 568px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-server-source-2.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1859\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2019\/12\/22\/distributed-computing-with-linda\/math-server-source-2\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-server-source-2.jpg\" data-orig-size=\"568,365\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1576864839&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Math Server (Part 2)\" data-image-description=\"&lt;p&gt;Math Server (Part 2)&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Math Server (Part 2)&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-server-source-2.jpg\" class=\"size-full wp-image-1859\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-server-source-2.jpg?resize=568%2C365&#038;ssl=1\" alt=\"Math Server (Part 2)\" width=\"568\" height=\"365\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-server-source-2.jpg?w=568&amp;ssl=1 568w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-server-source-2.jpg?resize=300%2C193&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Math-server-source-2.jpg?resize=140%2C90&amp;ssl=1 140w\" sizes=\"(max-width: 568px) 100vw, 568px\" \/><\/a><figcaption id=\"caption-attachment-1859\" class=\"wp-caption-text\"><strong>Math Server (Part 2)<\/strong><\/figcaption><\/figure>\n<p>Finally, here is how the client process looks like:<\/p>\n<figure id=\"attachment_1860\" aria-describedby=\"caption-attachment-1860\" style=\"width: 424px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Simple-client-source.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1860\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2019\/12\/22\/distributed-computing-with-linda\/simple-client-source\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Simple-client-source.jpg\" data-orig-size=\"424,557\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1576863840&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"The Simple Client\" data-image-description=\"&lt;p&gt;The Simple Client&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;The Simple Client&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Simple-client-source.jpg\" class=\"size-full wp-image-1860\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Simple-client-source.jpg?resize=424%2C557&#038;ssl=1\" alt=\"The Simple Client\" width=\"424\" height=\"557\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Simple-client-source.jpg?w=424&amp;ssl=1 424w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/12\/Simple-client-source.jpg?resize=228%2C300&amp;ssl=1 228w\" sizes=\"(max-width: 424px) 100vw, 424px\" \/><\/a><figcaption id=\"caption-attachment-1860\" class=\"wp-caption-text\"><strong>The Simple Client<\/strong><\/figcaption><\/figure>\n<p>That is it. Hope I managed to convey the basic idea of the <em><strong>Linda<\/strong><\/em> system. As mentioned in the beginning, I have implemented this example in <em><strong>Sicstus Prolog<\/strong><\/em> on windows.<\/p>\n<p>Have a <em><strong>Merry Christmas<\/strong><\/em> and a wonderful holiday season! See you again in the New Year!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linda, originally proposed by Nicholas Carriero and David Gelernter, is a model of process communication using a small set of well-defined primitives, operating on a tuple space.\u00a0 Interestingly, Sicstus Prolog\u00a0comes with a library that implements Linda (both Server and Client).\u00a0 I played with it a little bit and really enjoyed it.\u00a0In this article, I would [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[17,147],"tags":[223,222,148],"class_list":["post-1843","post","type-post","status-publish","format-standard","hentry","category-programming","category-prolog","tag-distributed-computing","tag-linda-tuple-space","tag-prolog"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9OLnF-tJ","jetpack-related-posts":[{"id":1770,"url":"https:\/\/www.rangakrish.com\/index.php\/2019\/11\/10\/calling-c-methods-from-sicstus-prolog-through-com-interface\/","url_meta":{"origin":1843,"position":0},"title":"Calling C# Methods from Sicstus Prolog through COM Interface","author":"admin","date":"November 10, 2019","format":false,"excerpt":"Recently\u00a0I needed to make use of a C# library (which I had implemented a few years ago) from Sicstus Prolog. Calling C\/C++ functions from Sicstus Prolog is fairly well documented. When it comes to C#\/.NET, the official documentation recommends the PrologBeans library. After going through the documentation, I felt that\u2026","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/www.rangakrish.com\/index.php\/category\/programming\/"},"img":{"alt_text":"Prolog Client Code","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/11\/Prolog-Code.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/11\/Prolog-Code.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/11\/Prolog-Code.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":2366,"url":"https:\/\/www.rangakrish.com\/index.php\/2021\/03\/28\/implementing-ilexicon-using-litedb\/","url_meta":{"origin":1843,"position":1},"title":"Implementing iLexicon using LiteDB","author":"admin","date":"March 28, 2021","format":false,"excerpt":"iLexicon is an \"intelligent\" dictionary that can be used to build Natural Language applications. I have two implementations, one in Lisp and another in Prolog. Both implementations are memory-based, in order to speed up performance. I have written several articles referencing it, for example see this. \u00a0 LiteDB is a\u2026","rel":"","context":"In &quot;Natural Language Processing&quot;","block_context":{"text":"Natural Language Processing","link":"https:\/\/www.rangakrish.com\/index.php\/category\/natural-language-processing\/"},"img":{"alt_text":"Sample Commands","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Session1.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":912,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/04\/22\/question-answering-using-dependency-trees\/","url_meta":{"origin":1843,"position":2},"title":"Question Answering\u00a0Using Dependency Trees","author":"admin","date":"April 22, 2018","format":false,"excerpt":"A few weeks ago I had written about my brief experiment with Mathematica's new feature, which provides answers to questions based on given text. After that post, I spent some time thinking about how to implement something similar. In today's post, I want to show you what I have been\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"Dependency Tree","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/04\/Deptree-example.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2433,"url":"https:\/\/www.rangakrish.com\/index.php\/2021\/06\/06\/getting-to-know-visual-prolog-10\/","url_meta":{"origin":1843,"position":3},"title":"Getting to Know Visual Prolog 10","author":"admin","date":"June 6, 2021","format":false,"excerpt":"Visual Prolog\u00a0has its roots in Turbo Prolog, which was popularized by Borland in the mid 1980s. It is developed and supported by PDC A\/S, Denmark. So how is Visual Prolog different from other Prolog implementations out there, for example, SWI-Prolog or Sicstus Prolog? Here are the key differences: 1) It\u2026","rel":"","context":"In &quot;C++&quot;","block_context":{"text":"C++","link":"https:\/\/www.rangakrish.com\/index.php\/category\/c\/"},"img":{"alt_text":"Visual Prolog Project","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/06\/Project-300x183.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/06\/Project-300x183.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/06\/Project-300x183.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1078,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/09\/30\/dependency-graph-to-rdf-part-2\/","url_meta":{"origin":1843,"position":4},"title":"Dependency Graph to RDF &#8211; Part 2","author":"admin","date":"September 30, 2018","format":false,"excerpt":"In the last post, I outlined an approach to convert a dependency graph (the result of dependency parsing) to RDF. The particular RDF format I used is Turtle, which is widely supported. Today, I would like to show how to load this RDF data in a Semantic\u00a0 Graph database and\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"Browser View","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/09\/Checking-the-server.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/09\/Checking-the-server.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/09\/Checking-the-server.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/09\/Checking-the-server.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":3260,"url":"https:\/\/www.rangakrish.com\/index.php\/2023\/11\/26\/generating-polynomials-in-prolog\/","url_meta":{"origin":1843,"position":5},"title":"Generating Polynomials in Prolog","author":"admin","date":"November 26, 2023","format":false,"excerpt":"Polynomial is an important topic in High School maths curriculum. There are many online courses that explain the topic in great details with lots of examples and sample exercises. Wouldn\u2019t it be interesting if we can generate polynomials of given degree programmatically? It turns out that this is not such\u2026","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/www.rangakrish.com\/index.php\/category\/programming\/"},"img":{"alt_text":"Generating Polynomials - Main Clauses","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/11\/Code1-300x163.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/11\/Code1-300x163.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/11\/Code1-300x163.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/1843","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/comments?post=1843"}],"version-history":[{"count":0,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/1843\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/media?parent=1843"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/categories?post=1843"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/tags?post=1843"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}