title: how to find the matching element in prolog list
body: <p>I have following facts in prolog. </p>
  
  <pre><code>p(cold,[flu,high_body_temp,headache,dizzy],0.3],
  p(cold,[flu,not high_body_temp,headache,dizzy],0.2],
  p(cold,[flu,high_body_temp,not headache,dizzy],0.4],
  p(cold,[flu,high_body_temp,headache,not dizzy],0.1],
  p(cold,[not flu,high_body_temp,headache,dizzy],0.3],
  p(cold,[flu,not high_body_temp,headache,not dizzy],0.3],
  
  
  p(diarrhea,[headache,not stomachache,dizzy,vomit],0.5),
  p(diarrhea,[headache,stomachache,not dizzy,vomit],0.4),
  p(diarrhea,[headache,stomachache,dizzy,not vomit],0.2),
  p(diarrhea,[not headache,stomachache,dizzy,vomit],0.1),
  p(diarrhea,[headache,not stomachache,not dizzy,not vomit],0.1),
  </code></pre>
  
  <p>And a list that is generated at runtime, for example:</p>
  
  <pre><code>[flu,headache]
  </code></pre>
  
  <p>we should get the answer from two facts contain 'true' elements of [flu,headache] whereas 'not' means the element is not exist:</p>
  
  <pre><code>p(cold,[flu,not high_body_temp,headache,not dizzy],0.3],
  p(diarrhea,[headache,not stomachache,not dizzy,not vomit],0.1),
  </code></pre>
  
  <p>and the answer should be:</p>
  
  <pre><code>cold = 0.3
  diarrhea = 0.1
  </code></pre>
  
  <p>How can i write a code in prolog to get this done?please help. i'm totally stuck. TQ.</p>