> Prolog is one example of a language that automatically solves declarative constraints but the syntax is bad.
The syntax is fine, but conventional logic programming is insufficient for what you describe; you need something more likely constraint logic programming as inplemented in, among other languages, Oz.