The AC input is isolated using an opto isolator. The opto-isolator is a photo transistor and an LED. Your AC power flows throught the LED, causing it to emit photons, which are picked up by the NPN transistor, turning it on. The NPN transistor then clamps the DC potential at a pull up resistor to ground, making it go low. Thus, when AC power is on at the input the internal DC voltage that represents the state of the input is low. When AC power is off at the input the internal DC voltage that represents the state of the inputis high. This is a function of the hardware, not a function of the software logic. Software logic is still 1=true, 0=false.