Voltage across an inductor contradicts Lenz's law? Imagine a simple circuit consisting of an alternating current source connected to an inductor. Assume they are connected in the following fashion: AC source - terminal A - Inductor - terminal B - AC source. When the current flows from terminal A towards terminal B and is increasing, the inductor should generate electromagnetic force that opposes the increase in current (according to Lenz's law), that is terminal B should become positive with respect to terminal A. But simulation shows the opposite is true. Terminal A becomes positive with respect to terminal B. Why?
 A: 
the inductor should generate electromagnetic force that opposes the
  increase in current (according to Lenz's law)

To be sure, it's electromotive force (emf) here and not electromagnetic force.

But simulation shows the opposite is true. Terminal A becomes positive
  with respect to terminal B. Why?

The voltage across the inductor is the opposite sign of the emf
$$v_L = L \frac{di}{dt} = -\mathcal E $$
and the circuit simulator gives the voltage across.
To see that this must be so, consider connecting an inductor across a voltage source; the voltage across the inductor equals the voltage across the source.
Since the inductor is (usually) a coiled conductor, there is (effectively) no resistance to limit the current through the conductor.  How then can there not be an arbitrarily large (effectively infinite) current through the conductor?
The only way for there not to be an arbitrarily large current is for there to be an emf that precisely opposes the applied voltage.
And, since the emf is proportional to the rate of change of current, the current must be changing at a particular rate in order for the generated emf to precisely oppose the applied voltage.
