title: Prolog: tuple|dict unification : partial match?
body: <p>is there a way to do partial unification of tuples :</p>
  
  <pre><code>?- (_,c: X, _) = ( w: 23, c: 10, p: 45 ).
  X = 10.
  
  ?- (c: X, _) = ( w: 23, c: 10, p: 45 ).
  false.
  
  ?- (c: X) = ( w: 23, c: 10, p: 45 ).
  false.
  </code></pre>
  
  <p>only the first works. I want the third example to work ?</p>
  
  <p>prepend-atom , does not work either, if the keys are not in exact order :</p>
  
  <pre><code>?- (_,w: X, p: Y, _) = (blah , w: 23, c: 10, p: 45 ).
  false.
  </code></pre>
  
  <p>I would also like it to unify in the rule head , f.e.</p>
  
  <pre><code>rule((c: X)) :- X &lt; 10.
  rule((w: X, p: Y)) :- X &lt; 10, Y &gt; 0.
  </code></pre>
  
  <p>The reason is that i dont know the content of the tuple I just know that it has element with "key"  - "c" or "w"-and-"p", or any combination in no particular order.</p>
  
  <hr>
  
  <p>SWI-Prolog dicts work, but I don't know how to do partial match in  a rule()-head ?!</p>
  
  <pre><code> ?- _{c: X, a: Y} &gt;:&lt; _{ a: 5, b: 4, c:12, d:18}.
   X = 12,
   Y = 5.
  </code></pre>
  
  <p>but rule-matching by default does full-unification i.e:</p>
  
  <pre><code> ?- _{c: X, a: Y} = _{ a: 5, b: 4, c:12, d:18}.
   false.
  </code></pre>