a function evaluator for boolean functions