Pattern-Script icon indicating copy to clipboard operation
Pattern-Script copied to clipboard

Decide on what to do with disambiguation of movements

Open ClementSparrow opened this issue 3 years ago • 3 comments

And in particular, should I implement increpare/PuzzleScript@d85b8058a1705dfca6463a77cb006079859ca8b5? I'm inclined not to, but I should certainly clarify why.

The main reason is that it may seem totally unnatural for some devs (including myself), even if others would have no problem with it. I like the concept of pattern matching and how simple it is to understand (despite some subtleties), but when inference becomes too powerful the simple visual matching becomes an exercise of being able to think like the machine that does the inference. Among the examples that increpare took:

right [ horizontal Player | perpendicular Player ] -> [ perpendicular Player | ]
right [ vertical Player | perpendicular Player ] -> [ perpendicular Player |  ]
right [ moving Player ] [ orthogonal crate ] -> [ orthogonal player ] [ crate ]
[ orthogonal a | moving a ] -> [ moving a | orthogonal a ]

None of this makes sense to me, visually. I can think visually about cells and objects inside cells, either present or absent before and after the application of the rule, which I can interpret as the creation/destruction/teleportation of objects. I can think about a property as an abstraction for a group of multiple possible objects, and hence infer that the same property appearing on both sides of the rule can correspond to the same object – although it will not always, and there are already issues with that, some being greatly alleviated by the introduction of rule parameters.

But making sense of the propagation of ambiguous movements is much harder, conceptually. I see movements as attributes of the objects: objects are primary concepts, movements are secondary. Matching movements requires me to ignore the object to which they are attached, and it's harder. How do I know when an object changes direction and when its direction is swapped with the one of another object? And how do I know if I'm supposed to interpret that as swapping two objects, preserving their movement, or as two objects staying in their respective cells but swapping movements?

Another reason for my reluctance is that I would like to add other features in the language and I'm not sure how they would interact with this kind of inference. Directional mappings are one thing. Identification of individual objects is another. I prefer to play with these ideas first and see what they have to offer, and then fine-tune them with inference if needed.

[end of the rant]

ClementSparrow avatar Aug 15 '21 22:08 ClementSparrow