Multiple clauses under a notany are AND-ed (like multiple clauses everywhere
else).
notany
clause_A
clause_B
means that there is "not any" proof for "clause_A and clause_B".
So the rule that you have should do what you want. (And, as stated, would
combine baking soda with vinegar, just not the other way around).
Two things that you might consider with this example.
First, if the ingredients don't conceptually come in pairs you could use one
list of single ingredients twice. Second, you could use a check clause with
Python's != operator:
combine_ingredients
foreach
ingredient($A)
check $A != 'vinegar'
ingredient($B)
check $B != 'baking_soda'
assert
combine($A, $B)
On Sat, Dec 12, 2009 at 9:46 PM, Chris <chriss
...@gmail.com> wrote:
> How do you differentiate between ANDed and ORed premises in Pyke,
> especially with negation?
> For example, how would I represent the following rule?
> "Combine ingredients A and B if A is not vinegar and B is not baking
> soda."
> After reading through the docs, the closest thing I could come up with
> is:
> combine_ingredients
> foreach
> ingredients($A,$B)
> notany
> is($A,vinegar)
> is($B,baking_soda)
> assert
> combine($A,$B)
> However, I'm not clear how multiple statements under the notany
> keyword are interpreted. I'm assuming they're ORed, which means that
> that representation would not fire for the statement ingredients
> (vinegar,vinegar), even though it should.
> --
> You received this message because you are subscribed to the Google Groups
> "PyKE" group.
> To post to this group, send email to pyke@googlegroups.com.
> To unsubscribe from this group, send email to
> pyke+unsubscribe@googlegroups.com <pyke%2Bunsubscribe@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/group/pyke?hl=en.