Thanks for explaining. That seems to be the neat thing that I'm picking up on about what Microsoft Research people keep calling "Model Based Machine Learning" [0], in that you construct a model based on your assumptions about the problem, and by implementing it, the compiler can fit it to an appropriate algorithm.
[0] https://www.youtube.com/watch?v=zKUFSKRjTIo and also https://github.com/dotnet/infer