It hasn't learned any LOGIC. It has 'learned' patterns from the input.
What is logic other than applying patterns?
What is logic other than applying patterns?