You should read The Reasoned Schemer for ideas. In principle, the method of mathematics in a logical program is to create encodings based on letters, which the logical engine can grow as necessary to try. I don’t have a convenient book, but it encodes integers in the form of a list of bits, in some strange way I can’t completely remember: maybe (1) represents 0, (0) is illegal, and MSB is the last in the list?
In any case, this is a lot of work; David Nolen also recently introduced something about final domains in core.logic. I don’t know how this works, but I think they simplify the problem for you, letting you specify which types of numbers should be considered as a solution to your problem.
amalloy
source share