How can I store logical expressions using a RDBMS?
I tag objects and would like to be able to build truth statements based on those tags. (These might be considered as
Managing the nesting/brackets can become quite complex and prone to errors. The way I have done this in the past is to use XML to define the logic as it handles nesting very well. Using SQL Server 2005 or higher you can also store this nicely in a single table.
Your second hand goods logic could be stored as...
I'm sorry this is not an actual answer to your question and just an alternative way of doing things. I've just found it to work for me in the past.