title: How do you do a Nested if-else statement in Prolog?
body: <p>If I have this function:</p>
  
  <pre><code>min(List1, List2, Output) :-
     length(List1, N),
     length(List2, M),
     (   N &lt; M -&gt;
         Output = 'true'
     ;   Output = 'false'
     ).
  </code></pre>
  
  <p>but what if I wanted to also check if N == M? Maybe like this:</p>
  
  <pre><code>min(List1, List2, Output) :-
     length(List1, N),
     length(List2, M),
     (   N &lt; M -&gt;
         Output = 'true'
     ;   (  N = M -&gt;
            Output = 'equal'
         ;  Output = 'other'
         )
     ).
  </code></pre>
  
  <p>Doesn't seem to work.</p>