title: Is there a way to logically bind values from two different multislots?
body: <p>I have number of key:value pairs such as Company:ABC, Role:Admin etc. I want to write a general rule such that I can search for facts with those pair values. For now, my rule below is just searching for the values in the fact but cannot be bound in such a way to compare company:ABC in rule fact to company:ABC in provided fact.</p>
  
  <p>I have certain facts (dynamic) for employees which is as follows:</p>
  
  <pre><code>Format: Employee
  FormatData:
          [ Name: Bob,
      Role: Admin,
      Company: ABC]
  </code></pre>
  
  <p>And another fact (rule): (Here the rule changes dynamically. So the rule should be very general.) </p>
  
  <pre><code>Format: Rule
  FormatData: 
      [ Format: Employee,
      Field: Company
      Value: ABC
      ]
  </code></pre>
  
  <p>My code for now:</p>
  
  <pre class="lang-c prettyprint-override"><code>(deftemplate rule
      (multislot fact1)
      (multislot fact2))
  
  (deftemplate fact
      (slot name)
      (multislot field)
      (multislot value))
  
  (defrule reasoning
      (rule (fact1 ?name1 ?field1 ?value1)
          (fact2 ?name2 ?field2 ?value2))
      (fact (name ?name1) (field $? ?field1 $?) (value $? ?value1 $?))
      (fact (name ?name2) (field $? ?field2 $?) (value $? ?value2 $?))
  =&gt;
      (assert (worked))
  </code></pre>
  
  <p>Provided facts:</p>
  
  <pre><code>(rule (fact1 'Employee' 'company' 'ABC')
      (fact2 'Event' 'Place' 'USA'))
  (fact (name 'Employee') (field 'Name' 'Company' 'Role') (value 'Bob' 'ABC' 'Admin'))
  (fact (name 'Event') (field 'Place') (value 'USA'))
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre class="lang-c prettyprint-override"><code>(worked)
  </code></pre>
  
  <p>But with this rule and templates even a fact with Employee name ABC and company bob gets the rule fired.
  I want it such that rule with company:ABC should be matched with only company:ABC in fact Employee. And also, I want the
  rule to be general and not restricted to Employee, event etc..</p>