Truth table with logical gates for a traffic light
YELLOW = \$B\$.

RED = \$\bar A\$. 

GREEN = \$\overline {RED + YELLOW}\$



Purple is the implied logic for the red light, orange is the implied logic for the yellow light and green is for the green light.

One OR gate and two inverters would do the trick.