 <p>You can just use boolean clauses:</p> <pre><code>(assert (myTemp (one asd) (second jhg)) (myTemp (one asd) (second kjh)) (myTemp (one bvc) (second jhg)) (myTemp (one bvc) (second jhg) (third qwe))) (find-fact ((?p myTemp)) (or (eq ?p:one bvc) (eq ?p:third qwe)) (&lt;Fact-4&gt;) (find-fact ((?p myTemp)) (or (eq ?p:one bvc) (eq ?p:second jhg)) (&lt;Fact-1&gt;) (find-all-fact ((?p myTemp)) (or (eq ?p:one bvc) (eq ?p:second jhg)) (&lt;Fact-1&gt; &lt;Fact-3&gt; &lt;Fact-4&gt;) </code></pre>