This is the seventh piece in a series of journal entries written about various aspects of artificial intelligence. This piece contains a short discussion of how programming languages deal with constraints.
Constraint satisfaction in artificial intelligence interested me when we went over it in class. I became particularly interested in how to represent a constraint in a programming language. What would be the best way? Clearly one could sometimes easily model a constraint with conventional logic available in any programming environment or language; consider Sudoku, the mathematical puzzle in which a square is divided as thought it is a tic-tac-toe board, with 9 subsquares. Each subsquare is again divided, for a total of 81 squares. The puzzle is partially filled in with integers 1 through 9 in various places, and the player must fill in the correct digits in the correct subsquares such that each row, each column, and each square contains only the digits 1 through 9, and each digit only one time. This kind of constraint-based problem could be easily modeled in nearly any programming language worth its salt.
But what about more complex constraints? I searched around for a bit, examining possible ways to deal with a complex constraint before I found an interesting language named Kaleidoscope, which seems to have constraints built directly into the language specification, probably as a basic type. I wish I could say with more certainty, but few details seem to exist outside of research paper form online, and my subscription to the ACM no longer seems valid.
However, even if you don't feel like using Kaleidoscope, some options exist in more common languages such as C++ and Java, both of which have constraint-satisfaction libraries available.
I have been thinking of an idea for a good final project based on Kaleidoscope. My next journal entry will probably be a project idea fleshed out in full about constraint satisfaction programming,