This document discusses optimizing the evaluation of logic expressions through the use of abstract syntax trees (ASTs). It begins by providing examples of different types of logic expressions. It then describes building an AST to represent the expression and reordering branches in the tree to minimize calculations through lazy evaluation. By prioritizing faster operations and cutting unnecessary branches, evaluation time can be reduced compared to a naive or reverse polish notation approach. Further optimizations include handling n-ary operations and dynamically learning expression weights over time. The key idea is that laziness in evaluation through AST reordering can significantly improve performance.