Hello, girls and boys, my question sounds a bit strange, but it 's very important for me to simplify my database queries. So, is there any known and implementable algorithm that simplifies an arbitrary logical expression such as: (either in PHP-style and in mathematical forms separated by comma) (A && B) || (B && C) , (A ^ B) v (B ^ C) to: --------------------- (A || C) && B , (A v C) ^ B. // applying distribution rule - I guess this is the english name or an other ( in PHP-style or if you love better ) (A && B) || B , (A ^ B) v B to : -------------- B As above I mentioned i'm looking for an algorithm that can be implemented in PHP which does as most as possible. This kind of simplifications is also used in the 'FROM' clause of the SQL-query, and that's why I can't pass this job to the DB. Papp Gyozo - [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]