In interview style, here’s the conclusion of my reflections after studying Prolog for two months. If you’d like, read Part 1 first.
What did you find unique about the language?
Unification! Prolog works by trying to make terms equal one another. In most languages, the statement “Cost = 100” sets the variable “Cost” to a value of 100. In Prolog, “Cost = 100” means (in effect): “can Cost and 100 be unified?” During execution, Prolog takes into account the entire set of logical rules that have been defined to figure out if Cost and 100 are allowed to equal the same value. While possible, the need for statements manipulating variables’ values within an operation occurs far less frequently in Prolog than in the languages I’m used to. Continue reading