{"id":146,"date":"2016-10-05T10:58:10","date_gmt":"2016-10-05T09:58:10","guid":{"rendered":"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/?p=146"},"modified":"2016-10-05T10:58:10","modified_gmt":"2016-10-05T09:58:10","slug":"concepts-vi-or-causality-part-1","status":"publish","type":"post","link":"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/2016\/10\/05\/concepts-vi-or-causality-part-1\/","title":{"rendered":"Concepts VI: OR-causality &#8211; Part 1"},"content":{"rendered":"<p>OR-causality is an interesting part of specification of circuits, specifically when using Signal Transition Graphs (STGs). We have recently released a translation tool for\u00a0<em>Concepts (<\/em>available from\u00a0<a href=\"https:\/\/github.com\/tuura\/concepts\">https:\/\/github.com\/tuura\/concepts<\/a>), which will take a set of concepts, and produce an STG specification for this. This includes both standard AND-causality, and OR-causality. OR-causality poses a challenge, as with STGs, and in this post we aim to discuss this.<\/p>\n<p>This will be a\u00a02 part series, with several examples to help explain OR-causality in this post, part 1, and an algorithm in part 2 to translate OR-causality concepts to STGs.<\/p>\n<p><strong><span style=\"text-decoration: underline\">OR-causality, an introduction<br \/>\n<\/span><\/strong><\/p>\n<p>For this, let&#8217;s use four\u00a0simple examples. Here, we will assume initial states for all signals as 0.<\/p>\n<ol>\n<li><span style=\"text-decoration: underline\">OR-Gate<\/span><\/li>\n<\/ol>\n<p>A standard gate used in many applications, an OR-gate, and the associated causality, \u00a0is important and a good example to use to display OR-causality.<\/p>\n<p>In\u00a0concepts, an OR-gate is defined as follows:<\/p>\n<p><strong>orGate a b c =<\/strong>\u00a0<strong>[a+, b+] ~|~&gt; c+ \u22c4 a- \u21dd c-\u00a0\u22c4 b-\u00a0\u21dd c-<\/strong><\/p>\n<p>There are some operators to discuss here:<\/p>\n<p>[a+ , b+] &#8211; This is how signal transitions are listed.<br \/>\n~|~&gt; &#8211; This shows an OR-Causalilty relationship<\/p>\n<p>In words, this is a composition of three concepts. First, <em>either<\/em>\u00a0<strong>a+<\/strong> <em>or<\/em>\u00a0<strong>b+\u00a0<\/strong>cause\u00a0<strong>c+<\/strong>. Then,\u00a0<strong>a-<\/strong> causes\u00a0<strong>c-<\/strong>, and\u00a0<strong>b-\u00a0<\/strong>causes\u00a0<strong>c-<\/strong>.<\/p>\n<p>This will mean that, when <strong>a+,<\/strong>\u00a0\u00a0<strong>b+<\/strong>\u00a0or both of these<strong>\u00a0<\/strong>occur, <strong>c+<\/strong> can occur. But, for\u00a0<strong>c-\u00a0<\/strong>to occur,\u00a0<strong>a-\u00a0<\/strong>and\u00a0<strong>b-<\/strong> must have occurred.<\/p>\n<p><a href=\"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/09\/OR_gate.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-149 size-large\" src=\"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/09\/OR_gate-1024x326.png\" alt=\"OR_gate\" width=\"474\" height=\"151\" srcset=\"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/09\/OR_gate-1024x326.png 1024w, https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/09\/OR_gate-300x96.png 300w, https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/09\/OR_gate-768x245.png 768w, https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/09\/OR_gate.png 1660w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/a><\/p>\n<p>This is the STG produced from translating the OR-gate concept. This looks like any other STG we have shown on this blog, however notice that there are two\u00a0<strong>c+<\/strong> transitions. This is how OR-causality is displayed in STGs. When\u00a0<strong>a+\u00a0<\/strong>occurs, one of the\u00a0<strong>c+<\/strong> transitions can occur. When\u00a0<strong>b+\u00a0<\/strong>occurs, the other\u00a0<strong>c+<\/strong> transition can occur. If both\u00a0<strong>a+<\/strong> and\u00a0<strong>b+<\/strong> have occurred, then either of the\u00a0<strong>c+\u00a0<\/strong>transitions can occur. However, both\u00a0<strong>a-\u00a0<\/strong>and\u00a0<strong>b-<\/strong> can occur, then and only then can\u00a0<strong>c-<\/strong> occur.<\/p>\n<p>Notice, that for the\u00a0<strong>c+<\/strong> transition, there is OR-causality with <strong>a+<\/strong>\u00a0or\u00a0<strong>b+<\/strong>, but for the\u00a0<strong>c-<\/strong> transition, there is AND-causality with\u00a0<strong>a-<\/strong> and\u00a0<strong>b-<\/strong>.<\/p>\n<p>2. <span style=\"text-decoration: underline\">OR-Gate with a single AND-causality<\/span><\/p>\n<p>This is an OR-gate with inputs <strong>a<\/strong>\u00a0and\u00a0<strong>b<\/strong>, and output <strong>c<\/strong>, with another input signal\u00a0<strong>d<\/strong>.\u00a0<strong>d<\/strong> will form a buffer with\u00a0c, including some AND-causality as well. This way we can show how AND- and OR-Causality interact.<strong>\u00a0<\/strong>In concepts this is:<\/p>\n<p><strong>circuit \u00a0= orGate a b c\u00a0\u22c4 buffer d c<\/strong><\/p>\n<p>And, expanded into signal-level concepts, this is:<\/p>\n<p><strong>circuit =\u00a0[a+, b+] ~|~&gt; c+ \u22c4 a- \u21dd c-\u00a0\u22c4 b-\u00a0\u21dd c-\u00a0\u22c4 d+\u00a0\u21dd c+\u00a0\u22c4 d- \u21dd c-<\/strong><\/p>\n<p>In words, for\u00a0<strong>c+\u00a0<\/strong>to occur,\u00a0<strong>d+<\/strong>\u00a0must\u00a0occur, <em>and<\/em>\u00a0<em>either\u00a0<\/em><strong>b+\u00a0<\/strong><em>or<\/em>\u00a0<strong>c+<\/strong>. For\u00a0<strong>c-\u00a0<\/strong>to occur, all of <strong>a-<\/strong>,\u00a0<strong>b-<\/strong> and\u00a0<strong>d-<\/strong> must occur.<\/p>\n<p>So, as a thought experiment, if\u00a0<strong>a+\u00a0<\/strong>and\u00a0<strong>b+<\/strong> have occurred, no\u00a0<strong>c+\u00a0<\/strong>transition can occur without\u00a0<strong>d+<\/strong>\u00a0having occurred.<\/p>\n<p>The STG after translating the above concept is:<a href=\"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/09\/OR_gate_1_AND_causality.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-151 size-large\" src=\"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/09\/OR_gate_1_AND_causality-1024x240.png\" alt=\"OR_gate_1_AND_causality\" width=\"474\" height=\"111\" srcset=\"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/09\/OR_gate_1_AND_causality-1024x240.png 1024w, https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/09\/OR_gate_1_AND_causality-300x70.png 300w, https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/09\/OR_gate_1_AND_causality-768x180.png 768w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/a><\/p>\n<p>Notice that this looks similar to the previous image, but with an extra consistency loop for the signal\u00a0<strong>d<\/strong>. However, notice that\u00a0<strong>d1<\/strong>, the place showing when\u00a0<strong>d+<\/strong> has occured, is connected to\u00a0<em>both<strong>\u00a0<\/strong><\/em><strong>c+<\/strong> transitions. And\u00a0<strong>d0<\/strong> is connected to\u00a0<strong>c-<\/strong>. This will therefore mean that, regardless of which of <b>a+ <\/b>or\u00a0<strong>b+<\/strong>\u00a0have occured,\u00a0<strong>c+\u00a0<\/strong>cannot occur without\u00a0<strong>d+<\/strong> occuring.<\/p>\n<p>3.\u00a0<span style=\"text-decoration: underline\">AND-Gate<\/span><\/p>\n<p>Another standard gate. In this case, when thinking of it in terms of causality, it is the opposite of the OR-gate. i.e. For the\u00a0<strong>c+<\/strong> transition, there is AND-causality with both the\u00a0<strong>a+\u00a0<\/strong>and\u00a0<strong>b+\u00a0<\/strong>transition. Yet, with the\u00a0<strong>c-<\/strong> transition, there is OR-causality between the\u00a0<strong>a-\u00a0<\/strong>and\u00a0<strong>b-<\/strong> transitions.<\/p>\n<p>The concepts for this is:<\/p>\n<p><strong>andGate a b c \u00a0=\u00a0a+ \u21dd c+ \u22c4 b+ \u21dd c+\u00a0\u22c4\u00a0[a-, b-] ~|~&gt; c-<\/strong><\/p>\n<p>This can be described in words as in the previous paragraph.<\/p>\n<p>Let&#8217;s translate this to an STG.<a href=\"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/10\/AND-Gate.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-155 size-full\" src=\"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/10\/AND-Gate.png\" alt=\"AND-Gate\" width=\"1410\" height=\"429\" srcset=\"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/10\/AND-Gate.png 1410w, https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/10\/AND-Gate-300x91.png 300w, https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/10\/AND-Gate-768x234.png 768w, https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/10\/AND-Gate-1024x312.png 1024w\" sizes=\"auto, (max-width: 1410px) 100vw, 1410px\" \/><\/a><\/p>\n<p>Notice that this time, there are two <strong>c-<\/strong> transitions, as this transition is the OR-causality in an AND-gate. Notice the similarities between this and the OR-gate STG, just a sort-of mirror image.<\/p>\n<p>4. <span style=\"text-decoration: underline\">AND-Gate and OR-Gate<\/span><\/p>\n<p>For this, signals\u00a0<strong>a<\/strong> and\u00a0<strong>b\u00a0<\/strong>are the inputs to an OR-gate, and signals\u00a0<strong>d<\/strong> and\u00a0<strong>e<\/strong> are the inputs to an AND-gate. The outputs for both of these gates are\u00a0<strong>c<\/strong>. Synthesizing this would not simply produce an AND and OR gate, but for this example, it shows how the AND and OR causality can interact in and interesting way.<\/p>\n<p>This in concepts is:<\/p>\n<p><strong>circuit = orGate a b c &lt;&gt; andGate d e c<\/strong><\/p>\n<p>If we expand this:<\/p>\n<p><strong>circut = [a+, b+] ~|~&gt; c+ \u22c4 a- \u21dd c- \u22c4 b- \u21dd c-\u00a0\u22c4<br \/>\n<\/strong><strong>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 d+\u00a0\u21dd c+\u00a0\u22c4 e+ \u21dd c+ \u22c4 [d-, e-]\u00a0\u21dd c-<\/strong><\/p>\n<p>In words, this means that for\u00a0<strong>c+<\/strong> to occur, <em>either<\/em>\u00a0<strong>a+\u00a0<\/strong><em>or<\/em>\u00a0<strong>b+<\/strong>,\u00a0<em>and<\/em> <em>both\u00a0<\/em><strong>d+\u00a0<\/strong>and\u00a0<strong>c+\u00a0<\/strong>must have occured. For\u00a0<strong>c-<\/strong> to occur,\u00a0<em>both\u00a0<\/em><strong>a-<\/strong> <em>and\u00a0<\/em><strong>b-<\/strong>, and\u00a0<em>either<\/em>\u00a0<strong>d-\u00a0<\/strong><em>or\u00a0<\/em><strong>e-<\/strong> must have occured.<\/p>\n<p>This is slightly more confusing than the previous examples, and the resulting STG produced by translating this concept is interesting:<\/p>\n<p><a href=\"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/10\/AND-OR-Gate.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-158\" src=\"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/10\/AND-OR-Gate-1024x252.png\" alt=\"AND-OR-Gate\" width=\"474\" height=\"117\" srcset=\"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/10\/AND-OR-Gate-1024x252.png 1024w, https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/10\/AND-OR-Gate-300x74.png 300w, https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/10\/AND-OR-Gate-768x189.png 768w, https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/files\/2016\/10\/AND-OR-Gate.png 1944w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/a><\/p>\n<p>It does look a little confusing, but notice there are two of both\u00a0<strong>c+<\/strong> and\u00a0<strong>c-<\/strong> transitions. Their interactions with\u00a0the other signals determine which of these are able to transition. Testing this would prove that the concept description above works.<\/p>\n<p><strong><span style=\"text-decoration: underline\">Finally<\/span><\/strong><\/p>\n<p>There is little reuse here. The concepts above feature some reuse of previously discussed concepts, but due to the inclusion of OR-causality, we cannot use any previously included gate- or protocol-concept as they do not feature any OR-causality.<\/p>\n<p>So in this post, we have discussed OR-causality, and some uses of it. Specifically, I have aimed to show how it works on it&#8217;s own, and in conjunction with AND-causality.<\/p>\n<p>Part 2 of this post will include an algorithm, as we have previously discussed how concepts are translated\u00a0to STGs, but this algorithm will explain how OR-causality is translated, as this is quite specific.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OR-causality is an interesting part of specification of circuits, specifically when using Signal Transition Graphs (STGs). We have recently released a translation tool for\u00a0Concepts (available from\u00a0https:\/\/github.com\/tuura\/concepts), which will take a set of concepts, and produce an STG specification for this. This includes both standard AND-causality, and OR-causality. OR-causality poses a challenge, as with STGs, and &hellip; <a href=\"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/2016\/10\/05\/concepts-vi-or-causality-part-1\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Concepts VI: OR-causality &#8211; Part 1<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":6010,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-146","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/wp-json\/wp\/v2\/posts\/146","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/wp-json\/wp\/v2\/users\/6010"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/wp-json\/wp\/v2\/comments?post=146"}],"version-history":[{"count":8,"href":"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/wp-json\/wp\/v2\/posts\/146\/revisions"}],"predecessor-version":[{"id":159,"href":"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/wp-json\/wp\/v2\/posts\/146\/revisions\/159"}],"wp:attachment":[{"href":"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/wp-json\/wp\/v2\/media?parent=146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/wp-json\/wp\/v2\/categories?post=146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.ncl.ac.uk\/jrbeaumont\/wp-json\/wp\/v2\/tags?post=146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}