I'm not sure if I follow what you're asking... If these are expressions using booleans (that is, the a and b in your example are booleans) you could work out the truth table for them, and if every case matches then your expressions are equivalent.
There are other ways but that seems fairly straight forward to implement. Just plug in a=true, b=true; a=true, b=false; a=false b=true; a=false, b=false and see what you get.