| OCR Text |
Show 21 another value cell, or an indication that the variable is unbound. Value cells are usually created for each variable in the head of a clause at the time the code for the clause is invoked. The value cells are associated with the activation record or .frame of the procedure call, created on the process stack. The frame provides a linkage between the calling procedure and the called procedure. To unify a variable with another term, the variable must be derejerenced by chaining through linked value cells to find its current binding. If the variable is unbound, it is bound to the other term. When backtracking occurs, the state of the computation must be restored to an earlier state, including possibly removing variable bindings made since the earlier state (this process is called unwinding). Value cells which are no longer used should be discarded and their memory recovered. All of these aspects of variable usage must be addressed by any parallel binding method. OR-parallel execution seeks concurrently to find multiple solutions to the same goal. In doing so, any unbound variable may receive several different bindings from the several different search tree branches being pursued. Consider, for example, the simple Prolog program of Figure 2, which defines the concatenation of two lists into a third list. If, as in the example, the first two arguments of the goal are unbound, this program will determine all pairs of lists which, when concatenated, form the third argument. For a list of size n, there are n+ 1 such pairs, so each of the variables representing the first two arguments of the goal will take on n+ 1 values during the course of program execution. In a sequential implementation, when one solution is found (one pair of lists), the value cells for these variables can be reset to an unbound state and used again for the next solution. Consider a parallel implementation which runs the same program and attempts to find all list pairs concurrently, using a different process for each pair. Since each solution to a goal must bind each of its variables only once, multiple solutions must use conceptually separate environments. Where will they store their variable bindings? Clearly, they cannot write the bindings to the same location, |