On Wed, 26 May 2004 00:04:45 +0900, Florian Weber wrote:

> my_set.add(NotNamedRule("orange").new)
> my_set.add(HasPropertyRule("color").new)
> my_set.add(OrRule(HasPropertyRule("size").new, 
> HasPropertyRule("weight").new))

that looks a lot like prolog.

> i wanna do something like
> 
> my_set.rules = !name("orange") && hasProperty("color") && 
> (hasProperty("size") || hasProperty("weight"))
> 
> can anybody think of a nice way to do this?
> 

python has a first-order logic library called pylog that lets you do this
kind of thing easily. I'm unaware of any comparable library in ruby, but I
would really like to know if one exists.