Hi,
Welcome to JavaRanch!
It's hard for me to tell exactly what you want to do here; there are a lot of things that don't make sense. For example, the value slots of the existing "hand" facts all contain Strings, but your rules seem to be trying to call a "contains" method on those Strings; the
String class has no such method.
I can tell you a few things that you're doing that can lead to problems, and maybe this advice will help you clear things up. For example, you seem to be mixing quoted Strings and unquoted symbols very liberally. Note that they're different data types in Jess:
"yes" and
yes are two different items and one won't match the other.
Another thing is just a silly thing: "not" means something does not exist. "exists" means it does exist, and it's implemented as "not not" -- i.e., something exists if it does not not exist. Writing "not exists" sounds like good english, but in Jess it means "not not not" -- which is just a very ineffificient way of writing "not".
I see some variables of the form ?*v* normally reserved for defglobals, but I don't see their declarations anywhere -- they are defglobals, right? Note that
pattern matching is driven by working memory changes; changing the value of a defglobal will not cause matches to be reevaluated later.