https://yutant.blogspot.com/2013/03/boolean-expressions-on-delphi.html