This continues until a solution is found or no solution is found. When searching for a solution, the Prolog processor searches for one of the required solutions. When that occurs that is called unification. This is when the interpreter matches things in the query with the rules. Prolog is a very high level programming language.
Programs consists of three different kinds of statements.
Rules that express the facts. These are similar to a database. Another kind of statement is a general principle. This is a logical statement. The previous two kinds of statements express assertions.