An interesting use of “the” in English is as a modifier that means “the generic version of this place that I frequent, never mind the specifics.” “The gym,” “the bus stop,” “the car.” But you wouldn’t say “so I’m at the school the other day,” or “I was in the restaurant” in the same context.
We have a mental list of genericizable locations and we understand what“the” means before them. I wonder what rules we use to create that list of locations?