As the 1st reply was not expected, I tried with second one.
I'm trying to implement constructive intensinal negation, and this could reduce a lot the main problem.
| ?- put_attr(X,_,X\==s(0)), p(X).
X = 0;
X = s(0);
X = s(s(0));
X = s(s(s(0)));
X = s(s(s(s(0))))
yes
| ?- put_attr(X,_,X=s(0)), p(X).
X = s(0);
no
| ?-
Regards,
Victor
put_attr, sorry.
And the original program is this ...
p(0).
p(s(X)) :- p(X).
Maybe I should detail it a little more:
| ?- put_attr(X,_,X=0), p(X).
X = 0;
no
| ?- put_attr(X,_,X=s(0)), p(X).
X = s(0);
no
| ?- put_attr(X,_,X\==0), p(X).
X = s(0);
X = s(s(0));
X = s(s(s(0)));
X = s(s(s(s(0))))
yes
| ?- put_attr(X,_,X\==s(0)), p(X).
X = 0;
X = s(0);
X = s(s(0))
yes
| ?-