>
> I think you can automatically achieve the factoring I describe in the
> rewrite examples, which might be more direct than what you have in mind.
>
> States will track scope and maintain an order on variables based on the
> order they're introduced. When variables introduced in newer scopes are
> unified with variables in older scopes, the newer variable points to and
> hands over ownership of its constraints to the older variable. By tracking
> the 'fresh' scopes that a state has seen inside of a negation, the negation
> will know to clean out (that is, fail) constraints involving these
> variables, while complementing the others as usual, building a disjunction
> out of whatever remains, as you do.
>
I can see you idea, but do not know how to implement it in code yet. The
case where you add indirection to handle (== `(2 . ,x) v))) scares me a
bit, because in case of OCaml there are algebraic data types, and handle
them may be harder.
However, I will think about it, thanks !
>
> What do you mean by compatibility in this case? Are you looking for
> unsatisfiability? Do you have an efficiency concern in mind (with an
> example)?
>
What I was trying to say can be illustrated by following examples.
Suppose, after (lazy) negation of individual states in stream we get the
following stream:
((x == 1) || ... ) && ((x == 2) || ... ) && ... // here goes other
conjuncts (probably, infinitely many)
We start folding this stream, i.e we are trying to convert it from CNF to
DNF.
First, we try to combine (x == 1) and (x == 2). Since the formula is
unsatisfiable, we can drop it and start to proceed with other disjuncts.
But lets consider other case:
((x == 1) || ... ) && ((y == 2) || ... ) && ...
Now (x == 1) && (y == 2) is satifiable, and we have to drag it through
other `negated` answers. In the worst case, we have to drag (x == 1)
through the whole stream.
--
You received this message because you are subscribed to the Google Groups
"minikanren" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/minikanren.
For more options, visit https://groups.google.com/d/optout.