TREE-THRESHOLD-SYNTHESIS OF TERNARY FUNCTIONS