I have the following problem to solve, and before I try and tackle it
the long way around, I wondered this was a problem that fits inside
the domain of problems to be handled by core.logic (of which I hear a
lot about recently)

Take a shop selling ice cream of the following flavors:  Vanilla,
Strawberry, Chocolate, Liquorice
It packages them for pricing purposes in the following way (example :
actual packaging rules to be evaluated at runtime):

A: 1 scoop - choose 1 from from Vanilla, Strawberry, Chocloate
B: 1 scoop - Liquorice
C: 2 scoops - choose 2 from Vanilla, Strawberry, Chocolate
D: 3 scoops - Vanilla, Strawberry, Chocolate
E: 3 scoops - choose 2 from (Vanilla, Strawberry, Chocloate)  plus
Liquorice

The problem is to take a list of scoops e.g.  Vanilla, Strawberry,
Chocolate
and to return all the valid ways these could be priced e.g:
1)  D
2)  C (Vanilla, Strawberry) + A (Chocolate)
3)  C (Strawberry, Chocloate) + A (Vanilla)
4)  C (Vanilla, Chocloate) + A (Strawberry)
5)  A (Vanilla) + A (Strawberry) + A (Chocloate)

Ideally this should work backwards too.. i.e. I am choosing package C,
which are valid scoops?


Am not looking for a solution, but I would just like a hint on whether
I should look at core.logic, or whether I need to do this the hard
way.

Thanks

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to