It hasn't learned any LOGIC. It has 'learned' patterns from the input.
What is logic other than applying patterns?
The definition is broad for now this will do: Logic is the study of correct reasoning.
How is that different from applying patterns?