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.
Define an anonymous constraint that can be used with the unifier:
(let [oddc (fnc [x] (odd? x))]
(unifier {:a '?a} {:a 1} :when {'?a oddc})
;;=> {:a 1}
(unifier {:a '?a} {:a 2} :when {'?a oddc})
;;=> nil
)
Note, the constraint will not run until all arguments are fully ground.
Use defnc to define a constraint and assign a toplevel var.
Take the argument to the goal and check that we don't
have an alpha equivalent cached answer term in the cache.
If it doesn't already exist in the cache add the new
answer term.
Like membero but uses to disequality further constraining
the results. For example, if x and l are ground and x occurs
multiple times in l, member1o will succeed only once.
EXPERIMENTAL: negation as failure constraint. All arguments to the goal c
must be ground. If some argument is not ground the execution of this constraint
will be delayed.
A function version of conde, which takes a list of goals and tries them as if via conde.
Note that or* only does disjunction, ie (or* [a b c]) is the same as (conde [a] [b] [c]).
If you need something like (conde [a b] [c]), you can use and*, or all:
(or* [(and* a b) c]).
Take a waiting stream, a success continuation, and a failure continuation.
If we don't find any ready suspended streams, invoke the failure continuation.
If we find a ready suspended stream calculate the remainder of the waiting
stream. If we've reached the fixpoint just call the thunk of the suspended
stream, otherwise call mplus on the result of the thunk and the remainder
of the waiting stream. Pass this result to the success contination.