{"id":1109,"date":"2018-10-28T09:17:56","date_gmt":"2018-10-28T03:47:56","guid":{"rendered":"https:\/\/www.rangakrish.com\/?p=1109"},"modified":"2018-11-13T07:09:54","modified_gmt":"2018-11-13T01:39:54","slug":"flora-2-an-expressive-knowledge-representation-system","status":"publish","type":"post","link":"https:\/\/www.rangakrish.com\/index.php\/2018\/10\/28\/flora-2-an-expressive-knowledge-representation-system\/","title":{"rendered":"Flora-2: An Expressive Knowledge Representation System"},"content":{"rendered":"<p>I am always on the lookout for a good <em><strong>Knowledge Representation (KR)<\/strong><\/em> system that facilitates modeling and reasoning about real-world knowledge. I have experience with\u00a0<a href=\"http:\/\/www.lispworks.com\/products\/knowledgeworks.html\" target=\"_blank\" rel=\"noopener\"><b><i>KnowledgeWorks<\/i><\/b><\/a>\u00a0available in <em><strong>LispWorks<\/strong><\/em>\u00a0since I have used it in a few projects. I have also taken a cursory look at <a href=\"https:\/\/www.isi.edu\/isd\/LOOM\/PowerLoom\/\" target=\"_blank\" rel=\"noopener\"><em><strong>PowerLoom<\/strong><\/em><\/a>\u00a0and <a href=\"https:\/\/www.ifis.uni-luebeck.de\/~moeller\/racer\/\" target=\"_blank\" rel=\"noopener\"><em><strong>Racer<\/strong><\/em><\/a>. Last week, I came across <a href=\"http:\/\/flora.sourceforge.net\" target=\"_blank\" rel=\"noopener\"><em><strong>Flora-2<\/strong><\/em><\/a>\u00a0and its commercial counterpart <a href=\"http:\/\/coherentknowledge.com\/product-overview-ergoai-platform\/\" target=\"_blank\" rel=\"noopener\"><em><strong>ErgoAI<\/strong><\/em><\/a>\u00a0from <em><strong>Coherent Knowledge<\/strong><\/em>, and decided to check out <em><strong>Flora-2<\/strong><\/em> first. <em><strong>ErgoAI<\/strong><\/em> adds several extra capabilities on top of <em><strong>Flora-2<\/strong><\/em> and comes with a 90-day trial license. I hope to experiment with that product later.<\/p>\n<p>Here are some of the attractive features of <em><strong>Flora-2<\/strong><\/em>:<\/p>\n<blockquote>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">* Crisp, expressive syntax<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">* Partitioning knowledge through module system<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">* Frames and Object IDs<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">* Object-orientation with multiple inheritance<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">* Higher-order syntax<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">* Reification<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">* Transaction logic<\/span><\/p>\n<\/blockquote>\n<p>I downloaded and installed the Windows version from <em><strong><a href=\"https:\/\/sourceforge.net\/projects\/flora\/files\/FLORA-2\/2.0%20%28Pyrus%20nivalis%29\/\" target=\"_blank\" rel=\"noopener\">here<\/a><\/strong><\/em>.<\/p>\n<p>Installation went smoothly (I did not use the default installation directory, but chose a different one for practical reasons).<\/p>\n<p>To start the program, we have to execute <em><strong>runflora.bat<\/strong> <\/em>located in the <em><strong>flora2<\/strong><\/em> directory. I usually launch the application by double clicking on this file from my <em><strong>File Explorer<\/strong><\/em>.<\/p>\n<p>Here is the command shell:<\/p>\n<figure id=\"attachment_1112\" aria-describedby=\"caption-attachment-1112\" style=\"width: 641px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/startscreen.png?ssl=1\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" data-attachment-id=\"1112\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2018\/10\/28\/flora-2-an-expressive-knowledge-representation-system\/startscreen\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/startscreen.png\" data-orig-size=\"641,395\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&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=\"Flora Initial Terminal\" data-image-description=\"&lt;p&gt;Flora Initial Terminal&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Flora Initial Terminal&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/startscreen.png\" class=\"size-full wp-image-1112\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/startscreen.png?resize=641%2C395&#038;ssl=1\" alt=\"Flora Initial Terminal\" width=\"641\" height=\"395\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/startscreen.png?w=641&amp;ssl=1 641w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/startscreen.png?resize=300%2C185&amp;ssl=1 300w\" sizes=\"(max-width: 641px) 100vw, 641px\" \/><\/a><figcaption id=\"caption-attachment-1112\" class=\"wp-caption-text\"><strong>Flora Interactive Terminal<\/strong><\/figcaption><\/figure>\n<p>We type in commands and queries at the <em><strong>flora2<\/strong><\/em> prompt and the system responds accordingly.<\/p>\n<p>Before we proceed further, of course, we need a <em><strong>Knowledge Base<\/strong><\/em> (<em><strong>KB)<\/strong><\/em>\u00a0to work with. After considering a few areas, I finally chose an example from <a href=\"https:\/\/en.wikipedia.org\/wiki\/Homeopathy\" target=\"_blank\" rel=\"noopener\"><em><strong>Homeopathy<\/strong><\/em><\/a>. I practise homeopathy and have even written a repertorization software called <a href=\"https:\/\/www.rangakrish.com\/index.php\/2015\/10\/28\/desirable-features-of-homeopathic-software\/\" target=\"_blank\" rel=\"noopener\"><em><strong>iCure<\/strong><\/em><\/a> many years ago. Therefore, I know the challenges in modelling remedy characteristics and felt it would be a good idea to see how <em><strong>Flora-2<\/strong><\/em> can help in this task.<\/p>\n<p>A word of caution is appropriate here. I am quite raw when it comes to <em><strong>Flora-2<\/strong><\/em>, and even though I have gone through the documentation a couple of times, I still feel I haven&#8217;t understood some of the finer features of the language. I am sure my modeling capabilities will improve as I spend more time with the product. Nevertheless, I am happy with what I have been able to achieve so far!<\/p>\n<p>The example I have chosen is from the excellent book <a href=\"https:\/\/www.amazon.com\/Pointers-Common-Remedies-Gems-Homoeopathy\/dp\/1860180000\" target=\"_blank\" rel=\"noopener\"><em><strong>Pointers to the Common Remedies<\/strong><\/em> by <em><strong>Dr. M.L.Tyler<\/strong><\/em><\/a>. This is a mini therapeutics handbook and has chapters covering several ailments. I have attempted to model 4 remedies from the section <em><strong>Acute Rheumatism (Adults)<\/strong><\/em>.<\/p>\n<p>Let us look at my rendering of the remedy <em><strong>Aconite<\/strong><\/em>:<\/p>\n<figure id=\"attachment_1114\" aria-describedby=\"caption-attachment-1114\" style=\"width: 651px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Aconite.png?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"1114\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2018\/10\/28\/flora-2-an-expressive-knowledge-representation-system\/aconite\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Aconite.png\" data-orig-size=\"501,194\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&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=\"Modeling Aconite\" data-image-description=\"&lt;p&gt;Modeling Aconite&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Modeling Aconite&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Aconite.png\" class=\"wp-image-1114\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Aconite.png?resize=651%2C252&#038;ssl=1\" alt=\"Modeling Aconite\" width=\"651\" height=\"252\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Aconite.png?w=501&amp;ssl=1 501w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Aconite.png?resize=300%2C116&amp;ssl=1 300w\" sizes=\"(max-width: 651px) 100vw, 651px\" \/><\/a><figcaption id=\"caption-attachment-1114\" class=\"wp-caption-text\"><strong>Modelling Aconite<\/strong><\/figcaption><\/figure>\n<p>The representation I am using is called a <em><strong>F<\/strong><strong>rame<\/strong><\/em> (actually, a <em><strong>data frame<\/strong><\/em> in this case). This format allows us to conveniently and succinctly capture different properties of an object. The object we are talking about is <em><strong>Aconite(Rheumatism(adult))<\/strong><\/em>. Those familiar with homeopathy know that the same remedy can cure many ailments if the specific characteristics are present in each case. What this means is the remedy <em><strong>Aconite<\/strong><\/em> can cure not just <em><strong>Rheumatism<\/strong><\/em> as in this example, but other ailments such as <em><strong>Cough<\/strong><\/em>, <em><strong>Fever<\/strong><\/em>, <em><strong>Measles<\/strong><\/em>, etc., provided the <em><strong>symptoms agree<\/strong><\/em>.<\/p>\n<p>So, I decided to add a <em><strong>qualifier<\/strong><\/em> to each remedy, indicating the specific ailment we are modelling. Thus, we can have <em><strong>frames<\/strong><\/em> for <em><strong>Aconite(Cough)<\/strong><\/em>, <em><strong>Aconite(Cough(Children))<\/strong><\/em>,\u00a0<em><strong>Aconite(Fever)<\/strong><\/em>, and so on.<span class=\"Apple-converted-space\">\u00a0The qualifier can be complex.<\/span><\/p>\n<p>Now, looking inside the <em><strong>frame<\/strong><\/em> structure, we have several <em><strong>attributes<\/strong><\/em> (or <em><strong>properties<\/strong><\/em>) describing the object being talked about. Each of these attributes describes the <em><strong>characteristics<\/strong><\/em> and <em><strong>modalities<\/strong><\/em> of the remedy that would make it applicable to the current situation. For example, in the case of <em><strong>Aconite<\/strong><\/em> (in the context of <em><strong>adult rheumatism<\/strong><\/em>), a person who requires this remedy (as opposed to another, say <em><strong>Nux Vomica<\/strong><\/em>) is likely to have <em><strong>high fever<\/strong><\/em>, <em><strong>inflamed joints<\/strong><\/em>, <em><strong>affected parts being swollen and sensitive to touch<\/strong><\/em>, and is likely to be <em><strong>mentally anxious and restless<\/strong><\/em>. It is also likely that the ailment started <em><strong>after<\/strong><\/em> the patient\u00a0<em><strong>got exposed to cold air<\/strong><\/em>.<\/p>\n<p>I hope you can see the characteristics of the remedy quite clearly in this representation. That is the power of a highly <em><strong>expressive<\/strong><\/em> KR system such as <em><strong>Flora-2<\/strong><\/em>. Of course, I would be able to describe this same knowledge directly in <a href=\"https:\/\/en.wikipedia.org\/wiki\/Prolog\" target=\"_blank\" rel=\"noopener\"><em><strong>Prolog<\/strong><\/em><\/a>, but it wouldn&#8217;t be this crisp. Indeed, <em><strong>Flora-2<\/strong><\/em> converts this representation into an underlying <em><strong>Prolog<\/strong><\/em> format (<a href=\"http:\/\/xsb.sourceforge.net\" target=\"_blank\" rel=\"noopener\"><em><strong>XSB Prolog<\/strong><\/em><\/a>), but that is not important to the modeller, since it is a matter of implementation detail (although it does give us an idea of the kind of reasoning we can do with the system).<\/p>\n<p>Let us look at another remedy <em><strong>Bryonia<\/strong><\/em>.<\/p>\n<figure id=\"attachment_1116\" aria-describedby=\"caption-attachment-1116\" style=\"width: 649px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Bryonia.png?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"1116\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2018\/10\/28\/flora-2-an-expressive-knowledge-representation-system\/bryonia\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Bryonia.png\" data-orig-size=\"471,209\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&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=\"Modelling Bryonia\" data-image-description=\"&lt;p&gt;Modelling Bryonia&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Modelling Bryonia&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Bryonia.png\" class=\"wp-image-1116\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Bryonia.png?resize=649%2C288&#038;ssl=1\" alt=\"Modelling Bryonia\" width=\"649\" height=\"288\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Bryonia.png?w=471&amp;ssl=1 471w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Bryonia.png?resize=300%2C133&amp;ssl=1 300w\" sizes=\"(max-width: 649px) 100vw, 649px\" \/><\/a><figcaption id=\"caption-attachment-1116\" class=\"wp-caption-text\"><strong>Modelling Bryonia<\/strong><\/figcaption><\/figure>\n<p>You can see that this remedy has some attributes in common with <em><strong>Aconite<\/strong><\/em>, but there are some new attributes too. For example, <em><strong>Bryonia<\/strong><\/em> typically affects <em><strong>synovial membranes<\/strong><\/em> (<em><strong>joints, pleura, pericardium <\/strong><\/em>and<em><strong> meninges<\/strong><\/em>). A patient requiring <em><strong>Bryonia<\/strong><\/em> is likely to be mentally <em><strong>irritable<\/strong><\/em> (unlike <em><strong>restlessness<\/strong><\/em> and <em><strong>anxiety<\/strong><\/em> of <em><strong>Aconite<\/strong><\/em>), with a <em><strong>white coated tongue<\/strong><\/em> and would keep <em><strong>drinking a lot of water<\/strong><\/em>. One similarity with <em><strong>Aconite<\/strong><\/em> is that the affected part is <em><strong>inflamed<\/strong><\/em> in this case too.<\/p>\n<p>There are two convincing reasons why this representation is preferable to natural language representation:<\/p>\n<blockquote>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">* It is much more readable<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">* It is possible to do formal reasoning with this representation<\/span><\/p>\n<\/blockquote>\n<p>The descriptions of other two remedies <em><strong>Nux Vomica<\/strong><\/em> and <em><strong>Colchicum<\/strong><\/em> also follow same format, and hence there is no need to go into the details. However, a minor aspect regarding the description of <em><strong>Num Vomica<\/strong><\/em> might be worth mentioning. See below.<\/p>\n<figure id=\"attachment_1118\" aria-describedby=\"caption-attachment-1118\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/NuxVom.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1118\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2018\/10\/28\/flora-2-an-expressive-knowledge-representation-system\/nuxvom\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/NuxVom.png\" data-orig-size=\"468,306\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&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=\"Modelling Nux Vomica\" data-image-description=\"&lt;p&gt;Modelling Nux Vomica&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Modelling Nux Vomica&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/NuxVom.png\" class=\"wp-image-1118\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/NuxVom.png?resize=650%2C425&#038;ssl=1\" alt=\"Modelling Nux Vomica\" width=\"650\" height=\"425\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/NuxVom.png?w=468&amp;ssl=1 468w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/NuxVom.png?resize=300%2C196&amp;ssl=1 300w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><figcaption id=\"caption-attachment-1118\" class=\"wp-caption-text\"><strong>Modelling Nux Vomica<\/strong><\/figcaption><\/figure>\n<p>The attributes <em><strong>lumbago<\/strong><\/em> and <em><strong>vertigo<\/strong><\/em> are essentially <em><strong>boolean<\/strong><\/em> valued. I could have written them as <em><strong>l<\/strong><strong>umbago -&gt; true<\/strong><\/em> and <em><strong>v<\/strong><strong>ertigo -&gt; true<\/strong><\/em>, but that is not necessary. This is another nice feature in <em><strong>Flora-2<\/strong><\/em>. The attributes can be as simple as such boolean attributes, or they can be complex functions (read the <a href=\"http:\/\/flora.sourceforge.net\/docs\/floraManual.pdf\" target=\"_blank\" rel=\"noopener\">documentation<\/a> for details).<\/p>\n<p>Having discussed the representation of remedy characteristics, I want to touch upon another interesting aspect of the model. We saw that <em><strong>Bryonia<\/strong><\/em> affects <em><strong>synovial membranes,<\/strong><\/em> for example, <em><strong>pleura<\/strong><\/em>. So if we want to find out which remedies have affinity for <em><strong>pleura<\/strong><\/em>, we want to get those remedies that have affinity for <em><strong>synovial membranes<\/strong><\/em>. How do we represent this knowledge?<\/p>\n<p>We can easily write a <em><strong>rule<\/strong><\/em> in Flora-2 to capture this:<\/p>\n<figure id=\"attachment_1119\" aria-describedby=\"caption-attachment-1119\" style=\"width: 653px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Rule.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1119\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2018\/10\/28\/flora-2-an-expressive-knowledge-representation-system\/rule\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Rule.png\" data-orig-size=\"601,81\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&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=\"A Rule\" data-image-description=\"&lt;p&gt;A Rule&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;A Rule&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Rule.png\" class=\"wp-image-1119\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Rule.png?resize=653%2C88&#038;ssl=1\" alt=\"A Rule\" width=\"653\" height=\"88\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Rule.png?w=601&amp;ssl=1 601w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Rule.png?resize=300%2C40&amp;ssl=1 300w\" sizes=\"(max-width: 653px) 100vw, 653px\" \/><\/a><figcaption id=\"caption-attachment-1119\" class=\"wp-caption-text\"><strong>A Rule<\/strong><\/figcaption><\/figure>\n<p>Such an elegant syntax! We will see how this is useful when I show examples of querying the <em><strong>KB<\/strong><\/em> in <em><strong>Flora-2<\/strong><\/em>.<\/p>\n<p>OK. Let us now see how to load our <em><strong>KB<\/strong><\/em> into <em><strong>Flora-2<\/strong><\/em> system and ask queries.<\/p>\n<p>We can load a <em><strong>KB<\/strong><\/em> by enclosing the full pathname in square brackets, followed by a period (<em><strong>&#8220;.&#8221;<\/strong><\/em>) in the <em><strong>Flora-2<\/strong><\/em> prompt. See the following figure:<\/p>\n<figure id=\"attachment_1120\" aria-describedby=\"caption-attachment-1120\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Loading.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1120\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2018\/10\/28\/flora-2-an-expressive-knowledge-representation-system\/loading\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Loading.png\" data-orig-size=\"681,427\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&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=\"Loading A KB File\" data-image-description=\"&lt;p&gt;Loading A KB File&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Loading A KB File&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Loading.png\" class=\"wp-image-1120\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Loading.png?resize=650%2C408&#038;ssl=1\" alt=\"Loading A KB File\" width=\"650\" height=\"408\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Loading.png?w=681&amp;ssl=1 681w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Loading.png?resize=300%2C188&amp;ssl=1 300w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><figcaption id=\"caption-attachment-1120\" class=\"wp-caption-text\"><strong>Loading A KB File<\/strong><\/figcaption><\/figure>\n<p>Now that the <em><strong>KB<\/strong><\/em> file is loaded, we can pose queries about the <em><strong>KB<\/strong><\/em>. Let us start with a simple query: <em><strong>What are the &#8220;Rheumatism&#8221; remedies?<\/strong><\/em><\/p>\n<blockquote>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">?rem(Rheumatism(?_))[].<\/span><\/p>\n<\/blockquote>\n<p>The question mark denotes a <em><strong>variable<\/strong><\/em>. If it is followed by an identifier, then the variable will have a binding when the query is satisfied by the <em><strong>KB<\/strong><\/em>. A question mark that stands by itself, or is followed by <em><strong>&#8220;_&#8221;<\/strong><\/em> is an <em><strong>anonymous<\/strong><\/em> variable: it will match anything that occurs in that place but it will not be bound to any value. It is convenient to use such an anonymous variable when we are not interested to know what it matches.<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>So, in the above query, we are interested in the name of the remedy, but not what type of <em><strong>Rheumatic<\/strong><\/em> remedy it is &#8211; whether it is for adults or children, etc. When I enter this query in <em><strong>Flora-2<\/strong><\/em> prompt, this is what I get:<\/p>\n<figure id=\"attachment_1122\" aria-describedby=\"caption-attachment-1122\" style=\"width: 651px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer1.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1122\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2018\/10\/28\/flora-2-an-expressive-knowledge-representation-system\/answer1\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer1.png\" data-orig-size=\"681,427\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&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=\"Answer to Query-1\" data-image-description=\"&lt;p&gt;Answer to Query-1&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Answer to Query-1&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer1.png\" class=\"wp-image-1122\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer1.png?resize=651%2C408&#038;ssl=1\" alt=\"Answer to Query-1\" width=\"651\" height=\"408\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer1.png?w=681&amp;ssl=1 681w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer1.png?resize=300%2C188&amp;ssl=1 300w\" sizes=\"(max-width: 651px) 100vw, 651px\" \/><\/a><figcaption id=\"caption-attachment-1122\" class=\"wp-caption-text\"><strong>Answer to Query-1<\/strong><\/figcaption><\/figure>\n<blockquote>\n<p style=\"padding-left: 30px;\"><span class=\"Apple-converted-space\">\u00a0<\/span><strong>Next\u00a0query:<\/strong><span style=\"color: #0000ff;\"> ?rem(?_)[affinity_for -&gt; synovial_membrane].<\/span><\/p>\n<\/blockquote>\n<p>This translates to: <em><strong>Find all remedies (Rheumatism or otherwise) that have affinity for the synovial membrane<\/strong><\/em>. Here is the answer:<\/p>\n<figure id=\"attachment_1123\" aria-describedby=\"caption-attachment-1123\" style=\"width: 651px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer2.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1123\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2018\/10\/28\/flora-2-an-expressive-knowledge-representation-system\/answer2\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer2.png\" data-orig-size=\"681,427\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&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=\"Answer to Query-2\" data-image-description=\"&lt;p&gt;Answer to Query-2&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Answer to Query-2&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer2.png\" class=\"wp-image-1123\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer2.png?resize=651%2C408&#038;ssl=1\" alt=\"Answer to Query-2\" width=\"651\" height=\"408\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer2.png?w=681&amp;ssl=1 681w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer2.png?resize=300%2C188&amp;ssl=1 300w\" sizes=\"(max-width: 651px) 100vw, 651px\" \/><\/a><figcaption id=\"caption-attachment-1123\" class=\"wp-caption-text\"><strong>Answer to Query-2<\/strong><\/figcaption><\/figure>\n<blockquote>\n<p style=\"padding-left: 30px;\"><strong>Third question:<\/strong><span style=\"color: #0000ff;\"> ?rem(?_)[pain -&gt; {stitching}, part -&gt; {inflamed}].<\/span><\/p>\n<\/blockquote>\n<p>I suppose you can guess the question: <strong><i>Which are the remedies that have stitching pains, with\u00a0inflammation of affected parts?<\/i><\/strong><span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<figure id=\"attachment_1124\" aria-describedby=\"caption-attachment-1124\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer3.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1124\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2018\/10\/28\/flora-2-an-expressive-knowledge-representation-system\/answer3\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer3.png\" data-orig-size=\"681,427\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&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=\"Answer to Query-3\" data-image-description=\"&lt;p&gt;Answer to Query-3&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Answer to Query-3&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer3.png\" class=\"wp-image-1124\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer3.png?resize=650%2C408&#038;ssl=1\" alt=\"Answer to Query-3\" width=\"650\" height=\"408\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer3.png?w=681&amp;ssl=1 681w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer3.png?resize=300%2C188&amp;ssl=1 300w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><figcaption id=\"caption-attachment-1124\" class=\"wp-caption-text\"><strong>Answer to Query-3<\/strong><\/figcaption><\/figure>\n<p>The system correctly determines that <em><strong>Bryonia<\/strong><\/em> is the matching remedy.<\/p>\n<blockquote>\n<p style=\"padding-left: 30px;\"><strong>A tricky question this time:<\/strong><span style=\"color: #0000ff;\"> ?rem(?_)[affinity_for -&gt; pleura].<\/span><\/p>\n<\/blockquote>\n<p>Guessed the question?: <em><strong>Which remedies have affinity for &#8220;pleura&#8221;?<\/strong><\/em><\/p>\n<p>The reason this question is tricky and interesting is because there is no <em><strong>direct<\/strong><\/em> match of attribute values in <em><strong>KB<\/strong><\/em>. The query will be satisfied only if the system can determine that any remedy that has affinity for <em><strong>synovial membrane<\/strong><\/em> will have affinity for <em><strong>pleura<\/strong><\/em>. If you remember, we have explicitly added such a rule to the <em><strong>KB<\/strong><\/em> to facilitate this type of reasoning. Therefore, <em><strong>Flora-2<\/strong><\/em> has no problem in determining the correct response:<\/p>\n<figure id=\"attachment_1125\" aria-describedby=\"caption-attachment-1125\" style=\"width: 651px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer4.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1125\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2018\/10\/28\/flora-2-an-expressive-knowledge-representation-system\/answer4\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer4.png\" data-orig-size=\"681,427\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&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=\"Answer to Query-4\" data-image-description=\"&lt;p&gt;Answer to Query-4&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Answer to Query-4&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer4.png\" class=\"wp-image-1125\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer4.png?resize=651%2C408&#038;ssl=1\" alt=\"Answer to Query-4\" width=\"651\" height=\"408\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer4.png?w=681&amp;ssl=1 681w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer4.png?resize=300%2C188&amp;ssl=1 300w\" sizes=\"(max-width: 651px) 100vw, 651px\" \/><\/a><figcaption id=\"caption-attachment-1125\" class=\"wp-caption-text\"><strong>Answer to Query-4<\/strong><\/figcaption><\/figure>\n<p>Quite nice, isn&#8217;t it?<\/p>\n<blockquote>\n<p style=\"padding-left: 30px;\"><strong>Here is our last question:<\/strong><span style=\"color: #0000ff;\"> ?rem[? -&gt; {face -&gt; hot}, ? -&gt; {chilly}].<\/span><\/p>\n<\/blockquote>\n<p>This is also an interesting question. We are asking for remedies that have <em><strong>face-&gt;hot<\/strong><\/em> and <em><strong>chilly<\/strong><\/em> for some set of attributes, without mentioning the names of the attributes. This saves some typing, but this is a <em><strong>weak<\/strong><\/em> question and might match irrelevant remedies if we are not careful. I am giving this example to show how much flexibility exists in <em><strong>Flora-2<\/strong><\/em>&#8216;s query formulation. Here is the answer:<\/p>\n<figure id=\"attachment_1126\" aria-describedby=\"caption-attachment-1126\" style=\"width: 651px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer5.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1126\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2018\/10\/28\/flora-2-an-expressive-knowledge-representation-system\/answer5\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer5.png\" data-orig-size=\"681,427\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&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=\"Answer to Query-5\" data-image-description=\"&lt;p&gt;Answer to Query-5&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Answer to Query-5&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer5.png\" class=\"wp-image-1126\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer5.png?resize=651%2C408&#038;ssl=1\" alt=\"Answer to Query-5\" width=\"651\" height=\"408\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer5.png?w=681&amp;ssl=1 681w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/answer5.png?resize=300%2C188&amp;ssl=1 300w\" sizes=\"(max-width: 651px) 100vw, 651px\" \/><\/a><figcaption id=\"caption-attachment-1126\" class=\"wp-caption-text\"><strong>Answer to Query-5<\/strong><\/figcaption><\/figure>\n<p>Now that we are done interacting with <em><strong>Flora-2<\/strong><\/em>, let us quit the system. To quit the interactive session, type &#8220;<em><strong>\\halt.&#8221;<\/strong><\/em> at the prompt.<\/p>\n<figure id=\"attachment_1127\" aria-describedby=\"caption-attachment-1127\" style=\"width: 651px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/quitting.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1127\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2018\/10\/28\/flora-2-an-expressive-knowledge-representation-system\/quitting\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/quitting.png\" data-orig-size=\"681,427\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&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=\"Quitting Flora-2 Session\" data-image-description=\"&lt;p&gt;Quitting Flora-2 Session&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Quitting Flora-2 Session&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/quitting.png\" class=\"wp-image-1127\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/quitting.png?resize=651%2C408&#038;ssl=1\" alt=\"Quitting Flora-2 Session\" width=\"651\" height=\"408\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/quitting.png?w=681&amp;ssl=1 681w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/quitting.png?resize=300%2C188&amp;ssl=1 300w\" sizes=\"(max-width: 651px) 100vw, 651px\" \/><\/a><figcaption id=\"caption-attachment-1127\" class=\"wp-caption-text\"><strong>Quitting Flora-2 Session<\/strong><\/figcaption><\/figure>\n<p>When you go through my <a href=\"http:\/\/www.rangakrish.com\/downloads\/homeopathy.flr\" target=\"_blank\" rel=\"noopener\"><em><strong>KB<\/strong><\/em> model<\/a>, you will find that I have only used the <em><strong>basic<\/strong><\/em> features of <em><strong>Flora-2<\/strong><\/em>. No <em><strong>object-orientation<\/strong><\/em> and no other <em><strong>exotic<\/strong><\/em> feature! Other advanced features might be applicable when modelling more complex domains and problems. It is even possible that if I start looking at other remedies and other ailments discussed in the book, I might find more interesting ways to model remedy characteristics. That is precisely how the real-world model evolves.<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>At this point, I do not know how <em><strong>Flora-2<\/strong> <\/em>performs in the context of large knowledge bases. If I were to convert the entire book of <em><strong>M.L.<\/strong><strong>Tyler <\/strong><\/em>(that I have been discussing) into <em><strong>Flora-2<\/strong><\/em> syntax, I expect it will result in a few hundred remedy descriptions. Can <em><strong>Flora-2<\/strong><\/em> handle those well? Maybe <em><strong>ErgoAI<\/strong><\/em> can? No idea. But that is not important for now.<\/p>\n<p>Overall, I am quite impressed with\u00a0<em><strong>Flora-2<\/strong><\/em>. I am hoping that in the next several weeks, I will find the time to model other interesting problems using the system, and perhaps even write my own program to interact with <em><strong>Flora-2<\/strong> <strong>engine<\/strong><\/em> instead of going through the interactive console that comes as default. So keep watching this space!<\/p>\n<p>You can download my homeopathy <em><strong>KB<\/strong><\/em> <a href=\"http:\/\/www.rangakrish.com\/downloads\/homeopathy.flr\" target=\"_blank\" rel=\"noopener\"><em><strong>here<\/strong><\/em><\/a>.<\/p>\n<p>Have a nice weekend!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am always on the lookout for a good Knowledge Representation (KR) system that facilitates modeling and reasoning about real-world knowledge. I have experience with\u00a0KnowledgeWorks\u00a0available in LispWorks\u00a0since I have used it in a few projects. I have also taken a cursory look at PowerLoom\u00a0and Racer. Last week, I came across Flora-2\u00a0and its commercial counterpart ErgoAI\u00a0from [&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":[169,22,162,17],"tags":[165,164,25,163,166,148,167],"class_list":["post-1109","post","type-post","status-publish","format-standard","hentry","category-flora-2","category-homeopathy","category-knowledge-representation","category-programming","tag-ergoai","tag-flora-2","tag-homeopathy","tag-knowledge-representation","tag-knowledgeworks","tag-prolog","tag-xsb-prolog"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9OLnF-hT","jetpack-related-posts":[{"id":1146,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/11\/04\/modeling-homeopathic-remedy-keynotes-in-flora-2\/","url_meta":{"origin":1109,"position":0},"title":"Modeling Homeopathic Remedy Keynotes in Flora-2","author":"admin","date":"November 4, 2018","format":false,"excerpt":"In my last post, I got started with Flora-2 and showed how we can model homeopathic remedies from a therapeutics perspective. Although such a limited view of remedies can be helpful in treating acute ailments, for treating chronic diseases, a comprehensive understanding of the various remedies from the perspective of\u2026","rel":"","context":"In &quot;Flora-2&quot;","block_context":{"text":"Flora-2","link":"https:\/\/www.rangakrish.com\/index.php\/category\/flora-2\/"},"img":{"alt_text":"Multiple Frames for Same Remedy","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/11\/Multiple-defn.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/11\/Multiple-defn.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/11\/Multiple-defn.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1229,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/11\/21\/flora-2-and-acupuncture\/","url_meta":{"origin":1109,"position":1},"title":"Flora-2 and Acupuncture","author":"admin","date":"November 21, 2018","format":false,"excerpt":"In my previous post\u00a0I gave examples of modeling homeopathy remedies using Flora-2. Today I want to show an example from a completely different domain namely,\u00a0Acupuncture.Acupuncture is an ancient system of Chinese medicine and is practised in many countries. It is based on the principle that our body has several meridians,\u2026","rel":"","context":"In &quot;Acupuncture&quot;","block_context":{"text":"Acupuncture","link":"https:\/\/www.rangakrish.com\/index.php\/category\/acupuncture\/"},"img":{"alt_text":"Sanzhen Therapy","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/11\/Fig6.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1202,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/11\/12\/simulating-possible-worlds-in-flora-2\/","url_meta":{"origin":1109,"position":2},"title":"Simulating Possible Worlds in Flora-2","author":"admin","date":"November 12, 2018","format":false,"excerpt":"The idea of encountering different worlds with varying truths is an interesting one. It has deep connections to philosophy and logic. For a nice discussion, see this article. Today, we are going to take advantage of Flora-2's module system to simulate possible worlds. Flora-2 allows us to dynamically associate any\u2026","rel":"","context":"In &quot;Flora-2&quot;","block_context":{"text":"Flora-2","link":"https:\/\/www.rangakrish.com\/index.php\/category\/flora-2\/"},"img":{"alt_text":"Modal Operators","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/11\/Modal-Operators.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/11\/Modal-Operators.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/11\/Modal-Operators.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":3660,"url":"https:\/\/www.rangakrish.com\/index.php\/2025\/04\/11\/using-claude-to-generate-rdf-triples\/","url_meta":{"origin":1109,"position":3},"title":"Using Claude to Generate RDF Triples","author":"admin","date":"April 11, 2025","format":false,"excerpt":"We all know that LLMs are now capable of generating structured data. I have used OpenAI models earlier to generate Tables and JSON data, but this time I wanted to try a more complex example.\u00a0 As someone interested in Homeopathy, I wanted to generate remedy descriptions as RDF triples, in\u2026","rel":"","context":"In &quot;Homeopathy&quot;","block_context":{"text":"Homeopathy","link":"https:\/\/www.rangakrish.com\/index.php\/category\/homeopathy\/"},"img":{"alt_text":"Lycopodium TTL Format","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco-300x232.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco-300x232.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco-300x232.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":2960,"url":"https:\/\/www.rangakrish.com\/index.php\/2022\/12\/08\/are-rule-based-systems-still-relevant-today\/","url_meta":{"origin":1109,"position":4},"title":"Are Rule-Based Systems Still Relevant Today?","author":"admin","date":"December 8, 2022","format":false,"excerpt":"Before Machine Learning came into the mainstream, Rule-based systems were being used actively to solve complex decision making problems. In fact, Rule engines were considered to be an exotic component of Artificial Intelligence and the systems built using these rule engines were called Expert Systems. I still remember learning to\u2026","rel":"","context":"In &quot;Knowledge Representation&quot;","block_context":{"text":"Knowledge Representation","link":"https:\/\/www.rangakrish.com\/index.php\/category\/knowledge-representation\/"},"img":{"alt_text":"Gathering Symptom Information","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2022\/12\/Screen1-300x187.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2832,"url":"https:\/\/www.rangakrish.com\/index.php\/2022\/06\/12\/definite-clause-grammars-in-lisp-part-4\/","url_meta":{"origin":1109,"position":5},"title":"Definite Clause Grammars in Lisp &#8211; Part 4","author":"admin","date":"June 12, 2022","format":false,"excerpt":"In a series of articles\u00a0written earlier, I had shown how it is possible to model Definite Clause Grammars (DCG) in LispWorks Lisp (Enterprise Edition). We use defgrammar\u00a0in Common Prolog (available as part of KnowledgeWorks package) to define our grammar rules. Here is a toy English grammar represented using defgrammar: This\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"DCG Using Defgrammar","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2022\/06\/defgrammar-version-300x177.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2022\/06\/defgrammar-version-300x177.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2022\/06\/defgrammar-version-300x177.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/1109","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=1109"}],"version-history":[{"count":0,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/1109\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/media?parent=1109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/categories?post=1109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/tags?post=1109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}