featurec

added

ns
clojure.core.logic

type
function

(featurec x fs)

Ensure that a map contains at least the key-value pairs
in the map fs. fs must be partially instantiated - that is,
it may contain values which are logic variables to support
feature extraction.

                user> (run 1 [q] (featurec q {1 2}) (== q {2 4}))
() ;; {2 4} does not cointain k-v 1 2
user> (run 1 [q] (featurec q {1 2}) (== q {1 2 2 4}))
({1 2, 2 4}) ;; {1 2 2 4} does contain k-v 1 2
            
                ;; http://michaelrbernste.in/2013/05/12/featurec-and-maps.html
;; http://stackoverflow.com/questions/15821718/how-do-i-de-structure-a-map-in-core-logic

(is (= (run* [q]
         (featurec q {:foo 1})
         (== q {:foo 1 :bar 2}))
       '({:foo 1 :bar 2})))