Prolog Assignment

Since SWI prolog already has implementations of several of these, you should name your declarations/rules in the following fashion:
.and_(input, input, output)
.or_(…)
.not_(…)
.xor_(…)
.nor_(…) :- …
.xnor_(…) :-…
.nand_(…) :-…
 
.half_adder(A, B, C, S) :- …
.full_adder(A, B, Cin, Cout, S) :- …
Resources: