It was not necessary to use any external libraries. I did not know about this Z3 and managed to solve it with linear algebra [1]. It was not the first time I had to implement a linear system solver to solve and Advent of Code problem [2]. Rather than specific tools it required specific knowledge, but that was not unique to this problem.