The datalog application that replaced an existing imperative solution is so much easier to understand and maintain.
Souffle generates c++ from the datalog program. We use SWIG to compile the c++ code into a Go application. So we have a Go application that deals with getting data in and out, and all of the business logic is defined in datalog.
It illustrates how you can have the Souffle program load its data from SQLite databases, or how you can work with tuples and relations from Go.
Though I doubt Hypothesis's stateful testing capabilities can replicate all the capabilities of Datalog (or its elegance for this kind of logic problem), I think you could port the author's expression of the game rules to Hypothesis pretty straightforwardly.
[1]: https://nchammas.com/writing/how-not-to-die-hard-with-hypoth...
[1] https://github.com/DylanSp/tic-tac-toe-react/blob/master/src...
2 7 6
9 5 1
4 3 8
Here, if a triplet of one player's cells sums to 15, that player has won.Though the counting seems a bit weird. Two overlapping lines of 5 seems to count as "1 two, 2 five". I also managed to get two overlapping fours to count as "2 two, 2 four". Maybe I just don't understand how it's supposed to work?
I expressed the logical rules of Go, which are already phrased in a concise yet mathematically rigorous way, pretty much directly into Haskell [1], which was more fun than tedium.
My original attempt was clunky and I rewrote the logic from scratch 2 or 3 times until I could bear look at the code and not wince.
It's all open source and playable at https://ora.kennerspiel.com
EDIT: I found an old project working on implementing the MtG rules in Prolog: https://github.com/stassa/Gleemin. It's definitely more concise than XMage's Java, but you can still get an idea of how much work it would take, especially since that project notes some pretty significant limitations that it didn't get to.