i have been given functions and predicate to use to verify a 2 bit full adder circuit. This is what I have understood so far:-
a function signal(t) where t is terminal and signal takes value 1 or 0.
signal(T, V) :- V is 1; V is 0.
a function type(x) where type is a circuit element and type(x) can take value xor, and, or
type(X, T) :- T is and; T is or; T is xor.
a function out(x) denoting output at gate x and in(n, x) n is an input terminal.
out(X, O) :- type(X, and), O is I1+I2, in(1, X, I1), in(1, X, I2).
%%and so on for other gates
for gates predicates are given as
forall X[{type(X) == OR} ----> {(out(X) =1)}-----> for some y(in(y, X) = 1)]
For these I am not sure how to convert them to prolog code and do not understand how prolog functions return something (I think the result must also be provided as a parameter).
Any Help would be very useful !