put_attr, sorry.
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
Victor Pablos Ceruelo
2009-02-10
put_attr, sorry.
Victor Pablos Ceruelo
2009-02-10
And the original program is this ...
p(0).
p(s(X)) :- p(X).
Nobody/Anonymous
2009-02-11
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
| ?-