vendredi 23 juillet 2021

Boolean expression tree with predicates?

I am trying to design an expression tree builder that can be used to build an expression tree that can be evaluated lazily with provided context (hash map). Required set of operators is AND/OR/NOT, <,<=,>,>=,=,!=, in_range(inclusive or not). Expression tree must support a short circuiting (not computing more than needed for the final result). Evaluation result is either true or false. Which nodes in my case must be intermediate and which are the leafs? I suppose AND/OR/NOT are intermediate ones and predicates (<,<=,>,>=,=,!=, in_range) will be leaf nodes? Or each predicate will be represented as a subtree?

Aucun commentaire:

Enregistrer un commentaire