I needed to extend rembero to handle removing multiple items. For example
(rememberallo [1 2 3] [1 2 3 4 5] [4 5]) is true. My relation is:
(l/defne remberallo [s l o]
([() l l])
([[h . r] _ _]
(l/fresh [o-h]
(l/rembero h l o-h)
(remberallo r o-h o))))
It's good enough for my use case where s and l are always ground but, in an
effort to understand logic programming better, I started testing programs
where s & l are ground but l is not. Here, I run into non-terminating
programs. For example:
(l/run 7 [q]
(remberallo [2 3] q [1]))
At run level 6, I get all the permutations of [1 2 3], just as expected.
However, at 7, the program does not terminate and I'd like to understand
why. I feel like I need to constrain the relation between o-h and o better
but I'm not sure what else to say about it.
Any thoughts?
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.