RC integral and differential functions, Schmitt triggers. How does this circuit work?
The circuit is a pulse frequency discriminator.  As already noted, both gates are inverters.

Whatever the sensor is, it's output must be some kind of square wave or pulse pattern.  C1, R2, and the left gate turns each positive transition into a constant width negative pulse. 

RV and C2 turn this stream of constant width pulses into a DC level that varies with the off-times between pulses; the longer the gap between pulses, the more positive the voltage across C2.  

The right gate compares this voltage to an internal reference and generates an output level based on the value of its input voltage.  As the input pulses get closer and closer together, the DC voltage on C2 gets lower and lower.  When the pulses are close enough together, the voltage on C2 is below the detection level of the right gate, and output voltage goes high.

One application for this kind of circuit is a fan fail detector.  Many fans have an optional tachometer pulse output which is an open collector transistor.  With this circuit, the output is high when the fan is running at normal speed, and goes low when the fan speed drops below some cutoff value.