Given. Eight binary sensors $A$–$H$ as defined above; corridor buttons ($D$,$E$) are valid only when the car is empty ($A'$); in-car buttons ($F$,$G$) are valid only when occupied ($A$); no action is ever taken unless the doors are closed ($H$); at most one sensor changes at a time.
Find. (a) the logic that starts the elevator moving from the 1st to the 2nd floor on a 2nd-floor corridor call; (b) the logic that acts correctly on either in-car button.
Approach. Each output is a single AND term gating the relevant call/button signal with the required floor sensor, the doors-closed sensor $H$, and (for corridor calls) $A'$ or (for in-car buttons) $A$ — matching exactly the disable rules stated in the question.
a) 1st→2nd movement on a 2nd-floor corridor call. The car must be empty (corridor control only active when $A'$), currently on the 1st floor ($B$), doors closed ($H$), and the 2nd-floor corridor button pressed ($E$):
$$UP = B\cdot E\cdot H\cdot A'$$
UP = B . E . H . A' (corridor call, empty car, 1st floor -> 2nd)
b) Action from an in-car button. In-car buttons are active only when occupied ($A$) and doors are closed ($H$); pressing the "2nd floor" button ($G$) while on the 1st floor ($B$) should move the car up, and pressing the "1st floor" button ($F$) while on the 2nd floor ($C$) should move it down:
$$UP_{incar}=A\cdot B\cdot H\cdot G \qquad\qquad DOWN_{incar}=A\cdot C\cdot H\cdot F$$
UP_incar = A . B . H . G (occupied, on 1st floor, doors shut, 'to-2nd' button)
DOWN_incar = A . C . H . F (occupied, on 2nd floor, doors shut, 'to-1st' button)