Modification of Running Code: Examples

The following examples show what happens when a procedure is modified while it is running. This can happen in two ways:

  1. The procedure calls some other procedure that modifies it.
  2. The procedure succeeds nondeterminately, and a subsequent goal makes the modification.
In either case, the question arises as to whether the modifications take effect upon backtracking into the modified procedure. In Quintus Prolog the answer is that they do not. As explained in the overview to this section (see ref-mdb-bas), modifications to a procedure affect only calls to that procedure that occur after the modification.