title: Executing the same rule for two diffrent cases in prolog
body: <p>Assume I have this predicate:</p>
  
  <pre><code>parentheses2([H1,'+'|T],L,C).
  parentheses2([H1,'-'|T],L,C) :- L=[1,2,3].
  parentheses2([H1,'*'|T],L,C).
  parentheses2([H1,'/'|T],L,C) :- L=[1,2,4,5,6,9].
  </code></pre>
  
  <p>What I want to achievie is to get the same answer when i ask prolog <code>?-parentheses2([1,-,3],L,5).</code> and <code>?- parentheses2([1,+,3],L,5).</code>, without rewritting <code>L=[1,2,3]</code> into <code>parentheses2([H1,'+'|T],L,C)</code>. I want to make Prolog execute <code>L=[1,2,3]</code> in two diffrent cases (when there is '+' or '-' after <code>H1</code>). The reasoning behind it is that in place <code>L=[1,2,3]</code>, <code>L=[1,2,4,5,6,9]</code> I'd like to put more complex rules.
  Is there any way to achieve it?</p>