Let us therefore agree to deal with such cases accordingly. Whenever our theory fails to state that something is the case, then it must be assumed that that something is not the case. As a result we cannot eliminate this goal and our proof fails. One very important property of the proof method outlined above which has so far not been illustrated is that it is constructive , in the sense that it can actually find a value for a variable in a goal. Let us look at a simple example.
Variable instantiation occurs as a result of matching.
For instance, in the last example, we could have made the variables X and B equal by giving them both the value peter . Prolog is a computer program for carrying out logical deductions of the type just illustrated above. You can then ask Prolog questions, so-called queries , which Prolog will answer using the method of logical deduction. In this course, a lot of the programs we will write will manipulate natural language sentences. It would therefore be useful if we had a way of talking about strings of words in Prolog.