We can also insist on some inputs or outputs, allowing Prolog to tell us what combination will make it all work. Try this goal, that insists on having input
A=1 and the output of
0:
goal: circuit1(1,B,C,D,0).
*This circuit was adapted from "Clause and Effect," by. W. Clocksin, Ch. 7.