Bottom negative top negative
|
---|
terminal(X):- X=positive;X=negative.
layout(T,B):- terminal(T),terminal(B),
not(T=B). % top terminal not equal to bottom terminalterminal(X):- X=positive;X=negative.
layout(T,B):- terminal(T),terminal(B),
not(T=B),
T=positive.% positive terminal at top of holder
Truth maintenance becomes an important problem if we wish to consider more than one solution to a problem at a time, or to make use of nonmonotonic reasoning (see Chapter 11). For instance, we might wish to develop several alternative designs, or to assume that a particular design is feasible until it is shown to be otherwise. In order to illustrate the concept of truth maintenance, we will stay with our example of arranging batteries in a holder. However, we will veer away from a Prolog representation of the problem, as standard Prolog can consider only one solution to a problem at a time.
Let us return to the case where we had specified that the two batteries must be in series, but we had not specified an orientation for either. There were, therefore, two possible arrangements: