If people around here are interested in this idea, I would just like to point out that this is basically what embedding miniKanren (a super-simple logic programming DSL) in your programming language lets you do. You write "give me all q such that 2^q = 8 with an expression like `find q. PowEq(2, q, 8)." Also since the asterisk is sort of "loaded" it may be more helpful notation-wise to use an underscore, PowEq(2, _, 8) standing for the above.
The most obvious problem here is that you have to think about the composability of relations the way you do with functions, because PowEq(3, PowEq(2, _, 8), _) makes sense (find me the number that you get when you raise 3 to the [whatever number you'd have to raise 2 to, to get 8]), but the very similar-looking PowEq(3, PowEq(2, 3, 8), _) is actually a type error, the function is being called on a statement rather than a value.