Boolean logic parsing and evaluation