Is there such a thing as a circuit that outputs 1 if the input is high-impedance, and 0 otherwise?
A simple window comparator will do what you want.

The input is tied to midvoltage by the two 1Mohm resistors.  The references are set at 1/3 and 2/3rds of the supply voltage.  LM339 is open-collector output, so can be OR'ed together to get the desired truth table.



Google for "window comparator" to get more detail about this circuit.

Please notice that this circuit will not detect a low-impedance connection to half the supply voltage, only low impedances to high or low levels.