Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If a, b and p are positive integers (assuming that the positive range include the 0 value) then the expression <strong>(((a+p) &lt;= b) &amp;&amp; (a == 0 || a > 1) &amp;&amp; (b >= p)) &amp;&amp; ((b - (a + p) == 0) || (b - (a + p) > 1))</strong> can be reduced to <strong>((a+p)&lt;=b) &amp;&amp; (a!=1)</strong> &amp;&amp; <strong>((b-(a+p))!=1)</strong></p> <p>Let me demonstrate it: In the first part of the expression there is a condition, <strong>((a+p)&lt;=b)</strong>, that if valuated true render true the second part: <strong>((b - (a + p) == 0) || (b - (a + p) > 1))</strong>. If it is true that <strong>(b >=(a+p))</strong> then <strong>(b - (a+p)) have to be greater or equal to 0</strong>, we need to assure that <strong>(b-(a+p))!=1</strong>. Put this term aside for awhile and go on.</p> <p>Now we can concentrate our efforts on the the first part <strong>(((a+p) &lt;= b) &amp;&amp; (a == 0 || a > 1) &amp;&amp; (b >= p))</strong> &amp;&amp; ((b-(a+p))!=1)</p> <p>If <strong>a</strong> is positive then it is always >=0 and so we can drop the test <strong>(a == 0 || a > 1)</strong> if favor of (a!=1) and reduce first part of the expression to <strong>(((a+p) &lt;= b) &amp;&amp; (b >= p) &amp;&amp; (a!=1))</strong>.</p> <p>For the next step of the reduction you can consider that if <strong>b >= (a+p)</strong> then, obviously <strong>b>=p</strong> (<strong>a</strong> is positive) and the expression can be reduced to </p> <p><strong>((a+p)&lt;=b) &amp;&amp; (a!=1)</strong> &amp;&amp; <strong>((b-(a+p))!=1)</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload