From Decision Trees to Boolean Logic: A Fast and Unified SHAP Algorithm