Workiva / eva

A distributed database-system implementing an entity-attribute-value data-model that is time-aware, accumulative, and atomically consistent
Other
565 stars 25 forks source link

Some `or` conditions fail when they should not #80

Open tylerwilding-wk opened 5 years ago

tylerwilding-wk commented 5 years ago

Datomic Example:

(d/q '[:find ?A ?B
       :where (or (and [?A :foo ?B] [(pos? ?B)]))]
     [[1 :foo 2]])
#{[1 2]}

Eva Example:

(q '[:find ?A ?B
     :where (or (and [?A :foo ?B] [(pos? ?B)]))]
   [[1 :foo 2]])
EvaException Insufficient bindings: no predicate could be selected.  eva.error/eva-exception (error.clj:121)

The set of required variables in an or clause is the union of the sets of required variables in its subclauses, which cannot be derived interior to the subclause, prior to their required binding.