Sheepdog The challenge with those bolean operators is not the programming part, its useability. It is quite difficult is to make it not look like spacecraft control station, or even worse, a linux command line. It should be very simple otherwise people will not understand it. Sometimes we need to sacrifice funcitonality to keep things simple.
In your example, yes, if you look for A+B, it will give you all the fotos where both are present, including those where other people are present too. However, as I understand the usage scenario, that shoul not be a problem, the list will be small enough already so you can scroll thru it and find what you are looking for. Yes, you probably will need to check 25% or so more picures, but does it really matter?
Can you please explain your scenario, where those additional photos are actually problem that prevents you from finding what you are looking for?