I'd like to know why I get an error with my SWI Prolog when I try to do this:
(signal(X) = signal(Y)) :- (terminal(X), terminal(Y), connected(X,Y)).
terminal(X) :- ((signal(X) = 1);(signal(X) = 0)).
I get the following error
Error: trabalho.pro:13: No permission to modify static procedure '(=)/2'
It doesn't recognize the "="
in the first line, but the second one "compiles". I guess it only accepts the "="
after the :-
? Why?
Will I need to create a predicate like: "equal(x,y) :- (x = y)"
for this?
equal_signals(X,Y):- ...
.=/2
is a system predicate, you can not and need not change it here. – Will Ness(Signal(t) = 1) OR ( Signal(t) = 0)
translates to Prolog assignal(T,S), (S=1 ; S=0)
. this if you have a "function"signal
which "returns" results in its 2nd argument. But you don't include any explanations in your questions, we're left guessing. Perhaps you could start by explaining what you have, in which "world" is your question set, and what do you want to achieve. – Will Ness