The Philosophy of Harry Potter

Reparo

"Ron!" said Hermione reproachfully, and she pulled out her wand, muttered "Reparo!" and the glass shards flew back into a single pane and back into the door.

(Ch. 11, Harry Potter and the Goblet of Fire)

This strikes me as a philosophically interesting phenomenon. How does the spell know what the repaired state of the window is? There are several possibilities I've considered.

Functionalism
The glass' natural state is that of a window. It wants to participate in Plato's form of windowpaneness. Reparo sets things back to their Platonic form.
Isn't the Reparo spell usable for initial creation of window panes as well?
Time rewind
The glass reverts to its state from five minutes ago, or perhaps back to right before its last major change of state. Determining a "state" for a shard of glass, however, seems it may require a collective state for all the shards. Perhaps by casting the spell on the shards and they have to go to the last time they all had a change of state at approximately (1) the same time. Targeting specifically a complete set of shards with out affecting anything else is difficult, but perhaps intention-based, similar to the next solution, but on a lower level.
1 Approximately the same time is a troubling word. What's a non-arbitrary way of choosing a period? I think the best would be however long it takes to cast the spell.
Whatever you want
Hermione clearly intended to have the glass reform the windowpane. Perhaps her "will" is what determined what the spell repaired the shards too. This gives the spell a lot of power though. Could this spell be used to form a pair of glass slippers if that's what she'd preferred? (Perhaps the shards wouldn't have fit together properly. . .)

Magic explained by idealism

Language

Most Harry Potter spells are Latin-based. One notable exception is the "Point Me" spell used by Harry Potter in the maze (HP4, Ch. 31). Do completely non-Romantic languages such as Japanese have different words for the same spells? ('Point' has a Romantic etymology, but 'me' is Anglo-Saxon.)